Bug 347746 - [1.7][compiler] Bounds check failure during method inference
Summary: [1.7][compiler] Bounds check failure during method inference
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 04:45 EDT by Srikanth Sankaran CLA
Modified: 2011-08-05 02:54 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch & test (3.52 KB, patch)
2011-05-31 05:04 EDT, Srikanth Sankaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.