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:
committed by
Space Team
parent
0fe793943d
commit
0b34d66b87
+6
-40
@@ -42,53 +42,19 @@ 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 {
|
||||
a = "allowed"
|
||||
}
|
||||
crossinlineMe {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>b<!> = "not allowed"
|
||||
b = "not allowed"
|
||||
}
|
||||
noinlineMe {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>c<!> = "not allowed"
|
||||
c = "not allowed"
|
||||
}
|
||||
notinline {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>d<!> = "not allowed"
|
||||
}
|
||||
|
||||
crossinlineMe {
|
||||
inlineMe {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>e<!> = "not allowed"
|
||||
}
|
||||
}
|
||||
|
||||
fun localFun() {
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>f<!> = "not allowed"
|
||||
}
|
||||
|
||||
val localLambda = {
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>g<!> = "not allowed"
|
||||
}
|
||||
|
||||
object {
|
||||
val o: String
|
||||
|
||||
init {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>h<!> = "not allowed"
|
||||
o = "allowed"
|
||||
}
|
||||
}
|
||||
|
||||
class Local {
|
||||
init {
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>i<!> = "not allowed"
|
||||
}
|
||||
d = "not allowed"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,12 +141,12 @@ class Test5 {
|
||||
a = "OK"
|
||||
}
|
||||
val bInit = crossinlineMe {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>b<!> = "not allowed"
|
||||
b = "OK"
|
||||
}
|
||||
val cInit = noinlineMe {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>c<!> = "not allowed"
|
||||
c = "OK"
|
||||
}
|
||||
val dInit = notinline {
|
||||
<!CAPTURED_VAL_INITIALIZATION!>d<!> = "not allowed"
|
||||
d = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-37
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -18,11 +18,6 @@ package
|
||||
public final val b: kotlin.String
|
||||
public final val c: kotlin.String
|
||||
public final val d: kotlin.String
|
||||
public final val e: kotlin.String
|
||||
public final val f: kotlin.String
|
||||
public final val g: kotlin.String
|
||||
public final val h: kotlin.String
|
||||
public final val i: kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
Reference in New Issue
Block a user