[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:
Sergey.Shanshin
2023-02-14 22:10:30 +00:00
committed by Space Team
parent c9b8160f1e
commit 498c1abbc6
3 changed files with 10 additions and 3 deletions
@@ -160,7 +160,7 @@ class SerializationJvmIrIntrinsicSupport(
}
override val runtimeHasEnumSerializerFactoryFunctions: Boolean
get() = currentVersion != null && currentVersion!! > ApiVersion.parse("1.4.0")!!
get() = currentVersion != null && currentVersion!! >= ApiVersion.parse("1.5.0")!!
private val hasNewContextSerializerSignature: Boolean
get() = currentVersion != null && currentVersion!! >= ApiVersion.parse("1.2.0")!!