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 152f8ec commit cad7e23
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 @@ -282,6 +282,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]).

* `writecsv(io, a; opts...)` has been deprecated in favor of
`writedlm(io, a, ','; opts...)` ([#23529]).

Expand Down
6 changes: 4 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,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 @@ -1760,7 +1762,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 cad7e23

Please sign in to comment.