Approximate projections in SAM type when creating SAM adapter

Use the same approach as Java 8 applies to function types
(see non-wildcard parametrization in §9.9 of JLS)

 #KT-6918 Fixed
This commit is contained in:
Denis Zharkov
2016-01-22 14:42:08 +03:00
parent d87b13931d
commit a5c13ce8cf
14 changed files with 390 additions and 38 deletions
@@ -10146,6 +10146,45 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
}
}
@TestMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SamByProjectedType extends AbstractDiagnosticsTest {
public void testAllFilesPresentInSamByProjectedType() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/j+k/samByProjectedType"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("genericInReturnType.kt")
public void testGenericInReturnType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.kt");
doTest(fileName);
}
@TestMetadata("genericInValueParameter.kt")
public void testGenericInValueParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.kt");
doTest(fileName);
}
@TestMetadata("genericSuperWildcard.kt")
public void testGenericSuperWildcard() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.kt");
doTest(fileName);
}
@TestMetadata("noAdapterBecuaseOfRecursiveUpperBound.kt")
public void testNoAdapterBecuaseOfRecursiveUpperBound() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.kt");
doTest(fileName);
}
@TestMetadata("starProjectionComplexUpperBound.kt")
public void testStarProjectionComplexUpperBound() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/tests/j+k/types")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)