mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
'descriptor -> descriptor.original' relation is often inconsistent wrt 'containingDeclaration', parameters, and type parameters, we have to introduce some workarounds here.
25 lines
445 B
Kotlin
Vendored
25 lines
445 B
Kotlin
Vendored
// !LANGUAGE: +NewInference
|
|
// TARGET_BACKEND: JVM
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// FILE: javaNestedSamInterface.kt
|
|
import test.A
|
|
|
|
fun box(): String = A<Int>(42).get<String> { "OK" }
|
|
|
|
// FILE: test/A.java
|
|
package test;
|
|
|
|
public class A<X extends Number> {
|
|
private final X x;
|
|
|
|
public A(X x) {
|
|
this.x = x;
|
|
}
|
|
|
|
public interface I<T> {
|
|
T compute();
|
|
}
|
|
|
|
public <T> T get(I<T> value) { return value.compute(); }
|
|
}
|