<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
variable	B-Language
shadowing	I-Language
occurs	O
when	O
a	O
variable	O
declared	O
within	O
a	O
certain	O
scope	B-Language
(	O
decision	O
block	O
,	O
method	O
,	O
or	O
inner	B-Language
class	I-Language
)	O
has	O
the	O
same	O
name	O
as	O
a	O
variable	O
declared	O
in	O
an	O
outer	O
scope	B-Language
.	O
</s>
<s>
This	O
can	O
lead	O
to	O
confusion	O
,	O
as	O
it	O
may	O
be	O
unclear	O
which	O
variable	O
subsequent	O
uses	O
of	O
the	O
shadowed	O
variable	O
name	O
refer	O
to	O
,	O
which	O
depends	O
on	O
the	O
name	B-Application
resolution	I-Application
rules	O
of	O
the	O
language	O
.	O
</s>
<s>
One	O
of	O
the	O
first	O
languages	O
to	O
introduce	O
variable	B-Language
shadowing	I-Language
was	O
ALGOL	B-Language
,	O
which	O
first	O
introduced	O
blocks	O
to	O
establish	O
scopes	O
.	O
</s>
<s>
It	O
was	O
also	O
permitted	O
by	O
many	O
of	O
the	O
derivative	O
programming	O
languages	O
including	O
C	O
,	O
C++	B-Language
and	O
Java	B-Language
.	O
</s>
<s>
The	O
C#	B-Application
language	O
breaks	O
this	O
tradition	O
,	O
allowing	O
variable	B-Language
shadowing	I-Language
between	O
an	O
inner	O
and	O
an	O
outer	O
class	O
,	O
and	O
between	O
a	O
method	O
and	O
its	O
containing	O
class	O
,	O
but	O
not	O
between	O
an	O
if-block	O
and	O
its	O
containing	O
method	O
,	O
or	O
between	O
case	O
statements	O
in	O
a	O
switch	O
block	O
.	O
</s>
<s>
Some	O
languages	O
allow	O
variable	B-Language
shadowing	I-Language
in	O
more	O
cases	O
than	O
others	O
.	O
</s>
<s>
For	O
example	O
Kotlin	B-Language
allows	O
an	O
inner	O
variable	O
in	O
a	O
function	O
to	O
shadow	O
a	O
passed	O
argument	O
and	O
a	O
variable	O
in	O
an	O
inner	O
block	O
to	O
shadow	O
another	O
in	O
an	O
outer	O
block	O
,	O
while	O
Java	B-Language
does	O
not	O
allow	O
these	O
.	O
</s>
<s>
Some	O
languages	O
disallow	O
variable	B-Language
shadowing	I-Language
completely	O
such	O
as	O
CoffeeScript	B-Application
.	O
</s>
<s>
The	O
following	O
Lua	B-Language
code	O
provides	O
an	O
example	O
of	O
variable	B-Language
shadowing	I-Language
,	O
in	O
multiple	O
blocks	O
.	O
</s>
<s>
The	O
following	O
Python	B-Language
code	I-Language
provides	O
another	O
example	O
of	O
variable	B-Language
shadowing	I-Language
:	O
</s>
<s>
As	O
there	O
is	O
no	O
variable	O
declaration	O
but	O
only	O
variable	O
assignment	O
in	O
Python	B-Language
,	O
the	O
keyword	O
nonlocal	O
introduced	O
in	O
Python	B-Language
3	O
is	O
used	O
to	O
avoid	O
variable	B-Language
shadowing	I-Language
and	O
assign	O
to	O
non-local	O
variables	O
:	O
</s>
<s>
The	O
keyword	O
global	O
is	O
used	O
to	O
avoid	O
variable	B-Language
shadowing	I-Language
and	O
assign	O
to	O
global	O
variables	O
:	O
</s>
<s>
ECMAScript	O
6	O
introduction	O
of	O
let	O
and	O
const	O
with	O
block	O
scoping	B-Language
allow	O
variable	B-Language
shadowing	I-Language
.	O
</s>
