Skip to content

Commit 13a25d9

Browse files
authored
Merge pull request #600 from JuliaArrays/cjf/remove-deprecated
Remove deprecated functionality
2 parents 1376c77 + 16dfa67 commit 13a25d9

18 files changed

+0
-878
lines changed

src/FixedSizeArrays.jl

Lines changed: 0 additions & 195 deletions
This file was deleted.

src/ImmutableArrays.jl

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/MArray.jl

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ mutable struct MArray{S <: Tuple, T, N, L} <: StaticArray{S, T, N}
3434
check_array_parameters(S, T, Val{N}, Val{L})
3535
new{S,T,N,L}()
3636
end
37-
38-
@static if VERSION < v"1.0"
39-
# deprecated empty constructor
40-
function MArray{S,T,N,L}() where {S,T,N,L}
41-
Base.depwarn("`MArray{S,T,N,L}()` is deprecated, use `MArray{S,T,N,L}(undef)` instead", :MArray)
42-
return MArray{S,T,N,L}(undef)
43-
end
44-
end
4537
end
4638

4739
@generated function (::Type{MArray{S,T,N}})(x::Tuple) where {S,T,N}
@@ -65,25 +57,13 @@ end
6557
end
6658
end
6759

68-
@static if VERSION < v"1.0"
69-
function (::Type{MArray{S,T,N}})() where {S,T,N}
70-
Base.depwarn("`MArray{S,T,N}()` is deprecated, use `MArray{S,T,N}(undef)` instead", :MArray)
71-
return MArray{S,T,N}(undef)
72-
end
73-
end
7460
@generated function (::Type{MArray{S,T,N}})(::UndefInitializer) where {S,T,N}
7561
return quote
7662
$(Expr(:meta, :inline))
7763
MArray{S, T, N, $(tuple_prod(S))}(undef)
7864
end
7965
end
8066

81-
@static if VERSION < v"1.0"
82-
function (::Type{MArray{S,T}})() where {S,T}
83-
Base.depwarn("`MArray{S,T}()` is deprecated, use `MArray{S,T}(undef)` instead", :MArray)
84-
return MArray{S,T}(undef)
85-
end
86-
end
8767
@generated function (::Type{MArray{S,T}})(::UndefInitializer) where {S,T}
8868
return quote
8969
$(Expr(:meta, :inline))
@@ -102,11 +82,6 @@ end
10282

10383
# MArray(I::UniformScaling) methods to replace eye
10484
(::Type{MA})(I::UniformScaling) where {MA<:MArray} = _eye(Size(MA), MA, I)
105-
# deprecate eye, keep around for as long as LinearAlgebra.eye exists
106-
@static if isdefined(LinearAlgebra, :eye)
107-
@deprecate eye(::Type{MArray{S}}) where {S} MArray{S}(1.0I)
108-
@deprecate eye(::Type{MArray{S,T}}) where {S,T} MArray{S,T}(I)
109-
end
11085

11186
####################
11287
## MArray methods ##
@@ -294,31 +269,6 @@ macro MArray(ex)
294269
$(esc(ex.args[1]))($(esc(ex.args[2])), MArray{$(esc(Expr(:curly, Tuple, ex.args[3:end]...)))})
295270
end
296271
end
297-
elseif ex.args[1] == :eye # deprecated
298-
if length(ex.args) == 2
299-
return quote
300-
Base.depwarn("`@MArray eye(m)` is deprecated, use `MArray{m,m}(1.0I)` instead", :eye)
301-
MArray{Tuple{$(esc(ex.args[2])), $(esc(ex.args[2]))},Float64}(I)
302-
end
303-
elseif length(ex.args) == 3
304-
# We need a branch, depending if the first argument is a type or a size.
305-
return quote
306-
if isa($(esc(ex.args[2])), DataType)
307-
Base.depwarn("`@MArray eye(T, m)` is deprecated, use `MArray{m,m,T}(I)` instead", :eye)
308-
MArray{Tuple{$(esc(ex.args[3])), $(esc(ex.args[3]))}, $(esc(ex.args[2]))}(I)
309-
else
310-
Base.depwarn("`@MArray eye(m, n)` is deprecated, use `MArray{m,n}(1.0I)` instead", :eye)
311-
MArray{Tuple{$(esc(ex.args[2])), $(esc(ex.args[3]))}, Float64}(I)
312-
end
313-
end
314-
elseif length(ex.args) == 4
315-
return quote
316-
Base.depwarn("`@MArray eye(T, m, n)` is deprecated, use `MArray{m,n,T}(I)` instead", :eye)
317-
MArray{Tuple{$(esc(ex.args[3])), $(esc(ex.args[4]))}, $(esc(ex.args[2]))}(I)
318-
end
319-
else
320-
error("Bad eye() expression for @MArray")
321-
end
322272
else
323273
error("@MArray only supports the zeros(), ones(), rand(), randn(), and randexp() functions.")
324274
end

