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

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

Issue 12038035: Issue 8022. Report compile-time error when using mixing with not Object superclass. (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 40bff86f49190de183fdba74f25040524ee90d53..5d4988daac37a57d9f1605df7ead58bc6271dead 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -6262,7 +6262,28 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
assertErrors(result.getErrors());
}
- public void test_mixin_dontAddSupertypes() throws Exception {
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=8022
+ */
+ public void test_mixin_notObjectSuperclass() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {}",
+ "class B extends A {}",
+ "typedef C = Object with B;",
+ "class D extends Object with B {}",
+ "");
+ assertErrors(
+ result.getErrors(),
+ errEx(ResolverErrorCode.ONLY_OBJECT_MIXIN_SUPERCLASS, 4, 25, 1),
+ errEx(ResolverErrorCode.ONLY_OBJECT_MIXIN_SUPERCLASS, 5, 29, 1));
+ }
+
+ /**
+ * 20130122. Currently it is not allowed to have mixin with superclass other than Object.
+ */
+ public void _test_mixin_dontAddSupertypes() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
@@ -6312,7 +6333,10 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, 15, 5, 7));
}
- public void test_mixin_dontAddSupertypes3() throws Exception {
+ /**
+ * 20130122. Currently it is not allowed to have mixin with superclass other than Object.
+ */
+ public void _test_mixin_dontAddSupertypes3() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
@@ -6331,7 +6355,10 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 10, 7, 1));
}
- public void test_mixin_dontLookSupertype_getter() throws Exception {
+ /**
+ * 20130122. Currently it is not allowed to have mixin with superclass other than Object.
+ */
+ public void _test_mixin_dontLookSupertype_getter() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
@@ -6353,7 +6380,10 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.NOT_A_MEMBER_OF, 13, 11, 2));
}
- public void test_mixin_dontLookSupertype_setter() throws Exception {
+ /**
+ * 20130122. Currently it is not allowed to have mixin with superclass other than Object.
+ */
+ public void _test_mixin_dontLookSupertype_setter() throws Exception {
AnalyzeLibraryResult result = analyzeLibrary(
"// filler filler filler filler filler filler filler filler filler filler",
"class A {",
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/SupertypeResolver.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698