From cca85566d32648bd031f8f15242a544f85ae27ba Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 27 Aug 2019 02:48:55 +0300 Subject: [PATCH] parser: fix duplicate enum generation --- compiler/parser.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser.v b/compiler/parser.v index 952a0e4dc5..2712721d23 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -686,7 +686,7 @@ fn (p mut Parser) enum_decl(_enum_name string) { enum_name = p.prepend_mod(enum_name) } // Skip empty enums - if enum_name != 'int' { + if enum_name != 'int' && !p.first_pass() { p.cgen.typedefs << 'typedef int $enum_name;' } p.check(.lcbr)