FIR: Resolve error expression in initializer of FirField

^KT-54775 Fixed
This commit is contained in:
Kirill Rakhman
2023-01-25 12:57:12 +01:00
committed by Space Team
parent 156c2db855
commit 583584be7e
9 changed files with 65 additions and 7 deletions
@@ -0,0 +1,15 @@
FILE: kt54775.kt
public final fun <T> bar(): R|T| {
^bar (Null(null) as R|T|)
}
public final class X : <ERROR TYPE REF: Symbol not found for B> {
public constructor(): R|X| {
super<R|kotlin/Any|>()
}
private final field $$delegate_0: <ERROR TYPE REF: Symbol not found for B> = ERROR_EXPR(Should have delegate)
public final val prop: <ERROR TYPE REF: Should have initializer> = ERROR_EXPR(Should have initializer)
public get(): <ERROR TYPE REF: Should have initializer>
}
@@ -0,0 +1,8 @@
fun <T> bar(): T {
return null <!UNCHECKED_CAST!>as T<!>
}
class X() : <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>B<!> by <!ASSIGNMENT_IN_EXPRESSION_CONTEXT!><!VARIABLE_EXPECTED!>get()<!> = bar()<!> {
val prop = <!ASSIGNMENT_IN_EXPRESSION_CONTEXT!><!VARIABLE_EXPECTED!>bar()<!> = 2<!>
}