aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-26 12:41:33 +0100
committergingerBill <bill@gingerbill.org>2023-09-26 12:41:33 +0100
commit9711dd13816330ad9b7be81efbbfd1ffa3d999f4 (patch)
tree294837bdc85beb118bdd2b2dfa98272be45d9a0e /src/parser.cpp
parent4c328d83ba31e867a51668a3f91348a5e80b737c (diff)
Fix #2816
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 37fd61e07..94e91fbb2 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4029,7 +4029,9 @@ gb_internal Ast *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_fl
if (f->curr_token.kind != Token_Eq) {
type = parse_var_type(f, allow_ellipsis, allow_typeid_token);
Ast *tt = unparen_expr(type);
- if (is_signature && !any_polymorphic_names && tt->kind == Ast_TypeidType && tt->TypeidType.specialization != nullptr) {
+ if (is_signature && !any_polymorphic_names &&
+ tt != nullptr &&
+ tt->kind == Ast_TypeidType && tt->TypeidType.specialization != nullptr) {
syntax_error(type, "Specialization of typeid is not allowed without polymorphic names");
}
}