mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-25 15:05:00 -07:00
Remove #relative slices; Replace with #relative multi-pointers
This commit is contained in:
+4
-4
@@ -2778,16 +2778,16 @@ gb_internal bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, T
|
||||
|
||||
Type *relative_type = nullptr;
|
||||
Type *base_type = check_type(ctx, rt->type);
|
||||
if (!is_type_pointer(base_type) && !is_type_slice(base_type)) {
|
||||
error(rt->type, "#relative types can only be a pointer or slice");
|
||||
if (!is_type_pointer(base_type) && !is_type_multi_pointer(base_type)) {
|
||||
error(rt->type, "#relative types can only be a pointer or multi-pointer");
|
||||
relative_type = base_type;
|
||||
} else if (base_integer == nullptr) {
|
||||
relative_type = base_type;
|
||||
} else {
|
||||
if (is_type_pointer(base_type)) {
|
||||
relative_type = alloc_type_relative_pointer(base_type, base_integer);
|
||||
} else if (is_type_slice(base_type)) {
|
||||
relative_type = alloc_type_relative_slice(base_type, base_integer);
|
||||
} else if (is_type_multi_pointer(base_type)) {
|
||||
relative_type = alloc_type_relative_multi_pointer(base_type, base_integer);
|
||||
}
|
||||
}
|
||||
GB_ASSERT(relative_type != nullptr);
|
||||
|
||||
Reference in New Issue
Block a user