Generate SAM wrappers only if they are required for a given argument

SAM interface wrapper for an argument is required,
if in the function descriptor for SAM adapter
type for the corresponding value parameter
doesn't match type of the corresponding value parameter
in the original (Java) descriptor.

 #KT-19251 Fixed Target versions 1.1.5
This commit is contained in:
Dmitry Petrov
2017-07-27 16:40:22 +03:00
parent c8bc2d9d16
commit 67336653e0
6 changed files with 71 additions and 0 deletions
@@ -17266,6 +17266,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt19251.kt")
public void testKt19251() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/kt19251.kt");
doTest(fileName);
}
@TestMetadata("kt19251_child.kt")
public void testKt19251_child() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/kt19251_child.kt");
doTest(fileName);
}
@TestMetadata("nonLiteralComparator.kt")
public void testNonLiteralComparator() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/nonLiteralComparator.kt");