In Scala, is it possible to "subtract" a type from a composed type like this one: "A with B with C" ?

-
Show this thread
-
-
-
Replying to @guizmaii
I don't think it will change anything for intersection types, but it might for union types. The mechanism, if it gets implemented, would be to pattern match some cases against a union type, and the catchall's type would be the Union of the unmatched types from the original union.
1 reply 0 retweets 3 likes -
Replying to @propensive @guizmaii
This code exists already in the compiler for doing exhaustivity checking. But that currently happens post-typer, and it would need to be promoted to the typer in order to make use of the newly-formed union type it calculates. It might happen.
1 reply 0 retweets 1 like
I make myself sound more authoritative on this issue than I really should; I learned this from a couple of conversations with Guillaume Martres.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.