Skip to content

Commit 5d3c279

Browse files
RexJaeschkeBillWagner
authored andcommitted
Add support for Name Shadowing
1 parent 01a97e6 commit 5d3c279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

standard/statements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ In the context of a local variable declaration, the identifier `var` acts as a c
336336
337337
The value of a local variable is obtained in an expression using a *simple_name* ([§11.7.4](expressions.md#1174-simple-names)). A local variable shall be definitely assigned ([§9.4](variables.md#94-definite-assignment)) at each location where its value is obtained.
338338
339-
The scope of a local variable declared in a *local_variable_declaration* is the block in which the declaration occurs. It is an error to refer to a local variable in a textual position that precedes the *local_variable_declarator* of the local variable. Within the scope of a local variable, it is a compile-time error to declare another local variable or constant with the same name.
339+
The scope of a local variable declared in a *local_variable_declaration* is the block in which the declaration occurs. It is an error to refer to a local variable in a textual position that precedes the *local_variable_declarator* of the local variable.
340340
341341
A local variable declaration that declares multiple variables is equivalent to multiple declarations of single variables with the same type. Furthermore, a variable initializer in a local variable declaration corresponds exactly to an assignment statement that is inserted immediately after the declaration.
342342
@@ -410,7 +410,7 @@ The *type* and *constant_expression* of a local constant declaration shall follo
410410

411411
The value of a local constant is obtained in an expression using a *simple_name* ([§11.7.4](expressions.md#1174-simple-names)).
412412

413-
The scope of a local constant is the block in which the declaration occurs. It is an error to refer to a local constant in a textual position that precedes the end of its *constant_declarator*. Within the scope of a local constant, it is a compile-time error to declare another local variable or constant with the same name.
413+
The scope of a local constant is the block in which the declaration occurs. It is an error to refer to a local constant in a textual position that precedes the end of its *constant_declarator*.
414414

415415
A local constant declaration that declares multiple constants is equivalent to multiple declarations of single constants with the same type.
416416

0 commit comments

Comments
 (0)