Variable shadowing

The C# language breaks this tradition, allowing variable shadowing between an inner and an outer class, and between a method and its containing class, but not between an if-block and its containing method, or between case statements in a switch block.

For example Kotlin allows an inner variable in a function to shadow a passed argument and a variable in an inner block to shadow another in an outer block, while Java does not allow these.

Both languages allow a passed argument to a function/Method to shadow a Class Field.

[1] Some languages disallow variable shadowing completely such as CoffeeScript[2] and V (Vlang).

[3] The following Lua code provides an example of variable shadowing, in multiple blocks.