JuliaLang / JuliaLang/JuliaSyntax.jl

Missing comma gives confusing error about missing `catch` / `finally` block

Open
#515 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
293
Forks
50
PR merge metrics
No merged PRs in 30d

Description

This mal-formed input:
```julia
try
foo(
arg1
arg2(),
)
finally
end
```
gives a confusing error about the `try`:
```julia
ERROR: LoadError: ParseError:
# Error @ /home/topolarity/repos/julia3/syntax_mwe.jl:1:1
┌──
try
foo(

arg2(),
)
#──┘ ── try without catch or finally
```

To my human eye, the scoping here all looks correct, so I was surprised not to be told about the missing `,`

If you change `arg2()` to `arg2`, this gives a better error:
```
ERROR: LoadError: ParseError:
# Error @ /home/topolarity/repos/julia3/syntax_mwe.jl:4:9
arg1
arg2,
# └───┘ ── Expected `)`
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.