What does this code do? Why is there two sets of constructor parameters?
class A(val x: Int)(val y: Int)
I can initialize an object and use both fields:
val a = new A(5)(7)
println(a.x + ", " + a.y)
If I make it a case class, I can match only by the first set of parameters.
case class A(x: Int)(y: Int)
val a = A(5)(7)
a match {
A(x) => println(x)
}
It's not possible to create 3 sets of parameters. It doesn't compile. So what is the meaning of the two sets of constructor parameters?