Fix SAM conversion generation condition
Remove check if array is passed to vararg parameter as it's not relevant anymore and leads to ^KT-51821. ^KT-51821: Fixed
This commit is contained in:
committed by
teamcity
parent
c604577132
commit
7033d78641
+1
-5
@@ -634,10 +634,6 @@ fun StatementGenerator.generateSamConversionForValueArgumentsIfRequired(call: Ca
|
||||
"Mismatching resolved call arguments:\n" +
|
||||
"${resolvedCallArguments?.size} != ${underlyingValueParameters.size}"
|
||||
}
|
||||
val isArrayAssignedToVararg: Boolean = resolvedCallArguments != null &&
|
||||
(underlyingValueParameters zip resolvedCallArguments).any { (param, arg) ->
|
||||
param.isVararg && arg is ResolvedCallArgument.SimpleArgument && arg.callArgument.isArrayOrArrayLiteral()
|
||||
}
|
||||
|
||||
val substitutionContext = call.original.typeArguments.entries.associate { (typeParameterDescriptor, typeArgument) ->
|
||||
underlyingDescriptor.typeParameters[typeParameterDescriptor.index].typeConstructor to TypeProjectionImpl(typeArgument)
|
||||
@@ -648,7 +644,7 @@ fun StatementGenerator.generateSamConversionForValueArgumentsIfRequired(call: Ca
|
||||
val underlyingValueParameter: ValueParameterDescriptor = underlyingValueParameters[i]
|
||||
|
||||
val expectedSamConversionTypesForVararg =
|
||||
if (!isArrayAssignedToVararg && resolvedCall is NewResolvedCallImpl<*>) {
|
||||
if (resolvedCall is NewResolvedCallImpl<*>) {
|
||||
val arguments = resolvedCall.valueArguments[originalValueParameters[i]]?.arguments
|
||||
arguments?.map { resolvedCall.getExpectedTypeForSamConvertedArgument(it) }
|
||||
} else null
|
||||
|
||||
Reference in New Issue
Block a user