From 35df59b3ce9912cf91499c9830549e9535d37b19 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 21 Jun 2019 20:38:11 +0200 Subject: [PATCH] [bugfix] fixes #11556 --- compiler/semstmts.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 5a876a6ea7..906ad63d54 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -891,10 +891,12 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode = of tyFloat..tyFloat128, tyString, tyError: discard else: + popCaseContext(c) + closeScope(c) if caseStmtMacros in c.features: result = handleCaseStmtMacro(c, n) - if result != nil: return result - + if result != nil: + return result localError(c.config, n.sons[0].info, errSelectorMustBeOfCertainTypes) return for i in 1 ..< sonsLen(n):