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

Side by Side Diff: pkg/front_end/testcases/inference/infer_field_override_multiple.dart

Issue 2938423003: Implement override-based inference of instance fields. (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 abstract class A {
9 int get x;
10 }
11
12 abstract class B {
13 int get x;
14 }
15
16 abstract class C {
17 num get x;
18 }
19
20 abstract class D {
21 double get x;
22 }
23
24 // Superclasses have a consistent type for `x` so inferrence succeeds.
25 class E extends A implements B {
26 var /*@topType=int*/ x;
27 }
28
29 // Superclasses don't have a consistent type for `x` so inference fails, even if
30 // the types are related.
31 class F extends A implements C {
32 var /*@topType=dynamic*/ x;
33 }
34
35 class G extends A implements D {
36 var /*@topType=dynamic*/ x;
37 }
38
39 class H extends C implements D {
40 var /*@topType=dynamic*/ x;
41 }
42
43 main() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698