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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 14761016: Report CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 6e3baa98a047b4832690cf57fba0a1147f880f71..91bb1b52ab9119f70c09daee953f4eeec01aa425 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -715,6 +715,36 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonConstMapAsExpressionStatement_const() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {",
+ " const {'a' : 0, 'b' : 1};",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_nonConstMapAsExpressionStatement_notExpressionStatement() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {",
+ " var m = {'a' : 0, 'b' : 1};",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_nonConstMapAsExpressionStatement_typeArguments() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {",
+ " <String, int> {'a' : 0, 'b' : 1};",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_nonVoidReturnForOperator_no() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698