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

Unified Diff: tests/language/mixin_illegal_cycles_test.dart

Issue 12041018: Disallow cyclic mixins. (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: tests/language/mixin_illegal_cycles_test.dart
diff --git a/tests/language/mixin_illegal_cycles_test.dart b/tests/language/mixin_illegal_cycles_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5829245831c82fbba4a9ec8c24942d7c8eca6afa
--- /dev/null
+++ b/tests/language/mixin_illegal_cycles_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class M { }
+class M0 extends Object with M0 { } /// 01: compile-time error
+typedef M1 = Object with M1; /// 02: compile-time error
+
+typedef M2 = Object with M3; /// 03: compile-time error
+typedef M3 = Object with M2; /// 03: continued
+
+typedef M4 = Object with M5; /// 04: compile-time error
+typedef M5 = Object with M6; /// 04: continued
+typedef M6 = Object with M4; /// 04: continued
+
+class M7 extends Object with M8 { } /// 05: compile-time error
+class M8 extends Object with M7 { } /// 05: continued
+
+main() {
+ new M0(); /// 01: continued
+
+ new M1(); /// 02: continued
+
+ new M2(); /// 03: continued
+ new M3(); /// 03: continued
+
+ new M4(); /// 04: continued
+ new M5(); /// 04: continued
+ new M6(); /// 04: continued
+
+ new M7(); /// 05: continued
+ new M8(); /// 05: continued
+}

Powered by Google App Engine
This is Rietveld 408576698