FIR: Remove duplicated diagnostics on annotations on types.
This commit is contained in:
committed by
TeamCityServer
parent
edb6b337dc
commit
1835185b16
Vendored
+1
-1
@@ -5,7 +5,7 @@ interface I {
|
||||
}
|
||||
|
||||
class A {
|
||||
fun too(): <!NOT_AN_ANNOTATION_CLASS, NOT_AN_ANNOTATION_CLASS!>@Annotation<!> Unit {}
|
||||
fun too(): <!NOT_AN_ANNOTATION_CLASS!>@Annotation<!> Unit {}
|
||||
|
||||
fun foo(): <!REDUNDANT_RETURN_UNIT_TYPE!>Unit<!>
|
||||
{
|
||||
|
||||
+6
-1
@@ -162,7 +162,12 @@ abstract class AbstractDiagnosticCollectorVisitor(
|
||||
}
|
||||
|
||||
override fun visitResolvedTypeRef(resolvedTypeRef: FirResolvedTypeRef, data: Nothing?) {
|
||||
super.visitResolvedTypeRef(resolvedTypeRef, data)
|
||||
// Assuming no errors, the children of FirResolvedTypeRef (currently this can be FirAnnotationCalls) will also be present
|
||||
// as children in delegatedTypeRef. We should make sure those elements are only visited once, otherwise diagnostics will be
|
||||
// collected twice: once through resolvedTypeRef's children and another through resolvedTypeRef.delegatedTypeRef's children.
|
||||
if (resolvedTypeRef.type is ConeClassErrorType) {
|
||||
super.visitResolvedTypeRef(resolvedTypeRef, data)
|
||||
}
|
||||
resolvedTypeRef.delegatedTypeRef?.accept(this, data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user