You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#20414 introduced syntactic sugar to make Ref{<:Real} shorthand for Ref{T} where T<:Real.
Now I'm trying to print some expressions making use of this syntax, but I end up with invalid code.
In short, AST printing rule 1, parse(string(ex)) == ex, seems to be violated:
Fine for full syntax:
julia>eval(parse(string(:(Ref{T} where T<:Real))))
Ref{T} where T<:Real
It goes wrong for the shorthand:
julia>eval(parse(string(:(Ref{<:Real}))))
ERROR: unsupported or misplaced expression $
Stacktrace:
[1] eval(::Module, ::Any) at .\boot.jl:291
[2] eval(::Any) at .\boot.jl:290
fixesJuliaLang#23457
Previously they were not explicitly handled by show_unquoted,
ending up being printed as Expr. This was not parsable back
to their original meaning.
#20414 introduced syntactic sugar to make
Ref{<:Real}
shorthand forRef{T} where T<:Real
.Now I'm trying to print some expressions making use of this syntax, but I end up with invalid code.
In short, AST printing rule 1,
parse(string(ex)) == ex
, seems to be violated:Fine for full syntax:
It goes wrong for the shorthand:
The intermediate values look like this:
Seen on v0.6.0 and master.
The text was updated successfully, but these errors were encountered: