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

Vararg closures don't round-trip properly through string conversion #36426

Open
Keno opened this issue Jun 25, 2020 · 0 comments
Open

Vararg closures don't round-trip properly through string conversion #36426

Keno opened this issue Jun 25, 2020 · 0 comments
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects.

Comments

@Keno
Copy link
Member

Keno commented Jun 25, 2020

Printing exprs drops parens around .... Usually this is fine, because the parens are non-significant,
but it matters in anonymous function syntax.

julia> Meta.parse(string(:((args...)->args)))
ERROR: Base.Meta.ParseError("extra token \"->\" after end of expression")
Stacktrace:
 [1] parse(::String, ::Int64; greedy::Bool, raise::Bool, depwarn::Bool) at ./meta.jl:186
 [2] parse(::String; raise::Bool, depwarn::Bool) at ./meta.jl:217
 [3] parse(::String) at ./meta.jl:217
 [4] top-level scope at REPL[1]:1

julia> (args...)->args
#1 (generic function with 1 method)
@Keno Keno added the domain:display and printing Aesthetics and correctness of printed representations of objects. label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

1 participant