Fix prematurely analyzing a lambda while fixing a type variable for another argument

^KT-35168 Fixed
This commit is contained in:
victor.petukhov
2019-11-28 15:56:59 +03:00
parent c4a115720e
commit e246c23a46
10 changed files with 37 additions and 8 deletions
@@ -72,7 +72,7 @@ fun ResolvedCall<*>.hasLastFunctionalParameterWithResult(context: BindingContext
val lastArgument = valueArguments[lastParameter]?.arguments?.singleOrNull() ?: return false
if (this is NewResolvedCallImpl<*>) {
// TODO: looks like hack
resolvedCallAtom.subResolvedAtoms.firstOrNull { it is ResolvedLambdaAtom }.safeAs<ResolvedLambdaAtom>()?.let { lambdaAtom ->
resolvedCallAtom.subResolvedAtoms?.firstOrNull { it is ResolvedLambdaAtom }.safeAs<ResolvedLambdaAtom>()?.let { lambdaAtom ->
return lambdaAtom.resultArguments.filterIsInstance<ReceiverKotlinCallArgument>().all {
val type = it.receiverValue?.type ?: return@all false
predicate(type)