Closed
Description
Compiler version
3.1.2
Minimized code
Welcome to Scala 3.1.2 (11.0.13, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> summon[("A" | "B") <:< Singleton]
val res0: ("A" | "B") =:= ("A" | "B") = generalized constraint
scala> summon[ValueOf["A" | "B"]]
-- Error: -------------------------------------------------------------------------------------------------------------------------------------------------------
1 |summon[ValueOf["A" | "B"]]
| ^
| No singleton value available for ("A" : String) | ("B" : String).
1 error found
scala>
Expectation
Seems strange that there is an instance of ("A" | "B") <:< Singleton
. I was mighty curious what ValueOf
might return!