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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 12048003: Issue 8025. Disallow mixing in classes that have constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 5d4988daac37a57d9f1605df7ead58bc6271dead..d1159b3abf49a8cb47be9cd1b9eda2731fa703c4 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -4831,10 +4831,10 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(ResolverErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR, 5, 9, 17),
+ errEx(TypeErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR, 5, 9, 17),
errEx(TypeErrorCode.NO_SUCH_TYPE, 6, 7, 1),
errEx(TypeErrorCode.NO_SUCH_TYPE, 7, 7, 1),
- errEx(ResolverErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR, 7, 9, 17));
+ errEx(TypeErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR, 7, 9, 17));
}
/**
@@ -6281,6 +6281,23 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=8025
+ */
+ public void test_mixin_withConstructor() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class M { M(); }",
+ "typedef A = Object with M;",
+ "class B extends Object with M {}",
+ "");
+ assertErrors(
+ result.getErrors(),
+ errEx(ResolverErrorCode.CANNOT_MIXIN_CLASS_WITH_CONSTRUCTOR, 3, 25, 1),
+ errEx(ResolverErrorCode.CANNOT_MIXIN_CLASS_WITH_CONSTRUCTOR, 4, 29, 1));
+ }
+
+ /**
* 20130122. Currently it is not allowed to have mixin with superclass other than Object.
*/
public void _test_mixin_dontAddSupertypes() throws Exception {

Powered by Google App Engine
This is Rietveld 408576698