From 1e452a30429d3a454e48b4aaa606dd0305fe6a23 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Wed, 6 Feb 2019 11:08:06 -0500 Subject: [PATCH] Treat NamedTuple like Tuple for treelike purposes --- src/treelike.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/treelike.jl b/src/treelike.jl index 3d2b918587..443a91e21b 100644 --- a/src/treelike.jl +++ b/src/treelike.jl @@ -5,7 +5,9 @@ children(x) = () mapchildren(f, x) = x children(x::Tuple) = x +children(x::NamedTuple) = x mapchildren(f, x::Tuple) = map(f, x) +mapchildren(f, x::NamedTuple) = map(f, x) function treelike(m::Module, T, fs = fieldnames(T)) @eval m begin