JVM_IR: change parameter type computation in InlineCallableReferenceToLambda

The reference type is approximated in Psi2Ir, so we may get Nothing as
a reference type argument. Better look at the arguments of the
referenced function.
This commit is contained in:
Georgy Bronnikov
2020-02-21 20:41:04 +03:00
parent 456139fc5e
commit 963258189a
8 changed files with 56 additions and 4 deletions
@@ -0,0 +1,12 @@
// IGNORE_BACKEND_FIR: JVM_IR
inline fun <TT> id(x: TT): TT = x
inline fun <TT> String.extId(x: TT): String = this
private fun <T> ff(value: T?): String {
// In PSI2IR, the funcref is approximated to Function1<Nothing, Pair<String, T>>
value?.let(::id)
return value?.let("OK"::extId)!!
}
fun box() = ff("arg")