Bug 82053

Summary: generic semantics have some problems
Product: [Eclipse Project] JDT Reporter: Eric Goff <goffster>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: All   
OS: Linux   
Whiteboard:

Description Eric Goff CLA 2004-12-31 15:43:44 EST
I have the following classes:
public class Foo {
	public interface Model {
	}
	public interface View<M extends Model> {
		M getTarget() ;
	}
}
public class Bar {
	public interface Model extends Foo.Model {
	}
	public interface View<M extends Model> extends Foo.View<M> {
	}
}
public class usettestclass {
	public static void main(String[] args) {
		Bar.View<?> bv = null ;
		Bar.Model m = bv.getTarget() ;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                Type mistmatch
	}
}

This should not be a type mismatch, and it works just fine with sun compiler.
Comment 1 Philipe Mulet CLA 2005-01-03 07:34:02 EST
Reproduced in latest.
Comment 2 Philipe Mulet CLA 2005-01-03 12:59:12 EST
Added regression test: GenericTypeTest#test442.

Problem is located in wildcard relocation when creating parameterized type
bindings, this should not occur, and was introduced to address bug 76434, which
got revised.

Removing relocation addresses the problem, the wildcard is properly remembering
its origin and is thus compatbile as expected with variable type.

Fixed
Comment 3 Jerome Lanneluc CLA 2005-02-15 05:21:49 EST
Verified in I20050214