[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".
This commit is contained in:
Nikolay Lunyak
2023-08-08 14:30:56 +03:00
committed by Space Team
parent 7a31167e0b
commit a871fa9a64
@@ -156,8 +156,8 @@ private fun ConeDiagnostic.toKtDiagnostic(
}
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)