backport recent changes to Scala 2.10

@fommil Yes it works... as well as a simple scheme like this can work. The best approach will still be to leverage scala-refactoring.