scala/scala — pull request #3858 by densh (2014-07-02 12:12:39+00:00)
Title: SI-8703 add support for blocks with just a single expression to quasiquotes

Previously it was impossible to match a block that was constructed as

Block(Nil, term)

Due to the fact that quasiquotes always flatten those into just `term`. This is
a correct behavior for construction (for sake of consistency with parser) but
doing it in deconstruction mode make it impossible to match such blocks which
could have been constructed manually somewhere.

To fix this we just disable block flattening in deconstruction mode.
Interestingly enough this doesn't break existing code due to the fact that
quasiquote's block matcher also matches expressions as single-element blocks.

This allows to match single-element blocks with patterns like `q"{ $foo }"`.

review @retronym @xeno-by