Files
kotlin-fork/compiler/testData/diagnostics/tests/secondaryConstructors/propertyInitializationWithoutPrimary.kt
T
Dmitrii Gridin 9a4a3d1f49 [LL FIR] introduce test with reversed resolve order
^KT-56543

Merge-request: KT-MR-9299
Merged-by: Dmitrii Gridin <dmitry.gridin@jetbrains.com>
2023-03-22 17:34:07 +00:00

42 lines
686 B
Kotlin
Vendored

// IGNORE_REVERSED_RESOLVE
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
val x: Int
var y: Int
val z: Int
val v = -1
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val uninitialized: Int<!>
val overinitialized: Int
constructor() {
x = 1
y = 2
<!VAL_REASSIGNMENT!>overinitialized<!> = 3
uninitialized = 4
}
constructor(a: Int): super() {
x = 5
y = 6
}
constructor(x: String): this() {
y = 7
<!VAL_REASSIGNMENT!>uninitialized<!> = 8
}
//anonymous
init {
z = 9
overinitialized = 10
}
// anonymous
init {
y = 12
}
}