From 9971c0606228e44e55b0a9574a10710bef0a7887 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 29 Dec 2015 13:41:35 +0100 Subject: [PATCH] fixes missing 'illegal capture' error message regression --- compiler/lambdalifting.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index b303d11fb5..706594ff10 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -246,11 +246,11 @@ proc liftIterSym(n: PNode; owner: PSym): PNode = # ------------------ new stuff ------------------------------------------- proc markAsClosure(owner: PSym; n: PNode) = - owner.typ.callConv = ccClosure - incl(owner.typ.flags, tfCapturesEnv) let s = n.sym if illegalCapture(s) or owner.typ.callConv notin {ccClosure, ccDefault}: localError(n.info, errIllegalCaptureX, s.name.s) + incl(owner.typ.flags, tfCapturesEnv) + owner.typ.callConv = ccClosure type DetectionPass = object