Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

fix setindex updates to existing elements of NT #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magerton
Copy link

@magerton magerton commented Jun 4, 2018

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)

@magerton magerton changed the title setindex updates existing elements of NT fix setindex updates to existing elements of NT Jun 4, 2018
@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #71 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           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%> (ø) ⬆️

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants