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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart b/pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart
new file mode 100644
index 0000000000000000000000000000000000000000..eb8d3d9148760729031969542164aef3fa1d3edc
--- /dev/null
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=inference*/
+library test;
+
+int intValue = 0;
+num numValue = 0;
+double doubleValue = 0.0;
+
+// There's a circularity between a and b because the type of `int + x` depends
+// on the type of x.
+
+var /*@topType=dynamic*/ a = /*@returnType=num*/ () =>
+ intValue /*@target=num::+*/ + b;
+var /*@topType=dynamic*/ b = a();
+
+// But there's no circularity between c and d because the type of `num + x` is
+// always num.
+
+var /*@topType=() -> num*/ c = /*@returnType=num*/ () =>
+ numValue /*@target=num::+*/ + d;
+var /*@topType=num*/ d = c();
+
+// Similar for double.
+
+var /*@topType=() -> double*/ e = /*@returnType=double*/ () =>
+ doubleValue /*@target=double::+*/ + f;
+var /*@topType=double*/ f = e();
+
+main() {}

Powered by Google App Engine
This is Rietveld 408576698