Added tests with adding method to superclass.

Original commit: 3237791433
This commit is contained in:
Evgeny Gerashchenko
2014-10-24 15:57:07 +04:00
parent 5d93890a84
commit 6447c4183d
9 changed files with 69 additions and 0 deletions
@@ -358,6 +358,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
doTest(fileName);
}
@TestMetadata("methodAddedInSuper")
public void testMethodAddedInSuper() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper/");
doTest(fileName);
}
@TestMetadata("methodRenamed")
public void testMethodRenamed() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/");
@@ -411,6 +417,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
doTest(fileName);
}
@TestMetadata("methodAddedInSuper")
public void testMethodAddedInSuper() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper/");
doTest(fileName);
}
@TestMetadata("notChangeSignature")
public void testNotChangeSignature() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature/");
@@ -0,0 +1,4 @@
public class Sub: Super() {
private fun y() {
}
}
@@ -0,0 +1,4 @@
public class Super {
public void x() {
}
}
@@ -0,0 +1,7 @@
public class Super {
public void x() {
}
public void y() {
}
}
@@ -0,0 +1,15 @@
Cleaning output files:
out/production/module/Super.class
End of files
Compiling files:
src/Super.java
End of files
Cleaning output files:
out/production/module/Sub.class
End of files
Compiling files:
src/Sub.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Cannot weaken access privilege 'public' for 'y' in 'Super'
Kotlin:ERROR:'y' hides member of supertype 'Super' and needs 'override' modifier
@@ -0,0 +1,5 @@
public class Sub extends Super {
private void y() {
}
}
@@ -0,0 +1,4 @@
public open class Super {
public fun x() {
}
}
@@ -0,0 +1,7 @@
public open class Super {
public fun x() {
}
public fun y() {
}
}
@@ -0,0 +1,11 @@
Cleaning output files:
out/production/module/Super.class
End of files
Compiling files:
src/Super.kt
End of files
Compiling files:
src/Sub.java
End of files
COMPILATION FAILED
java:ERROR:$PROJECT/src/Sub.java:2: y() in Sub cannot override y() in Super; overridden method is final