[tests] Klib based signature clash improve coverage for KT-63670

This commit is contained in:
Andrei Tyrin
2024-02-14 14:08:58 +01:00
committed by Space Team
parent fff5a412ec
commit 4e10dcd808
7 changed files with 263 additions and 61 deletions
@@ -0,0 +1,7 @@
/main.kt:27:5: error: Platform declaration clash: The following declarations have the same IR signature (com.example.klib.serialization.diagnostics/ConstructorsClash.<init>|<init>(kotlin.Int){}[0]):
constructor ConstructorsClash(s: kotlin.Int) defined in com.example.klib.serialization.diagnostics.ConstructorsClash
constructor ConstructorsClash(s: kotlin.Int) defined in com.example.klib.serialization.diagnostics.ConstructorsClash
/main.kt:29:5: error: Platform declaration clash: The following declarations have the same IR signature (com.example.klib.serialization.diagnostics/ConstructorsClash.<init>|<init>(kotlin.Int){}[0]):
constructor ConstructorsClash(s: kotlin.Int) defined in com.example.klib.serialization.diagnostics.ConstructorsClash
constructor ConstructorsClash(s: kotlin.Int) defined in com.example.klib.serialization.diagnostics.ConstructorsClash
@@ -0,0 +1,31 @@
// WITH_STDLIB
// DIAGNOSTICS: -ERROR_SUPPRESSION
// FIR_IDENTICAL
// RENDER_ALL_DIAGNOSTICS_FULL_TEXT
// IGNORE_BACKEND: JS_IR, NATIVE
// ^ KT-65680: Class redeclaration leads to BackendException during IR fake override builder
// MODULE: lib
package com.example.klib.serialization.diagnostics
class SeparateModules
// MODULE: main(lib)
// FILE: foo.kt
package com.example.klib.serialization.diagnostics
class SeparateModules
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("PACKAGE_OR_CLASSIFIER_REDECLARATION") class SeparateFiles<!>
// FILE: main.kt
package com.example.klib.serialization.diagnostics
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("PACKAGE_OR_CLASSIFIER_REDECLARATION") class SeparateFiles<!>
class ConstructorsClash {
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN)
constructor(s: Int)<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>constructor(s: Int)<!>
}
@@ -1,64 +1,30 @@
/foo.kt:14:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
/foo.kt:16:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
fun foo(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.String defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:17:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myVal|{}myVal[0]):
val myVal: kotlin.String defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Int defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Long defined in com.example.klib.serialization.diagnostics
/foo.kt:19:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/topLevelParametrized|topLevelParametrized@0:0(0:1){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]):
fun <T, K> T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics
fun <T, K> T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics
/foo.kt:17:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myVal.<get-myVal>|<get-myVal>(){}[0]):
fun `<get-myVal>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.String defined in com.example.klib.serialization.diagnostics
/foo.kt:22:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/topLevelInternalVararg|topLevelInternalVararg(kotlin.IntArray...){}[0]):
fun topLevelInternalVararg(vararg i: kotlin.Int): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun topLevelInternalVararg(vararg i: kotlin.Int): kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:19:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated|{}myDelegated[0]):
val myDelegated: kotlin.Int defined in com.example.klib.serialization.diagnostics
val myDelegated: kotlin.Long defined in com.example.klib.serialization.diagnostics
/foo.kt:26:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/typealiasReciever|typealiasReciever@kotlin.collections.Map<kotlin.String,kotlin.Int>(){}[0]):
fun kotlin.collections.Map<kotlin.String, kotlin.Int>.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun kotlin.collections.Map<kotlin.String, kotlin.Int>.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:19:26: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated.<get-myDelegated>|<get-myDelegated>(){}[0]):
fun `<get-myDelegated>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myDelegated>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:24:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
/main.kt:34:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
fun foo(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.String defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:27:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
/main.kt:37:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/foo|foo(){}[0]):
fun foo(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.String defined in com.example.klib.serialization.diagnostics
fun foo(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:29:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myVal|{}myVal[0]):
val myVal: kotlin.String defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Int defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:29:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myVal.<get-myVal>|<get-myVal>(){}[0]):
fun `<get-myVal>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:32:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myVal|{}myVal[0]):
val myVal: kotlin.String defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Int defined in com.example.klib.serialization.diagnostics
var myVal: kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:34:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myVal.<get-myVal>|<get-myVal>(){}[0]):
fun `<get-myVal>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun `<get-myVal>`(): kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:36:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated|{}myDelegated[0]):
val myDelegated: kotlin.Int defined in com.example.klib.serialization.diagnostics
val myDelegated: kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:37:25: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated.<get-myDelegated>|<get-myDelegated>(){}[0]):
fun `<get-myDelegated>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myDelegated>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:43:5: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/A.parameterized|parameterized(0:0){0§<kotlin.Any?>}[0]):
fun <T> parameterized(a: T): T defined in com.example.klib.serialization.diagnostics.A
fun <T> parameterized(a: T): kotlin.Unit defined in com.example.klib.serialization.diagnostics.A
@@ -90,3 +56,15 @@
/main.kt:70:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/bar|bar(){}[0]):
fun bar(): kotlin.Long defined in com.example.klib.serialization.diagnostics
fun bar(): kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:72:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/topLevelParametrized|topLevelParametrized@0:0(0:1){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]):
fun <T, K> T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics
fun <T, K> T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics
/main.kt:75:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/topLevelInternalVararg|topLevelInternalVararg(kotlin.IntArray...){}[0]):
fun topLevelInternalVararg(vararg i: kotlin.Int): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun topLevelInternalVararg(vararg i: kotlin.Int): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:78:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/typealiasReciever|typealiasReciever@kotlin.collections.Map<kotlin.String,kotlin.Int>(){}[0]):
fun kotlin.collections.Map<kotlin.String, kotlin.Int>.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun kotlin.collections.Map<kotlin.String, kotlin.Int>.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics
@@ -11,31 +11,31 @@ fun movedToLib() {}
// FILE: foo.kt
package com.example.klib.serialization.diagnostics
private fun privateFunSeparateFiles() = Unit
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): Long = 0L<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>var myVal: Long = 0L<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun <T, K> T.topLevelParametrized(s: K): T = TODO()<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>val myDelegated: Long by <!CONFLICTING_KLIB_SIGNATURES_ERROR!>lazy { 0L }<!><!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
internal fun topLevelInternalVararg(vararg i: Int) = 0<!>
typealias S = Map<String, Int>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun S.typealiasReciever() = 0<!>
// FILE: main.kt
package com.example.klib.serialization.diagnostics
private fun privateFunSeparateFiles() = Unit
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>fun foo(): Int = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
var myVal: Int = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
val myVal: String
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>get() = ""<!><!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
val myDelegated: Int by <!CONFLICTING_KLIB_SIGNATURES_ERROR!>lazy { 1 }<!><!>
@Deprecated("This function moved to the 'lib' module", level = DeprecationLevel.HIDDEN)
fun movedToLib() {}
@@ -68,3 +68,12 @@ fun main() {
fun bar(): Long = 0L<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>fun bar(): Long = 1L<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun <T, K> T.topLevelParametrized(s: K): T = TODO()<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
internal fun topLevelInternalVararg(vararg i: Int) = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Deprecated("", level = DeprecationLevel.HIDDEN)
fun Map<String, Int>.typealiasReciever() = 0<!>
@@ -0,0 +1,111 @@
/foo.kt:18:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/valueSeparateFiles|{}valueSeparateFiles[0]):
val valueSeparateFiles: kotlin.Int defined in com.example.klib.serialization.diagnostics
val valueSeparateFiles: kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:18:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/valueSeparateFiles.<get-valueSeparateFiles>|<get-valueSeparateFiles>(){}[0]):
fun `<get-valueSeparateFiles>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-valueSeparateFiles>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:20:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated|{}myDelegated[0]):
val myDelegated: kotlin.Int defined in com.example.klib.serialization.diagnostics
val myDelegated: kotlin.Long defined in com.example.klib.serialization.diagnostics
/foo.kt:20:53: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated.<get-myDelegated>|<get-myDelegated>(){}[0]):
fun `<get-myDelegated>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myDelegated>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
/foo.kt:22:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/extensionValue|@kotlin.Int{}extensionValue[0]):
val kotlin.Int.extensionValue: kotlin.Int defined in com.example.klib.serialization.diagnostics
var kotlin.Int.extensionValue: kotlin.Int defined in com.example.klib.serialization.diagnostics
/foo.kt:24:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/extensionValue.<get-extensionValue>|<get-extensionValue>@kotlin.Int(){}[0]):
fun kotlin.Int.`<get-extensionValue>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun kotlin.Int.`<get-extensionValue>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:32:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/valueSeparateFiles|{}valueSeparateFiles[0]):
val valueSeparateFiles: kotlin.Int defined in com.example.klib.serialization.diagnostics
val valueSeparateFiles: kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:32:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/valueSeparateFiles.<get-valueSeparateFiles>|<get-valueSeparateFiles>(){}[0]):
fun `<get-valueSeparateFiles>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-valueSeparateFiles>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:34:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/valueSingleFile|{}valueSingleFile[0]):
val valueSingleFile: kotlin.Int defined in com.example.klib.serialization.diagnostics
val valueSingleFile: kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:34:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/valueSingleFile.<get-valueSingleFile>|<get-valueSingleFile>(){}[0]):
fun `<get-valueSingleFile>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-valueSingleFile>`(): kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:35:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/valueSingleFile|{}valueSingleFile[0]):
val valueSingleFile: kotlin.Int defined in com.example.klib.serialization.diagnostics
val valueSingleFile: kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:35:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/valueSingleFile.<get-valueSingleFile>|<get-valueSingleFile>(){}[0]):
fun `<get-valueSingleFile>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-valueSingleFile>`(): kotlin.String defined in com.example.klib.serialization.diagnostics
/main.kt:37:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated|{}myDelegated[0]):
val myDelegated: kotlin.Int defined in com.example.klib.serialization.diagnostics
val myDelegated: kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:37:52: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/myDelegated.<get-myDelegated>|<get-myDelegated>(){}[0]):
fun `<get-myDelegated>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun `<get-myDelegated>`(): kotlin.Long defined in com.example.klib.serialization.diagnostics
/main.kt:39:1: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/extensionValue|@kotlin.Int{}extensionValue[0]):
val kotlin.Int.extensionValue: kotlin.Int defined in com.example.klib.serialization.diagnostics
var kotlin.Int.extensionValue: kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:41:1: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/extensionValue.<get-extensionValue>|<get-extensionValue>@kotlin.Int(){}[0]):
fun kotlin.Int.`<get-extensionValue>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
fun kotlin.Int.`<get-extensionValue>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics
/main.kt:44:5: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClass|{}valueSameClass[0]):
val valueSameClass: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
val valueSameClass: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
/main.kt:44:5: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClass.<get-valueSameClass>|<get-valueSameClass>(){}[0]):
fun `<get-valueSameClass>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
fun `<get-valueSameClass>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
/main.kt:45:5: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClass|{}valueSameClass[0]):
val valueSameClass: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
val valueSameClass: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
/main.kt:45:5: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClass.<get-valueSameClass>|<get-valueSameClass>(){}[0]):
fun `<get-valueSameClass>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
fun `<get-valueSameClass>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container
/main.kt:48:9: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.Companion.valueSameClassCompanion|{}valueSameClassCompanion[0]):
val valueSameClassCompanion: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
val valueSameClassCompanion: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
/main.kt:48:9: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.Companion.valueSameClassCompanion.<get-valueSameClassCompanion>|<get-valueSameClassCompanion>(){}[0]):
fun `<get-valueSameClassCompanion>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
fun `<get-valueSameClassCompanion>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
/main.kt:49:9: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.Companion.valueSameClassCompanion|{}valueSameClassCompanion[0]):
val valueSameClassCompanion: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
val valueSameClassCompanion: kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
/main.kt:49:9: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.Companion.valueSameClassCompanion.<get-valueSameClassCompanion>|<get-valueSameClassCompanion>(){}[0]):
fun `<get-valueSameClassCompanion>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
fun `<get-valueSameClassCompanion>`(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion
/main.kt:52:5: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClassExtension|@kotlin.String{}valueSameClassExtension[0]):
val kotlin.String.valueSameClassExtension: kotlin.String defined in com.example.klib.serialization.diagnostics.Container
val kotlin.String.valueSameClassExtension: kotlin.String defined in com.example.klib.serialization.diagnostics.Container
/main.kt:52:75: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClassExtension.<get-valueSameClassExtension>|<get-valueSameClassExtension>@kotlin.String(){}[0]):
fun kotlin.String.`<get-valueSameClassExtension>`(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container
fun kotlin.String.`<get-valueSameClassExtension>`(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container
/main.kt:53:5: error: Platform declaration clash: The following properties have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClassExtension|@kotlin.String{}valueSameClassExtension[0]):
val kotlin.String.valueSameClassExtension: kotlin.String defined in com.example.klib.serialization.diagnostics.Container
val kotlin.String.valueSameClassExtension: kotlin.String defined in com.example.klib.serialization.diagnostics.Container
/main.kt:53:75: error: Platform declaration clash: The following functions have the same IR signature (com.example.klib.serialization.diagnostics/Container.valueSameClassExtension.<get-valueSameClassExtension>|<get-valueSameClassExtension>@kotlin.String(){}[0]):
fun kotlin.String.`<get-valueSameClassExtension>`(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container
fun kotlin.String.`<get-valueSameClassExtension>`(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container
@@ -0,0 +1,54 @@
// WITH_STDLIB
// DIAGNOSTICS: -ERROR_SUPPRESSION
// FIR_IDENTICAL
// RENDER_ALL_DIAGNOSTICS_FULL_TEXT
// MODULE: lib
package com.example.klib.serialization.diagnostics
val valueSeparateModules: Int = 0
// MODULE: main(lib)
// FILE: foo.kt
package com.example.klib.serialization.diagnostics
val valueSeparateModules = 0
private val privateValueSeparateFiles = 0
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSeparateFiles = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val myDelegated: Long by <!CONFLICTING_KLIB_SIGNATURES_ERROR!>lazy { 0L }<!><!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION")
var Int.extensionValue: Int
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>get() = 0<!>
set(value) = TODO()<!>
// FILE: main.kt
package com.example.klib.serialization.diagnostics
private val privateValueSeparateFiles = 0
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSeparateFiles = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSingleFile: Int = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSingleFile: String = ""<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val myDelegated: Int by <!CONFLICTING_KLIB_SIGNATURES_ERROR!>lazy { 1 }<!><!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION")
val Int.extensionValue: Int
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>get() = 0<!><!>
class Container {
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSameClass = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSameClass = 0<!>
companion object{
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSameClassCompanion = 0<!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR, CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val valueSameClassCompanion = 0<!>
}
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val String.valueSameClassExtension: String <!CONFLICTING_KLIB_SIGNATURES_ERROR!>get() = ""<!><!>
<!CONFLICTING_KLIB_SIGNATURES_ERROR!>@Suppress("REDECLARATION") val String.valueSameClassExtension: String <!CONFLICTING_KLIB_SIGNATURES_ERROR!>get() = ""<!><!>
}
@@ -26,9 +26,21 @@ public class FirPsiJsKlibDiagnosticsTestGenerated extends AbstractFirPsiJsDiagno
}
@Test
@TestMetadata("signatureClash.kt")
public void testSignatureClash() {
runTest("compiler/testData/diagnostics/klibSerializationTests/signatureClash.kt");
@TestMetadata("signatureClashClasses.kt")
public void testSignatureClashClasses() {
runTest("compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.kt");
}
@Test
@TestMetadata("signatureClashFunctions.kt")
public void testSignatureClashFunctions() {
runTest("compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.kt");
}
@Test
@TestMetadata("signatureClashVariables.kt")
public void testSignatureClashVariables() {
runTest("compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.kt");
}
@Test