Open
Description
MWE:
largetree = maketree("root" => [string(i) for i in 1:600]);
# All values of same type seem to be ok
FileTrees.load(largetree; lazy=true) do file
"AAA"
end |> exec;
FileTrees.load(largetree; lazy=true) do file
isodd(parse(Int, name(file))) ? "AAA" : 13
end |> exec;
# Internal error: stack overflow in type inference of (::Dagger.var"#85#86"{FileTrees.var"#165#169", Tuple{Dagger.Chunk{Array{String, 1}, etc...
# This might be caused by recursion over very long tuples or argument lists.
# Small(ish) trees are always ok it seems
smalltree = maketree("root" => [string(i) for i in 1:300]);
FileTrees.load(smalltree; lazy=true) do file
isodd(parse(Int, name(file))) ? "AAA" : 13
end |> exec;
I suppose it is this line which happens to get a nice signature when everything has the same type.
Possible solution is to use assocreduce
(or at least the same strategy) here. I will experiment with this in a PR, but other suggestions are welcome in the meantime.