Skip to content

Commit

Permalink
Allow disabling scalar iteration.
Browse files Browse the repository at this point in the history
For use in the REPL, and to not cause depwarns for everyone.
  • Loading branch information
maleadt committed Jun 10, 2021
1 parent 25ce681 commit efb14c0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/host/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ function allowscalar(f::Base.Callable)
task_local_storage(f, :ScalarIndexing, ScalarAllowed)
end

# deprecated
function allowscalar(allow::Bool=true)
if allow
Base.depwarn("allowscalar([true]) is deprecated, use `allowscalar() do end` or `@allowscalar` to denote exactly which operations can use scalar operations.", :allowscalar)
else
Base.depwarn("allowscalar(false) is deprecated; scalar indexing is now disabled by default.", :allowscalar)
end
task_local_storage(:ScalarIndexing, allow ? ScalarAllowed : ScalarDisallowed)
return
Expand Down

2 comments on commit efb14c0

@maleadt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/38628

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v7.0.0 -m "<description of version>" efb14c0bcfe7ba555dda55a637ebcbd8c5caf655
git push origin v7.0.0

Please sign in to comment.