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 abstract class I<E> { | 8 abstract class I<E> { |
9 String m(a, String f(v, E e)); | 9 String m(/*@topType=dynamic*/ a, String f(v, E e)); |
10 } | 10 } |
11 | 11 |
12 abstract class A<E> implements I<E> { | 12 abstract class A<E> implements I<E> { |
13 const A(); | 13 const A(); |
14 String m(a, String f(v, E e)); | 14 String m(/*@topType=dynamic*/ a, String f(v, E e)); |
15 } | 15 } |
16 | 16 |
17 abstract class M { | 17 abstract class M { |
18 final int y = 0; | 18 final int y = 0; |
19 } | 19 } |
20 | 20 |
21 class B<E> extends A<E> implements M { | 21 class B<E> extends A<E> implements M { |
22 const B(); | 22 const B(); |
23 int get y => 0; | 23 int get y => 0; |
24 | 24 |
25 m(a, f(v, E e)) {} | 25 /*@topType=String*/ m(/*@topType=dynamic*/ a, f(v, E e)) {} |
26 } | 26 } |
27 | 27 |
28 foo() { | 28 foo() { |
29 int y = /*error:INVALID_ASSIGNMENT*/ new /*@typeArgs=dynamic*/ B() | 29 int y = /*error:INVALID_ASSIGNMENT*/ new /*@typeArgs=dynamic*/ B() |
30 . /*@target=B::m*/ m(null, null); | 30 . /*@target=B::m*/ m(null, null); |
31 String z = new /*@typeArgs=dynamic*/ B(). /*@target=B::m*/ m(null, null); | 31 String z = new /*@typeArgs=dynamic*/ B(). /*@target=B::m*/ m(null, null); |
32 } | 32 } |
33 | 33 |
34 main() {} | 34 main() {} |
OLD | NEW |