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

Side by Side Diff: test/rules/overriden_field.dart

Issue 1870423002: Lint rule: Do not override fields. Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Hint if a field overrides or hides other field. Created 4 years, 8 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
« no previous file with comments | « lib/src/rules/overriden_field.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 // test w/ `dart test/util/solo_test.dart overriden_field`
6
7 class Base {
8 Object field = 'lorem';
9
10 Object something = 'change';
11 }
12
13 class Bad1 extends Base {
14 @override
15 final x = 1, field = 'ipsum'; // LINT
16 }
17
18 class Bad2 extends Base {
19 @override
20 Object something = 'done'; // LINT
21 }
22
23 class Ok extends Base {
24 Object newField; // OK
25
26 final Object newFinal = 'ignore'; // OK
27 }
28
29 class Super1 {}
30
31 class Sub1 extends Super1 {
32 @override
33 int y;
34 }
35
36 class Super2 {
37 int x, y;
38 }
39
40 class Sub2 extends Super2 {
41 @override
42 int y; // LINT
43 }
44
45 class Super3 {
46 int x;
47 }
48
49 class Sub3 extends Super3 {
50 int x; // LINT
51 }
OLDNEW
« no previous file with comments | « lib/src/rules/overriden_field.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698