make enums defined in other modules work

pull/1133/head
Alexander Medvednikov 2019-07-14 00:10:39 +02:00
parent 5dfd5fa3e7
commit 48f841bb26
1 changed files with 2 additions and 2 deletions

View File

@ -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
}