Files
kotlin-fork/compiler/testData/ir/irText/firProblems/VarInInit.kt
T
Mikhail Glukhikh 7b4f781ea8 [FIR] Split primary constructor parameter scope into two different
In init block or property initializers,
for `val x` declared in primary constructor,
`x` reference is now resolved to property, not to parameter.
So we need two different scopes for primary constructor,
one for 'pure' parameters and another one for all parameters,
including val/var ones.

#KT-42844 Fixed
2020-10-30 18:44:55 +03:00

8 lines
115 B
Kotlin
Vendored

// FIR_IDENTICAL
class Some(var foo: Int) {
init {
if (foo < 0) {
foo = 0
}
}
}