
The languages for this rule fall into two categories: * CFamily, JS, and PLSQL: "Variables should not be shadowed" (general case of shadowing) * C#, Flex, Java, PHP, Swift: "Local variables should not shadow field/property/enum case/..." (narrow case of shadowing) For CFamily, these tickets are also handled: CPP-2785 CPP-3589
17 lines
252 B
Plaintext
17 lines
252 B
Plaintext
include::../why-fields.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,flex]
|
|
----
|
|
class Foo {
|
|
public var myField:int;
|
|
|
|
public function doSomething():String {
|
|
var myField:int = 0; // Noncompliant
|
|
//...
|
|
}
|
|
}
|
|
----
|
|
|
|
include::../rspecator.adoc[] |