mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
explicit side-effects override the inferred effect; refs #4659
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user