Fix compilation exception where overload ambiguity should be

#KT-16246 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-09-05 13:40:50 +03:00
parent ec512d1c8a
commit 6d4bb229ac
6 changed files with 47 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ fun <D : CallableDescriptor> ResolvedCall<D>.usesDefaultArguments(): Boolean {
fun <C: ResolutionContext<C>> Call.hasUnresolvedArguments(context: ResolutionContext<C>): Boolean {
val arguments = valueArguments.map { it.getArgumentExpression() }
return arguments.any (fun (argument: KtExpression?): Boolean {
if (argument == null || ArgumentTypeResolver.isFunctionLiteralArgument(argument, context)) return false
if (argument == null || ArgumentTypeResolver.isFunctionLiteralOrCallableReference(argument, context)) return false
val resolvedCall = argument.getResolvedCall(context.trace.bindingContext) as MutableResolvedCall<*>?
if (resolvedCall != null && !resolvedCall.hasInferredReturnType()) return false