[FIR] Support typealiases in FirAssignAnnotationMatchingService
This commit is contained in:
committed by
Space Team
parent
0c00e79024
commit
6a1c9e9279
+5
-5
@@ -9,7 +9,7 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.caches.FirCache
|
||||
import org.jetbrains.kotlin.fir.caches.firCachesFactory
|
||||
import org.jetbrains.kotlin.fir.caches.getValue
|
||||
import org.jetbrains.kotlin.fir.expressions.classId
|
||||
import org.jetbrains.kotlin.fir.declarations.toAnnotationClassId
|
||||
import org.jetbrains.kotlin.fir.extensions.FirExtensionSessionComponent
|
||||
import org.jetbrains.kotlin.fir.extensions.FirExtensionSessionComponent.Factory
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
@@ -40,10 +40,10 @@ internal class FirAssignAnnotationMatchingService(
|
||||
}
|
||||
|
||||
private fun FirRegularClassSymbol.annotated(): Boolean {
|
||||
if (this.annotations.any { it.classId in annotationClassIds }) return true
|
||||
return resolvedSuperTypeRefs.any {
|
||||
val symbol = it.type.fullyExpandedType(session).toRegularClassSymbol(session) ?: return@any false
|
||||
symbol.annotations.any { it.classId in annotationClassIds }
|
||||
if (this.annotations.any { it.toAnnotationClassId(session) in annotationClassIds }) return true
|
||||
return resolvedSuperTypeRefs.any { superTypeRef ->
|
||||
val symbol = superTypeRef.type.fullyExpandedType(session).toRegularClassSymbol(session) ?: return@any false
|
||||
symbol.annotations.any { it.toAnnotationClassId(session) in annotationClassIds }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user