Check default parameters of expect suspend functions on original

functions instead of function views.
 #KT-24461 Fixed
This commit is contained in:
Ilmir Usmanov
2019-11-12 16:27:58 +03:00
parent 633d1c9ea3
commit ea5b529d19
7 changed files with 62 additions and 1 deletions
@@ -1323,7 +1323,9 @@ public class FunctionCodegen {
private boolean isDefaultNeeded(@NotNull FunctionDescriptor descriptor, @Nullable KtNamedFunction function) {
List<ValueParameterDescriptor> parameters =
CodegenUtil.getFunctionParametersForDefaultValueGeneration(descriptor, state.getDiagnostics());
CodegenUtil.getFunctionParametersForDefaultValueGeneration(
descriptor.isSuspend() ? CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor) : descriptor,
state.getDiagnostics());
return CollectionsKt.any(parameters, ValueParameterDescriptor::declaresDefaultValue);
}