Bug 10676

Summary: StringLiteral.resolveTypeBinding() return null
Product: [Eclipse Project] JDT Reporter: Luc Bourlier <eclipse>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows NT   
Whiteboard:

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.