From 48f841bb26c0ecfa393b6aaf9a0111c5d72fa1ae Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 14 Jul 2019 00:10:39 +0200 Subject: [PATCH] make enums defined in other modules work --- compiler/parser.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/parser.v b/compiler/parser.v index d7affbd86c..6fb1c02242 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -1296,7 +1296,7 @@ fn (p mut Parser) name_expr() string { if !T.has_enum_val(val) { p.error('enum `$T.name` does not have value `$val`') } - p.gen(p.mod + '__' + p.expected_type + '_' + val) + p.gen(T.mod + '__' + p.expected_type + '_' + val) } return p.expected_type } @@ -1375,7 +1375,7 @@ fn (p mut Parser) name_expr() string { p.check(.dot) val := p.lit // println('enum val $val') - p.gen(p.mod + '__' + enum_type.name + '_' + val)// `color = main__Color_green` + p.gen(enum_type.mod + '__' + enum_type.name + '_' + val)// `color = main__Color_green` p.next() return enum_type.name }