The code below use “?” to do the wildcard match in type match and value match, but in Scala 3.1.2, the compiler complains “Unbound wildcard type”.
What is the syntax for the wildcard match in the type match and the value match against the singleton type?
type InputValue = Singleton & Int
...
type DepType [T <: InputValue] = T match
...
case ? => B[Boolean] // red mark under '?', the tip is "Unbound wildcard type bloop"
object DepFunction:
def apply[N <: InputValue](x: N): DepType[x.type] =
x match
case 0 : 0 => b0
case 1 : 1 => b1
case _ : ? => b2 // red mark under '?', the tip is "Unbound wildcard type bloop"
Thanks for your help!
Guofeng