Use correct check in FirSerializationPluginClassChecker to determine if the given type is a enum class.

Otherwise, findTypeSerializerOrContextUnchecked works incorrectly when analyzing code
compiled with Kotlin 1.7.20 and serialization 1.4.1.

#KT-57704 Fixed
This commit is contained in:
Leonid Startsev
2023-04-18 14:54:23 +02:00
committed by Space Team
parent 167ed5e049
commit f29e505bd3
8 changed files with 120 additions and 1 deletions
@@ -536,7 +536,7 @@ object FirSerializationPluginClassChecker : FirClassChecker() {
}
checkTypeArguments(type, source, reporter)
} else {
if (!type.isEnum) {
if (type.toRegularClassSymbol(session)?.isEnumClass != true) {
// enums are always serializable
reporter.reportOn(source, FirSerializationErrors.SERIALIZER_NOT_FOUND, type)
}