From 30b6ef235bedd3b4a4c20aecdf009ab454defbdf Mon Sep 17 00:00:00 2001 From: sergeych Date: Thu, 10 Jul 2025 12:42:39 +0300 Subject: [PATCH] each new scope with no parent now starts with a copy of import manager to isolate its imports --- lynglib/src/commonMain/kotlin/net/sergeych/lyng/Scope.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Scope.kt b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Scope.kt index dcff4be..29a5e28 100644 --- a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Scope.kt +++ b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Scope.kt @@ -30,7 +30,7 @@ open class Scope( args: Arguments = Arguments.EMPTY, pos: Pos = Pos.builtIn, ) - : this(Script.defaultImportManager.newModuleAt(pos), args, pos) + : this(Script.defaultImportManager.copy().newModuleAt(pos), args, pos) fun raiseNotImplemented(what: String = "operation"): Nothing = raiseError("$what is not implemented")