Fix JVM import caching and class/object bytecode dispatch
This commit is contained in:
1 parent
953f237ca3
commit
0973a6afeb
5 files changed
+164
-74
No files matched your search
@@ -247,6 +247,21 @@ class BytecodeRecentOpsTest {
|
||||
assertEquals(11, scope.eval("calc()").toInt())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun capturedLambdaCanCallListFillOnCapturedClassReceiver() = runTest {
|
||||
val scope = Script.newScope()
|
||||
val result = scope.eval(
|
||||
"""
|
||||
fun calc(n: Int) {
|
||||
val xs = { List.fill(n) { it } }()
|
||||
xs[4]
|
||||
}
|
||||
calc(5)
|
||||
""".trimIndent()
|
||||
)
|
||||
assertEquals(4, result.toInt())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directLambdaLiteralCallWithCaptureUsesInlineBytecode() = runTest {
|
||||
val scope = Script.newScope()
|
||||
|
||||
Reference in new issue
Block a user