diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/nim.cfg | 5 | ||||
-rw-r--r-- | compiler/options.nim | 2 | ||||
-rw-r--r-- | compiler/sempass2.nim | 8 |
3 files changed, 6 insertions, 9 deletions
diff --git a/compiler/nim.cfg b/compiler/nim.cfg index 020104fe5..2df001085 100644 --- a/compiler/nim.cfg +++ b/compiler/nim.cfg @@ -30,11 +30,6 @@ define:useStdoutAsStdmsg warning[ObservableStores]: off @end -@if nimHasEffectsOf: - experimental:strictEffects - warningAsError:Effect:on -@end - @if nimHasWarningAsError: warningAsError:GcUnsafe2:on @end diff --git a/compiler/options.nim b/compiler/options.nim index 6257f8969..9043362d9 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -228,6 +228,8 @@ type ## Historically and especially in version 1.0.0 of the language ## conversions to unsigned numbers were checked. In 1.0.4 they ## are not anymore. + laxEffects + ## Lax effects system prior to Nim 2.0. SymbolFilesOption* = enum disabledSf, writeOnlySf, readOnlySf, v2Sf, stressTest diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index f2da33e8b..34490f492 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -495,7 +495,7 @@ proc isIndirectCall(tracked: PEffects; n: PNode): bool = if n.kind != nkSym: result = true elif n.sym.kind == skParam: - if strictEffects in tracked.c.features: + if laxEffects notin tracked.c.config.legacyFeatures: if tracked.owner == n.sym.owner and sfEffectsDelayed in n.sym.flags: result = false # it is not a harmful call else: @@ -581,7 +581,7 @@ proc isOwnedProcVar(tracked: PEffects; n: PNode): bool = tracked.owner == n.sym.owner #if result and sfPolymorphic notin n.sym.flags: # echo tracked.config $ n.info, " different here!" - if strictEffects in tracked.c.features: + if laxEffects notin tracked.c.config.legacyFeatures: result = result and sfEffectsDelayed in n.sym.flags proc isNoEffectList(n: PNode): bool {.inline.} = @@ -598,7 +598,7 @@ proc trackOperandForIndirectCall(tracked: PEffects, n: PNode, formals: PType; ar # assume indirect calls are taken here: if op != nil and op.kind == tyProc and n.skipConv.kind != nkNilLit and not isTrival(caller) and - ((param != nil and sfEffectsDelayed in param.flags) or strictEffects notin tracked.c.features): + ((param != nil and sfEffectsDelayed in param.flags) or laxEffects in tracked.c.config.legacyFeatures): internalAssert tracked.config, op.n[0].kind == nkEffectList var effectList = op.n[0] @@ -844,7 +844,7 @@ proc trackCall(tracked: PEffects; n: PNode) = assumeTheWorst(tracked, n, op) gcsafeAndSideeffectCheck() else: - if strictEffects in tracked.c.features and a.kind == nkSym and + if laxEffects notin tracked.c.config.legacyFeatures and a.kind == nkSym and a.sym.kind in routineKinds: propagateEffects(tracked, n, a.sym) else: |