Skip to content

Commit a01177c

Browse files
RexJaeschkeBillWagner
authored andcommitted
Add support for Name Shadowing
1 parent 86fdf7e commit a01177c

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
@@ -348,7 +348,7 @@ In the context of a local variable declaration, the identifier `var` acts as a c
348348
349349
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.
350350
351-
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.
351+
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.
352352
353353
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.
354354
@@ -426,7 +426,7 @@ The *type* and *constant_expression* of a local constant declaration shall follo
426426

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

429-
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.
429+
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*.
430430

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

0 commit comments

Comments
 (0)