OLD | NEW |
| (Empty) |
1 // Copyright (c) 2016, 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.md file. | |
4 | |
5 import "package:expect/expect.dart"; | |
6 | |
7 class A<N, S, U> { | |
8 final List<U> field; | |
9 | |
10 A(N n, S s) : field = new List<U>() { | |
11 Expect.isTrue(n is N); | |
12 Expect.isTrue(s is S); | |
13 } | |
14 | |
15 A.empty() : field = null{} | |
16 | |
17 factory A.f(S s) { | |
18 Expect.isTrue(s is S); | |
19 return new A.empty(); | |
20 } | |
21 | |
22 const A.c(U u, S s) : field = const [null]; | |
23 | |
24 List<U> get getter { | |
25 return field; | |
26 } | |
27 | |
28 void set setter(S s){} | |
29 } | |
30 | |
31 abstract class J<Aa, B>{} | |
32 | |
33 abstract class I<H, C, K> extends J<C, K> | |
34 { } | |
35 | |
36 | |
37 main() { | |
38 new A<num, double, List>(1, 2.0); | |
39 A a = new A<int, int, int>.f(1); | |
40 const A<int, int, List>.c(const[], 1); | |
41 | |
42 var z = a.getter; | |
43 a.setter = 1; | |
44 } | |
OLD | NEW |