[FIR][Serialization] Use resolvedCompilerAnnotationsWithClassIds to avoid recursive resolve
`resolvedAnnotationsWithClassIds` requires resolve to TYPES phase, which is unavailable during compiler plugins stages. Trying to resolve to that phases will cause an infinite recursive resolve loop Also, call `resolvedAnnotationsWithArguments` only when `neededArguments` is true ^KTIJ-24893 Fixed
This commit is contained in:
+5
-1
@@ -84,7 +84,11 @@ val FirClassSymbol<*>.hasSerializableAnnotation: Boolean
|
||||
get() = serializableAnnotation(needArguments = false, this@FirSession) != null
|
||||
|
||||
fun FirBasedSymbol<*>.serializableAnnotation(needArguments: Boolean, session: FirSession): FirAnnotation? {
|
||||
val annotations = if (needArguments) resolvedAnnotationsWithClassIds else resolvedAnnotationsWithArguments
|
||||
val annotations = if (needArguments) {
|
||||
resolvedAnnotationsWithArguments
|
||||
} else {
|
||||
resolvedCompilerAnnotationsWithClassIds
|
||||
}
|
||||
return annotations.serializableAnnotation(session)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user