[KxSerialization] Fix SERIALIZER_NOT_FOUND diagnostic for enums
If enum class from dependencies is used, which was compiled by a new version of the plugin, which uses a factory and does not create a nested `$serializer` class, then an `SERIALIZER_NOT_FOUND` diagnostic error is thrown for such an enumeration. This happens if the old serialization runtime is used for the current project - in this case, the serializer is taken from the nested class `$serializer`. Since it is missing, the diagnostics does not work correctly. It is acceptable for enumerations to ignore this error, because we know that enumerations are always serializable. Merge-request: KT-MR-8818 Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
c9b8160f1e
commit
498c1abbc6
+4
-1
@@ -539,7 +539,10 @@ object FirSerializationPluginClassChecker : FirClassChecker() {
|
||||
}
|
||||
checkTypeArguments(type, source, reporter)
|
||||
} else {
|
||||
reporter.reportOn(source, FirSerializationErrors.SERIALIZER_NOT_FOUND, type)
|
||||
if (!type.isEnum) {
|
||||
// enums are always serializable
|
||||
reporter.reportOn(source, FirSerializationErrors.SERIALIZER_NOT_FOUND, type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user