aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-04-16 13:31:49 +0100
committergingerBill <bill@gingerbill.org>2024-04-16 13:31:49 +0100
commita61ae7c861fa301684ee1582507061317b11426b (patch)
treed2d743c799a493e55ed61631625bb1129be7986f /src/check_type.cpp
parent8a0f9ae108a75d9ca86b8a91fca2f2423e0a58df (diff)
Fix #3427
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index f4e5d7c96..3bb1a4fd1 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2495,18 +2495,16 @@ gb_internal Type *get_map_cell_type(Type *type) {
return s;
}
-gb_internal void init_map_internal_types(Type *type) {
+gb_internal void init_map_internal_debug_types(Type *type) {
GB_ASSERT(type->kind == Type_Map);
GB_ASSERT(t_allocator != nullptr);
- if (type->Map.lookup_result_type != nullptr) return;
+ if (type->Map.debug_metadata_type != nullptr) return;
Type *key = type->Map.key;
Type *value = type->Map.value;
GB_ASSERT(key != nullptr);
GB_ASSERT(value != nullptr);
-
-
Type *key_cell = get_map_cell_type(key);
Type *value_cell = get_map_cell_type(value);
@@ -2541,6 +2539,18 @@ gb_internal void init_map_internal_types(Type *type) {
gb_unused(type_size_of(debug_type));
type->Map.debug_metadata_type = debug_type;
+}
+
+
+gb_internal void init_map_internal_types(Type *type) {
+ GB_ASSERT(type->kind == Type_Map);
+ GB_ASSERT(t_allocator != nullptr);
+ if (type->Map.lookup_result_type != nullptr) return;
+
+ Type *key = type->Map.key;
+ Type *value = type->Map.value;
+ GB_ASSERT(key != nullptr);
+ GB_ASSERT(value != nullptr);
type->Map.lookup_result_type = make_optional_ok_type(value);
}
@@ -2613,8 +2623,6 @@ gb_internal void check_map_type(CheckerContext *ctx, Type *type, Ast *node) {
init_core_map_type(ctx->checker);
init_map_internal_types(type);
-
- // error(node, "'map' types are not yet implemented");
}
gb_internal void check_matrix_type(CheckerContext *ctx, Type **type, Ast *node) {