|
Re: pattern matching works strange for an O'Caml programmer: msg#00249lang.scala
> Even later, I made it into this: > abstract class Expr { > def eval: int = this match { > case Number(n) => n > case Sum(x, 0) => 0 > } > } > case class Number(n: int) extends Expr > case class Sum(e1: Expr, e2: Expr) extends Expr > > The type error didn't showed up either. This looks like a bug to me, especially since version 2.2.0 is the first version to accept such a program. It might have to do with the experimental addition of unnaply patterns, but I let Buraq detail on that. Cheers, Iulian |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Tail recursion -> while (?): 00249, Insitu |
|---|---|
| Next by Date: | Re: pattern matching works strange for an O'Caml programmer: 00249, Alexander Sergeev |
| Previous by Thread: | Re: pattern matching works strange for an O'Caml programmeri: 00249, Alexander Sergeev |
| Next by Thread: | Multi-parameter case classes: 00249, Tony Morris |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |