OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 typedef void Func(); | 5 typedef void Func(); |
6 | 6 |
7 class C<T> { | 7 class C<T> { |
8 test() { | 8 test() { |
9 // Note: we cannot write a type literal with generic type arguments. For | 9 // Note: we cannot write a type literal with generic type arguments. For |
10 // example, `C<String>` isn't a valid expression. | 10 // example, `C<String>` isn't a valid expression. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 C += 42; | 83 C += 42; |
84 use(C += 42); | 84 use(C += 42); |
85 dynamic += 42; | 85 dynamic += 42; |
86 use(dynamic += 42); | 86 use(dynamic += 42); |
87 T += 42; | 87 T += 42; |
88 use(T += 42); | 88 use(T += 42); |
89 Func += 42; | 89 Func += 42; |
90 use(Func += 42); | 90 use(Func += 42); |
91 | 91 |
92 C-= 42; | 92 C -= 42; |
93 use(C-= 42); | 93 use(C -= 42); |
94 dynamic-= 42; | 94 dynamic -= 42; |
95 use(dynamic-= 42); | 95 use(dynamic -= 42); |
96 T-= 42; | 96 T -= 42; |
97 use(T-= 42); | 97 use(T -= 42); |
98 Func-= 42; | 98 Func -= 42; |
99 use(Func-= 42); | 99 use(Func -= 42); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 use(x) { | 103 use(x) { |
104 if (x == new DateTime.now().millisecondsSinceEpoch) throw "Shouldn't happen"; | 104 if (x == new DateTime.now().millisecondsSinceEpoch) throw "Shouldn't happen"; |
105 } | 105 } |
106 | 106 |
107 main() { | 107 main() { |
108 new C().test(); | 108 new C().test(); |
109 } | 109 } |
OLD | NEW |