Change override rules when type parameters have multiple bounds

Instead of constructing the magic intersection type, compare sets of upper
bounds instead as javac does, modulo the substitution
This commit is contained in:
Alexander Udalov
2015-10-22 22:40:26 +03:00
parent a59ca2ea9f
commit 477823b093
9 changed files with 244 additions and 38 deletions
@@ -11033,6 +11033,33 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/tests/override/typeParameters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeParameters extends AbstractJetDiagnosticsTest {
public void testAllFilesPresentInTypeParameters() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/override/typeParameters"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("classAndTwoInterfaceBounds.kt")
public void testClassAndTwoInterfaceBounds() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.kt");
doTest(fileName);
}
@TestMetadata("differentSetsOfBounds.kt")
public void testDifferentSetsOfBounds() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/typeParameters/differentSetsOfBounds.kt");
doTest(fileName);
}
@TestMetadata("simpleVisitorTwoAccepts.kt")
public void testSimpleVisitorTwoAccepts() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.kt");
doTest(fileName);
}
}
}
@TestMetadata("compiler/testData/diagnostics/tests/platformTypes")