[klib] Fix exception for clashing signatures from different modules

If we encounter a declaration in the current module whose signature
is the same as that of a declaration in another module which we happen
to also reference from the current module, don't report any errors,
just like we don't do it in Kotlin/JVM. This leaves the user in the KLIB
hell situation, but this is intentional, because otherwise a legitimate
change like moving a declaration to another module and marking
the original one as `@Deprecated("", level = DeprecationLevel.HIDDEN)`
would lead to a error, and we don't want that.

Also, don't try to show the diagnostics on a declaration that doesn't
have an IrFile.

^KT-65063 Fixed
This commit is contained in:
Sergej Jaskiewicz
2024-01-18 15:58:50 +01:00
committed by Space Team
parent a5c8ecae0b
commit 6900e20096
8 changed files with 62 additions and 14 deletions
@@ -0,0 +1,3 @@
package com.example.klib.serialization.diagnostics
fun movedToLib() {}
@@ -7,6 +7,10 @@ class A {
fun foo(): Int = 0
}
@Deprecated("This function moved to the 'lib' module", level = DeprecationLevel.HIDDEN)
fun movedToLib() {}
fun main() {
println(A().foo())
movedToLib()
}