Skip to content

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.

2 participants