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

Unified Diff: pkg/front_end/testcases/inference/call_corner_cases.dart

Issue 2928613003: Fix corner cases of type inference with implicit references to `.call`. (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/call_corner_cases.dart
diff --git a/pkg/front_end/testcases/inference/call_corner_cases.dart b/pkg/front_end/testcases/inference/call_corner_cases.dart
new file mode 100644
index 0000000000000000000000000000000000000000..694c620fac3039e4bba49faf534fa446d37655c2
--- /dev/null
+++ b/pkg/front_end/testcases/inference/call_corner_cases.dart
@@ -0,0 +1,30 @@
+// 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;
+
+class A {
+ int call() => 0;
+}
+
+class B {
+ A get call => new A();
+}
+
+class D {
+ A fieldA = new A();
+ A get getA => new A();
+ B fieldB = new B();
+ B get getB => new B();
+}
+
+main() {
+ var /*@type=int*/ callA = new A() /*@target=A::call*/ ();
+ var /*@type=dynamic*/ callB = new B() /*@target=B::call*/ ();
+ var /*@type=int*/ callFieldA = new D(). /*@target=D::fieldA*/ fieldA();
+ var /*@type=int*/ callGetA = new D(). /*@target=D::getA*/ getA();
+ var /*@type=dynamic*/ callFieldB = new D(). /*@target=D::fieldB*/ fieldB();
+ var /*@type=dynamic*/ callGetB = new D(). /*@target=D::getB*/ getB();
+}
« no previous file with comments | « pkg/front_end/test/fasta/kompile.status ('k') | pkg/front_end/testcases/inference/call_corner_cases.dart.direct.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698