Summary: | Not Allowing Access to Private ITD inside Nested Type | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> | ||||
Component: | Compiler | Assignee: | Andrew Clement <aclement> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | 1.5.0RC1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ron Bodkin
2005-11-30 15:18:31 EST
Created attachment 30893 [details]
Patch to tests module that integrates this test case into the ajc150 test suite.
I have a fix for most of the cases. All except 1 and I'm not sure if its a bug or not: public aspect pr118698 { private static interface Marker {} private class Foo implements Marker { public Foo() { bar = null; // works listener = null; // works this.listener = null; // works Marker.this.listener = null; // FAILS ((Marker)this).listener = null; // works } } private Object Marker.listener; private Object bar; } you can see above which case fails - with a message: No enclosing instance of the type pr118698.Marker is accessible in scope So I mocked up a Java equivalent (kind of...): public class A { private static class Marker { private Object listener; } private class Foo extends Marker { public Foo() { Marker.this.listener = null; // FAILS ((Marker)this).listener = null; // works } } } The failure message in this case is the same (javac flavour message): A.java:7: not an enclosing class: A.Marker Marker.this.listener = null; ^ 1 error So ... I'm not currently sure if the failing case with my fix in is supposed to be possible. That sounds great: thanks for fixing the bug so quickly. You are right, I was trying different forms but the one that's failing should be failing: Marker.this.listener = null; is an error, since Marker.this is only valid in a nested type just checked in the test program and fix for this. fix available |