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:
@@ -1421,6 +1421,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/sam"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("genericSamProjectedOut.kt")
|
||||
public void testGenericSamProjectedOut() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samByProjectedType.kt")
|
||||
public void testSamByProjectedType() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt");
|
||||
|
||||
Reference in New Issue
Block a user