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

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

Issue 14773018: Report MIXIN_INHERITS_FROM_NOT_OBJECT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks 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 45cf1b9e9903052154f6475d1776ca50e2f67ffc..4ba39dcddbb9d40ce4140cc8943870b0658a1a70 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
@@ -274,16 +274,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_mixinInheritsFromNotObject() throws Exception {
- Source source = addSource(createSource(//
- "class A {}",
- "class B extends A {}",
- "class C extends Object mixin B {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT);
- verify(source);
- }
-
public void fail_mixinOfNonClass() throws Exception {
// TODO(brianwilkerson) Compare with MIXIN_WITH_NON_CLASS_SUPERCLASS.
Source source = addSource(createSource(//
@@ -1746,6 +1736,46 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_mixinInheritsFromNotObject_classDeclaration_extends() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {}",
+ "class B extends A {}",
+ "class C extends Object with B {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT);
+ verify(source);
+ }
+
+ public void test_mixinInheritsFromNotObject_classDeclaration_with() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {}",
+ "class B extends Object with A {}",
+ "class C extends Object with B {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT);
+ verify(source);
+ }
+
+ public void test_mixinInheritsFromNotObject_typedef_extends() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {}",
+ "class B extends A {}",
+ "typedef C = Object with B {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT);
+ verify(source);
+ }
+
+ public void test_mixinInheritsFromNotObject_typedef_with() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {}",
+ "class B extends Object with A {}",
+ "typedef C = Object with B {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT);
+ verify(source);
+ }
+
public void test_mixinOfNonClass_class() throws Exception {
Source source = addSource(createSource(//
"int A;",

Powered by Google App Engine
This is Rietveld 408576698