Is V? what we need ?

forax at forax at
Wed May 1 13:19:59 UTC 2019

----- Mail original -----
> De: "Brian Goetz" <brian.goetz at>
> À: "Remi Forax" <forax at>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at>
> Envoyé: Mercredi 1 Mai 2019 15:03:42
> Objet: Re: Is V? what we need ?

>> we need V?
>> - to represent the L variation of a Q type.
>> - to interact with generics that are not reified.
> These are the proximate causes, but I think this undersells it.
>> V? does that but does far more, V? is a super type of V which is dangerous,
>> because people will use it as parameter of function instead of V because it's a
>> super type and works with null.
>> Here we are back to a world were every value types may be null.
> Whoa, I think you just skipped a few dozen steps …

use the most super type possible for a parameter is the usual rule hence "program to an interface", i don't think i'v skipped a lot of steps.

> Perhaps you could clarify this with some examples of “I worry people will write
> __ instead of ___, and then __ will happen.”

i worry people will code as we have told them to code.

>> I believe that the issue is that V? should work as a box and currently V? is to
>> powerful/useful as a box so people will start to use it as a true type.
> Again, lots to unpack here:
>  - What, in your mind, is the difference between a box and an adjunction?

not sure to fully understand the question, is it about the syntax ?

>  - What benefits do box types give here?

a box is a necessary evil, everybody want to write an ArrayList<int> but we are not there yet, so we provide just the right abstraction to deal with value type in generics, not more.

>   - What risks do you envision from “using V? as a true type”?

V? everywhere where V should be used, or worst, people using V? half of the time, randomly.


More information about the valhalla-spec-experts mailing list