Fixes
h3rald h3rald@h3rald.com
Sun, 16 Jun 2024 18:35:11 +0200
1 files changed,
4 insertions(+),
2 deletions(-)
jump to
M
minpkg/core/interpreter.nim
→
minpkg/core/interpreter.nim
@@ -197,11 +197,13 @@ proc apply*(i: In, op: MinOperator, sym = "") {.effectsOf: op.} =
if op.kind == minProcOp: if not op.mdl.isNil and not op.mdl.scope.isNil: # Capture closures at module level + let origScope = i.scope let origParentScope = i.scope.parent let origMdlParentScope = op.mdl.scope.parent - i.scope.parent = op.mdl.scope - i.scope.parent.parent = origParentScope + i.scope = op.mdl.scope + i.scope.parent = origScope op.prc(i) + i.scope = origScope i.scope.parent = origParentScope op.mdl.scope.parent = origMdlParentScope else: