From 722abbe9c9cfbbbf0dde7f8221cd2a563c6c394a Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 27 Jun 2018 21:36:52 +0200 Subject: Reject enums with holes when computedGoto is used (#8132) Fixes #7699 --- tests/casestmt/t7699.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/casestmt/t7699.nim (limited to 'tests/casestmt') 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 -- cgit 1.4.1-2-gfad0