[lworld] javac allows Value Type generic parameters with var
Srikanth
srikanth.adayapalam at oracle.com
Tue Sep 4 10:33:15 UTC 2018
Thanks James and Remi.
I have pushed a fix here:
http://hg.openjdk.java.net/valhalla/valhalla/rev/b0d7c517ee62
(this special cases and tolerates Class<ValueType> at the moment so that
ValueType.class does not become an error)
Srikanth
On Saturday 18 August 2018 11:35 PM, Remi Forax wrote:
> ----- Mail original -----
>> De: "James Thompson" <thompsonjamesrichard at gmail.com>
>> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
>> Envoyé: Mardi 14 Août 2018 20:13:58
>> Objet: [lworld] javac allows Value Type generic parameters with var
>> Local type inference with the use of var masks at the source level generic
>> type parameters, therefore it is trivial to create a new generic collection
>> of Value types.
>>
>> e.g. var list = List.of(Point.create(1, 1), Point.create(2, 2));
>>
>> where Point is a Value type. This will compile without
>> *-XDallowGenericsOverValues*
> Thanks James,
> i suppose you can also do the same thing with the other kind of type inference, method call and diamond syntax.
>
> regards,
> Rémi
More information about the valhalla-dev
mailing list