Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing comma gives confusing error about missing catch / finally block #515

Open
topolarity opened this issue Oct 30, 2024 · 0 comments
Open

Comments

@topolarity
Copy link
Member

This mal-formed input:

try
    foo(
        arg1
        arg2(),
    )
finally
end

gives a confusing error about the try:

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 `)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant