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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java

Issue 10635004: Redirecting constructors may not have a body. Fail with compile-time error (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/parser/SyntaxTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
index e60331a6e352aedfe82a7555ceb2f0fafc9024e9..65709c496c09d3f88b5d746ebbfe984ad8f2d6f1 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
@@ -615,7 +615,7 @@ public class SyntaxTest extends AbstractParserTest {
" typedef();",
"}"));
}
-
+
/**
* We should be able to parse "static(abstract) => 42" top-level function.
* <p>
@@ -792,4 +792,15 @@ public class SyntaxTest extends AbstractParserTest {
" }",
"}"));
}
+
+ public void testRedirectingConstructorBody() throws Exception {
+ parseUnit("phony_test_redirecting_constructor_body.dart",
+ Joiner.on("\n").join(
+ "class A {",
+ " A.c() {}", // OK
+ " A.d() : this.c();", // OK
+ " A(): this.b() {}", // body not allowed
+ "}"),
+ ParserErrorCode.REDIRECTING_CONSTRUCTOR_CANNOT_HAVE_A_BODY, 4, 18);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698