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

StepRange constructor with an OrdinalRange argument #57718

Merged
merged 3 commits into from
Mar 13, 2025

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Mar 11, 2025

The StepRange constructor currently doesn't convert from a StepRange, but similar calls work with other range types such as StepRangeLen and UnitRange.

julia> StepRange(2:1:4)
ERROR: MethodError: no method matching StepRange(::StepRange{Int64, Int64})
The type `StepRange` exists, but no method is defined for this combination of argument types when trying to construct it.

After this PR, it works:

julia> StepRange(2:1:4)
2:1:4

@jishnub jishnub added the ranges Everything AbstractRange label Mar 11, 2025
@jishnub jishnub changed the title StepRange constructor with OrdinalRange arguments StepRange constructor with an OrdinalRange argument Mar 11, 2025
@jishnub jishnub merged commit fbe9c8b into master Mar 13, 2025
7 checks passed
@jishnub jishnub deleted the jishnub/steprange_constructor branch March 13, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ranges Everything AbstractRange
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant