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
// TARGET_BACKEND: JVM
fun interface Foo {
fun invoke(): String
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun interface Foo {
fun invoke(): String
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun interface KRunnable {
fun invoke()
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
fun interface MyRunnable {
@@ -1,5 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun interface KRunnable {
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun interface Fn<T, R> {
@@ -1,6 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun interface KRunnable {
@@ -1,4 +1,7 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_COROUTINES
// WITH_RUNTIME
@@ -1,4 +1,5 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// IGNORE_BACKEND: JVM_IR
// FILE: A.kt
@@ -9,4 +9,4 @@ fun foo(f: Foo) {}
fun test() {
foo {}
}
}
@@ -12,4 +12,4 @@ fun foo(f: KRunnable) {}
fun test() {
foo(KRunnable {})
foo(KRunnableAlias {})
}
}
@@ -22,4 +22,4 @@ fun test(
k.f_t(f_string) { it checkType { _<String>() } }
k.f_r(f_int) { it checkType { _<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({}, {}, {})
}
}
@@ -11,4 +11,4 @@ suspend fun bar() {}
fun test() {
run(::bar)
}
}
@@ -348,6 +348,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
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")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -343,6 +343,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile
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")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)