Skip to content

Commit

Permalink
show_json(CompTypeWrapper): access fields by name (#210)
Browse files Browse the repository at this point in the history
allows to reuse CompositeTypeWrapper for defining lower() of custom
types with some fields excluded
  • Loading branch information
alyst authored and TotalVerb committed Jun 1, 2017
1 parent 0af4ed0 commit aad2e25
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,8 @@ end

function show_json(io::SC, s::CS, x::CompositeTypeWrapper)
begin_object(io)
fns = x.fns
for k in 1:length(fns)
show_pair(io, s, fns[k], getfield(x.wrapped, k))
for fn in x.fns
show_pair(io, s, fn, getfield(x.wrapped, fn))
end
end_object(io)
end
Expand Down

0 comments on commit aad2e25

Please sign in to comment.