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

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

Issue 14655016: Report CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for review comments 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 ded12e125cd4dcf44c1147be7c9fbbc7cf174741..1e8a2acfd3f2a5c3a08f280a23a801b90c1ea54b 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
@@ -1724,6 +1724,28 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
// no test because indistinguishable from constructor
}
+ public void test_mixinDeclaresConstructor_classDeclaration() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A() {}",
+ "}",
+ "class B extends Object with A {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR);
+ verify(source);
+ }
+
+ public void test_mixinDeclaresConstructor_typedef() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A() {}",
+ "}",
+ "typedef B = Object with A;"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR);
+ verify(source);
+ }
+
public void test_mixinOfNonClass_class() throws Exception {
Source source = addSource(createSource(//
"int A;",

Powered by Google App Engine
This is Rietveld 408576698