[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:
+12
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user