Bug 135323 - [compiler] Anonymous inner class scope error
Summary: [compiler] Anonymous inner class scope error
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-06 13:00 EDT by Chris Longfield CLA
Modified: 2006-04-28 14:00 EDT (History)
0 users

See Also:


Attachments
example project demonstrating the scope error (310.80 KB, application/octet-stream)
2006-04-06 13:00 EDT, Chris Longfield CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Longfield CLA 2006-04-06 13:00:01 EDT
An anonymous inner class that refers to a variable of the enclosing class erroneously reports the variable to be inaccessible if the immediate public superclass of the inner class does not define the variable and the super superclass does define the variable but is out of scope.
(example attached)
Comment 1 Chris Longfield CLA 2006-04-06 13:00:56 EDT
Created attachment 37915 [details]
example project demonstrating the scope error
Comment 2 Philipe Mulet CLA 2006-04-26 12:16:56 EDT
We do the right thing for method lookups, but not for fields.
Comment 3 Philipe Mulet CLA 2006-04-26 15:14:07 EDT
Problem comes from blaming non visible receiver type, which is then changing the lookup semantics, where non visible field (only) is subsumed by enclosing match.

Added LookupTest#test065-067.
Fixed
Comment 4 Philipe Mulet CLA 2006-04-26 15:16:01 EDT
fixed
Comment 5 Olivier Thomann CLA 2006-04-28 14:00:51 EDT
Verified with I20060427-1600 for 3.2RC2