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

Unified Diff: tests/language/mixin_illegal_syntax_test.dart

Issue 11953012: Add more mixin tests and start rejecting illegal syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files. 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_syntax_test.dart
diff --git a/tests/language/mixin_illegal_syntax_test.dart b/tests/language/mixin_illegal_syntax_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..76e11f33725b392fa8af1982ecf26ea5513340d6
--- /dev/null
+++ b/tests/language/mixin_illegal_syntax_test.dart
@@ -0,0 +1,45 @@
+// 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 S { }
+class M { }
+
+typedef T0 = abstract S with M;
+typedef T1 = final S with M; /// 01: compile-time error
+typedef T2 = var S with M; /// 02: compile-time error
+typedef T3 = const S with M; /// 03: compile-time error
+typedef T4 = static S with M; /// 04: compile-time error
+typedef T5 = external S with M; /// 05: compile-time error
+
+class C0 extends abstract S with M { } /// 06: compile-time error
+class C1 extends final S with M { } /// 07: compile-time error
+class C2 extends var S with M { } /// 08: compile-time error
+class C3 extends const S with M { } /// 09: compile-time error
+class C4 extends static S with M { } /// 10: compile-time error
+class C5 extends external S with M { } /// 11: compile-time error
+
+class D0 extends S with M
+ implements M /// 12: compile-time error
+ implements M { }
+
+class D1 extends T0 { }
+
+main() {
+ new T0(); /// 13: static type warning, runtime error
+ new T1(); /// 01: continued
+ new T2(); /// 02: continued
+ new T3(); /// 03: continued
+ new T4(); /// 04: continued
+ new T5(); /// 05: continued
+
+ new C0(); /// 06: continued
+ new C1(); /// 07: continued
+ new C2(); /// 08: continued
+ new C3(); /// 09: continued
+ new C4(); /// 10: continued
+ new C5(); /// 11: continued
+
+ new D0(); /// 12: continued
+ new D1();
+}

Powered by Google App Engine
This is Rietveld 408576698