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

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

Issue 15162010: Report CTEC.RECURSIVE_CONSTRUCTOR_REDIRECT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Non-error test and status file tweaks 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 a95c2e042fc48e9e79fd3e542899ba764d3e36f8..c48c77a958f1d60c6769823d713e436eb36ea5fd 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
@@ -2136,6 +2136,29 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_recursiveConstructorRedirect() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A.a() : this.b();",
+ " A.b() : this.a();",
+ "}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+ CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT);
+ verify(source);
+ }
+
+ public void test_recursiveConstructorRedirect_directSelfReference() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A() : this();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT);
+ verify(source);
+ }
+
public void test_recursiveFactoryRedirect() throws Exception {
Source source = addSource(createSource(//
"class A implements B {",

Powered by Google App Engine
This is Rietveld 408576698