[AA] do not try to build KtSymbol for FirErrorFunction
^KTIJ-23669 FirErrorFunctions are created for unknown labels when the code in return statements is not complete yet. Such labels cannot be resolved, and no symbols should be created for them
This commit is contained in:
+6
@@ -1561,6 +1561,12 @@ public class Fe10IdeNormalAnalysisSourceModuleReferenceResolveTestGenerated exte
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/AnnotationParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ByReturnExpression.kt")
|
||||
public void testByReturnExpression() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/ByReturnExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassNameBeforeDot.kt")
|
||||
public void testClassNameBeforeDot() throws Exception {
|
||||
|
||||
+2
-1
@@ -387,7 +387,8 @@ internal object FirReferenceResolveHelper {
|
||||
symbolBuilder: KtSymbolByFirBuilder
|
||||
): Collection<KtSymbol> {
|
||||
return if (expression is KtLabelReferenceExpression) {
|
||||
listOf(fir.target.labeledElement.buildSymbol(symbolBuilder))
|
||||
val labeledElement = fir.target.labeledElement
|
||||
if (labeledElement is FirErrorFunction) emptyList() else listOf(labeledElement.buildSymbol(symbolBuilder))
|
||||
} else emptyList()
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -1561,6 +1561,12 @@ public class FirIdeDependentAnalysisSourceModuleReferenceResolveTestGenerated ex
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/AnnotationParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ByReturnExpression.kt")
|
||||
public void testByReturnExpression() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/ByReturnExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassNameBeforeDot.kt")
|
||||
public void testClassNameBeforeDot() throws Exception {
|
||||
|
||||
+6
@@ -1561,6 +1561,12 @@ public class FirIdeNormalAnalysisSourceModuleReferenceResolveTestGenerated exten
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/AnnotationParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ByReturnExpression.kt")
|
||||
public void testByReturnExpression() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/ByReturnExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassNameBeforeDot.kt")
|
||||
public void testClassNameBeforeDot() throws Exception {
|
||||
|
||||
+6
@@ -1561,6 +1561,12 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceResolveTestGenerate
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/AnnotationParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ByReturnExpression.kt")
|
||||
public void testByReturnExpression() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/withErrors/ByReturnExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassNameBeforeDot.kt")
|
||||
public void testClassNameBeforeDot() throws Exception {
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
fun bar(block: () -> Unit) {}
|
||||
|
||||
fun foo() {
|
||||
bar {
|
||||
return@<caret>b
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user