diff --git a/vlib/compiler/expression.v b/vlib/compiler/expression.v index 6de9755ded..b339c31d6c 100644 --- a/vlib/compiler/expression.v +++ b/vlib/compiler/expression.v @@ -187,7 +187,10 @@ fn (p mut Parser) name_expr() string { p.check(.dot) name = p.lit // C struct initialization - if p.peek() == .lcbr && p.table.known_type(name) { + if p.peek() == .lcbr { + if !p.table.known_type(name) { + p.error('unknown C type `$name`') + } return p.get_struct_type(name, true, ptr) } if ptr && p.peek() == .lpar {