[FIR] Transform children independently when callee is an error
To make sure all possible types are resolved and any additional errors are reported, resolve children of function calls using independent resolution mode when the callee reference is an error. #KT-59041 Fixed
This commit is contained in:
+6
@@ -14428,6 +14428,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt4866UnresolvedArrayAccess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt59041.kt")
|
||||
public void testKt59041() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt59041.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NoSenselessComparisonForErrorType.kt")
|
||||
public void testNoSenselessComparisonForErrorType() throws Exception {
|
||||
|
||||
+6
@@ -14428,6 +14428,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt4866UnresolvedArrayAccess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt59041.kt")
|
||||
public void testKt59041() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt59041.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NoSenselessComparisonForErrorType.kt")
|
||||
public void testNoSenselessComparisonForErrorType() throws Exception {
|
||||
|
||||
+6
@@ -14428,6 +14428,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt4866UnresolvedArrayAccess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt59041.kt")
|
||||
public void testKt59041() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt59041.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NoSenselessComparisonForErrorType.kt")
|
||||
public void testNoSenselessComparisonForErrorType() throws Exception {
|
||||
|
||||
+6
@@ -14434,6 +14434,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt4866UnresolvedArrayAccess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt59041.kt")
|
||||
public void testKt59041() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt59041.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NoSenselessComparisonForErrorType.kt")
|
||||
public void testNoSenselessComparisonForErrorType() throws Exception {
|
||||
|
||||
+1
-1
@@ -413,7 +413,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
|
||||
// The callee reference can be resolved as an error very early, e.g., `super` as a callee during raw FIR creation.
|
||||
// We still need to visit/transform other parts, e.g., call arguments, to check if any other errors are there.
|
||||
if (calleeReference !is FirResolvedNamedReference) {
|
||||
functionCall.transformChildren(transformer, data)
|
||||
functionCall.transformChildren(transformer, ResolutionMode.ContextIndependent)
|
||||
}
|
||||
return functionCall
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
fun main() {
|
||||
val list = <!UNRESOLVED_REFERENCE!>mutable<!> ListOf<!SYNTAX!><<!>Int<!SYNTAX{LT}!><!SYNTAX!>><!>(1) {}<!>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
fun main() {
|
||||
val list = <!UNRESOLVED_REFERENCE!>mutable<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>ListOf<!><!SYNTAX!><<!><!DEBUG_INFO_MISSING_UNRESOLVED!>Int<!><!SYNTAX!>><!>(1) {}
|
||||
}
|
||||
Generated
+6
@@ -14434,6 +14434,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt4866UnresolvedArrayAccess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt59041.kt")
|
||||
public void testKt59041() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/kt59041.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NoSenselessComparisonForErrorType.kt")
|
||||
public void testNoSenselessComparisonForErrorType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user