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); |
+ } |
} |