diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-06-14 23:56:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 08:56:10 +0200 |
commit | 8ef6073543b14bd48665ae075df66c2c36f564dd (patch) | |
tree | a4c037102e246ba065583febc1dabe078720ac8f /tests/errmsgs | |
parent | e80d7ff0f2716fd1f892a936a78986531b107fb6 (diff) | |
download | Nim-8ef6073543b14bd48665ae075df66c2c36f564dd.tar.gz |
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
Diffstat (limited to 'tests/errmsgs')
-rw-r--r-- | tests/errmsgs/t10251.nim | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/errmsgs/t10251.nim b/tests/errmsgs/t10251.nim index 5ad373ba3..0c7fe0b3d 100644 --- a/tests/errmsgs/t10251.nim +++ b/tests/errmsgs/t10251.nim @@ -1,12 +1,19 @@ discard """ -errormsg: "redefinition of 'foo'; previous declaration here: t10251.nim(9, 9)" -line: 11 -column: 9 + 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 + 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 |