summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-03 15:15:10 +0800
committerGitHub <noreply@github.com>2023-01-03 08:15:10 +0100
commit81b7f9108f139bbf237f3e121fdbe9ff32a7193f (patch)
treef6121fe6593bb06ac3290e4d4341d8b6be0975d0 /tests
parent3b965f463b41eace340393af636e4abcd9c223d6 (diff)
downloadNim-81b7f9108f139bbf237f3e121fdbe9ff32a7193f.tar.gz
fixes #21207; reports redefinition error in the definition of enums (#21217)
* fixes #21207;  reports redefinition in the enums

* add a test
Diffstat (limited to 'tests')
-rw-r--r--tests/enum/tredefinition.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/enum/tredefinition.nim b/tests/enum/tredefinition.nim
new file mode 100644
index 000000000..615ca6b1c
--- /dev/null
+++ b/tests/enum/tredefinition.nim
@@ -0,0 +1,9 @@
+discard """
+  cmd: '''nim check --hints:off $file'''
+  action: reject
+nimout: '''
+tredefinition.nim(9, 25) Error: redefinition of 'Key_a'; previous declaration here: tredefinition.nim(9, 18)
+'''
+"""
+
+type Key* = enum Key_A, Key_a
\ No newline at end of file