IR Scripting: update capturing logic for the REPL, imported scripts,

as well as all other implicit receivers.
This commit is contained in:
Ilya Chernikov
2022-03-22 19:02:35 +01:00
committed by teamcity
parent 4ec639cafd
commit 35f80c04ca
8 changed files with 223 additions and 43 deletions
@@ -0,0 +1,16 @@
@file:Import("import-common.main.kts")
@file:Import("import-middle.main.kts")
sharedVar = sharedVar + 1
class CapturingClass1 {
val value = sharedVar
}
class CapturingClass2 {
fun f() = CapturingClass1().value
}
println("${SharedObject.greeting} ${from.msg} main")
println("sharedVar == ${CapturingClass2().f()}")