aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-01-11 20:11:39 +0000
committergingerBill <bill@gingerbill.org>2020-01-11 20:11:39 +0000
commit24bd370e1b25d7cb8289ceda450a00867fc08db7 (patch)
tree0008512427acb6adcf8787d9481cf2d129a4beb3
parentd520b9a1ba118d7a97da261d0df22f2ed4eb696f (diff)
Fix Panic with runtime.type_info_base #532
-rw-r--r--src/check_expr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index b7318ca1d..ac6f22e6d 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4175,8 +4175,12 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
return false;
}
Type *t = o.type;
- if (t == nullptr || t == t_invalid || is_type_polymorphic(operand->type)) {
- error(ce->args[0], "Invalid argument for 'type_info_of'");
+ if (t == nullptr || t == t_invalid || is_type_polymorphic(t)) {
+ if (is_type_polymorphic(t)) {
+ error(ce->args[0], "Invalid argument for 'type_info_of', unspecialized polymorphic type");
+ } else {
+ error(ce->args[0], "Invalid argument for 'type_info_of'");
+ }
return false;
}
t = default_type(t);