Commit 17a36ee
authored
[Docs](https://docs.julialang.org/en/v1/manual/control-flow/#else-Clauses)
state:
> The try, catch, else, and finally clauses each introduce their own
> scope blocks.
But it is currently not the case for `else` blocks
```julia
julia> try
catch
else
z = 1
end
1
julia> z
1
```
This change actually makes `else` blocks have their own scope block:
```julia
julia> try
catch
else
z = 1
end
1
julia> z
ERROR: UndefVarError: `z` not defined
```
1 parent 0907858 commit 17a36ee
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | | - | |
| 1427 | + | |
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3187 | 3187 | | |
3188 | 3188 | | |
3189 | 3189 | | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
3190 | 3206 | | |
3191 | 3207 | | |
3192 | 3208 | | |
| |||
0 commit comments