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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java

Issue 10540029: Adds a warning if the + opearator is used with two strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
index c03392f88c9279702ddac2378edbbe140e111c43..0c4a5001d1f6ba0eb7911734e3d969b7dcd28459 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
@@ -11,6 +11,8 @@ import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartExprStmt;
import com.google.dart.compiler.ast.DartExpression;
+import com.google.dart.compiler.ast.DartField;
+import com.google.dart.compiler.ast.DartFieldDefinition;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartNode;
@@ -313,6 +315,12 @@ public abstract class TypeAnalyzerTestCase extends TypeTestCase {
String className = classElement.getName();
coreElements.put(className, classElement);
classes.put(className, classElement);
+ } else if (node instanceof DartFieldDefinition) {
+ DartFieldDefinition fieldNode = (DartFieldDefinition) node;
+ for (DartField field : fieldNode.getFields()) {
+ Element fieldElement = field.getElement();
+ coreElements.put(fieldElement.getName(), fieldElement);
+ }
} else {
DartFunctionTypeAlias alias = (DartFunctionTypeAlias) node;
FunctionAliasElement element = alias.getElement();

Powered by Google App Engine
This is Rietveld 408576698