Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: pkg/front_end/testcases/inference_new/strongly_connected_component.dart

Issue 2942623004: Fuse top level type inference with dependency generation. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698