Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java |
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
index d30d11a4fdda2c447bb99bc4c48fd162116501cc..071e337e9a37ad18181ffde9c502fc791d00a285 100644 |
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
@@ -420,7 +420,11 @@ public class Resolver { |
private void resolveVariableStatement(DartVariableStatement node, |
boolean isImplicitlyInitialized) { |
- Type type = resolveType(node.getTypeNode(), inStaticContext(currentMethod)); |
+ Type type = |
+ resolveType( |
+ node.getTypeNode(), |
+ inStaticContext(currentMethod), |
+ TypeErrorCode.NO_SUCH_TYPE_VARIABLE_STATEMENT); |
for (DartVariable variable : node.getVariables()) { |
Elements.setType(resolveVariable(variable, node.getModifiers()), type); |
checkVariableStatement(node, variable, isImplicitlyInitialized); |
@@ -702,7 +706,10 @@ public class Resolver { |
@Override |
public Element visitTypeNode(DartTypeNode x) { |
- return resolveType(x, inStaticContext(currentMethod)).getElement(); |
+ return resolveType( |
+ x, |
+ inStaticContext(currentMethod), |
+ ResolverErrorCode.NO_SUCH_TYPE_IN_EXPRESSION).getElement(); |
} |
@Override |
@@ -883,7 +890,9 @@ public class Resolver { |
Element element = x.getConstructor().accept(getContext().new Selector() { |
// Only 'new' expressions can have a type in a property access. |
@Override public Element visitTypeNode(DartTypeNode type) { |
- return recordType(type, resolveType(type, inStaticContext(currentMethod))); |
+ return recordType( |
+ type, |
+ resolveType(type, inStaticContext(currentMethod), ResolverErrorCode.NO_SUCH_TYPE_NEW)); |
} |
@Override public Element visitPropertyAccess(DartPropertyAccess node) { |