From 91c05426338c649175404f9f6a1fc4899cea700a Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Fri, 10 Jan 2020 08:57:03 -0600 Subject: [PATCH] Add type parameter to PostOrderDFS --- src/AbstractTrees.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/AbstractTrees.jl b/src/AbstractTrees.jl index 987ccf7..96f8456 100644 --- a/src/AbstractTrees.jl +++ b/src/AbstractTrees.jl @@ -318,12 +318,11 @@ Any[1,Any[2,3]] we will get [1,2,3,Any[2,3],Any[1,Any[2,3]]] """ -struct PostOrderDFS <: TreeIterator{Any} - tree::Any - PostOrderDFS(x::Any) = new(x) +struct PostOrderDFS{T} <: TreeIterator{T} + tree::T end PostOrderDFS(tree::Tree) = PostOrderDFS(tree.x) -IteratorSize(::Type{PostOrderDFS}) = SizeUnknown() +IteratorSize(::Type{PostOrderDFS{T}}) where T = SizeUnknown() """ Iterator to visit the nodes of a tree, guaranteeing that parents