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

Side by Side Diff: pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.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 class A {
9 T f<T>(T t) => t;
10 int g(dynamic i) => 0;
11 }
12
13 var /*@topType=A*/ a = new A();
14
15 // There's a circularity between b and c because a.f is generic, so the type of
16 // c is required to infer b, and vice versa.
17
18 var /*@topType=() -> dynamic*/ b = /*@returnType=() -> dynamic*/ () =>
19 a. /*@typeArgs=() -> dynamic*/ /*@target=A::f*/ f(c);
20 var /*@topType=() -> dynamic*/ c = /*@returnType=() -> dynamic*/ () =>
21 a. /*@typeArgs=() -> dynamic*/ /*@target=A::f*/ f(b);
22
23 // e's use of a.g breaks the circularity, because a.g is not generic, therefore
24 // the type of e does not depend on the type of d.
25
26 var /*@topType=() -> dynamic*/ d = /*@returnType=() -> int*/ () =>
27 a. /*@typeArgs=() -> int*/ /*@target=A::f*/ f(e);
28 var /*@topType=() -> int*/ e = /*@returnType=int*/ () =>
29 a. /*@target=A::g*/ g(d);
30
31 main() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698