From 86873ad4c1116e638c3d573ffec662fe98daba88 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 8 Oct 2019 19:13:42 +0200 Subject: [PATCH] Drop compat code for `something` from #562 --- README.md | 3 --- src/Compat.jl | 8 -------- test/old.jl | 6 ++++++ test/runtests.jl | 6 ------ 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index eeb0d4ba4..afa280082 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,6 @@ Currently, the `@compat` macro supports the following syntaxes: * Single-argument `permutedims(x)` for matrices and vectors ([#24839]). -* `something` to get the first argument different from `nothing`, unwrapping those - of the `Some` type ([#27258]). - * `mapslices` with `dims` keyword argument ([#27828]). * `hasproperty` and `hasfield` ([#28850]). diff --git a/src/Compat.jl b/src/Compat.jl index fd1be5feb..17dcefa07 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -78,14 +78,6 @@ end end end -if VERSION < v"0.7.0-DEV.5278" - something() = throw(ArgumentError("No value arguments present")) - something(x::Nothing, y...) = something(y...) - something(x::Some, y...) = x.value - something(x::Any, y...) = x - export something -end - if !isdefined(LinearAlgebra, :opnorm) # julia#27401 opnorm(A::AbstractMatrix, p::Real=2) = LinearAlgebra.norm(A, p) const norm = LinearAlgebra.vecnorm diff --git a/test/old.jl b/test/old.jl index b874932fe..b20dd030c 100644 --- a/test/old.jl +++ b/test/old.jl @@ -1196,3 +1196,9 @@ let s = "∀α>β:α+1>β" end end end + +# 0.7.0-DEV.5278 +@test something(nothing, 1) === 1 +@test something(Some(2)) === 2 +@test something(Some(2), 1) === 2 +@test something(nothing, Some(1)) === 1 diff --git a/test/runtests.jl b/test/runtests.jl index 87be199f7..b358e7b34 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -85,12 +85,6 @@ end @test length(Compat.CartesianIndices((1:2,))) == 2 @test length(Compat.CartesianIndices((1:2, -1:1))) == 6 -# 0.7.0-DEV.5278 -@test something(nothing, 1) === 1 -@test something(Some(2)) === 2 -@test something(Some(2), 1) === 2 -@test something(nothing, Some(1)) === 1 - # julia#24839 @test permutedims([1 2; 3 4]) == [1 3; 2 4] @test permutedims([1,2,3]) == [1 2 3]