Fix rewrite at slice exception for callable references inside flatMap

#KT-40254 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-07-13 15:45:50 +03:00
parent 1e4c554bcd
commit 09b44b3189
7 changed files with 48 additions and 5 deletions
@@ -101,11 +101,8 @@ class KotlinCallCompleter(
return candidates
}
val newAtoms = mutableMapOf<KotlinResolutionCandidate, ResolvedLambdaAtom>()
for ((candidate, atom) in lambdas.entries) {
val newAtom = kotlinConstraintSystemCompleter.prepareLambdaAtomForFactoryPattern(atom, candidate, candidate)
newAtoms[candidate] = newAtom
candidate.addResolvedKtPrimitive(newAtom)
val newAtoms = lambdas.mapValues { (candidate, atom) ->
kotlinConstraintSystemCompleter.prepareLambdaAtomForFactoryPattern(atom, candidate, candidate)
}
val diagnosticHolderForLambda = KotlinDiagnosticsHolder.SimpleHolder()