Summary: | [1.5][compiler] generic parameter and qualified access seems to confuse each other | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Tobias Riemenschneider <tobys> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | dirk_baeumer | ||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1 RC3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Tobias Riemenschneider
2005-06-17 02:42:25 EDT
We were unwrapping raw types, but hadn't think of parameterized case. Fix is simple, always reach the erased type. Added GenericTypeTest#test763 +1 for RC3. Simple fix. Dirk - can you vote for it ? Fix is: Index: QualifiedThisReference.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java,v retrieving revision 1.31 diff -u -r1.31 QualifiedThisReference.java --- QualifiedThisReference.java 23 Feb 2005 02:47:28 -0000 1.31 +++ QualifiedThisReference.java 17 Jun 2005 09:19:18 -0000 @@ -72,15 +72,13 @@ public TypeBinding resolveType(BlockScope scope) { constant = NotAConstant; - TypeBinding type = this.resolvedType = this.qualification.resolveType(scope, true /* check bounds*/); + TypeBinding type = this.qualification.resolveType(scope, true /* check bounds*/); if (type == null) return null; - // X.this is not a raw type as denoting enclosing instance - if (type.isRawType()) { - RawTypeBinding rawType = (RawTypeBinding) type; - type = this.resolvedType = rawType.type; // unwrap - } + // X.this is not a param/raw type as denoting enclosing instance + this.resolvedType = type = type.erasure(); + // the qualification MUST exactly match some enclosing type name - // Its possible to qualify 'this' by the name of the current class + // It is possible to qualify 'this' by the name of the current class int depth = 0; this.currentCompatibleType = scope.referenceType().binding; while (this.currentCompatibleType != null +1 for RC3. fixed Created attachment 23463 [details]
Augmented test case.
Shows that the fix covers other cases than the initial test case. Checked that
behavior is the same as javac. Invalidated _test763d shows a slight difference
in compiler error messages semantics between javac and jdt.core, for which I
open a separate bug.
Verified using Build id: I20050617-0010 + JDT Core HEAD. Verified with I20050617-1227 |