|
[#1220] |
project: compiler |
priority: low |
category: bug |
|
submitter |
assigned to |
status |
date submitted |
|
Nikolay |
Martin |
fixed |
2007-07-18 07:16:21.0 |
subject |
[contrib #695] Compiler crash with unapply |
code |
class QSRichIterable[A](self:Iterable[A]) {
def filterMap[R](f: PartialFunction[A,R]): Iterable[R] = null;
}
object Un {
def unapply(i:int) = Some(i)
}
val richIter = new QSRichIterable(List(0))
richIter filterMap {case Un(3) => 0}
|
what happened |
exception when traversing ((x$0: Int) => x$0 match {
case line2$object.$iw.$iw.Un.unapply() (3) => 0
})
exception when traversing line4$object.$iw.$iw.richIter.filterMap[Int](((x$0: Int) => x$0 match {
case line2$object.$iw.$iw.Un.unapply() (3) => 0
}))
exception when traversing private[this] val unnamed0: Iterable[Int] = line4$object.$iw.$iw.richIter.
filterMap[Int](((x$0: Int) => x$0 match {
case line2$object.$iw.$iw.Un.unapply() (3) => 0
}))
exception when traversing ...
[snip]
Exception in thread "main" java.lang.Error: unexpected tree: line2$object.$iw.$iw.Un.unapply()\
(3)
|
what expected |
As far as I can tell, the code should compile. The compiler certainly should not crash. |
[back to overview] |