Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347746

Summary: [1.7][compiler] Bounds check failure during method inference
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, satyam.kandula
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch & test none

Description Srikanth Sankaran CLA 2011-05-31 04:45:58 EDT
The following code use to compile with BETA_JAVA7 (and does compile
with HEAD), but not anymore. 

// ------------------- 8< -----------------------
public class X {
    class A<T extends B<?>> {}
    class B<T extends A<?>> extends D {}
    class C<T extends D> {}
    class D {}
    class E<T extends C<? extends B<?>>> {}
    <U extends C<V>, V extends B<W>, W extends A<V>> W foo(E<U> e) {
        return goo(e);
    }
    <P extends C<Q>, Q extends B<R>, R extends A<Q>> R goo(E<P> e) {
        return null;
    }
}
// ------------------- 8< -----------------------


The fix for bug 347145 should have also propagated the altered intersection
types back into the inference context, but fails to do so.

I have a fix that is under test.
Comment 1 Srikanth Sankaran CLA 2011-05-31 05:04:10 EDT
Created attachment 196968 [details]
Proposed patch & test

Under test
Comment 2 Srikanth Sankaran CLA 2011-05-31 06:43:08 EDT
Released in BETA_JAVA7 branch only,
Olivier, please review, TIA.
Comment 3 Srikanth Sankaran CLA 2011-06-02 00:51:09 EDT
Please ignore this code review request, This fix is being subsumed by
the better fix being tested for bug 347600 for which I will
raise a separate code review request.
Comment 4 Satyam Kandula CLA 2011-07-01 08:50:40 EDT
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.