scala-ide/scala-refactoring — pull request #58 by Luegg (2014-06-13 13:19:33+00:00)
Title: Extend ExtractExtractor

This PR fixes two issues:

* Allow packages as possible extraction targets for extractor extractions
* Fix unapply's result values for extractors providing no bindings (sometimes called tests)

Previously, extracting the following pattern

```scala
object Demo {
1 match {
case /*(*/1/*)*/ => println(1)
}
}
```
generated the extractor
```scala
object Extracted {
def unapply(x: Int) = x match {
case 1 => Some()
case _ => None
}
}
```
Since Scala 2.11 this is no longer an Extractor providing zero binding but an extractor providing one binding of type `Unit` (see https://issues.scala-lang.org/browse/SI-6111).

The correct result is:

```scala
object Extracted {
def unapply(x: Int) = x match {
case 1 => true
case _ => false
}
}
```