Don't write any COERCION_STRATEGY for Unit to Unit return types
This commit is contained in:
+5
-1
@@ -334,7 +334,11 @@ class CallableReferencesCandidateFactory(
|
|||||||
// lower(Unit!) = Unit
|
// lower(Unit!) = Unit
|
||||||
val returnExpectedType = inputOutputTypes.outputType
|
val returnExpectedType = inputOutputTypes.outputType
|
||||||
|
|
||||||
val coercion = if (returnExpectedType.isUnit()) CoercionStrategy.COERCION_TO_UNIT else CoercionStrategy.NO_COERCION
|
val coercion =
|
||||||
|
if (returnExpectedType.isUnit() && descriptor.returnType?.isUnit() == false)
|
||||||
|
CoercionStrategy.COERCION_TO_UNIT
|
||||||
|
else
|
||||||
|
CoercionStrategy.NO_COERCION
|
||||||
|
|
||||||
val adaptedArguments =
|
val adaptedArguments =
|
||||||
if (expectedType != null && ReflectionTypes.isBaseTypeForNumberedReferenceTypes(expectedType))
|
if (expectedType != null && ReflectionTypes.isBaseTypeForNumberedReferenceTypes(expectedType))
|
||||||
|
|||||||
Reference in New Issue
Block a user