K2: fix field annotation splitting and frontend checks

Related to KT-57135
This commit is contained in:
Mikhail Glukhikh
2023-03-22 16:13:51 +01:00
committed by Space Team
parent 37ed7beda0
commit dc38ce24f7
43 changed files with 497 additions and 119 deletions
@@ -231,7 +231,8 @@ object FirSerializationPluginClassChecker : FirClassChecker() {
if (classSymbol.resolvedSuperTypes.any { it.classId == JAVA_SERIALIZABLE_ID }) return // do not check
for (property in properties) {
if (property.transient) continue
val incorrectTransient = property.propertySymbol.annotations.getAnnotationByClassId(TRANSIENT_ANNOTATION_CLASS_ID, session)
val incorrectTransient =
property.propertySymbol.backingFieldSymbol?.annotations?.getAnnotationByClassId(TRANSIENT_ANNOTATION_CLASS_ID, session)
if (incorrectTransient != null) {
reporter.reportOn(
source = incorrectTransient.source ?: property.propertySymbol.source,