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

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

Issue 14985013: Report CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweak 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..c6861bd5a608429455a2b74a8f915a6cf199e7db 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
@@ -245,6 +245,32 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_constWithUndefinedConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A.name();",
+ "}",
+ "f() {",
+ " return const A.name();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_constWithUndefinedConstructorDefault() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A();",
+ "}",
+ "f() {",
+ " return const A();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_defaultValueInFunctionTypeAlias() throws Exception {
Source source = addSource(createSource(//
"typedef F([x]);"));

Powered by Google App Engine
This is Rietveld 408576698