Hi,
I’m trying to encode a set of different types of formulae and have the following equality method for True (and something similar for False) (this doesn’t deal with semantic equivalence but that’s ok for me):
However, when I test it, I get a SO error. I think because the pattern matching is calling the equals method itself.
What’s the correct way of implementing this idea that prevents this problem please?
object True extends Formula {
override def equals(other: Any) = other match {
case True => true
case _ => false
}
...
}
>: True equals True
creates the error.