Files
kotlin-fork/compiler/testData/codegen/box/sam/noConversionFromSamToSam.kt
T
2023-11-30 08:39:04 +00:00

21 lines
401 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: Sam.java
public interface Sam<T> {
T foo();
}
// FILE: Connection.java
public interface Connection {
<T> T accept(Sam<T> sam);
}
// FILE: box.kt
fun test(sam: Sam<*>, c: Connection): Any {
return c.accept(sam)
}
fun box(): String {
return test({ "OK" }, object: Connection {
override fun <T> accept(sam: Sam<T>) = sam.foo()
}) as String
}