FIR: Resolve error expression in initializer of FirField
^KT-54775 Fixed
This commit is contained in:
committed by
Space Team
parent
156c2db855
commit
583584be7e
+5
@@ -314,6 +314,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54220.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt54775.kt")
|
||||
public void testKt54775() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54775.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("labelAndReceiverForInfix.kt")
|
||||
public void testLabelAndReceiverForInfix() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/labelAndReceiverForInfix.kt");
|
||||
|
||||
@@ -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<!>
|
||||
}
|
||||
|
||||
+6
@@ -368,6 +368,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54220.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54775.kt")
|
||||
public void testKt54775() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54775.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("labelAndReceiverForInfix.kt")
|
||||
public void testLabelAndReceiverForInfix() throws Exception {
|
||||
|
||||
+6
@@ -368,6 +368,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54220.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54775.kt")
|
||||
public void testKt54775() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/kt54775.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("labelAndReceiverForInfix.kt")
|
||||
public void testLabelAndReceiverForInfix() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user