parser: fix Enum.value when Enum is an imported symbol (#9046)
parent
a1e0f2bc46
commit
4c3ce97763
|
@ -1391,7 +1391,7 @@ pub fn (mut p Parser) name_expr() ast.Expr {
|
|||
if mod != '' {
|
||||
enum_name = mod + '.' + enum_name
|
||||
} else {
|
||||
enum_name = p.prepend_mod(enum_name)
|
||||
enum_name = p.imported_symbols[enum_name] or { p.prepend_mod(enum_name) }
|
||||
}
|
||||
// p.warn('Color.green $enum_name ' + p.prepend_mod(enum_name) + 'mod=$mod')
|
||||
p.check(.dot)
|
||||
|
|
|
@ -35,4 +35,5 @@ fn vertex_count(s Shape) int {
|
|||
|
||||
fn test_imported_symbols_enums() {
|
||||
assert vertex_count(.triangle) == 3
|
||||
assert vertex_count(Shape.triangle) == 3
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue