Skip to content

Commit ade40f6

Browse files
dlfivefiftyJeffBezanson
authored andcommitted
Deprecate conj(::Any), add real(::Missing) and imag(::Missing) (#26288)
1 parent 01939d4 commit ade40f6

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

base/deprecated.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,9 @@ function assert(x)
14881488
@assert x ""
14891489
end
14901490

1491+
# Issue #26248
1492+
@deprecate conj(x) x
1493+
14911494
# END 0.7 deprecations
14921495

14931496
# BEGIN 1.0 deprecations

base/missing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ isless(::Any, ::Missing) = true
6464

6565
# Unary operators/functions
6666
for f in (:(!), :(~), :(+), :(-), :(identity), :(zero), :(one), :(oneunit),
67-
:(abs), :(abs2), :(sign),
67+
:(abs), :(abs2), :(sign), :(real), :(imag),
6868
:(acos), :(acosh), :(asin), :(asinh), :(atan), :(atanh),
6969
:(sin), :(sinh), :(cos), :(cosh), :(tan), :(tanh),
7070
:(exp), :(exp2), :(expm1), :(log), :(log10), :(log1p),
7171
:(log2), :(Math.exponent), :(sqrt), :(Math.gamma), :(Math.lgamma),
7272
:(iseven), :(ispow2), :(isfinite), :(isinf), :(isodd),
7373
:(isinteger), :(isreal), :(isnan), :(isempty),
74-
:(iszero), :(transpose), :(adjoint), :(float))
74+
:(iszero), :(transpose), :(adjoint), :(float), :(conj))
7575
@eval $(f)(::Missing) = missing
7676
end
7777

base/operators.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,6 @@ See also: [`fld1`](@ref), [`mod1`](@ref).
733733
"""
734734
fldmod1(x, y) = (fld1(x, y), mod1(x, y))
735735

736-
conj(x) = x
737-
738736

739737
"""
740738
widen(x)

stdlib/LinearAlgebra/test/generic.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ Base.zero(::Type{ModInt{n}}) where {n} = ModInt{n}(0)
335335
Base.zero(::ModInt{n}) where {n} = ModInt{n}(0)
336336
Base.one(::Type{ModInt{n}}) where {n} = ModInt{n}(1)
337337
Base.one(::ModInt{n}) where {n} = ModInt{n}(1)
338+
Base.conj(a::ModInt{n}) where {n} = a
338339
Base.adjoint(a::ModInt{n}) where {n} = ModInt{n}(conj(a))
339340
Base.transpose(a::ModInt{n}) where {n} = a # see Issue 20978
340341
LinearAlgebra.Adjoint(a::ModInt{n}) where {n} = adjoint(a)

test/missing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Base.zero(::Type{Unit}) = Unit(0)
142142
Base.one(::Type{Unit}) = 1
143143

144144
@testset "elementary functions" begin
145-
elementary_functions = [abs, abs2, sign,
145+
elementary_functions = [abs, abs2, sign, real, imag,
146146
acos, acosh, asin, asinh, atan, atanh, sin, sinh,
147147
conj, cos, cosh, tan, tanh,
148148
exp, exp2, expm1, log, log10, log1p, log2,

0 commit comments

Comments
 (0)