On 10/10/2019 01:50, Brian Goetz wrote:
Right. We already restrict anon and lambda instances of the sealed type. Not only can't we stably write down their types in the PS attribute, but even if we could, it's so easy to accidentally lose exhaustiveness.
This is a very good point; if I have type T = A | B | C, but then I have 'anonymous' Ts flying around, all switches assuming A|B|C are no longer exhaustive.
Maurizio