| ... | @@ -3872,7 +3872,7 @@ test "labeled break from labeled block expression" { | ... | @@ -3872,7 +3872,7 @@ test "labeled break from labeled block expression" { |
| 3872 | {#see_also|Labeled while|Labeled for#} | 3872 | {#see_also|Labeled while|Labeled for#} |
| 3873 | | 3873 | |
| 3874 | {#header_open|Shadowing#} | 3874 | {#header_open|Shadowing#} |
| 3875 | <p>It is never allowed for an identifier to "hide" another one by using the same name:</p> | 3875 | <p>Identifiers are never allowed to "hide" other identifiers by using the same name:</p> |
| 3876 | {#code_begin|test_err|local shadows declaration#} | 3876 | {#code_begin|test_err|local shadows declaration#} |
| 3877 | const pi = 3.14; | 3877 | const pi = 3.14; |
| 3878 | | 3878 | |
| ... | @@ -3884,8 +3884,9 @@ test "inside test block" { | ... | @@ -3884,8 +3884,9 @@ test "inside test block" { |
| 3884 | } | 3884 | } |
| 3885 | {#code_end#} | 3885 | {#code_end#} |
| 3886 | <p> | 3886 | <p> |
| 3887 | Because of this, when you read Zig code you can rely on an identifier always meaning the same thing, | 3887 | Because of this, when you read Zig code you can always rely on an identifier to consistently mean |
| 3888 | within the scope it is defined. Note that you can, however use the same name if the scopes are separate: | 3888 | the same thing within the scope it is defined. Note that you can, however, use the same name if |
| | 3889 | the scopes are separate: |
| 3889 | </p> | 3890 | </p> |
| 3890 | {#code_begin|test|test_scopes#} | 3891 | {#code_begin|test|test_scopes#} |
| 3891 | test "separate scopes" { | 3892 | test "separate scopes" { |