Skip to content

Commit fbe124f

Browse files
committed
analyser: fix assert
1 parent cd890c8 commit fbe124f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

analyser/module_analyser_expr.c2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn Decl* Analyser.analyseIdentifier(Analyser* ma, Expr** e_ptr, u32 side) {
138138
}
139139

140140
QualType qt = d.getType();
141-
assert(qt.isValid());
141+
if (qt.isInvalid()) return nil;
142142
e.setType(qt);
143143
i.setDecl(d);
144144

test/types/unknown_type.c2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module test;
2+
3+
type Value const char*[3];
4+
5+
Values defaults = { 1, 2, 3 } // @error{unknown type 'Values'}
6+
7+
Value* values = defaults;
8+

0 commit comments

Comments
 (0)