Bug 35658

Summary: Cannot resolve Inner Class reference
Product: [Eclipse Project] JDT Reporter: alan dodridge <alan_dodridge>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC4   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description alan dodridge CLA 2003-03-25 13:27:39 EST
1 - Public class with inner class which contains a static int

package com.kainos.solas.test;
public class TestParentClass
{
    public TestParentClass(){}

    public class TestInnerClass
    {
        public final static int i = 0;
    }
    
}

2 - Try and reference the int from another class

package com.kainos.solas.test;
public class CallInnerClass
{

    TestParentClass tpc = new TestParentClass();
    
    int a = tpc.TestInnerClass.i; 

}

** ECLIPSE SAYS - tpc.TestInnerClass cannot be resolved or is not a field
Comment 1 Philipe Mulet CLA 2003-03-26 04:27:24 EST
Such a reference is forbidden as per JLS 6.5.6.
    int a = tpc.TestInnerClass.i; 
should be written
    int a = TestParentClass.TestInnerClass.i; 

Some 1.3 compilers were too permissive. Most 1.4 compilers are doing the proper 
thing. Eclipse is enforcing the spec here.