Bug 26095 - variable access directed to class of different scope
Summary: variable access directed to class of different scope
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-03 23:33 UTC by cagney
Modified: 2007-01-09 20:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-04 02:45:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cagney 2006-02-03 23:33:42 UTC
// this should not compile
package samename;

public class WrongScope
{
    public int v1 ()
    {
        class SingleName
        {
            int v1 = 1;
        }
        // Should not compile.
        return new SingleName ().v2;
    }
    public int v2 ()
    {
        class SingleName
        {
            int v2 = 2;
        }
        return new SingleName ().v2;
    }
}
Comment 1 Andrew Pinski 2006-02-04 00:54:19 UTC
IIRC this is because inner classes are not really scoped.
Comment 2 Tom Tromey 2006-02-04 02:45:31 UTC
ISTR seeing this one before.
Comment 3 Tom Tromey 2007-01-09 20:48:20 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.