Bug 76786 - [1.5] Generics processing broken for simple test case.
Summary: [1.5] Generics processing broken for simple test case.
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: 3.1 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-22 00:34 EDT by R Lenard CLA
Modified: 2004-10-29 13:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R Lenard CLA 2004-10-22 00:34:12 EDT
/*
 * Created on Oct 22, 2004
 */

import java.lang.Comparable;

/**
 * This shows some bad template resolution.
 * It gives this error, but javac compiles it succesfully and it looks like it 
should be valid.
 * The method doSomethingElse(BadTemplateResolution.Z<V1,V2>, 
BadTemplateResolution.Z<V1,V2>) in the type BadTemplateResolution is not 
applicable for the arguments 
(BadTemplateResolution.Z<BadTemplateResolution.X<BadTemplateResolution.W,BadTemp
lateResolution.W>,String>, 
BadTemplateResolution.Z<BadTemplateResolution.X<BadTemplateResolution.W,BadTempl
ateResolution.W>,String>)
 */
public class BadTemplateResolution
{
    private static final class X<T1, T2> implements Comparable<X<T1, T2>> {
        public int compareTo(X<T1, T2> arg0)
        {
            return 0;
        }
        
    };
    
    private static class Y<T1, T2> {
        
    };
    
    private static final class Z<T1, T2> extends Y<T1, T2> implements 
Comparable<Z<T1, T2>> {
        public int compareTo(Z<T1, T2> arg0)
        {
            return 0;
        }
        
    };
    
    public static <T> void doSomething(Comparable<? super T> a, Comparable<? 
super T> b) {
    }
    
    public static <V1, V2> void doSomethingElse(Z<V1, V2> a, Z<V1, V2> b) {
        doSomething(a, b);
    }
    
    private static final class W { };
    
    public static void main(String[] args) {
        doSomething(new X<Integer, String>(), new X<Integer, String>());
        doSomething(new Z<Integer, String>(), new Z<Integer, String>());
        doSomethingElse(new Z<Integer, String>(), new Z<Integer, String>());
        doSomethingElse(new Z<W, String>(), new Z<W, String>());
        // The next line won't compile.  It's the generic<generic which seems
        // to be the problem
        doSomethingElse(new Z<X<W, W>, String>(), new Z<X<W, W>, String>());
    }
}
Comment 1 Frederic Fusier CLA 2004-10-27 07:39:15 EDT
It works with last integration build: I200410260800.
Comment 2 Frederic Fusier CLA 2004-10-29 13:06:14 EDT
Test case test0360 added in GenericTypeTest.