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

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

Issue 14855015: Report StaticWarningCode.NEW_WITH_NON_TYPE and CompileTimeErrorCode.CONST_WITH_NON_TYPE (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 2fc9c9585b180f7a60ec5900d2de8d2447322f5a..ae7fd6a1f42fae7ddedf8723e3a961a0393418f4 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -40,17 +40,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_constWithNonType() throws Exception {
- Source source = addSource(createSource(//
- "int A;",
- "f() {",
- " return const A();",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.CONST_WITH_NON_TYPE);
- verify(source);
- }
-
public void fail_constWithTypeParameters() throws Exception {
Source source = addSource(createSource(//
// TODO
@@ -961,6 +950,17 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constWithNonType() throws Exception {
+ Source source = addSource(createSource(//
+ "int A;",
+ "f() {",
+ " return const A();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_WITH_NON_TYPE);
+ verify(source);
+ }
+
public void test_defaultValueInFunctionTypeAlias() throws Exception {
Source source = addSource(createSource(//
"typedef F([x = 0]);"));
@@ -1978,6 +1978,16 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_undefinedClass_const() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {",
+ " return const A();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.UNDEFINED_CLASS);
+ verify(source);
+ }
+
public void test_uriDoesNotExist_export() throws Exception {
Source source = addSource(createSource(//
"export 'unknown.dart';"));

Powered by Google App Engine
This is Rietveld 408576698