Correctly map nullable generic underlying value of inline class
if upper bound is primitive type. #KT-32162
This commit is contained in:
@@ -83,7 +83,9 @@ object AbstractTypeMapper {
|
||||
typeConstructor.isTypeParameter() -> {
|
||||
val typeParameter = typeConstructor.asTypeParameter()
|
||||
val upperBound = typeParameter.representativeUpperBound()
|
||||
val newType = if (upperBound.typeConstructor().isInlineClass() && type.isNullableType())
|
||||
val upperBoundIsPrimitiveOrInlineClass =
|
||||
upperBound.typeConstructor().isInlineClass() || upperBound is SimpleTypeMarker && upperBound.isPrimitiveType()
|
||||
val newType = if (upperBoundIsPrimitiveOrInlineClass && type.isNullableType())
|
||||
upperBound.makeNullable()
|
||||
else upperBound
|
||||
|
||||
|
||||
Reference in New Issue
Block a user