I'm trying Literal Types from Scala 2.13 and I encounter the following error :
scala> def double[A <: Singleton] = valueOf[A]
^
error: No singleton value available for A.
Run Code Online (Sandbox Code Playgroud)
Could you explain why ?
I don't think that's working like that, but rather with the related typeclass ValueOf:
object Foo
def foo[A : ValueOf] = valueOf[A]
scala> foo[Foo.type]
res2: Foo.type = Foo$@1c105c3a
Run Code Online (Sandbox Code Playgroud)