diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/deprecationUtils.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/deprecationUtils.kt index c3933801062..c94a49df5c8 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/deprecationUtils.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/deprecationUtils.kt @@ -181,6 +181,10 @@ private fun FirAnnotation.getDeprecationLevel(): DeprecationLevelValue? { private fun List.extractDeprecationAnnotationInfoPerUseSite( session: FirSession, fromJava: Boolean ): DeprecationAnnotationInfoPerUseSiteStorage { + // NB: We can't expand typealiases (`toAnnotationClassId`), because it + // requires `lookupTag.tySymbol()`, but we can have cycles in annotations. + // See the commit message for an example. + @Suppress("RemoveExplicitTypeArguments") val annotations = buildList> { mapAnnotationsWithClassIdTo(StandardClassIds.Annotations.Deprecated, this) { it to false }