aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-11-29 16:13:16 +0000
committergingerBill <bill@gingerbill.org>2020-11-29 16:13:16 +0000
commitb922398a962734b97d65f93db2784939bce36288 (patch)
treef4854886e828250f62a29b322d04e131b9b6779a /src/check_type.cpp
parent57f5976ac1b5416093ef25d725c30ae5ff270809 (diff)
Sanity check for map key
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 453348aa6..10ffe076c 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2854,7 +2854,9 @@ void add_map_key_type_dependencies(CheckerContext *ctx, Type *key) {
} else if (is_type_string(key)) {
add_package_dependency(ctx, "runtime", "default_hasher_string");
} else if (!is_type_polymorphic(key)) {
- GB_ASSERT_MSG(is_type_simple_compare(key), "%s", type_to_string(key));
+ if (!is_type_simple_compare(key)) {
+ return;
+ }
if (is_type_struct(key)) {
add_package_dependency(ctx, "runtime", "default_hasher_n");