| [#1163] | project: compiler | priority: low | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Burak | Burak | fixed | 2007-06-02 09:21:51.0 | |
| subject | [contrib #647] complex match error | |||
| code |
abstract class Function
case class Var(n: String) extends Function
case class Const(v: double) extends Function
def f(): (Function, Function) = {
(Var("x"): Function, Var("y"): Function) match {
case (Const(lv), Const(rv)) => throw new Error
case (l9, Var("z")) => throw new Error
case (l1, r1) => (l1, r1)
}
}
println(f()) |
|||
| what happened | (Var(y),Var(x)) |
|||
| what expected | (Var(x),Var(y)) Couldn't find simpler example. | |||
| [back to overview] | ||||
| Burak edited on 2007-06-02 11:11:32.0 |
| the bug only appears when sharing code... it is actually quite scary, the reason that it does not appear in many more programmers is probably that some exception is thrown by typer and the fallback matcher is used. phew. |