diff options
| author | gingerBill <bill@gingerbill.org> | 2020-06-10 14:25:11 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-06-10 14:25:11 +0100 |
| commit | 4acae2af44d55e5fabd739276f92c64fd3f2e955 (patch) | |
| tree | 931f2166bc02cd5abf3200d8925198836719c801 /src | |
| parent | 036429bf2f7597fe17ae3dec39a30e60829c5e56 (diff) | |
Add support for `using` on relative pointers #670
Diffstat (limited to 'src')
| -rw-r--r-- | src/types.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/types.cpp b/src/types.cpp index 7fd363dd4..a9e9eb0f1 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -956,10 +956,15 @@ Type *alloc_type_simd_vector(i64 count, Type *elem) { Type *type_deref(Type *t) { if (t != nullptr) { Type *bt = base_type(t); - if (bt == nullptr) + if (bt == nullptr) { return nullptr; - if (bt != nullptr && bt->kind == Type_Pointer) + } + if (bt != nullptr && bt->kind == Type_Pointer) { return bt->Pointer.elem; + } + if (bt != nullptr && bt->kind == Type_RelativePointer) { + return type_deref(bt->RelativePointer.pointer_type); + } } return t; } |