[FIR] Correctly determine primary constructor parameters scope for class initialization section

^KT-58135 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-04-26 17:35:59 +03:00
committed by Space Team
parent 7ee648a4f5
commit 913b55174d
7 changed files with 65 additions and 9 deletions
@@ -0,0 +1,31 @@
// FIR_IDENTICAL
// ISSUE: KT-58135
class Test(
val x: Int, // (1)
y: Int // (2)
) {
val String.x: String get() = this // (3)
val String.y: String get() = this // (4)
val y: Int = y // (5)
fun test(s: String) {
with(s) {
x.length // (3)
y.length // (4)
}
}
val test = with("hello") {
x.length // (3)
y.inc() // (2)
}
init {
with("hello") {
x.length // (3)
y.inc() // (2)
}
}
}