| 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 int intValue = 0; |
| 9 num numValue = 0; |
| 10 double doubleValue = 0.0; |
| 11 |
| 12 // There's a circularity between a and b because the type of `int + x` depends |
| 13 // on the type of x. |
| 14 |
| 15 var /*@topType=dynamic*/ a = /*@returnType=num*/ () => |
| 16 intValue /*@target=num::+*/ + b; |
| 17 var /*@topType=dynamic*/ b = a(); |
| 18 |
| 19 // But there's no circularity between c and d because the type of `num + x` is |
| 20 // always num. |
| 21 |
| 22 var /*@topType=() -> num*/ c = /*@returnType=num*/ () => |
| 23 numValue /*@target=num::+*/ + d; |
| 24 var /*@topType=num*/ d = c(); |
| 25 |
| 26 // Similar for double. |
| 27 |
| 28 var /*@topType=() -> double*/ e = /*@returnType=double*/ () => |
| 29 doubleValue /*@target=double::+*/ + f; |
| 30 var /*@topType=double*/ f = e(); |
| 31 |
| 32 main() {} |
| OLD | NEW |