Nim/tests/errmsgs/t10251.nim
Timothee Cour 8ef6073543
add test case for pure enum redefinition error within enum (fixed in recent PR) (#18266)
* add test case for pure enum redefinition error within enum (fixed in recent PR)

* remove code duplication

* Revert "remove code duplication" (would require bootstrap >= 1.4)

This reverts commit 3f793874c231f847ef015e37a5fd6851f85d9675.

* fixup
2021-06-15 08:56:10 +02:00

19 lines
481 B
Nim

discard """
action:reject
cmd: "nim check $options $file"
nimout: '''
t10251.nim(15, 5) Error: redefinition of 'foo'; previous declaration here: t10251.nim(13, 5)
t10251.nim(19, 23) Error: redefinition of 'goo1'; previous declaration here: t10251.nim(19, 11)
'''
"""
# line 10
type
Enum1 = enum
foo, bar, baz
Enum2 = enum
foo, bar, baz
type
Enum3 {.pure.} = enum # fixed (by accident?) in https://github.com/nim-lang/Nim/pull/18263
goo0, goo1, goo2, goo1