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 import "package:expect/expect.dart"; | |
6 | |
7 class A<T> { | 5 class A<T> { |
8 Function closure; | 6 Function closure; |
9 A._(this.closure); | 7 A._(this.closure); |
10 | 8 |
11 factory A() { | 9 factory A() { |
12 return new A._(() => new Set<T>()); | 10 return new A._(() => new Set<T>()); |
13 } | 11 } |
14 | 12 |
15 A.bar() { | 13 A.bar() { |
16 closure = () => new Set<T>(); | 14 closure = () => new Set<T>(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 s = ((new A<int>.bar()).closure)(); | 55 s = ((new A<int>.bar()).closure)(); |
58 Expect.isTrue(s is Set<int>); | 56 Expect.isTrue(s is Set<int>); |
59 Expect.isFalse(s is Set<double>); | 57 Expect.isFalse(s is Set<double>); |
60 | 58 |
61 A.staticMethod("not_null"); | 59 A.staticMethod("not_null"); |
62 print(A.staticField); | 60 print(A.staticField); |
63 | 61 |
64 A.staticMethod2(null); | 62 A.staticMethod2(null); |
65 print(A.staticField2); | 63 print(A.staticField2); |
66 } | 64 } |
OLD | NEW |