KT-51282 Add tests
This commit is contained in:
committed by
teamcity
parent
ca221cc6f2
commit
1b8a60b5a5
+12
@@ -26792,6 +26792,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt47510.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51282.kt")
|
||||
public void testKt51282() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt51282.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt512832_inherit_multifile_parts.kt")
|
||||
public void testKt512832_inherit_multifile_parts() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt512832_inherit_multifile_parts.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51868_contravariantGenericSam.kt")
|
||||
public void testKt51868_contravariantGenericSam() throws Exception {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: Foo.java
|
||||
package org.example.foo;
|
||||
public interface Foo {
|
||||
String foo(String s);
|
||||
}
|
||||
|
||||
// FILE: bar1.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Bar")
|
||||
|
||||
package org.example.bar
|
||||
|
||||
fun doFoo(s: String): String = s.toUpperCase()
|
||||
|
||||
// FILE: bar2.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Bar")
|
||||
|
||||
package org.example.bar
|
||||
|
||||
val unused = 1
|
||||
|
||||
// FILE: Baz.kt
|
||||
|
||||
package org.example.baz
|
||||
|
||||
import org.example.foo.Foo
|
||||
import org.example.bar.doFoo
|
||||
|
||||
fun box(): String {
|
||||
val foo = Foo(::doFoo)
|
||||
return foo.foo("ok")
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// INHERIT_MULTIFILE_PARTS
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: Foo.java
|
||||
package org.example.foo;
|
||||
public interface Foo {
|
||||
String foo(String s);
|
||||
}
|
||||
|
||||
// FILE: bar1.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Bar")
|
||||
|
||||
package org.example.bar
|
||||
|
||||
fun doFoo(s: String): String = s.toUpperCase()
|
||||
|
||||
// FILE: bar2.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Bar")
|
||||
|
||||
package org.example.bar
|
||||
|
||||
const val unused = 1
|
||||
|
||||
// FILE: Baz.kt
|
||||
|
||||
package org.example.baz
|
||||
|
||||
import org.example.foo.Foo
|
||||
import org.example.bar.doFoo
|
||||
|
||||
fun box(): String {
|
||||
val foo = Foo(::doFoo)
|
||||
return foo.foo("ok")
|
||||
}
|
||||
+12
@@ -26792,6 +26792,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt47510.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51282.kt")
|
||||
public void testKt51282() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt51282.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt512832_inherit_multifile_parts.kt")
|
||||
public void testKt512832_inherit_multifile_parts() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt512832_inherit_multifile_parts.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51868_contravariantGenericSam.kt")
|
||||
public void testKt51868_contravariantGenericSam() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user