FIR IDE: fix reference resolve with invalid number of type args
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ private fun ConeDiagnostic.toFirDiagnostic(
|
||||
is ConeOuterClassArgumentsRequired ->
|
||||
FirErrors.OUTER_CLASS_ARGUMENTS_REQUIRED.createOn(qualifiedAccessSource ?: source, this.symbol)
|
||||
is ConeNoTypeArgumentsOnRhsError ->
|
||||
FirErrors.NO_TYPE_ARGUMENTS_ON_RHS.createOn(qualifiedAccessSource ?: source, this.desiredCount, this.type)
|
||||
FirErrors.NO_TYPE_ARGUMENTS_ON_RHS.createOn(qualifiedAccessSource ?: source, this.desiredCount, this.symbol)
|
||||
is ConeSimpleDiagnostic -> when {
|
||||
source.kind is FirFakeSourceElementKind && source.kind != FirFakeSourceElementKind.ReferenceInAtomicQualifiedAccess -> null
|
||||
else -> this.getFactory(source).createOn(qualifiedAccessSource ?: source)
|
||||
|
||||
+10
-7
@@ -108,20 +108,23 @@ class ConeIllegalAnnotationError(val name: Name) : ConeDiagnostic() {
|
||||
override val reason: String get() = "Not a legal annotation: $name"
|
||||
}
|
||||
|
||||
abstract class ConeUnmatchedTypeArgumentsError(val desiredCount: Int, val type: FirClassLikeSymbol<*>) : ConeDiagnostic()
|
||||
interface ConeUnmatchedTypeArgumentsError {
|
||||
val desiredCount: Int
|
||||
val symbol: FirClassLikeSymbol<*>
|
||||
}
|
||||
|
||||
class ConeWrongNumberOfTypeArgumentsError(
|
||||
val desiredCount: Int,
|
||||
val symbol: FirRegularClassSymbol,
|
||||
override val desiredCount: Int,
|
||||
override val symbol: FirRegularClassSymbol,
|
||||
source: FirSourceElement
|
||||
) : ConeDiagnosticWithSource(source) {
|
||||
) : ConeDiagnosticWithSource(source), ConeUnmatchedTypeArgumentsError {
|
||||
override val reason: String get() = "Wrong number of type arguments"
|
||||
}
|
||||
|
||||
class ConeNoTypeArgumentsOnRhsError(
|
||||
desiredCount: Int,
|
||||
type: FirClassLikeSymbol<*>
|
||||
) : ConeUnmatchedTypeArgumentsError(desiredCount, type) {
|
||||
override val desiredCount: Int,
|
||||
override val symbol: FirClassLikeSymbol<*>
|
||||
) : ConeDiagnostic(), ConeUnmatchedTypeArgumentsError {
|
||||
override val reason: String get() = "No type arguments on RHS"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user