scala/scala — pull request #1129 by paulp (2012-08-13 18:27:05+00:00)
Title: Rewrite of transformTypeTagEvidenceParams.

This fixes what a bug where the prefix seems to be checked but
is ignored; however I rewrote this method purely out of a desire
for tighter code. I would consider it a great personal
favor if you would study the before/after and endeavor to
internalize the mechanisms I applied.

Points of particular note:

- Before you write Option[Symbol], remember we already have
an Option[Symbol], and it's Symbol. None == NoSymbol.
- flatMap can be to an Option, you don't have to create a
one element List for flatMap's enjoyment
- lastOption and headOption are rarely the way to go
... especially if you start with if (xs.isEmpty) return
- The method which checks for emptiness is ".isEmpty",
it is NOT ".length == 0"

I should add a pattern matcher warning for when you have a lower
case name in scope (like "contextParam") and then use a lower case
pattern variable of the same name, which of course ignores the
one outside the pattern and matches everything.

Review by @xeno-by.