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:
Dmitry Petrov
2019-12-24 14:51:11 +03:00
parent f8fd5092c6
commit a8e9a6a1d0
9 changed files with 83 additions and 5 deletions

View 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(); }
}