fixes #8066
This commit is contained in:
parent
fab4498727
commit
2f7b979e38
4 changed files with 46 additions and 10 deletions
19
tests/enum/tpure_enums_conflict.nim
Normal file
19
tests/enum/tpure_enums_conflict.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
errormsg: "ambiguous identifier: 'amb'"
|
||||
line: 19
|
||||
"""
|
||||
|
||||
# bug #8066
|
||||
|
||||
when true:
|
||||
type
|
||||
MyEnum {.pure.} = enum
|
||||
valueA, valueB, valueC, valueD, amb
|
||||
|
||||
OtherEnum {.pure.} = enum
|
||||
valueX, valueY, valueZ, amb
|
||||
|
||||
|
||||
echo valueA # MyEnum.valueA
|
||||
echo MyEnum.amb # OK.
|
||||
echo amb # Error: Unclear whether it's MyEnum.amb or OtherEnum.amb
|
||||
Loading…
Add table
Add a link
Reference in a new issue