scala/scala — pull request #2111 by retronym (2013-02-10 22:23:19+00:00)
Title: SI-6514 Avoid spurious dead code warnings

`deadCode.expr` stores the method symbol most recently encountered
in `handleMonomorphicCall`, and uses this to avoid warnings
for arguments to label jumps and `Object#synchronized` (which
sneakily acts by-name without advertising the fact in its type.)

But this scheme was insufficient if the argument itself contains
another method call, such as `matchEnd(throw e(""))`.

This commit changes the single slot to a stack, and also
grants exemption to `LabelDef` trees. They were incorrectly
flagged in the enclosed test case after I made the the first change.

Review by @paulp