From af2e6b7e1d515933b8143cfd74c99cefe63f0434 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Thu, 22 Feb 2018 00:15:38 +0000 Subject: [PATCH] fix --- src/treelike.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treelike.jl b/src/treelike.jl index 15ac6a1f..b974702e 100644 --- a/src/treelike.jl +++ b/src/treelike.jl @@ -10,7 +10,7 @@ function treelike(T, fs = fieldnames(T)) @eval current_module() begin children(x::$T) = ($([:(x.$f) for f in fs]...),) mapchildren(f, x::$T) = $T(f.(children(x))...) - adapt(T, x::$T) = mapchildren(x -> adapt(T, x), x) + adapt(T, x::$T) = mapleaves(x -> adapt(T, x), x) end end