[Fir] get candidate from missed type args diagnostics in annotation call
Otherwise, navigation to unresolved reference is impossible ^ KTIJ-26441 In order to avoid duplicated diagnostic, wrapper is still used. Symbol collector is updated to retrieve symbols from that wrapper. Merge-request: KT-MR-11381 Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
This commit is contained in:
+6
@@ -687,6 +687,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/localInterfaces.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missedTypeArgumentsInAnnotationCall.kt")
|
||||
public void testMissedTypeArgumentsInAnnotationCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/missedTypeArgumentsInAnnotationCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missingIteratorMissing.kt")
|
||||
public void testMissingIteratorMissing() throws Exception {
|
||||
|
||||
+6
@@ -687,6 +687,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/localInterfaces.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missedTypeArgumentsInAnnotationCall.kt")
|
||||
public void testMissedTypeArgumentsInAnnotationCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/missedTypeArgumentsInAnnotationCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missingIteratorMissing.kt")
|
||||
public void testMissingIteratorMissing() throws Exception {
|
||||
|
||||
@@ -586,7 +586,10 @@ class FirCallResolver(
|
||||
callInfo,
|
||||
if (annotationClassSymbol != null) ConeIllegalAnnotationError(reference.name)
|
||||
//calleeReference and annotationTypeRef are both error nodes so we need to avoid doubling of the diagnostic report
|
||||
else ConeStubDiagnostic(ConeUnresolvedNameError(reference.name)),
|
||||
else ConeStubDiagnostic(
|
||||
//prefer diagnostic with symbol, e.g. to use the symbol during navigation in IDE
|
||||
(annotation.typeRef.coneType as? ConeErrorType)?.diagnostic as? ConeDiagnosticWithSymbol<*>
|
||||
?: ConeUnresolvedNameError(reference.name)),
|
||||
reference.source
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
package usage
|
||||
|
||||
annotation class B<T>
|
||||
|
||||
@<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>B<!>
|
||||
class A
|
||||
Generated
+6
@@ -687,6 +687,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/localInterfaces.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missedTypeArgumentsInAnnotationCall.kt")
|
||||
public void testMissedTypeArgumentsInAnnotationCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/missedTypeArgumentsInAnnotationCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("missingIteratorMissing.kt")
|
||||
public void testMissingIteratorMissing() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user