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 // Regression test for | 5 // Regression test for |
6 // http://code.google.com/p/dart/issues/detail?id=9050. | 6 // http://code.google.com/p/dart/issues/detail?id=9050. |
7 | 7 |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 | 9 |
10 class A<T> { | 10 class A<T> {} |
11 } | |
12 | 11 |
13 class B<T> { | 12 class B<T> { |
14 var _copy; | 13 var _copy; |
15 B() { | 14 B() { |
16 // We used to not register the dependency between List and B. | 15 // We used to not register the dependency between List and B. |
17 _copy = new List<A<T>>(); | 16 _copy = new List<A<T>>(); |
18 } | 17 } |
19 } | 18 } |
20 | 19 |
21 main() { | 20 main() { |
22 var a = new B(); | 21 var a = new B(); |
23 Expect.isFalse(a._copy is List<int>); | 22 Expect.isFalse(a._copy is List<int>); |
24 Expect.isTrue(a._copy is List<A>); | 23 Expect.isTrue(a._copy is List<A>); |
25 Expect.isTrue(a._copy is List<A<int>>); | 24 Expect.isTrue(a._copy is List<A<int>>); |
26 | 25 |
27 a = new B<String>(); | 26 a = new B<String>(); |
28 Expect.isFalse(a._copy is List<String>); | 27 Expect.isFalse(a._copy is List<String>); |
29 Expect.isTrue(a._copy is List<A>); | 28 Expect.isTrue(a._copy is List<A>); |
30 Expect.isTrue(a._copy is List<A<String>>); | 29 Expect.isTrue(a._copy is List<A<String>>); |
31 Expect.isTrue(a._copy is List<A<Object>>); | 30 Expect.isTrue(a._copy is List<A<Object>>); |
32 Expect.isFalse(a._copy is List<A<int>>); | 31 Expect.isFalse(a._copy is List<A<int>>); |
33 } | 32 } |
OLD | NEW |