Use a correct type for SERIALIZER_TYPE_INCOMPATIBLE diagnostic.
This diagnostic used an incorrect type for rendering (outer class type instead of a property type) and didn't expand type argument of `KSerializer`. Also add an additional test case for generic parameters. #KT-63570 Fixed
This commit is contained in:
committed by
Space Team
parent
1260d03561
commit
51e3e9af94
+2
-2
@@ -564,14 +564,14 @@ object FirSerializationPluginClassChecker : FirClassChecker() {
|
||||
serializerType: ConeKotlinType,
|
||||
reporter: DiagnosticReporter
|
||||
) {
|
||||
val serializerForType = serializerType.serializerForType(session) ?: return
|
||||
val serializerForType = serializerType.serializerForType(session)?.fullyExpandedType(session) ?: return
|
||||
|
||||
val declarationTypeClassId = declarationType.classId
|
||||
if (declarationTypeClassId == null || declarationTypeClassId != serializerForType.classId) {
|
||||
reporter.reportOn(
|
||||
source ?: containingClassSymbol.serializableOrMetaAnnotationSource,
|
||||
FirSerializationErrors.SERIALIZER_TYPE_INCOMPATIBLE,
|
||||
containingClassSymbol.defaultType(),
|
||||
declarationType,
|
||||
serializerType,
|
||||
serializerForType
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user