-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
Back in the day, doing something like x[1][end] was possible, but it no longer is:
julia> AbstractPPL.vinds(:(x[1][end]))
:((((lastindex)(var"##S#319"),),))which references an undefined variable. This is because of the Base.replace_ref_begin_end!:
julia> Base.replace_ref_begin_end!(:(x[1][end]))
:(let var"##S#320" = x[1]
var"##S#320"[(lastindex)(var"##S#320")]
end)which is then further altered afterwards in
Lines 357 to 364 in 34fc3e1
| @static if VERSION < v"1.5.0-DEV.666" | |
| Base.replace_ref_end!(ex) | |
| else | |
| Base.replace_ref_begin_end!(ex) | |
| end | |
| last = Expr(:tuple, ex.args[2:end]...) | |
| init = vinds(ex.args[1]).args | |
| return Expr(:tuple, init..., last) |
resulting in the incorrect generated code.
Is this intended?
Metadata
Metadata
Assignees
Labels
No labels