Revert "FIR: Report CAPTURED_VAL_INITIALIZATION if initialization is done"

This reverts commit 1c4023fda5.

#KT-64854 Submitted
#KT-59906 Submitted
This commit is contained in:
Mikhail Glukhikh
2024-03-12 11:38:34 +01:00
committed by Space Team
parent 0fe793943d
commit 0b34d66b87
7 changed files with 10 additions and 149 deletions
@@ -42,11 +42,6 @@ class Test {
val b: String
val c: String
val d: String
val e: String
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val f: String<!>
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val g: String<!>
val h: String
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val i: String<!>
init {
inlineMe {
@@ -61,35 +56,6 @@ class Test {
notinline {
<!CAPTURED_VAL_INITIALIZATION!>d<!> = "not allowed"
}
crossinlineMe {
inlineMe {
e = "not allowed"
}
}
fun localFun() {
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>f<!> = "not allowed"
}
val <!UNUSED_VARIABLE!>localLambda<!> = {
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>g<!> = "not allowed"
}
object {
val o: String
init {
h = "not allowed"
o = "allowed"
}
}
class Local {
init {
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>i<!> = "not allowed"
}
}
}
}
@@ -175,12 +141,12 @@ class Test5 {
a = "OK"
}
val bInit = crossinlineMe {
<!CAPTURED_VAL_INITIALIZATION!>b<!> = "not allowed"
<!CAPTURED_VAL_INITIALIZATION!>b<!> = "OK"
}
val cInit = noinlineMe {
<!CAPTURED_VAL_INITIALIZATION!>c<!> = "not allowed"
<!CAPTURED_VAL_INITIALIZATION!>c<!> = "OK"
}
val dInit = notinline {
<!CAPTURED_VAL_INITIALIZATION!>d<!> = "not allowed"
<!CAPTURED_VAL_INITIALIZATION!>d<!> = "OK"
}
}