OLD | NEW |
---|---|
(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 | |
OLD | NEW |