mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
Properly reference type parameter descriptors
'descriptor -> descriptor.original' relation is often inconsistent wrt 'containingDeclaration', parameters, and type parameters, we have to introduce some workarounds here.
This commit is contained in:
24
compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt
vendored
Normal file
24
compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// !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(); }
|
||||
}
|
||||
Reference in New Issue
Block a user