javac 8/9 inconsistency

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Feb 16 19:27:40 UTC 2015


Hi Anna,
it looks like the test should compile - I'm not sure as to which bugs 
are involved, I'll take a closer look and let you know.

Thanks
Maurizio

On 16/02/15 17:45, Anna Kozlova wrote:
>
> Hi,
>
> The following code compiles with java 9 (b. 49) but doesn’t with 8 
> (1.8u40 b.23)
>
> class Test<K> {
>
> public static void foo(Test<String> test) {
>
> Test<String> e = create(Test::factory, test);
>
> }
>
> private static <T> T create(Supplier<T> callback, T defaultVal) {
>
> return null;
>
> }
>
> static <P> Test<P> factory() {
>
> return null;
>
> }
>
> }
>
> What is correct?
>
> BTW I’ve found https://bugs.openjdk.java.net/browse/JDK-8055963 which 
> explains to me the situation withTest<String> e = create(() -> 
> factory(), test); but the fix version is 9. Would it be backported to 
> java 8?
>
> Thank you,
>
> Anna
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20150216/8f40d73a/attachment-0001.html>


More information about the compiler-dev mailing list