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