Reviewers: Brian Wilkerson, jwren,
Description:
Remove CTEC.MIXIN_OF_NON_MIXIN and MIXIN_WITH_NON_CLASS_SUPERCLASS.
I believe these codes are covered by the more specific
MIXIN_REFERENCES_SUPER,
MIXIN_DECLARES_CONSTRUCTOR and MIXIN_INHERITS_FROM_NOT_OBJECT.
R=
brianwi...@google.com,
jw...@google.com
BUG=
Please review this at
https://codereview.chromium.org/15029010/
SVN Base:
https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Affected files:
M
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
M
editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
Index:
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
diff --git
a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
index
6e7b596f3491896b20f2cc55fc50c000afe439b5..e5623c0097578bbc52f41ef0166ae8220ce7c9d4
100644
---
a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
+++
b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
@@ -606,23 +606,11 @@ public enum CompileTimeErrorCode implements ErrorCode
{
MIXIN_OF_NON_CLASS("Classes can only mixin other classes"),
/**
- * 9.1 Mixin Application: If <i>M</i> is a class, it is a compile time
error if a well formed
- * mixin cannot be derived from <i>M</i>.
- */
- MIXIN_OF_NON_MIXIN(""), // TODO(brianwilkerson) This might be covered by
more specific errors.
-
- /**
* 9 Mixins: It is a compile-time error if a declared or derived mixin
refers to super.
*/
MIXIN_REFERENCES_SUPER("The class '%s' cannot be used as a mixin because
it references 'super'"),
/**
- * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does
not denote a class available
- * in the immediately enclosing scope.
- */
- MIXIN_WITH_NON_CLASS_SUPERCLASS(""),
-
- /**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative
constructor. Then <i>k</i> may
* include at most one superinitializer in its initializer list or a
compile time error occurs.
*/
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
24090c330ac0f38bbc478e6e6602f5117fcfd90e..764e30fa8965eae5c9dcae4abac8e8cd7ab709d9
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
@@ -187,36 +187,6 @@ public class CompileTimeErrorCodeTest extends
ResolverTestCase {
verify(source);
}
- public void fail_mixinOfNonClass() throws Exception {
- // TODO(brianwilkerson) Compare with MIXIN_WITH_NON_CLASS_SUPERCLASS.
- Source source = addSource(createSource(//
- "var A;",
- "class B extends Object mixin A {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
- verify(source);
- }
-
- public void fail_mixinOfNonMixin() throws Exception {
- // TODO(brianwilkerson) This might be covered by more specific errors.
- Source source = addSource(createSource(//
- // TODO
- ));
- resolve(source);
- assertErrors(CompileTimeErrorCode.MIXIN_OF_NON_MIXIN);
- verify(source);
- }
-
- public void fail_mixinWithNonClassSuperclass() throws Exception {
- // TODO(brianwilkerson) Compare with MIXIN_OF_NON_CLASS.
- Source source = addSource(createSource(//
- "int A;",
- "class B extends Object mixin A {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS);
- verify(source);
- }
-
public void fail_nonConstantDefaultValue_named() throws Exception {
Source source = addSource(createSource(//
"f({x : 2 + 3}) {}"));