MUST_BE_INITIALIZED: take into account containingDeclaration's modality

^KT-58587 Fixed
Review: https://jetbrains.team/p/kt/reviews/10136

This commit is important in scope of KT-57553. It makes the migration
more smooth.

Other related tests:
- testUninitializedOrReassignedVariables
- testAugmentedAssignmentInInitializer
This commit is contained in:
Nikita Bobko
2023-05-10 16:00:54 +02:00
committed by Space Team
parent 4807a714ec
commit 9a65dcb664
11 changed files with 136 additions and 16 deletions
@@ -0,0 +1,12 @@
// !LANGUAGE:-TakeIntoAccountEffectivelyFinalInMustBeInitializedCheck
open class Base {
open var x: String = ""
}
class Foo : Base() {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>override var x: String<!>
init {
x = ""
}
}