OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 class A<T extends Hashable> { | 5 class A<T > { |
Mads Ager (google)
2012/09/27 12:48:27
hep
| |
6 Function closure; | 6 Function closure; |
7 A._(this.closure); | 7 A._(this.closure); |
8 | 8 |
9 factory A() { | 9 factory A() { |
10 return new A._(() => new Set<T>()); | 10 return new A._(() => new Set<T>()); |
11 } | 11 } |
12 | 12 |
13 A.bar() { | 13 A.bar() { |
14 closure = () => new Set<T>(); | 14 closure = () => new Set<T>(); |
15 } | 15 } |
(...skipping 25 matching lines...) Expand all Loading... | |
41 Expect.isTrue(s is Set<int>); | 41 Expect.isTrue(s is Set<int>); |
42 Expect.isFalse(s is Set<double>); | 42 Expect.isFalse(s is Set<double>); |
43 | 43 |
44 s = ((new A<int>.bar()).closure)(); | 44 s = ((new A<int>.bar()).closure)(); |
45 Expect.isTrue(s is Set<int>); | 45 Expect.isTrue(s is Set<int>); |
46 Expect.isFalse(s is Set<double>); | 46 Expect.isFalse(s is Set<double>); |
47 | 47 |
48 A.staticMethod(null); | 48 A.staticMethod(null); |
49 print(A.staticField); | 49 print(A.staticField); |
50 } | 50 } |
OLD | NEW |