Ignore type parameters of inline class

when checking whether we can return unboxed inline class
from suspend function
This commit is contained in:
Ilmir Usmanov
2020-09-17 05:05:08 +02:00
parent fbfe56e0cc
commit f960201f52
7 changed files with 63 additions and 16 deletions
@@ -475,7 +475,8 @@ fun FunctionDescriptor.originalReturnTypeOfSuspendFunctionReturningUnboxedInline
// Force boxing if the function overrides function with different type modulo nullability
if (originalDescriptor.overriddenDescriptors.any {
(it.original.returnType?.isMarkedNullable == true && it.original.returnType?.isNullableUnderlyingType() == true) ||
it.original.returnType?.makeNotNullable() != originalReturnType.makeNotNullable()
// We do not care about type parameters, just main class type
it.original.returnType?.constructor?.declarationDescriptor != originalReturnType.constructor.declarationDescriptor
}) return null
// Don't box other inline classes
return originalReturnType