[FIR] Implement UNRESOLVED_REFERENCE_WRONG_RECEIVER
This commit is contained in:
+3
-3
@@ -141,9 +141,9 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("checkType.kt")
|
||||
public void testCheckType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/checkType.kt");
|
||||
@TestMetadata("checkTypeTest.kt")
|
||||
public void testCheckTypeTest() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/checkTypeTest.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+9
@@ -304,6 +304,15 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.UNRESOLVED_REFERENCE_WRONG_RECEIVER) { firDiagnostic ->
|
||||
UnresolvedReferenceWrongReceiverImpl(
|
||||
firDiagnostic.a.map { firBasedSymbol ->
|
||||
firSymbolBuilder.buildSymbol(firBasedSymbol.fir)
|
||||
},
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS) { firDiagnostic ->
|
||||
CreatingAnInstanceOfAbstractClassImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
|
||||
+5
@@ -241,6 +241,11 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val message: String
|
||||
}
|
||||
|
||||
abstract class UnresolvedReferenceWrongReceiver : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = UnresolvedReferenceWrongReceiver::class
|
||||
abstract val candidates: List<KtSymbol>
|
||||
}
|
||||
|
||||
abstract class CreatingAnInstanceOfAbstractClass : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = CreatingAnInstanceOfAbstractClass::class
|
||||
}
|
||||
|
||||
+8
@@ -353,6 +353,14 @@ internal class DeprecationImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class UnresolvedReferenceWrongReceiverImpl(
|
||||
override val candidates: List<KtSymbol>,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.UnresolvedReferenceWrongReceiver(), KtAbstractFirDiagnostic<PsiElement> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class CreatingAnInstanceOfAbstractClassImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
|
||||
Reference in New Issue
Block a user