Fix too strict serializer lookup for generic type parameters

This commit is contained in:
Leonid Startsev
2019-06-10 16:49:19 +03:00
parent acf9670306
commit 414c116d93
@@ -122,7 +122,8 @@ fun AbstractSerialGenerator.findTypeSerializerOrContext(
module: ModuleDescriptor,
kType: KotlinType,
sourceElement: PsiElement? = null
): ClassDescriptor {
): ClassDescriptor? {
if (kType.isTypeParameter()) return null
return findTypeSerializerOrContextUnchecked(module, kType) ?: throw CompilationException(
"Serializer for element of type $kType has not been found.\n" +
"To use context serializer as fallback, explicitly annotate element with @ContextualSerialization",