JDK-8028547 : javac type inference mistmatch between 7 and 8
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-11-18
  • Updated: 2014-01-31
  • Resolved: 2014-01-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Relates :  
Description
These examples:

Ex 1:
abstract class A2<T>{
    abstract <S> S foo(S x, S y);
    abstract <S1> void baz(A2<S1> a);

    void bar(A2<Integer> y, A2<Long> x){
         baz(foo(x, y));
    }
}

Ex 2:
abstract class A<T>{
    abstract <S> S foo(S x, S y);
    <S extends Number & Comparable<? extends Number>> void baz(A<S> a){}

    void bar(A<Long> x, A<Integer> y){
        baz(foo(x, y));
    }
}

Ex 3:
abstract class A1<T>{
    abstract <S> S foo(S x, S y);
    <T extends Number & Comparable<?>, S extends Number & Comparable<?
extends T>> void baz(A1<S> a){}

    void bar(A1<Long> x, A1<Integer> y){
        baz(foo(x, y));
    }
}

compiles in 6 and 7 but fails to compile in 8.

reported by anna.kozlova_at_jetbrains.com in lambda-dev
Comments
I suggest putting Ex. 4 in a different bug. Both specification-related, but concern different parts of the inference spec. Ex.1 - Ex. 3 are concerned with a nested method invocation with an inference variable as its return type. There's a capture step missing in reduction (JDK-8028800). Ex. 4 is a problem of incorporation not using information in two different upper bounds (t <: Task<e>, t <: Task<CustomException>) to generate additional bounds.
21-11-2013