I’d like to know if the status of the following is not yet done, working as intended, or bug (I couldn’t find a proper description on the dotty site):
EDIT just tried latest master (mybad was on the linker branch) and the following no longer makes sense
This works as expected:
val a: 42 = 42 val b: 42 = 24 //doesn't compile val c: String | Int = 1 val d: String | Int = "str" val e: String | Int = false //doesn't compile
But this doesn’t work as expected:
val a: 42 | 45 = 43 //compiles val b: "This" | "That" = "what?" //compiles
Also, will intersection/union types allow us to do something like
def right[L, R](a: L | R): Option[R] = ... def left[L, R](a: L | R): Option[L] = ...
I understand that then the question would arise that what is L and R for something like
A|B|C so I don’t know if this would make sense. Anyway, I’d like to inquire.