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

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

View File

@@ -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