In the document on “Towards a plan for L10 / L20” I tried to answer these, but I got it slightly wrong. I said:
V <: V? <: ValObject <: Object But really that should be V <: V? <: ValObject? <: Object V <: ValObject <: Object V <: V? by value set inclusion; V? is the type obtained by adjoining `null` to the value set of V. I am leaning towards saying that `RefObject?` and `Object?` are not sensible things to write, because they are equal to `RefObject` and `Object`. (That’s separately from `T?`, which always makes sense, but sometimes just means “T”.). No flavor of Point is a subtype of any flavor of RefObject; ValObject and RefObject are disjoint. > On Apr 15, 2019, at 5:10 PM, fo...@univ-mlv.fr wrote: > > > > De: "Brian Goetz" <brian.go...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "Maurizio Cimadamore" <maurizio.cimadam...@oracle.com>, > "valhalla-spec-experts" <valhalla-spec-experts@openjdk.java.net> > Envoyé: Lundi 15 Avril 2019 22:46:08 > Objet: Re: RefObject and ValObject > yes ! > all generics will suddenly accept value types. > > > Yes, this is by design. If you can’t have an ArrayList of Point, that would > be terrible. Of course, until we have specialization (later in the story), > these will be erased, and restricted to the nullable projection. > > Does it means that Point? is a subtype of RefObject ? > > Note: the second question mark in this sentence is because it's a question. > > Rémi >