Bug 41293 - Incorrect error detected: "The method put is defined in an inherited type and an enclosing scope."
Summary: Incorrect error detected: "The method put is defined in an inherited type and...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-07 15:31 EDT by Tupshin Harper CLA
Modified: 2003-08-14 12:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tupshin Harper CLA 2003-08-07 15:31:27 EDT
The following code snipped compiles fine, but Eclpse complains with the
following error: The method put is defined in an inherited type and an enclosing
scope. It's obviously dependent on other code (It's a simplified exerpt from the
xwt source code http://www.xwt.org), but it should be self explanatory that put
is an inherited method.

import org.xwt.js.*;

public final class XWT extends JS.Obj {

   public void put(Object name, Object value) {
    }

   private static class XWTMath extends JS.Obj {
       public XWTMath() {
           JS gs = new JS.GlobalScope();
           put("isNaN",gs.get("isNaN"));
       }
   }
}
Comment 1 Kent Johnson CLA 2003-08-11 11:26:29 EDT
Which drop on you running?

Can you please provide the source for the class JS.Obj (or at least the spec of 
any method named put, regardless of the number of parameters)?

BTW: Why are both classes extending the same superclass?
Comment 2 Kent Johnson CLA 2003-08-14 12:54:05 EDT
I can reproduce the error in Eclipse with the Compiler compliance level set to 
1.3 when I define the method put in the superclass JS.Obj. I can also generate 
the same error using javac 1.3.

When I try the case with javac 1.4.1 & Eclipse with the Compiler compliance 
level set to 1.4... both compile without any errors.

I'm closing this PR, reopen it if you can provide a complete testcase that 
shows Eclipse fails against the matching version of javac (or any other 
compiler).