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,16 @@
class A {
fun test1a() = B().runnable1()
fun test1b() = B().runnable1()
fun test2a() = B().runnable2()
fun test2b() = B().runnable2()
fun testRunnableSamCtor1() = B().runnableSamCtor {}
fun testRunnableSamCtor2() = B().runnableSamCtor {}
}
class B {
inline fun runnable1() = Runnable {}
inline fun runnable2() = Runnable {}
inline fun runnableSamCtor(noinline s: () -> Unit ) = Runnable (s)
}