[FIR] Add attributes to ConeErrorType for correct annotations resolving

This commit is contained in:
Ivan Kochurkin
2022-06-16 13:43:18 +03:00
committed by teamcity
parent 9c67a4bc27
commit 1a398e89ec
2 changed files with 6 additions and 5 deletions
@@ -39,7 +39,11 @@ sealed class ConeSimpleKotlinType : ConeKotlinType(), SimpleTypeMarker
class ConeClassLikeErrorLookupTag(override val classId: ClassId) : ConeClassLikeLookupTag()
class ConeErrorType(val diagnostic: ConeDiagnostic, val isUninferredParameter: Boolean = false) : ConeClassLikeType() {
class ConeErrorType(
val diagnostic: ConeDiagnostic,
val isUninferredParameter: Boolean = false,
override val attributes: ConeAttributes = ConeAttributes.Empty
) : ConeClassLikeType() {
override val lookupTag: ConeClassLikeLookupTag
get() = ConeClassLikeErrorLookupTag(ClassId.fromString("<error>"))
@@ -49,9 +53,6 @@ class ConeErrorType(val diagnostic: ConeDiagnostic, val isUninferredParameter: B
override val nullability: ConeNullability
get() = ConeNullability.UNKNOWN
override val attributes: ConeAttributes
get() = ConeAttributes.Empty
override fun equals(other: Any?) = this === other
override fun hashCode(): Int = System.identityHashCode(this)
}
@@ -253,7 +253,7 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
ConeUnresolvedQualifierError(typeRef.render())
}
}
return ConeErrorType(diagnostic)
return ConeErrorType(diagnostic, attributes = typeRef.annotations.computeTypeAttributes(session))
}
if (symbol is FirTypeParameterSymbol) {
for (part in typeRef.qualifier) {