PSI2IR: SAM conversion in method arguments of out-projected Java classes

It uses the same logic as an old back-end
(see SamType#createByValueParameter and genericSamProjectedOut.kt),
split into two parts:

1. When inserting SAM casts, use SamType#createByValueParamerer to get
the target SAM type.

2. When inserting implicit casts, cast SAM conversions as arguments of
methods of out-projected types to the original type of value parameter
instead of 'Nothing'.
This commit is contained in:
Dmitry Petrov
2019-12-31 16:35:44 +03:00
parent a55bce801e
commit d27593aeda
13 changed files with 145 additions and 19 deletions
@@ -1,5 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: example/Hello.java