[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
@@ -619,7 +619,6 @@ class ControlFlowInformationProviderImpl private constructor(
if (variableDescriptor !is PropertyDescriptor
|| ctxt.enterInitState?.mayBeInitialized() == true
|| ctxt.exitInitState?.mayBeInitialized() != true
|| !variableDescriptor.isVar
|| trace.get(BACKING_FIELD_REQUIRED, variableDescriptor) != true
) {
return false