Bug 24347 - AST: Resolve on type name qualifier
Summary: AST: Resolve on type name qualifier
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-03 05:55 EDT by Martin Aeschlimann CLA
Modified: 2003-03-23 12:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2002-10-03 05:55:56 EDT
20021001
Quick Fix issue, I hope you can help:

public class A {
  void foo() {
    A.NewClass c;
  }
}
NewClass is not existing. I get the binding of A to find out if A is a class or 
package so I can suggest to add a new inner class.
Unfortunatly, no binding is returned for A. Would it be possible to get the 
binding even in this incomplete code case? I'm hoping because in the editor 
code resolve on A works.
Comment 1 Olivier Thomann CLA 2002-10-03 08:43:42 EDT
I don't have the compiler bindings in this case. The binding for A.NewClass is a
problem binding. I don't have any information on the binding for A. So there is
no much I can do in this case.
Comment 2 Olivier Thomann CLA 2002-10-03 09:13:05 EDT
The editor code resolve is a different mecanism from parsing and resoluting binding.
Ok to close as WONTFIX?
Comment 3 Martin Aeschlimann CLA 2002-10-03 09:28:28 EDT
Maybe Philippe can help? It would be really helpful to have. I'm currently 
using 'code resolve' to resolve.
Note that with qualified field references, bindings are accessible
e.g. A.i= 1;
A has a binding


Comment 4 Olivier Thomann CLA 2002-10-03 09:38:00 EDT
My point is that your first test case cannot be done using DOM/AST. If you want 
to use code resolve, it is fine for me, but I have no way to fix it using 
DOM/AST. We might not retrieve any bindings when the compilation unit contains 
errors. Changing anything in the compiler ast node in order to fix this might 
have really bad side effects on binding resolution for the compiler. So I would 
say this is not an option.
Don't try to use the DOM/AST API for a purpose for which it wasn't designed. 
Your case A.i doesn't mean we can get a binding for A.NewClass. When your have 
errors in a CU, it is really difficult to specify what bindings you can get. 
Using "code resolve" seems to be the solution in this case. DOM/AST won't help 
you.
Comment 5 Olivier Thomann CLA 2002-10-03 11:46:26 EDT
I don't want to add an extra binding resolution to simply solve this case.
Close as WONTFIX.