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

Unified Diff: tests/language/mixin_black_listed_test.dart

Issue 25844002: Check mixin of black-listed types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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_black_listed_test.dart
diff --git a/tests/language/mixin_black_listed_test.dart b/tests/language/mixin_black_listed_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..809274be81fd6e793517516accad97ff03067560
--- /dev/null
+++ b/tests/language/mixin_black_listed_test.dart
@@ -0,0 +1,52 @@
+// 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.
+
+// Check mixin of black-listed types.
+
+import 'package:expect/expect.dart';
karlklose 2013/10/03 07:50:01 Tests for num are missing.
Johnni Winther 2013/10/03 08:00:26 It is in 05.
+
+class C {}
+class D {}
+
+class C1 extends Object
+with String /// 01: compile-time error
+{}
+
+class D1 extends Object with C
+, Null /// 02: compile-time error
+{}
+
+class E1 extends Object with
+int, /// 03: compile-time error
+C {}
+
+class F1 extends Object with C
+, double /// 04: compile-time error
+, D {}
+
+typedef C2 = Object with num; /// 05: compile-time error
+
+typedef D2 = Object with C
+, bool /// 06: compile-time error
+;
+
+typedef E2 = Object with
+String, /// 07: compile-time error
+C;
+
+typedef F2 = Object with C,
+dynamic, /// 08: compile-time error
+D;
+
+
+main() {
+ Expect.isNotNull(new C1());
+ Expect.isNotNull(new D1());
+ Expect.isNotNull(new E1());
+ Expect.isNotNull(new F1());
+ Expect.isNotNull(new C2()); /// 05: continued
+ Expect.isNotNull(new D2());
+ Expect.isNotNull(new E2());
+ Expect.isNotNull(new F2());
+}

Powered by Google App Engine
This is Rietveld 408576698