OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "dart:mirrors"; | 5 import "dart:mirrors"; |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 class G<A extends int, B extends String> { | 8 class G<A extends int, B extends String> { |
9 G(); | 9 G(); |
10 factory G.swap() = G<B, A>; | 10 factory G.swap() = G<B,A>; /// 00: static type warning |
11 | 11 factory G.retain() = G<A,B>; |
12 /// 00: static type warning | |
13 factory G.retain() = G<A, B>; | |
14 } | 12 } |
15 | 13 |
16 main() { | 14 main() { |
17 ClassMirror cm = reflect(new G<int, String>()).type; | 15 ClassMirror cm = reflect(new G<int, String>()).type; |
18 | 16 |
19 Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int, String>); | 17 Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int,String>); |
20 | 18 |
21 Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String, int>); | 19 Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String,int>); /// 00:
dynamic type error |
22 | |
23 /// 00: dynamic type error | |
24 } | 20 } |
OLD | NEW |