Set up tests for fun interfaces for JVM backend for now

This commit is contained in:
Mikhail Zarechenskiy
2020-01-17 14:01:20 +03:00
parent 39e0f101b1
commit 58c235e722
16 changed files with 36 additions and 6 deletions
@@ -1,4 +1,5 @@
// !LANGUAGE: +FunctionalInterfaceConversion // !LANGUAGE: +FunctionalInterfaceConversion
// TARGET_BACKEND: JVM
fun interface Foo { fun interface Foo {
fun invoke(): String fun invoke(): String
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun interface Foo { fun interface Foo {
fun invoke(): String fun invoke(): String
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun interface KRunnable { fun interface KRunnable {
fun invoke() fun invoke()
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
fun interface MyRunnable { fun interface MyRunnable {
@@ -1,5 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
fun interface KRunnable { fun interface KRunnable {
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
fun interface Fn<T, R> { fun interface Fn<T, R> {
@@ -1,6 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
fun interface KRunnable { fun interface KRunnable {
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_COROUTINES // WITH_COROUTINES
// WITH_RUNTIME // WITH_RUNTIME
@@ -1,4 +1,5 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// IGNORE_BACKEND: JVM_IR
// FILE: A.kt // FILE: A.kt
@@ -9,4 +9,4 @@ fun foo(f: Foo) {}
fun test() { fun test() {
foo {} foo {}
} }
@@ -12,4 +12,4 @@ fun foo(f: KRunnable) {}
fun test() { fun test() {
foo(KRunnable {}) foo(KRunnable {})
foo(KRunnableAlias {}) foo(KRunnableAlias {})
} }
@@ -22,4 +22,4 @@ fun test(
k.f_t(f_string) { it checkType { _<String>() } } k.f_t(f_string) { it checkType { _<String>() } }
k.f_r(f_int) { it checkType { _<Int>() } } k.f_r(f_int) { it checkType { _<Int>() } }
k.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } } k.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } }
} }
@@ -30,4 +30,4 @@ fun test(j: J, r: KRunnable) {
j.foo3({}, r, {}) j.foo3({}, r, {})
j.foo3({}, {}, r) j.foo3({}, {}, r)
j.foo3({}, {}, {}) j.foo3({}, {}, {})
} }
@@ -11,4 +11,4 @@ suspend fun bar() {}
fun test() { fun test() {
run(::bar) run(::bar)
} }
@@ -348,6 +348,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt"); runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
} }
@TestMetadata("useDeserializedFunInterface.kt")
public void testUseDeserializedFunInterface() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt");
}
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8") @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
@@ -343,6 +343,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt"); runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
} }
@TestMetadata("useDeserializedFunInterface.kt")
public void testUseDeserializedFunInterface() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt");
}
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8") @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)