[FE] Prohibit open val deferred initialization

^KT-57553 Fixed
Review: https://jetbrains.team/p/kt/reviews/9967

Other related tests:
- testUninitializedOrReassignedVariables
- testUseOfPropertiesWithoutPrimary
- @TestMetadata("compiler/testData/diagnostics/tests/secondaryConstructors")
- testAugmentedAssignmentInInitializer
- testInitOpenSetter
- testInitOverrideInConstructorComplex
- testPropertyInitializationOrder
This commit is contained in:
Nikita Bobko
2023-05-01 15:18:51 +02:00
parent 38319c55a8
commit ac40010501
27 changed files with 399 additions and 151 deletions
@@ -0,0 +1,12 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -DEBUG_INFO_LEAKING_THIS
// !LANGUAGE:-ProhibitOpenValDeferredInitialization
open class Foo {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>open val foo: Int<!>
init {
if (1 != 1) {
foo = 1
}
}
}