JVM_IR KT-36984 SAM wrappers are anonymous inner classes

This commit is contained in:
Dmitry Petrov
2020-12-17 11:35:39 +03:00
parent 443cd0fc2c
commit 57dd9fc87a
17 changed files with 467 additions and 17 deletions
@@ -0,0 +1,24 @@
// FILE: test.kt
fun test1() {
val f = { }
val t1 = Runnable(f)
val t2 = Runnable(f)
}
fun test2() {
val t1 = getWrapped1()
val t2 = getWrapped2()
}
// FILE: f1.kt
fun getWrapped1(): Runnable {
val f = { }
return Runnable(f)
}
// FILE: f2.kt
fun getWrapped2(): Runnable {
val f = { }
return Runnable(f)
}