1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Fix decl c struct follow a v struct

struct C.CURL

struct Curl {
    h *C.CURL
}
This commit is contained in:
drswinghead 2019-06-24 00:08:09 +08:00 committed by Alexander Medvednikov
parent 6cb5eee1b2
commit 7ca00c8f5e

View File

@ -422,7 +422,7 @@ fn (p mut Parser) struct_decl() {
}
}
// V used to have 'type Foo struct', many Go users might use this syntax
if p.tok == STRUCT {
if !is_c && p.tok == STRUCT {
p.error('use `struct $name {` instead of `type $name struct {`')
}
// Register the type