They don’t seem to mix that well:
abstract class A
case class B (var a: Int)(var b: String) extends A
case class C extends A
The following will not work:
B(1)("1") match {
case B(a)(b) => print("B")
case C() => print("C")
}
The problem is that pattern matching and curried arguments do not seem to work. Is there a work-around for this?
What’s wrong with this?
I’m only asking because you didn’t ask for more functionality than this.
EDIT
This could help:
Now you can create dogs either like this:
or like this:
But when you pattern match on dogs the constructor pattern is not curried.