Sanity check for map key

This commit is contained in:
gingerBill
2020-11-29 16:13:16 +00:00
parent 57f5976ac1
commit b922398a96
+3 -1
View File
@@ -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");