Files
kotlin-fork/compiler/testData/diagnostics/tests/backingField/MustBeInitializedEffectivelyFinalOff.kt
T
Nikita Bobko 38319c55a8 [FE] Replace some MUST_BE_INITIALIZED messages with MUST_BE_INITIALIZED_OR_BE_FINAL
From user point of view it's an improvement in compilation message.

From technical point of view it's an introduction of new compilation
diagnostic.

Review: https://jetbrains.team/p/kt/reviews/9967

I'm going to deprecate `open val` case in the next few commits KT-57553.
But it is always possible to suggest using `final` for `open val` case.
2023-05-23 14:12:28 +03:00

14 lines
266 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE:-TakeIntoAccountEffectivelyFinalInMustBeInitializedCheck
open class Base {
open var x: String = ""
}
class Foo : Base() {
<!MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT!>override var x: String<!>
init {
x = ""
}
}