Skip to content

Commit 6b76c59

Browse files
committed
remove depwarn and move isimmutable to the bottom of deprecated.jl
1 parent 8faa424 commit 6b76c59

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

base/deprecated.jl

+21
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,24 @@ MPFR.BigFloat(x::Real, prec::Int, rounding::RoundingMode) = BigFloat(x, rounding
190190
end
191191

192192
# END 1.3 deprecations
193+
194+
# BEGIN 1.5 deprecations
195+
"""
196+
isimmutable(v) -> Bool
197+
198+
Return `true` iff value `v` is immutable. See [Mutable Composite Types](@ref)
199+
for a discussion of immutability. Note that this function works on values, so if you give it
200+
a type, it will tell you that a value of `DataType` is mutable.
201+
202+
# Examples
203+
```jldoctest
204+
julia> isimmutable(1)
205+
true
206+
207+
julia> isimmutable([1,2])
208+
false
209+
```
210+
"""
211+
isimmutable(@nospecialize(x)) = (@_pure_meta; !typeof(x).mutable)
212+
213+
# END 1.5 deprecations

base/reflection.jl

-21
Original file line numberDiff line numberDiff line change
@@ -401,27 +401,6 @@ function datatype_fielddesc_type(dt::DataType)
401401
return (flags >> 1) & 3
402402
end
403403

404-
"""
405-
isimmutable(v) -> Bool
406-
407-
Return `true` iff value `v` is immutable. See [Mutable Composite Types](@ref)
408-
for a discussion of immutability. Note that this function works on values, so if you give it
409-
a type, it will tell you that a value of `DataType` is mutable.
410-
411-
# Examples
412-
```jldoctest
413-
julia> isimmutable(1)
414-
true
415-
416-
julia> isimmutable([1,2])
417-
false
418-
```
419-
"""
420-
function isimmutable(@nospecialize(x))
421-
depwarn(" isimmutable is deprecated use ismutable instead ", :isimmutable)
422-
return (@_pure_meta; !typeof(x).mutable)
423-
end
424-
425404
"""
426405
ismutable(v) -> Bool
427406

0 commit comments

Comments
 (0)