|
[#910] |
project: compiler |
priority: low |
category: bug |
|
submitter |
assigned to |
status |
date submitted |
|
Burak |
Burak |
fixed |
2007-01-23 17:47:12.0 |
subject |
typing of unapply patterns too imprecise |
code |
object RegExpTest1 extends Application {
def co(x: Seq[Char]) = x match {
case Seq('s','c','a','l','a', rest @ _*) =>
val y: Seq[int] = rest
y
}
}
|
what happened |
I found this while fixing the syntax of the overview example.
This thing compiles...
|
what expected |
rest should have type Seq[char]. Failing that, it should have Seq[a] where a is fresh (this pattern here calls Seq.unapply) then the overlap could be done later (this part is tricky and we have not thought about "overlap constraint propagation into patterns" yet). I submit this issue to the tracking system so we do not forget it.
|
[back to overview] |