Summary: | [compiler][1.5]Protected field not visible to subclass in different package when having a class parameter | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jan Schäfer <j_schaef> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | Other | ||
OS: | Linux | ||
Whiteboard: |
Description
Jan Schäfer
2005-01-12 10:28:58 EST
Sorry, it must be: this.s = "foo"; // Works instead of this.b = false // Works Philippe, what do you want to do with this? In the call to FieldBinding canBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) the receiverType is FooBar#RAW so the comparison to the declaringClass fails. Used erasure to compare identical. Added GenericTypeTest#test467-468. Fixed Is there a chance to get a patch against M4? OK. The previous example works now, but the bug is still there in a slightly modified example. This time the superclass is generic, too: package test; public class Foo<R> { protected R s; } package test2; import test.Foo; public class FooBar<R> extends Foo<R> { void fail() { FooBar<String> f = new FooBar<String>(); f.s = "foo"; // Error: field f.s not visible } } Thanks for noticing it. Added GenericTypeTest#test471-472. Fixed. You can grab the next nightly build output, copy the org.eclipse.jdt.core plugin from it and paste it into a M4 install. Fixed I have downloaded the HEAD from CVS and it works now! Thank you! Verified in I20050214 |