I have been searching for a bit but can not locate any examples that demonstrate the usage of @_* while pattern matching case classes.
Below is an example of the kind of application I am referring to.
def findPerimeter(o: SomeObject): Perimeter = o match {
case Type1(length, width) =>
new Perimeter(0, 0, length, width)
case Type2(radius) =>
new Perimeter(0, 0, 2*radius, 2*radius)
...
case MixedTypes(group @_*) => {
\\How could @_* be used to check subpatterns of group?
}
}
If someone could show me some examples or point me to a web page that has a few examples that would be great.
Thanks