On 8/19/2019 11:27 AM, Brian Goetz wrote:
So, given all this, we should focus all our ceremony-reduction on the
case of co-declared sum types. Which is mostly what I think I was
suggesting:
- Infer the permits clause when all the subtypes are co-declared;
- Infer “final” for leaf classes in a sum type;
- Require explicitness in both sealed/non-sealed, and permits
clause, in other cases.
How do you know from `sealed class X {}` and the rest of its
compilation unit that all X's subtypes are co-declared?
By co-declared, I mean "in the same compilation unit."
The emphasis should be on the word "all", not "co-declared". How do you
know that ALL of X's subtypes are declared in the same compilation unit?
Alex