JVM IR: disable SAM conversion in case type has 'in' projection

... and the corresponding type parameter has a non-trivial (i.e.
non-`Any?`) upper bound.

The best solution here would be to get rid of
`removeExternalProjections` completely, and just use the type of the
argument at the call site, but see KT-52428.

 #KT-51868 Fixed
This commit is contained in:
Alexander Udalov
2022-04-22 00:15:11 +02:00
parent 62c12864f3
commit 584b70719e
14 changed files with 138 additions and 51 deletions
@@ -21907,6 +21907,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt47510.kt");
}
@TestMetadata("kt51868_contravariantGenericSam.kt")
public void testKt51868_contravariantGenericSam() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt51868_contravariantGenericSam.kt");
}
@TestMetadata("kt52040_severalProxyFunsInInit.kt")
public void testKt52040_severalProxyFunsInInit() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/sam/kt52040_severalProxyFunsInInit.kt");