Do not create synthesized equals/hashCode/toString in data classes in compatibility mode

To simplify migration from 1.0 to 1.1, do not allow data classes to
automatically implement abstract equals/hashCode/toString declared in
super-interfaces (KT-11306) if "-language-version 1.0" is specified
This commit is contained in:
Alexander Udalov
2016-10-03 11:46:48 +03:00
parent 597912824b
commit 73652f309f
10 changed files with 122 additions and 36 deletions
@@ -3617,6 +3617,21 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/compatibility")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Compatibility extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInCompatibility() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/compatibility"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("dataClassEqualsHashCodeToString.kt")
public void testDataClassEqualsHashCodeToString() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/compatibility/dataClassEqualsHashCodeToString.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/constants")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)