Add test for SAM adapter.

This commit is contained in:
Dmitry Petrov
2016-09-05 11:32:41 +03:00
committed by Dmitry Petrov
parent a4b9f6b215
commit 513ef0c1c8
3 changed files with 27 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// FULL_JDK
// WITH_RUNTIME
fun test1() {
val hello = Runnable { println("Hello, world!") }
hello.run()
}
+14
View File
@@ -0,0 +1,14 @@
FILE /samAdapter.kt
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
VAR val hello: java.lang.Runnable
CALL .Runnable type=java.lang.Runnable operator=null
function: BLOCK type=() -> kotlin.Unit operator=LAMBDA
FUN local final fun <anonymous>(): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=<anonymous>
CALL .println type=kotlin.Unit operator=null
message: CONST String type=kotlin.String value='Hello, world!'
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Unit operator=LAMBDA
CALL .run type=kotlin.Unit operator=null
$this: GET_VAR hello type=java.lang.Runnable operator=null
@@ -624,5 +624,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/lambdas/nonLocalReturn.kt");
doTest(fileName);
}
@TestMetadata("samAdapter.kt")
public void testSamAdapter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/lambdas/samAdapter.kt");
doTest(fileName);
}
}
}