[FIR] Fix invalid diagnostic fir node sites and improved invalid type parameters count diagnostic report
This commit is contained in:
@@ -29,12 +29,10 @@ internal class FirErrorTypeRefImpl(
|
||||
|
||||
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
||||
annotations.forEach { it.accept(visitor, data) }
|
||||
delegatedTypeRef?.accept(visitor, data)
|
||||
}
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirErrorTypeRefImpl {
|
||||
transformAnnotations(transformer, data)
|
||||
delegatedTypeRef = delegatedTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
@@ -859,7 +859,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
}
|
||||
|
||||
override fun visitErrorTypeRef(errorTypeRef: FirErrorTypeRef) {
|
||||
visitTypeRef(errorTypeRef)
|
||||
errorTypeRef.annotations.renderAnnotations()
|
||||
print("<ERROR TYPE REF: ${errorTypeRef.diagnostic.reason}>")
|
||||
}
|
||||
|
||||
|
||||
@@ -26,14 +26,7 @@ fun FirClassifierSymbol<*>.constructType(
|
||||
ConeTypeParameterTypeImpl(this.toLookupTag(), isNullable, attributes)
|
||||
}
|
||||
is FirClassSymbol -> {
|
||||
val errorTypeRef = typeArguments.find {
|
||||
it is ConeClassErrorType
|
||||
}
|
||||
if (errorTypeRef is ConeClassErrorType) {
|
||||
ConeClassErrorType(errorTypeRef.diagnostic)
|
||||
} else {
|
||||
ConeClassLikeTypeImpl(this.toLookupTag(), typeArguments, isNullable, attributes)
|
||||
}
|
||||
ConeClassLikeTypeImpl(this.toLookupTag(), typeArguments, isNullable, attributes)
|
||||
}
|
||||
is FirTypeAliasSymbol -> {
|
||||
ConeClassLikeTypeImpl(
|
||||
|
||||
+3
@@ -172,6 +172,9 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
default("type", "ConeClassErrorType(diagnostic)")
|
||||
default("annotations", "mutableListOf()")
|
||||
useTypes(coneClassErrorTypeType)
|
||||
default("delegatedTypeRef") {
|
||||
needAcceptAndTransform = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user