This fixes in a regression introduced by 6eeda06c1.
When deducing the return type of nested function calls, only the
return type of the outermost expression should be ignored.
Instead of assuming all contextes nested in a discared statements
are themselves discarded, only assume that in immediate contexts.
Similarly, only consider contextes immediately in an immediate or
discarded statement as being themselves immediate.