OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /*@testedFeatures=inference*/ |
| 6 library test; |
| 7 |
| 8 dynamic f() => null; |
| 9 |
| 10 abstract class A { |
| 11 static int get x => 0; |
| 12 } |
| 13 |
| 14 // Even though B extends A, A.x and B.x are unrelated because they're static. |
| 15 // So B.x doesn't inherit A.x's type. |
| 16 |
| 17 class B extends A { |
| 18 static var /*@topType=dynamic*/ x = f(); |
| 19 } |
| 20 |
| 21 // Similar with C.x. It is not even eligible for inference since it's static |
| 22 // and has no initializer. |
| 23 |
| 24 class C extends A { |
| 25 static var x; |
| 26 } |
| 27 |
| 28 main() {} |
OLD | NEW |