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

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

Issue 15083002: Report CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 2ba64afc8e59e6ec1c79a7694769863cd505ef4c..ee7d76c5cf6127a4040f37ff82de50569760829a 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
@@ -215,15 +215,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_invalidConstructorName() throws Exception {
- Source source = addSource(createSource(//
- // TODO
- ));
- resolve(source);
- assertErrors(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME);
- verify(source);
- }
-
public void fail_invalidFactoryNameNotAClass() throws Exception {
Source source = addSource(createSource(//
// TODO
@@ -1574,6 +1565,16 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_invalidConstructorName_notEnclosingClassName() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " B() : super();", // add ": super()" to force parsing as constructor
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME);
+ // no verify() call, "B" is not resolved
+ }
+
public void test_invalidOverrideNamed() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698