| [#927] | project: compiler | priority: low | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Burak | Martin | fixed | 2007-01-30 22:07:22.0 | |
| subject | unapply does not work for selects | |||
| code |
// Lex found this (object Stream.cons is new, but currently does not work due to)
// library has now
// Stream { ... object cons { ... apply,unapply ... }}
object StreamFoo extends TestCase("unapply for Streams") with Assert {
def sum(stream: Stream[int]): int =
stream match {
case Stream.empty => 0
case Stream.cons(hd, tl) => hd + sum(tl)
}
val str: Stream[int] = Stream.fromIterator(List(1,2,3).elements)
assertEquals(sum(str), 6)
}
|
|||
| what happened | |
|||
| what expected | this to work. I tried to hack typedSelect in the analogous manner to typedIdent. But then other unapplySeq patterns don't work (manifested in compiling ProcInstr).
We should have a look at this together.
Maybe related to some inconsistency regarding use of term names / type names |
|||
| [back to overview] | ||||
| Martin edited on 2007-01-31 17:09:37.0 |