2 questions about enums and the closed/withdrawn JEP 301

David Alayachew davidalayachew at gmail.com
Wed Mar 29 02:30:33 UTC 2023


Hello Tesla,

Thank you for your response!

> F-bound is a way of having access to the
> subtype in the supertype. That's a trick
> used by Java in the Enum interface, note
> that it has a generic parameter. If you
> have an enum T, then T extends
> Enum<T>. Note that this extends relation
> has some sort of recursion -- that's the
> F-bound.

This somewhat clears it up. Are you basically saying that the only reason
why the supertype can know about the subtype is because the relationship is
recursive, and thus, the recursion allows the supertype to "know" about the
subtype because the subtype is just a roundabout way of referencing itself
- something the supertype DOES have access to?

> A well-formed type is a type that makes
> sense. You can think of it as a type
> expression that doesn't contain an error.
> But you need to make sure you have a
> sensible criterion of "no error".

Ok, this makes a lot of sense. I think my confusion came from the fact that
all of my google searches dug deep into the criterion itself before
explaining that it's just a set of criterion that's either arbitrarily
chosen or respective to the domain where "type" is defined.

Thid gave me a lot of insight. I understand the first half of my question a
lot better now.

Thank you for your time and help!
David Alayachew

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230328/441e9f82/attachment.htm>


More information about the amber-dev mailing list