Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate zeros(inds::UnitRange...) and similar ones #12

Merged
merged 1 commit into from
Aug 26, 2016
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Aug 26, 2016

Sadly, I think we need to eliminate these methods. The problem is that a UnitRange is an AbstractArray, and zeros([T], A::AbstractArray) already means something different (create an all-zeros array of element type T and size of A). So making a 1-dimensional OffsetArray this way is ambiguous. Sorry I didn't notice this conflict earlier.

I made them a deprecation rather than an error in case anyone's code is relying on these. But at a certain point we should delete the deprecations.

The problem is that a UnitRange is an AbstractArray, and `zeros([T], A::AbstractArray)` already means something different (create an all-zeros array of element type T and size of A).
@alsam
Copy link
Member

alsam commented Aug 26, 2016

That's fine, thank you for noticing the conflict and for the patch. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants