Skip to content

Commit fc53f29

Browse files
committed
no longer need special handling of begin after Setfield 0.7.1
1 parent c72faab commit fc53f29

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
1111

1212
[compat]
1313
AbstractMCMC = "2, 3"
14+
Setfield = "0.7.1"
1415
julia = "1"

src/varname.jl

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -493,34 +493,6 @@ function drop_escape(expr::Expr)
493493
return Expr(expr.head, map(x -> drop_escape(x), expr.args)...)
494494
end
495495

496-
@static if VERSION v"1.5.0-DEV.666"
497-
# TODO: Replace once https://github.com/jw3126/Setfield.jl/pull/155 has been merged.
498-
function Setfield.lower_index(collection::Symbol, index, dim)
499-
if Setfield.isexpr(index, :call)
500-
return Expr(:call, Setfield.lower_index.(collection, index.args, dim)...)
501-
elseif (index === :end)
502-
if dim === nothing
503-
return :($(Base.lastindex)($collection))
504-
else
505-
return :($(Base.lastindex)($collection, $dim))
506-
end
507-
elseif index === :begin
508-
if dim === nothing
509-
return :($(Base.firstindex)($collection))
510-
else
511-
return :($(Base.firstindex)($collection, $dim))
512-
end
513-
end
514-
return index
515-
end
516-
517-
function Setfield.need_dynamic_lens(ex)
518-
return Setfield.foldtree(false, ex) do yes, x
519-
(yes || x === :end || x === :begin || x === :_)
520-
end
521-
end
522-
end
523-
524496
"""
525497
@vsym(expr)
526498

0 commit comments

Comments
 (0)