From 5d6adbf8a2c4b2b84a3a9b5cb15c272b0f683bc0 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Sat, 5 Aug 2017 13:29:28 -0400 Subject: [PATCH] deprecate `union()` --- base/deprecated.jl | 2 ++ base/set.jl | 1 - test/sets.jl | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index bd90c1497825d5..5e63afcff4a1ed 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1334,6 +1334,8 @@ end @deprecate issubtype (<:) +@deprecate union() Set() + # 12807 start(::Union{Process, ProcessChain}) = 1 done(::Union{Process, ProcessChain}, i::Int) = (i == 3) diff --git a/base/set.jl b/base/set.jl index c0d18af570d611..7d79287e4abe28 100644 --- a/base/set.jl +++ b/base/set.jl @@ -65,7 +65,6 @@ done(s::Set, state) = done(s.dict, state) # NOTE: manually optimized to take advantage of Dict representation next(s::Set, i) = (s.dict.keys[i], skip_deleted(s.dict, i+1)) -union() = Set() union(s::Set) = copy(s) function union(s::Set, sets::Set...) u = Set{join_eltype(s, sets...)}() diff --git a/test/sets.jl b/test/sets.jl index 8808036301acbc..6e62708f64cede 100644 --- a/test/sets.jl +++ b/test/sets.jl @@ -138,7 +138,6 @@ for data_in in ((7,8,4,5), end # union -@test isequal(union(),Set()) @test isequal(union(Set([1])),Set([1])) s = ∪(Set([1,2]), Set([3,4])) @test isequal(s, Set([1,2,3,4]))