PSI2IR: support SAM conversion to substituted types

i.e. in arguments to `f(T x)` where `T` is a type parameter bound to a
SAM type.
This commit is contained in:
pyos
2020-04-29 13:20:17 +02:00
committed by Dmitry Petrov
parent d9fd51c608
commit df4f1365ec
6 changed files with 45 additions and 3 deletions
@@ -0,0 +1,18 @@
// TODO: new inference doesn't do SAM conversion in this case. KT-37149
// !LANGUAGE: -NewInference
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Generic.java
class Generic<T> {
T id(T x) { return x; }
}
// FILE: Specialized.java
class Specialized extends Generic<Runnable> {}
// FILE: use.kt
fun box(): String {
var result = "fail"
Specialized().id { result = "OK" }.run()
return result
}