Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java')
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java
index 8619ab0e..fbe326eb 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -75,12 +75,23 @@ public class ObjectLiteral extends Expression implements IObjectLiteral {
public TypeBinding resolveType(BlockScope scope) {
this.constant=Constant.NotAConstant;
- if (this.fields!=null)
+ if (this.fields!=null) {
for (int i = 0; i < this.fields.length; i++) {
this.fields[i].resolveType(scope);
}
- if(inferredType != null && inferredType.binding != null)
- return inferredType.binding;
+ }
+
+ if(inferredType != null) {
+ //build the type if it is not yet built
+ if(inferredType.binding == null) {
+ inferredType.resolveType(scope, this);
+ }
+
+ if(inferredType.binding != null) {
+ return inferredType.binding;
+ }
+ }
+
return TypeBinding.ANY;
}

Back to the top