NamedTuples.jl
NamedTuples.jl copied to clipboard
fix setindex updates to existing elements of NT
Fixes setindex
so that function can "update" arguments in place and added test. Looks like was an issue with the order of the arguments in merge
function. Seems to relate to #40
MWE shows current issue
using NamedTuples
x = @NT(a = 1)
@show setindex(x, :a, 2) # (a=1)
@show merge(@NT(a=2), x) # (a=2) CORRECT!
@show merge(x, @NT(a=2)) # (a=1)
Codecov Report
Merging #71 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #71 +/- ##
=======================================
Coverage 73.18% 73.18%
=======================================
Files 1 1
Lines 179 179
=======================================
Hits 131 131
Misses 48 48
Impacted Files | Coverage Δ | |
---|---|---|
src/NamedTuples.jl | 73.18% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 6353fcc...8621fca. Read the comment docs.