Skip to content

Commit d18d8b1

Browse files
use nochildren
1 parent 6b09ec7 commit d18d8b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/functor.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ end
1313

1414
# @leaf Any # every type is a leaf by default
1515

16+
# Default functor
1617
function functor(T, x)
1718
names = fieldnames(T)
1819
if isempty(names)
19-
return (), _ -> x
20+
return NoChildren(), _ -> x
2021
end
2122
S = constructorof(T) # remove parameters from parametric types and support anonymous functions
2223
vals = ntuple(i -> getfield(x, names[i]), length(names))

0 commit comments

Comments
 (0)