Ceylon Migration Bot
Ceylon Migration Bot
[@quintesse] Agreed. Although given the fact that for literals we don't/can't check for complete coverage of values anyway (like we do for enumerated types) why do we even need a...
[@tombentley] @quintesse the idea is that the cases should be disjoint. Literals are allowed because the typechecker can prove their disjointness. It cannot do that for arbitrary expressions. It can't...
[@tombentley] As for Java enums in particular I don't understand why the model loader doesn't tell the typechecker that the enum itself is an enumerated class of its elements, and...
[@quintesse] @tombentley Sure, disjointedness is probably nice to have, but for @FroMage example it could work, right? It would just have to be non-variable non-formal?
[@FroMage] > Literals are allowed because the typechecker can prove their disjointness Some constants can be loaded by the typechecker to prove this. Java does this for primitives, strings and...
[@FroMage] > Enum values are not instances of anonymous classes We can however assume they are disjoint instances.
[@tombentley] @quintesse I didn't mean "change" as in `variable`, I meant "change" as in recompile. If the constant is defined in different compilation unit to the `switch` then if the...
[@FroMage] > the value of the constant changes the analysis of the switch statement becomes invalid The same is true of enumerated types if you don't recompile dependencies properly, this...
[@tombentley] > > I don't understand why the model loader doesn't tell the typechecker that the enum itself is an enumerated class of its elements, and tell it that the...
[@FroMage] Well, that's the same isn't it? They are not anonymous types. Though I have to say, it's not entirely clear to me why that would be something we couldn't...