| 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 bool f() => null; |
| 9 |
| 10 // Even though x, y, and z form a strongly connected component (each depends on |
| 11 // all the others), the circularity is calculated based on the first problematic |
| 12 // dependency of each field. So x's first problematic dependency is y, and y's |
| 13 // first problematic dependency is x; therefore x and y are considered to have a |
| 14 // circularity, and for error recovery their type is set to `dynamic`. |
| 15 // Thereafter, z infers without problems. |
| 16 |
| 17 var /*@topType=dynamic*/ x = /*@returnType=dynamic*/ () => f() ? y : z; |
| 18 var /*@topType=dynamic*/ y = /*@returnType=dynamic*/ () => x; |
| 19 var /*@topType=() -> dynamic*/ z = /*@returnType=dynamic*/ () => x; |
| 20 |
| 21 main() {} |
| OLD | NEW |