src/MMatrix.jl

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ end
4444
end
4545
end
4646

47-
@static if VERSION < v"1.0"
48-
function (::Type{MMatrix{S1,S2,T}})() where {S1,S2,T}
49-
Base.depwarn("`MMatrix{S1,S2,T}()` is deprecated, use `MMatrix{S1,S2,T}(undef)` instead", :MMatrix)
50-
return MMatrix{S1,S2,T}(undef)
51-
end
52-
end
5347
@generated function (::Type{MMatrix{S1,S2,T}})(::UndefInitializer) where {S1,S2,T}
5448
return quote
5549
$(Expr(:meta, :inline))
@@ -66,10 +60,6 @@ end
6660
# Some more advanced constructor-like functions
6761
@inline one(::Type{MMatrix{N}}) where {N} = one(MMatrix{N,N})
6862

69-
# deprecate eye, keep around for as long as LinearAlgebra.eye exists
70-
@static if isdefined(LinearAlgebra, :eye)
71-
@deprecate eye(::Type{MMatrix{N}}) where {N} MMatrix{N,N}(1.0I)
72-
end
7363

7464
#####################
7565
## MMatrix methods ##
@@ -181,31 +171,6 @@ macro MMatrix(ex)
181171
else
182172
error("@MMatrix expected a 2-dimensional array expression")
183173
end
184-
elseif ex.args[1] == :eye # deprecated
185-
if length(ex.args) == 2
186-
return quote
187-
Base.depwarn("`@MMatrix eye(m)` is deprecated, use `MMatrix{m,m}(1.0I)` instead", :eye)
188-
MMatrix{$(esc(ex.args[2])),$(esc(ex.args[2])),Float64}(I)
189-
end
190-
elseif length(ex.args) == 3
191-
# We need a branch, depending if the first argument is a type or a size.
192-
return quote
193-
if isa($(esc(ex.args[2])), DataType)
194-
Base.depwarn("`@MMatrix eye(T, m)` is deprecated, use `MMatrix{m,m,T}(I)` instead", :eye)
195-
MMatrix{$(esc(ex.args[3])), $(esc(ex.args[3])), $(esc(ex.args[2]))}(I)
196-
else
197-
Base.depwarn("`@MMatrix eye(m, n)` is deprecated, use `MMatrix{m,n}(1.0I)` instead", :eye)
198-
MMatrix{$(esc(ex.args[2])), $(esc(ex.args[3])), Float64}(I)
199-
end
200-
end
201-
elseif length(ex.args) == 4
202-
return quote
203-
Base.depwarn("`@MMatrix eye(T, m, n)` is deprecated, use `MMatrix{m,n,T}(I)` instead", :eye)
204-
MMatrix{$(esc(ex.args[3])), $(esc(ex.args[4])), $(esc(ex.args[2]))}(I)
205-
end
206-
else
207-
error("Bad eye() expression for @MMatrix")
208-
end
209174
else
210175
error("@MMatrix only supports the zeros(), ones(), rand(), randn(), and randexp() functions.")
211176
end

0 commit comments

Comments
 (0)