OLD | NEW |
(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 } |
OLD | NEW |