Tests for some more cases of JVM signature clashes

This commit is contained in:
Andrey Breslav
2014-06-20 15:51:47 +04:00
parent e2c5d9edf6
commit 64175d3996
6 changed files with 49 additions and 0 deletions
@@ -19,3 +19,16 @@ trait Tr {
class SubTr : Tr {
val tr = 1
}
// Clashing synthetic accessors are only reported in compiler, IDE doesn't see them
class C {
private fun f() {}
fun `f$b$0`(c: C) {}
class Nested {
fun test() {
C().f()
}
}
}
@@ -1,3 +1,4 @@
WARNING: $TESTDATA_DIR$/signatureClash.kt: (26, 17) Parameter 'c' is never used
ERROR: $TESTDATA_DIR$/signatureClash.kt: (6, 5) Accidental override: The following declarations have the same JVM signature (getX()I):
fun getX(): kotlin.Int
fun <get-x>(): kotlin.Int
@@ -19,4 +20,10 @@ ERROR: $TESTDATA_DIR$/signatureClash.kt: (16, 5) Platform declaration clash: The
ERROR: $TESTDATA_DIR$/signatureClash.kt: (20, 5) Platform declaration clash: The following declarations have the same JVM signature (getTr()I):
fun <get-tr>(): kotlin.Int
fun getTr(): kotlin.Int
ERROR: $TESTDATA_DIR$/signatureClash.kt: (24, 7) Platform declaration clash: The following declarations have the same JVM signature (f$b$0(LC;)V):
fun f$b$0(c: C): kotlin.Unit
fun f(): kotlin.Unit
ERROR: $TESTDATA_DIR$/signatureClash.kt: (26, 5) Platform declaration clash: The following declarations have the same JVM signature (f$b$0(LC;)V):
fun f$b$0(c: C): kotlin.Unit
fun f(): kotlin.Unit
COMPILATION_ERROR