mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 12:54:22 +00:00
bugfix: wrong error: not all cases covered with enums with holes
This commit is contained in:
16
tests/accept/compile/tenum2.nim
Executable file
16
tests/accept/compile/tenum2.nim
Executable file
@@ -0,0 +1,16 @@
|
||||
# Test that enum with holes is handled correctly by case statement
|
||||
|
||||
type
|
||||
TEnumHole = enum
|
||||
eA = 0,
|
||||
eB = 4,
|
||||
eC = 5
|
||||
|
||||
var
|
||||
e: TEnumHole = eB
|
||||
|
||||
case e
|
||||
of eA: echo "A"
|
||||
of eB: echo "B"
|
||||
of eC: echo "C"
|
||||
|
||||
Reference in New Issue
Block a user