From 7ca00c8f5e621f6469b7e2eb7d4f99337b7a04c4 Mon Sep 17 00:00:00 2001 From: drswinghead Date: Mon, 24 Jun 2019 00:08:09 +0800 Subject: [PATCH] Fix decl c struct follow a v struct struct C.CURL struct Curl { h *C.CURL } --- compiler/parser.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser.v b/compiler/parser.v index 99dbaeeab5..c4c0ea7973 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -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