jw3126 / Setfield.jl

Update deeply nested immutable structs.
Other
167 stars 17 forks source link

`DynamicIndexLens` for `begin`? #154

Closed phipsgabler closed 3 years ago

phipsgabler commented 3 years ago
julia> @lens _[end]
Setfield.DynamicIndexLens{var"#1#2"}(var"#1#2"())

julia> @lens _[begin]
ERROR: UndefVarError: begin not defined
Stacktrace:
 [1] top-level scope at REPL[6]:1

I presume this line:

https://github.com/jw3126/Setfield.jl/blob/544346fce31eb904a951eb651e69fe0fe24490b2/src/sugar.jl#L66

should also contain a test for :begin, right?

jw3126 commented 3 years ago

Oh wow thanks a lot for reporting, interesting that this went unnoticed so long!