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

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

Issue 2403443003: Fix failure when linting getters (issue 27545) (Closed)
Patch Set: Created 4 years, 2 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/parameter_assignments.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
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // test w/ `pub run test -N parameter_assignments` 5 // test w/ `pub run test -N parameter_assignments`
6 6
7 void badFunction(int parameter) { // LINT 7 void badFunction(int parameter) { // LINT
8 parameter = 4; 8 parameter = 4;
9 } 9 }
10 10
11 void ok(String parameter) { 11 void ok(String parameter) {
12 print(parameter); 12 print(parameter);
13 } 13 }
14 14
15 class A { 15 class A {
16 void badFunction(int parameter) { // LINT 16 int get x => 0;
17
18 set x(int value) { // LINT
19 value = 5;
20 }
21
22 void badFunction(int parameter) { // LINT
17 parameter = 4; 23 parameter = 4;
18 } 24 }
19 25
20 void ok(String parameter) { 26 void ok(String parameter) {
21 print(parameter); 27 print(parameter);
22 } 28 }
23 } 29 }
24 30
25 void ok2(String parameter) { 31 void ok2(String parameter) {
26 if (parameter == null) { 32 if (parameter == null) {
27 int parameter = 2; 33 int parameter = 2;
28 parameter = 3; 34 parameter = 3;
29 } 35 }
30 } 36 }
31 37
32 void otherBad(int parameter) { // LINT 38 void otherBad(int parameter) { // LINT
33 print(parameter++); 39 print(parameter++);
34 } 40 }
35 41
36 void otherBad1(int parameter) { // LINT 42 void otherBad1(int parameter) { // LINT
37 parameter += 3; 43 parameter += 3;
38 print(parameter); 44 print(parameter);
39 } 45 }
OLDNEW
« no previous file with comments | « lib/src/rules/parameter_assignments.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698