diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.diag.txt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.diag.txt new file mode 100644 index 00000000000..da78d5dbccf --- /dev/null +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.diag.txt @@ -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.|(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.|(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 diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.kt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.kt new file mode 100644 index 00000000000..f54623fcb8e --- /dev/null +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashClasses.kt @@ -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 + +@Suppress("PACKAGE_OR_CLASSIFIER_REDECLARATION") class SeparateFiles + +// FILE: main.kt +package com.example.klib.serialization.diagnostics + +@Suppress("PACKAGE_OR_CLASSIFIER_REDECLARATION") class SeparateFiles + +class ConstructorsClash { + @Deprecated(message = "", level = DeprecationLevel.HIDDEN) + constructor(s: Int) + constructor(s: Int) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash.diag.txt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.diag.txt similarity index 53% rename from compiler/testData/diagnostics/klibSerializationTests/signatureClash.diag.txt rename to compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.diag.txt index 927825e554d..977f1837b07 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash.diag.txt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.diag.txt @@ -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§;1§}[0]): + fun T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics + fun 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.|(){}[0]): - fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics - fun ``(): kotlin.Long defined in com.example.klib.serialization.diagnostics - fun ``(): 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(){}[0]): + fun kotlin.collections.Map.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun kotlin.collections.Map.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.|(){}[0]): - fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics - fun ``(): 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.|(){}[0]): - fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics - fun ``(): kotlin.Long defined in com.example.klib.serialization.diagnostics - fun ``(): 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.|(){}[0]): - fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics - fun ``(): kotlin.Long defined in com.example.klib.serialization.diagnostics - fun ``(): 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.|(){}[0]): - fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics - fun ``(): 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§}[0]): fun parameterized(a: T): T defined in com.example.klib.serialization.diagnostics.A fun 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§;1§}[0]): + fun T.topLevelParametrized(s: K): T defined in com.example.klib.serialization.diagnostics + fun 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(){}[0]): + fun kotlin.collections.Map.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun kotlin.collections.Map.typealiasReciever(): kotlin.Int defined in com.example.klib.serialization.diagnostics diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash.kt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.kt similarity index 71% rename from compiler/testData/diagnostics/klibSerializationTests/signatureClash.kt rename to compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.kt index 387b52bc7d7..f6635a9ec86 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash.kt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashFunctions.kt @@ -11,31 +11,31 @@ fun movedToLib() {} // FILE: foo.kt package com.example.klib.serialization.diagnostics +private fun privateFunSeparateFiles() = Unit + @Deprecated("", level = DeprecationLevel.HIDDEN) fun foo(): Long = 0L -var myVal: Long = 0L +@Deprecated("", level = DeprecationLevel.HIDDEN) +fun T.topLevelParametrized(s: K): T = TODO() -val myDelegated: Long by lazy { 0L } +@Deprecated("", level = DeprecationLevel.HIDDEN) +internal fun topLevelInternalVararg(vararg i: Int) = 0 + +typealias S = Map +@Deprecated("", level = DeprecationLevel.HIDDEN) +fun S.typealiasReciever() = 0 // FILE: main.kt package com.example.klib.serialization.diagnostics +private fun privateFunSeparateFiles() = Unit + @Deprecated("", level = DeprecationLevel.HIDDEN) fun foo(): String = "" fun foo(): Int = 0 -@Deprecated("", level = DeprecationLevel.HIDDEN) -var myVal: Int = 0 - -@Deprecated("", level = DeprecationLevel.HIDDEN) -val myVal: String -get() = "" - -@Deprecated("", level = DeprecationLevel.HIDDEN) -val myDelegated: Int by 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 fun bar(): Long = 1L + +@Deprecated("", level = DeprecationLevel.HIDDEN) +fun T.topLevelParametrized(s: K): T = TODO() + +@Deprecated("", level = DeprecationLevel.HIDDEN) +internal fun topLevelInternalVararg(vararg i: Int) = 0 + +@Deprecated("", level = DeprecationLevel.HIDDEN) +fun Map.typealiasReciever() = 0 \ No newline at end of file diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.diag.txt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.diag.txt new file mode 100644 index 00000000000..0aeccaa2e37 --- /dev/null +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.diag.txt @@ -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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|@kotlin.Int(){}[0]): + fun kotlin.Int.``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun kotlin.Int.``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun ``(): 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.|@kotlin.Int(){}[0]): + fun kotlin.Int.``(): kotlin.Int defined in com.example.klib.serialization.diagnostics + fun kotlin.Int.``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion + fun ``(): 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.|(){}[0]): + fun ``(): kotlin.Int defined in com.example.klib.serialization.diagnostics.Container.Companion + fun ``(): 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.|@kotlin.String(){}[0]): + fun kotlin.String.``(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container + fun kotlin.String.``(): 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.|@kotlin.String(){}[0]): + fun kotlin.String.``(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container + fun kotlin.String.``(): kotlin.String defined in com.example.klib.serialization.diagnostics.Container diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.kt b/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.kt new file mode 100644 index 00000000000..7b31f54715e --- /dev/null +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClashVariables.kt @@ -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 + +@Suppress("REDECLARATION") val valueSeparateFiles = 0 + +@Suppress("REDECLARATION") val myDelegated: Long by lazy { 0L } + +@Suppress("REDECLARATION") +var Int.extensionValue: Int +get() = 0 +set(value) = TODO() + +// FILE: main.kt +package com.example.klib.serialization.diagnostics + +private val privateValueSeparateFiles = 0 + +@Suppress("REDECLARATION") val valueSeparateFiles = 0 + +@Suppress("REDECLARATION") val valueSingleFile: Int = 0 +@Suppress("REDECLARATION") val valueSingleFile: String = "" + +@Suppress("REDECLARATION") val myDelegated: Int by lazy { 1 } + +@Suppress("REDECLARATION") +val Int.extensionValue: Int +get() = 0 + +class Container { + @Suppress("REDECLARATION") val valueSameClass = 0 + @Suppress("REDECLARATION") val valueSameClass = 0 + + companion object{ + @Suppress("REDECLARATION") val valueSameClassCompanion = 0 + @Suppress("REDECLARATION") val valueSameClassCompanion = 0 + } + + @Suppress("REDECLARATION") val String.valueSameClassExtension: String get() = "" + @Suppress("REDECLARATION") val String.valueSameClassExtension: String get() = "" +} \ No newline at end of file diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsKlibDiagnosticsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsKlibDiagnosticsTestGenerated.java index 3454a486999..4f8b391f950 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsKlibDiagnosticsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsKlibDiagnosticsTestGenerated.java @@ -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