-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add default constructors for AbstractRange #48894
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to add constructors for abstract types?
julia> methods(AbstractRange)
# 0 methods for type constructor
julia> supertype(AbstractRange)
AbstractVector (alias for AbstractArray{T, 1} where T)
julia> methods(AbstractVector)
# 0 methods for type constructor
julia> supertype(AbstractVector)
Any
As you can see from added tests, it does eltype conversion for general ranges. |
@putianyi889 This seems like a good idea. Is this ready from your side? |
confirm.
not sure how many. maybe add 2-3 segments to every conversion test? |
Co-authored-by: Sheehan Olver <[email protected]>
Could you add tests for other range types, such as |
There are some issues with the step type of |
Found this Lines 1237 to 1244 in 7635190
|
Related posts
convert(AbstractArray{T}, ::AbstractRange)
and variants #27138