RFR: 8273328: Compiler implementation for Pattern Matching for switch (Second Preview)
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Thu Nov 4 14:04:08 UTC 2021
On Thu, 4 Nov 2021 13:55:06 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> Uhm - I get what you say. But isn't sealing meant to be used within a single maintenance domain? If B is missing, how the heck did we get to Flow in the first place (since for sealed classes we check that permitted subclasses extend the sealed class being defined)
Ok - maybe you are considering the case where `I` is used in a compilation unit which did not defined it. And which cannot (for some reason) see B. Seems cornery, but what I'm mostly worried about is that it's not (I think) uniform with the rest of the javac code dealing with sealed classes. For instance, look at the cast conversion rules in `Types::areDisjoint` - in that case there's no protection against missing types.
I think the compiler code should be consistent in how we reason about sealed permitted types?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6209
More information about the compiler-dev
mailing list