Withdrawn: 8315134: javac inference seems to be capturing types incorrectly
Vicente Romero
vromero at openjdk.org
Tue Aug 29 16:20:22 UTC 2023
On Tue, 29 Aug 2023 03:20:52 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> this code:
>
>
> import java.util.*;
>
> public class Test {
> private static <T> void arrayMethod(List<? super T>[] args) {
> listMethod(Arrays.asList(args));
> }
>
> private static <T> void listMethod(List<List<? super T>> list) {}
> }
>
>
> is being rejected by the compiler. This code should be accepted according to the spec. The compiler is doing a capture conversion that is not mentioned in the spec while reducing subtyping constraints during type inference. This fix is syncing the compiler with the spec.
>
> TIA
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/15463
More information about the compiler-dev
mailing list