Bug 94747

Summary: [1.5][compiler] Error message is not optimal
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2005-05-11 11:21:41 EDT
Related to bug 84551, the reported error message is misleading.

Test case:
class Outer {
   class Inner { }
   
   static void test(Inner i) { }
}
 
compile sans problème, mais:
class Outer<T> {
   class Inner { }
   
   static void test(Inner i) { }
}

We now report:
Cannot make a static reference to the type parameter Inner

This is not clear what the problem is.

javac reports:
Outer.java:4: non-static class Outer.Inner cannot be referenced from a static
context
        static void test(Inner i) { }
                         ^
1 error

Not sure if this is much better.
Comment 1 Philipe Mulet CLA 2005-05-11 18:24:24 EDT
Tweaked error message to read:
Cannot make a static reference to the non-static type Inner

Corrected testcases.
Comment 2 Philipe Mulet CLA 2005-05-11 18:24:43 EDT
fixed
Comment 3 Olivier Thomann CLA 2005-05-12 13:04:24 EDT
Verified in I20050510-0010 + JDT/Core 556.