[FIR] Don't ignore too many diagnostics
`DelegatingConstructorCall` -
because in this case there is
either `UNRESOLVED_REFERENCE` or
`SYNTAX` already.
`ErrorTypeRef` - because in this
case there is `SYNTAX` already.
Note that there is only 1 test
that shows this behavior, and
it's LT-specific. It's
`FirLightTreeOldFrontendDiagnosticsTestGenerated.testKt847`, and
in this test the string template
is parsed and processed
differently in LT and PSI:
- in LT there are 6 nodes: "",
"$this", " must be", "$as", "$t",
"".
- in PSI there 4 notes: "$this",
" must be", "$as", "$t".
diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
index 33c259a..01b2eaf 100644
--- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
+++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
@@ -156,8 +156,8 @@
}
private val KtFakeSourceElementKind.canBeIgnored: Boolean
- get() = this != KtFakeSourceElementKind.ReferenceInAtomicQualifiedAccess
- && this != KtFakeSourceElementKind.ImplicitReturnTypeOfLambdaValueParameter
+ get() = this == KtFakeSourceElementKind.DelegatingConstructorCall
+ || this == KtFakeSourceElementKind.ErrorTypeRef
fun FirBasedSymbol<*>.toInvisibleReferenceDiagnostic(source: KtSourceElement?): KtDiagnostic? = when (val symbol = this) {
is FirCallableSymbol<*> -> FirErrors.INVISIBLE_REFERENCE.createOn(source, symbol, symbol.visibility, symbol.callableId.classId)