scala/scala — pull request #3622 by retronym (2014-03-12 13:45:48+00:00)
Title: SI-8395 Regression in pattern matching with nested binds

Regressed in https://github.com/scala/scala/pull/2848. In particular,
see 0cf47bdb5b and 017460e63c.

This commit does away with the `unbind` in the `TypeBound` extractor,
as this was burrowing through

Because of the regression, this pattern:

(s @ (_s @ (_: String)))

was translated into `typeTestStep`, rather than a `bindingStep`. This
came down the the use of `unbind` in the `TypeBound` extractor.

My first step was to remove the `unbind`. That led to another
problem: the tree now matches `SymbolAndTypeBound`, which extracted
`symbol = s, tpe = String`, ignoring the `_s`. I changed that
extractor to no longer recursively apply to the sub-pattern tree,
which is what `MaybeTypedBound` used to do.

I also checked for other uses of `unbind` in the match translation.
The only place I found it is in `BoundTree#pt`. I believe that this
usage is correct, or at least, not obviously incorrect.