[bugfix] fixes #11556

This commit is contained in:
Andreas Rumpf 2019-06-21 20:38:11 +02:00
commit 35df59b3ce

View file

@ -891,10 +891,12 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
of tyFloat..tyFloat128, tyString, tyError: of tyFloat..tyFloat128, tyString, tyError:
discard discard
else: else:
popCaseContext(c)
closeScope(c)
if caseStmtMacros in c.features: if caseStmtMacros in c.features:
result = handleCaseStmtMacro(c, n) result = handleCaseStmtMacro(c, n)
if result != nil: return result if result != nil:
return result
localError(c.config, n.sons[0].info, errSelectorMustBeOfCertainTypes) localError(c.config, n.sons[0].info, errSelectorMustBeOfCertainTypes)
return return
for i in 1 ..< sonsLen(n): for i in 1 ..< sonsLen(n):