Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartNode.java

Issue 10413041: Propagate variable type in TypeAnalyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/ast/DartNode.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartNode.java b/compiler/java/com/google/dart/compiler/ast/DartNode.java
index 1da622c68b7d78eeedd11d63a202fdf60a53c376..77931caaa159644dfafc15fe0f52237aec53ba69 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartNode.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartNode.java
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -16,8 +16,10 @@ import java.util.List;
* Base class for all Dart AST nodes.
*/
public abstract class DartNode extends AbstractNode {
+ private static final Type dynamicType = Types.newDynamicType();
private DartNode parent;
+ private Type type = dynamicType;
public final String toSource() {
DefaultTextOutput out = new DefaultTextOutput(false);
@@ -34,11 +36,11 @@ public abstract class DartNode extends AbstractNode {
}
public void setType(Type type) {
- throw new UnsupportedOperationException(getClass().getSimpleName());
+ this.type = type;
}
public Type getType() {
- return Types.newDynamicType();
+ return type;
}
@Override
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698