diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-06-27 21:36:52 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-06-27 21:36:52 +0200 |
commit | 722abbe9c9cfbbbf0dde7f8221cd2a563c6c394a (patch) | |
tree | a24192d5af71a862673ea72d727b49ceef1a8069 /tests/casestmt | |
parent | bb23d903b6741c1697ac55f8ee54ff30a9b2cc49 (diff) | |
download | Nim-722abbe9c9cfbbbf0dde7f8221cd2a563c6c394a.tar.gz |
Reject enums with holes when computedGoto is used (#8132)
Fixes #7699
Diffstat (limited to 'tests/casestmt')
-rw-r--r-- | tests/casestmt/t7699.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/casestmt/t7699.nim b/tests/casestmt/t7699.nim new file mode 100644 index 000000000..ea08388eb --- /dev/null +++ b/tests/casestmt/t7699.nim @@ -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 |