From e16bd735c48464ef5efcc48afbcbbd49cbf3cc74 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 26 Aug 2016 13:23:15 +0200 Subject: [PATCH] explicit side-effects override the inferred effect; refs #4659 --- compiler/sempass2.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index a8fb9ef91b..3908fa26ef 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -935,7 +935,7 @@ proc trackProc*(s: PSym, body: PNode) = localError(s.info, errXhasSideEffects, s.name.s) if not t.gcUnsafe: s.typ.flags.incl tfGcSafe - if not t.hasSideEffect: + if not t.hasSideEffect and sfSideEffect notin s.flags: s.typ.flags.incl tfNoSideEffect if s.typ.lockLevel == UnspecifiedLockLevel: s.typ.lockLevel = t.maxLockLevel