Refine type mapping for nullable inline class types

This commit is contained in:
Mikhail Zarechenskiy
2018-01-24 15:19:43 +03:00
parent d5400f11a3
commit d1049e5553
3 changed files with 43 additions and 1 deletions
@@ -132,7 +132,13 @@ fun <T : Any> mapType(
if (descriptor.isInline && !mode.needInlineClassWrapping) {
val underlyingType = descriptor.underlyingRepresentation()?.type
if (underlyingType != null) {
return mapType(underlyingType, factory, mode, typeMappingConfiguration, descriptorTypeWriter, writeGenericType)
if (!kotlinType.isMarkedNullable) {
return mapType(underlyingType, factory, mode, typeMappingConfiguration, descriptorTypeWriter, writeGenericType)
}
if (!underlyingType.isMarkedNullable && !KotlinBuiltIns.isPrimitiveType(underlyingType)) {
return mapType(underlyingType, factory, mode, typeMappingConfiguration, descriptorTypeWriter, writeGenericType)
}
}
}