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

Improve error message when method calls missed some commas in Julia 1.10 #52285

Closed
Tortar opened this issue Nov 23, 2023 · 2 comments
Closed
Labels
error messages Better, more actionable error messages parser Language parsing and surface syntax

Comments

@Tortar
Copy link
Contributor

Tortar commented Nov 23, 2023

In Julia 1.10-rc1:

julia> f(x, y, z) = x+y+z
f (generic function with 1 method)

julia> f(3,4 5)
ERROR: ParseError:
# Error @ REPL[2]:1:7
f(3,4 5)
#     ╙ ── Expected `)`
Stacktrace:
 [1] top-level scope
   @ none:1

Contrast this with Python 3.10 which instead:

>>> def f(x,y,z): return x+y+z
... 
>>> f(3,4 5)
  File "<stdin>", line 1
    f(3,4 5)
        ^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

The error message of Python seems better, can we change the Julia message to something similar? Probably multiple dispatch makes this trickier though.

Indeed it was better in Julia 1.9

julia> f(3,4 5)
ERROR: syntax: missing comma or ) in argument list
Stacktrace:
 [1] top-level scope
   @ none:1
@jishnub jishnub added the error messages Better, more actionable error messages label Nov 23, 2023
@giordano giordano added the parser Language parsing and surface syntax label Nov 23, 2023
@Tortar
Copy link
Contributor Author

Tortar commented May 2, 2024

Actually this was fixed in JuliaSyntax 0.4.8 and was a duplicate (JuliaLang/JuliaSyntax.jl#397) so I think this can be closed.

Base version is still at 0.4.7 though so the issue remains

@Tortar Tortar closed this as completed May 2, 2024
@Tortar
Copy link
Contributor Author

Tortar commented May 2, 2024

Actually there is #53119 trying to bump the version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

3 participants