From 3fe8c793d03a1777c320746b421b1dd944735282 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Fri, 10 Feb 2017 20:07:58 -0500 Subject: [PATCH] Fix 0.6 abstract type declaration depwarn --- REQUIRE | 2 +- src/AbstractTrees.jl | 4 ++-- src/implicitstacks.jl | 4 ++-- src/traits.jl | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/REQUIRE b/REQUIRE index 9e74e5b..2652857 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ julia 0.5 -Compat 0.9.5 +Compat 0.17.0 diff --git a/src/AbstractTrees.jl b/src/AbstractTrees.jl index 8ec98a0..4180b3f 100644 --- a/src/AbstractTrees.jl +++ b/src/AbstractTrees.jl @@ -10,7 +10,7 @@ import Base: getindex, setindex!, start, next, done, nextind, print, show, using Base: SizeUnknown using Compat -abstract AbstractShadowTree +@compat abstract type AbstractShadowTree end include("traits.jl") include("implicitstacks.jl") @@ -267,7 +267,7 @@ eltype{I}(::Type{IndEnumerate{I}}) = Tuple{Any, eltype(I)} # Tree Iterators -abstract TreeIterator{T} +@compat abstract type TreeIterator{T} end """ Iterator to visit the leaves of a tree, e.g. for the tree diff --git a/src/implicitstacks.jl b/src/implicitstacks.jl index a1acc24..11c5d73 100644 --- a/src/implicitstacks.jl +++ b/src/implicitstacks.jl @@ -1,4 +1,4 @@ -abstract ImplicitStack +@compat abstract type ImplicitStack end immutable ImplicitIndexStack{S} <: ImplicitStack stack::Vector{S} end @@ -18,7 +18,7 @@ Base.isempty(s::ImplicitIndexStack) = isempty(s.stack) getnode(tree, ns::ImplicitIndexStack) = isempty(ns.stack) ? tree[rootstate(tree)] : (@assert isa(treekind(tree), IndexedTree); tree[ns.stack[end]]) function getnode(tree, stack::ImplicitNodeStack) - isempty(stack.node_stack) ? + isempty(stack.node_stack) ? (isempty(stack.idx_stack) ? tree : children(tree)[stack.idx_stack.stack[end]]) : children(stack.node_stack[end])[stack.idx_stack.stack[end]] end diff --git a/src/traits.jl b/src/traits.jl index 16ef6b1..e98ee19 100644 --- a/src/traits.jl +++ b/src/traits.jl @@ -1,4 +1,4 @@ -abstract ParentLinks +@compat abstract type ParentLinks end """ Indicates that this tree stores parent links explicitly. The implementation @@ -11,7 +11,7 @@ immutable ImplicitParents <: ParentLinks; end parentlinks(::Type) = ImplicitParents() parentlinks(tree) = parentlinks(typeof(tree)) -abstract SiblingLinks +@compat abstract type SiblingLinks end """ Indicates that this tree stores sibling links explicitly, or can compute them @@ -27,7 +27,7 @@ siblinglinks(::Type) = ImplicitSiblings() siblinglinks(tree) = parentlinks(typeof(tree)) -abstract TreeKind +@compat abstract type TreeKind end immutable RegularTree <: TreeKind; end immutable IndexedTree <: TreeKind; end @@ -38,7 +38,7 @@ children(tree, node, ::IndexedTree) = (tree[y] for y in childindices(tree, node) children(tree, node) = children(tree, node, treekind(tree)) function rootstate() -end +end childindices(tree, node) = tree == node ? childindices(tree, rootstate(tree)) :