K2: report JVM backend errors in the same way in PSI as LT

Do not try to find PSI element, but always use the IR element offsets
instead. This greatly simplifies test data because we don't need to have
custom PSI- and LT- based diagnostic ranges in every test, and K1/K2
behavior also is mostly the same.

The exact offset ranges are not as important for backend diagnostics, so
it's better to have K2+PSI and K2+LT behaving the same.
This commit is contained in:
Alexander Udalov
2023-07-27 19:12:36 +02:00
committed by Space Team
parent 6069aaee9c
commit 965946d3ef
148 changed files with 267 additions and 860 deletions
@@ -1,14 +1,13 @@
// COMPARE_WITH_LIGHT_TREE
// !LANGUAGE: +ValueClasses
// WITH_STDLIB
@JvmInline
value class A(val x: Int, val y: Int) {
<!CONFLICTING_JVM_DECLARATIONS{LT}!><!CONFLICTING_JVM_DECLARATIONS{PSI}!>constructor(other: A)<!>: this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS{LT}!><!CONFLICTING_JVM_DECLARATIONS{PSI}!>constructor(x: UInt, y: UInt)<!>: this(x.toInt(), y.toInt())<!>
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A): this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt, y: UInt): this(x.toInt(), y.toInt())<!>
}
<!CONFLICTING_JVM_DECLARATIONS{LT}!>data class <!CONFLICTING_JVM_DECLARATIONS{PSI}!>B<!CONFLICTING_JVM_DECLARATIONS!>(val x: UInt, val y: UInt)<!><!> {
<!CONFLICTING_JVM_DECLARATIONS{LT}!><!CONFLICTING_JVM_DECLARATIONS{PSI}!>constructor(other: A)<!> : this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS{LT}!><!CONFLICTING_JVM_DECLARATIONS{PSI}!>constructor(x: Int, y: Int)<!> : this(x.toUInt(), y.toUInt())<!>
<!CONFLICTING_JVM_DECLARATIONS!>data class B<!CONFLICTING_JVM_DECLARATIONS!>(val x: UInt, val y: UInt)<!> {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A) : this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int, y: Int) : this(x.toUInt(), y.toUInt())<!>
}<!>
@@ -1,14 +1,13 @@
// COMPARE_WITH_LIGHT_TREE
// !LANGUAGE: +ValueClasses
// WITH_STDLIB
@JvmInline
value class A(val x: Int, val y: Int) {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A)<!>: this(other.x, other.y)
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt, y: UInt)<!>: this(x.toInt(), y.toInt())
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A): this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt, y: UInt): this(x.toInt(), y.toInt())<!>
}
data class <!CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS!>B(val x: UInt, val y: UInt)<!> {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A)<!> : this(other.x, other.y)
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int, y: Int)<!> : this(x.toUInt(), y.toUInt())
}
<!CONFLICTING_JVM_DECLARATIONS!>data <!CONFLICTING_JVM_DECLARATIONS!>class B(val x: UInt, val y: UInt) {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A) : this(other.x, other.y)<!>
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int, y: Int) : this(x.toUInt(), y.toUInt())<!>
}<!><!>