explicit side-effects override the inferred effect; refs #4659

This commit is contained in:
Andreas Rumpf 2016-08-26 13:23:15 +02:00
commit e16bd735c4

View file

@ -935,7 +935,7 @@ proc trackProc*(s: PSym, body: PNode) =
localError(s.info, errXhasSideEffects, s.name.s) localError(s.info, errXhasSideEffects, s.name.s)
if not t.gcUnsafe: if not t.gcUnsafe:
s.typ.flags.incl tfGcSafe s.typ.flags.incl tfGcSafe
if not t.hasSideEffect: if not t.hasSideEffect and sfSideEffect notin s.flags:
s.typ.flags.incl tfNoSideEffect s.typ.flags.incl tfNoSideEffect
if s.typ.lockLevel == UnspecifiedLockLevel: if s.typ.lockLevel == UnspecifiedLockLevel:
s.typ.lockLevel = t.maxLockLevel s.typ.lockLevel = t.maxLockLevel