Skip to content

Commit

Permalink
Add NEWS.md; slightly better deprecation message
Browse files Browse the repository at this point in the history
and a few breadcrumbs to help guide the deprecation removal process
  • Loading branch information
mbauman committed Sep 15, 2017
1 parent f9826c5 commit fa51376
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ Deprecated or removed
* The keyword `immutable` is fully deprecated to `struct`, and
`type` is fully deprecated to `mutable struct` ([#19157], [#20418]).

* Indexing into multidimensional arrays with more than one index but fewer indices than there are
dimensions is no longer permitted when those trailing dimensions have lengths greater than 1.
Instead, reshape the array or add trailing indices so the dimensionality and number of indices
match ([#14770], [#23628]).

* The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).

* The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
Expand Down
6 changes: 4 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,9 @@ function countnz(x)
end

# issue #14470
# This definition will gracefully supercede the real definition until deprecations are removed
# TODO: More deprecations must be removed in src/cgutils.cpp:emit_array_nd_index()
# TODO: Re-enable the disabled tests marked PLI
# On the Julia side, this definition will gracefully supercede the new behavior (already coded)
@inline function checkbounds_indices(::Type{Bool}, IA::Tuple{Any,Vararg{Any}}, ::Tuple{})
any(x->unsafe_length(x)==0, IA) && return false
any(x->unsafe_length(x)!=1, IA) && return _depwarn_for_trailing_indices(IA)
Expand All @@ -1737,7 +1739,7 @@ function _depwarn_for_trailing_indices(n::Integer) # Called by the C boundscheck
true
end
function _depwarn_for_trailing_indices(t::Tuple)
depwarn("omitting indices for non-singleton trailing dimensions is deprecated. Add `$(map(first, t))` as trailing indices or use `reshape` to make the dimensionality of the array match the number of indices.", (:getindex, :setindex!, :view))
depwarn("omitting indices for non-singleton trailing dimensions is deprecated. Add `$(join(map(first, t),','))` as trailing indices or use `reshape` to make the dimensionality of the array match the number of indices.", (:getindex, :setindex!, :view))
true
end

Expand Down

0 comments on commit fa51376

Please sign in to comment.