Reject enums with holes when computedGoto is used (#8132)

Fixes #7699
This commit is contained in:
LemonBoy 2018-06-27 21:36:52 +02:00 • committed by Andreas Rumpf
commit 722abbe9c9
2 changed files with 18 additions and 0 deletions

15
tests/casestmt/t7699.nim Normal file
View file

@ -0,0 +1,15 @@
discard """
line: 13
errormsg: "case statement cannot work on enums with holes for computed goto"
"""
type
X = enum
A = 0, B = 100
var z = A
while true:
{.computedGoto.}
case z
of A: discard
of B: discard