mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
handle unknown C types
This commit is contained in:
parent
7adda3b71a
commit
6ae51b2cbf
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue