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

Side by Side Diff: pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.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 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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698