K2: do not generate line numbers for delegated members

Psi2ir does not generate them, see
https://github.com/JetBrains/kotlin/blob/1.8.20/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt#L319.

Besides influencing debugger and coverage behavior, it also affects how
conflicting JVM signature diagnostics are reported because they
use offsets to determine which element to report the error on. So after
this change, K1 and K2 behavior is the same in that regard as well.

 #KT-58215 Fixed
This commit is contained in:
Alexander Udalov
2023-05-06 00:11:30 +02:00
committed by Space Team
parent b3aa2dd60f
commit 987e8c25dc
22 changed files with 126 additions and 56 deletions
@@ -0,0 +1,14 @@
// IGNORE_BACKEND: JVM
class DelegatedList : List<Int> by ArrayList()
// There's 1 line number in each of the following methods:
// - <init>()V
// - size()I
// - contains(Ljava/lang/Object;)Z
// - get(I)Ljava/lang/Object;
// - indexOf(Ljava/lang/Object;)I
// - lastIndexOf(Ljava/lang/Object;)I
// 6 LINENUMBER 5