aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-09-22 00:05:11 +0100
committergingerBill <bill@gingerbill.org>2022-09-22 00:05:11 +0100
commit8c3f01fbfa73f707e9150b0dbe2629d7d5ac2f8d (patch)
treec0d3308f49ae14abf970c7a5a127498a8b0bf29c /src/check_expr.cpp
parent0380601bb489d6488bbc0a3322a06889dca9bd02 (diff)
Correct parapoly determination of generated internal type of a `map`
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 196982084..3f4f11813 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -1360,7 +1360,13 @@ bool is_polymorphic_type_assignable(CheckerContext *c, Type *poly, Type *source,
if (source->kind == Type_Map) {
bool key = is_polymorphic_type_assignable(c, poly->Map.key, source->Map.key, true, modify_type);
bool value = is_polymorphic_type_assignable(c, poly->Map.value, source->Map.value, true, modify_type);
- return key || value;
+ if (key || value) {
+ poly->Map.entry_type = nullptr;
+ poly->Map.internal_type = nullptr;
+ poly->Map.lookup_result_type = nullptr;
+ init_map_internal_types(poly);
+ return true;
+ }
}
return false;