Open
Description
Compiler version
3.6.3
Minimized code
sealed trait Operand[T]
case class Abs[T <: Int | BigInt](a: Operand[T]) extends Operand[T]
def foo[T](op: Operand[T]): Operand[T] =
op match
case Abs(a) => Abs(foo(a))
^^^^^^^^^^^
Found: com.arteris.forj.parameters.constraints.operand.Abs[Int & T | BigInt & T]
Required: com.arteris.forj.parameters.constraints.operand.Operand[T]
Output
Found: com.arteris.forj.parameters.constraints.operand.Abs[Int & T | BigInt & T]
Required: com.arteris.forj.parameters.constraints.operand.Operand[T]
Expectation
This should compile.
Workaround
case op: Abs[t] => Abs(foo(op.a))