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

Side by Side Diff: tests/language/mixin_super_bound_test.dart

Issue 1232613005: Allow super calls in mixins (for now behind a --supermixin flag). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « tests/language/mixin_super_bound2_test.dart ('k') | tests/language/mixin_super_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6
7 bool inCheckedMode() {
8 try {
9 var i = 42;
10 String s = i;
11 } on TypeError catch (e) {
12 return true;
13 }
14 return false;
15 }
16
17 class M<U extends V, V> { }
18
19 class N<U, V extends U> { }
20
21 class S<T> { }
22
23 class MNA<U, V, W> extends S<List<U>> with M<V, U>, N<List<W>, List<W>> { }
hausner 2015/07/17 16:55:22 A short comment would be helpful, explaining what
regis 2015/07/17 18:29:51 Done here and in the other test.
24
25 class MNA2<U, V, W> = S<List<U>> with M<V, U>, N<List<W>, List<W>>;
26
27 main() {
28 new MNA<num, int, bool>();
29 new MNA2<num, int, bool>();
30 if (inCheckedMode()) {
31 Expect.throws(() => new MNA<int, num, bool>(), (e) => e is TypeError);
32 Expect.throws(() => new MNA2<int, num, bool>(), (e) => e is TypeError);
33 } else {
34 new MNA<int, num, bool>();
35 new MNA2<int, num, bool>();
36 }
37 }
38
OLDNEW
« no previous file with comments | « tests/language/mixin_super_bound2_test.dart ('k') | tests/language/mixin_super_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698