[klib] Fix NIE when showing signature clash diagnostics on properties

The issue was that when rendering declarations in
the `CONFLICTING_KLIB_SIGNATURES_DATA` diagnostics, we sort them using
`MemberComparator`. That comparator falls back to comparing
declarations' renders if all previous checks were unsuccessful
(and in case of almost identical properties they are). The renderer that
the comparator uses also renders the properties' backing field
annotations, for which it calls `PropertyDescriptor#getBackingField`.
That method wasn't implemented in IR-based descriptors.

This is fixed by returning an instance of the new
`IrBasedBackingFieldDescriptor` class from that method.

^KT-65551 Fixed
This commit is contained in:
Sergej Jaskiewicz
2024-02-08 19:01:50 +01:00
committed by Space Team
parent 9688c3e761
commit d80a67652f
5 changed files with 196 additions and 72 deletions
@@ -7,9 +7,18 @@ class A {
fun foo(): Int = 0
}
var myVal: Long = 0L
@Deprecated("This function moved to the 'lib' module", level = DeprecationLevel.HIDDEN)
fun movedToLib() {}
@Deprecated("", level = DeprecationLevel.HIDDEN)
var myVal: Int = 0
@Deprecated("", level = DeprecationLevel.HIDDEN)
val myVal: String
get() = ""
fun main() {
println(A().foo())
movedToLib()