RFR: addressing several issues in the implementation of universal tvars [v9]

Vicente Romero vromero at openjdk.java.net
Wed Jun 8 18:42:53 UTC 2022


On Wed, 8 Jun 2022 18:16:03 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   removing additional code from isSubtype visitors
>
> test/langtools/tools/javac/valhalla/lworld-values/universal-type-variables/UniversalTVarsCompilationTests.java line 671:
> 
>> 669:                     T.ref field;
>> 670:                     void foo(T t, Consumer<? super T> action) {
>> 671:                         action.accept(field = t);
> 
> Why does this fail? Aren't the two types identical (modulo ref/val) ?

well action is parameterized with a wildcard so here we are assigning a ref to a wildcard, `field = t` is not failing though that assignment generates a warning

-------------

PR: https://git.openjdk.java.net/valhalla/pull/684


More information about the valhalla-dev mailing list