scala/scala — pull request #3088 by retronym (2013-10-30 17:54:07+00:00)
Title: SI-7944 FOUND: stray undetermined type params in vicinity of implicits

Implicit search created a nested Context into which the results of
its typechecking, namely, errors and undetermined type parameters
(roughly: those inferred as Nothing) are stashed.

The code the drives the process was checking for errors, but
discarded those undetermined type parameters.

This commit copies them from the child context to the parent,
which lets `Typer#adapt` to get to:

else if (hasUndetsInMonoMode) { // (9)
assert(!context.inTypeConstructorAllowed, context) //@M
instantiatePossiblyExpectingUnit(tree, mode, pt)
}

Our lost TypeVar has found its way home! The reward for which
is being instantiated, based on another type inference session
adapting the expression's type to the expected type.