I can't figure out why this code wouldn't compile and fail with a:
No singleton value available for A
where: A is a type variable with constraint >: ("yo" : String) and <: Singleton
case class Wrapper[A <: Singleton](a: A)(using ValueOf[A])
def test[A <: Singleton](blabla: Wrapper[A]): Unit = ()
test(Wrapper("yo"))
Is this expected or a bug in Scala 3?
Note that if I extract Wrapper("yo")
then it works:
case class Wrapper[A <: Singleton](a: A)(using ValueOf[A])
def test[A <: Singleton](blabla: Wrapper[A]): Unit = ()
val value = Wrapper("yo")
test(value)