I have made my own framework of traits and classes that extend my traits. The parent of all classes is a trait named 'Contract'. 'Combinator' and 'ElementaryContract' are two immediate children of Contract.
def disintegrateContract[T](element: T): Elem =
{
element match
{
case com <: Combinator => matchCombinator(com)
case e <:ElementaryContract =>matchElementaryContract(e)
}
}
I want to make a match class that recognizes whether a passed 'Contract' is a subtype of 'Combinator' or 'ElementaryContract' and then pass it to some other functions. This is the compilation error I get:
'=>' expected but '<:' found
Probably it does not recognize the subtype operator. How can I make this happen?