Bug 10676 - StringLiteral.resolveTypeBinding() return null
Summary: StringLiteral.resolveTypeBinding() return null
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-04 10:18 EST by Luc Bourlier CLA
Modified: 2002-03-13 11:26 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luc Bourlier CLA 2002-03-04 10:18:16 EST
Summary says it all. StringLiteral.resolveTypeBinding() returns null. It should
return a valid ITypeBinding.

Suggest adding the following code to DefaultBindingResolver.resolveExpressionType:

} else if (expression instanceof StringLiteral) {
  Literal literal = (Literal) this.newAstToOldAst.get(expression);
  return
this.getTypeBinding(literal.literalType(this.retrieveEnclosingScope(expression)));
Comment 1 Philipe Mulet CLA 2002-03-04 11:55:08 EST
Olivier - is it also true for other literals ?
Comment 2 Olivier Thomann CLA 2002-03-04 12:04:57 EST
I simply forgot the string literal. I didn't resolve the issue of reusing the 
scope when I wrote that code. Now this is working fine calling 
retrieveEnclosingScope(...).  The suggestion looks good.
Should be fixed for next drop.
Comment 3 Olivier Thomann CLA 2002-03-04 13:15:30 EST
Fixed and released in HEAD.