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

Side by Side Diff: pkg/front_end/testcases/inference/infer_field_static.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 dynamic f() => null;
9
10 abstract class A {
11 static int get x => 0;
12 }
13
14 // Even though B extends A, A.x and B.x are unrelated because they're static.
15 // So B.x doesn't inherit A.x's type.
16
17 class B extends A {
18 static var /*@topType=dynamic*/ x = f();
19 }
20
21 // Similar with C.x. It is not even eligible for inference since it's static
22 // and has no initializer.
23
24 class C extends A {
25 static var x;
26 }
27
28 main() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698