Skip to content

Commit 9beca9b

Browse files
authored
Merge pull request #149 from samuelsonric/master
Fixed propagation of traits `ParentLinks` and `SiblingLinks`.
2 parents af3fabd + 5e63593 commit 9beca9b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/indexing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ end
116116

117117
IndexNode(tree) = IndexNode(tree, rootindex(tree))
118118

119-
ParentLinks(::Type{<:IndexNode{N,T}}) where {N,T} = ParentLinks(T)
120-
SiblingLinks(::Type{<:IndexNode{N,T}}) where {N,T} = SiblingLinks(T)
119+
ParentLinks(::Type{<:IndexNode{T,I}}) where {T,I} = ParentLinks(T)
120+
SiblingLinks(::Type{<:IndexNode{T,I}}) where {T,I} = SiblingLinks(T)
121121

122122
nodevalue(idx::IndexNode) = nodevalue(idx.tree, idx.index)
123123

test/trees.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ include(joinpath(@__DIR__, "examples", "onetree.jl"))
8383
@test eltype(nodevalue.(collect(Leaves(n)))) Int
8484
@test nodevalue.(collect(PreOrderDFS(n))) == [2, 3, 4, 0]
8585
@test nodevalue.(collect(PostOrderDFS(n))) == [0, 4, 3, 2]
86+
@test ParentLinks(n) == StoredParents()
87+
@test SiblingLinks(n) == StoredSiblings()
8688
end
8789

8890
include(joinpath(@__DIR__, "examples", "fstree.jl"))

0 commit comments

Comments
 (0)