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

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

Issue 1870423002: Lint rule: Do not override fields. Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: 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
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 final_override_non_final`
6
7 class Base {
8 Object field = 'lorem';
9
10 Object something = 'change';
11 }
12
13 class Bad extends Base {
14 @override
15 final field = 'ipsum'; // LINT
16 }
17
18 class Sophisticated extends Base {
19 @override
20 final field = 'ipsum'; // OK
21
22 void set field(Object newValue) {
23
24 }
25 }
26
27 class Ok extends Base {
28 @override
29 Object something = 'blah'; // OK
30
31 Object newField;
32
33 final Object newFinal = 'ignore';
34 }
OLDNEW
« lib/src/rules/final_override_non_final.dart ('K') | « lib/src/rules/final_override_non_final.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698