OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /*@testedFeatures=inference*/ | 5 /*@testedFeatures=inference*/ |
6 library test; | 6 library test; |
7 | 7 |
8 import 'infer_types_on_generic_instantiations_in_library_cycle_a.dart'; | 8 import 'infer_types_on_generic_instantiations_in_library_cycle_a.dart'; |
9 | 9 |
10 abstract class A<E> implements I<E> { | 10 abstract class A<E> implements I<E> { |
11 const A(); | 11 const A(); |
12 | 12 |
13 final E value = null; | 13 final E value = null; |
14 } | 14 } |
15 | 15 |
16 abstract class M { | 16 abstract class M { |
17 final int y = 0; | 17 final int y = 0; |
18 } | 18 } |
19 | 19 |
20 class B<E> extends A<E> implements M { | 20 class B<E> extends A<E> implements M { |
21 const B(); | 21 const B(); |
22 int get y => 0; | 22 int get y => 0; |
23 | 23 |
24 m(a, f(v, int e)) {} | 24 /*@topType=A<B::E>*/ m(/*@topType=dynamic*/ a, f(v, int e)) {} |
25 } | 25 } |
26 | 26 |
27 foo() { | 27 foo() { |
28 int y = /*error:INVALID_ASSIGNMENT*/ new B<String>() | 28 int y = /*error:INVALID_ASSIGNMENT*/ new B<String>() |
29 . /*@target=B::m*/ m(null, null) | 29 . /*@target=B::m*/ m(null, null) |
30 . /*@target=A::value*/ value; | 30 . /*@target=A::value*/ value; |
31 String z = new B<String>() | 31 String z = new B<String>() |
32 . /*@target=B::m*/ m(null, null) | 32 . /*@target=B::m*/ m(null, null) |
33 . /*@target=A::value*/ value; | 33 . /*@target=A::value*/ value; |
34 } | 34 } |
35 | 35 |
36 main() {} | 36 main() {} |
OLD | NEW |