mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-22 08:31:31 +00:00
Don't write any COERCION_STRATEGY for Unit to Unit return types
This commit is contained in:
@@ -334,7 +334,11 @@ class CallableReferencesCandidateFactory(
|
||||
// lower(Unit!) = Unit
|
||||
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 =
|
||||
if (expectedType != null && ReflectionTypes.isBaseTypeForNumberedReferenceTypes(expectedType))
|
||||
|
||||
Reference in New Issue
Block a user