Does anyone know why the following code doesn't recognize ∙ as a valid infix operator?
object Main extends App {
val c = (I() ∙ I())
}
sealed abstract class Term
case class I() extends Term
case class ∙(x: Term, y: Term) extends Term
Define ∙
as method on I
.
sealed abstract class Term
case class II(x: Term, y: Term) extends Term
case class I() extends Term {
def ∙(o: Term) = II(this, o)
}
Now I() ∙ I()
will work, returning II
.
Not sure what you are trying to achieve, though.