Added tests with redeclaration. The behavior is correct (compilation error), while diagnostic message is not ideal.
This commit is contained in:
@@ -99,6 +99,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classRedeclaration")
|
||||||
|
public void testClassRedeclaration() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/classRedeclaration/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("classSignatureChanged")
|
@TestMetadata("classSignatureChanged")
|
||||||
public void testClassSignatureChanged() throws Exception {
|
public void testClassSignatureChanged() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/classSignatureChanged/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/classSignatureChanged/");
|
||||||
@@ -117,6 +123,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conflictingPlatformDeclarations")
|
||||||
|
public void testConflictingPlatformDeclarations() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/conflictingPlatformDeclarations/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("constantsUnchanged")
|
@TestMetadata("constantsUnchanged")
|
||||||
public void testConstantsUnchanged() throws Exception {
|
public void testConstantsUnchanged() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/constantsUnchanged/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/constantsUnchanged/");
|
||||||
@@ -141,6 +153,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funRedeclaration")
|
||||||
|
public void testFunRedeclaration() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/funRedeclaration/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("independentClasses")
|
@TestMetadata("independentClasses")
|
||||||
public void testIndependentClasses() throws Exception {
|
public void testIndependentClasses() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/independentClasses/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/independentClasses/");
|
||||||
@@ -249,6 +267,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyRedeclaration")
|
||||||
|
public void testPropertyRedeclaration() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/propertyRedeclaration/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("returnTypeChanged")
|
@TestMetadata("returnTypeChanged")
|
||||||
public void testReturnTypeChanged() throws Exception {
|
public void testReturnTypeChanged() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/returnTypeChanged/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/returnTypeChanged/");
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
Compiling files:
|
||||||
|
src/class2.kt
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Klass.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/class1.kt
|
||||||
|
src/class2.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Kotlin:ERROR:Redeclaration: Klass
|
||||||
|
Kotlin:ERROR:Redeclaration: Klass
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
class Klass
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
class Klass
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$fun2$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/fun2.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (function(Ljava/util/List;)V):
|
||||||
|
fun function(list: kotlin.List<kotlin.Any>): kotlin.Unit
|
||||||
|
fun function(list: kotlin.List<kotlin.String>): kotlin.Unit
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun function(list: List<Any>) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val x = 1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val x = 1
|
||||||
|
|
||||||
|
fun function(list: List<String>) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$fun2$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/fun2.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (function()V):
|
||||||
|
fun function(): kotlin.Unit
|
||||||
|
fun function(): kotlin.Unit
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun function() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val x = 1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val x = 1
|
||||||
|
|
||||||
|
fun function() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$prop2$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/prop2.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (getProperty()I):
|
||||||
|
fun <get-property>(): kotlin.Int
|
||||||
|
fun <get-property>(): kotlin.Int
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val property = 1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun dummy() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun dummy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
val property = 1
|
||||||
Reference in New Issue
Block a user