RegionTrees.jl
RegionTrees.jl copied to clipboard
Type unstable allchildren()
root = RegionTrees.Cell(SVector(0., 0), SVector(1., 1))
split!(root)
split!(root[1,1])
function run(root)
for c in RegionTrees.allleaves(root)
a = c.boundary.origin + c.boundary.widths
#@show a
end
end
@code_warntype run(root)
shows that c is ::Any .
A simple solution would be adding types in allleaves()
function allleaves(cell::RegionTrees.Cell{Data, N, T, L}) where {Data, N, T, L}
Channel{RegionTrees.Cell{Data, N, T, L}}() do c
for child in allcells(cell)
if RegionTrees.isleaf(child)
put!(c, child)
end
end
end
end