Inconsistency with Array(T)#[]?(range : Range)
when range is beginless or starts with 0
.
#13327
Labels
Array(T)#[]?(range : Range)
when range is beginless or starts with 0
.
#13327
Bug Report
When using
#[]?
with a range, the behavior is different when using range.begin == 0 than when using range.begin != 0Playground: link
The
#[]?(range : Range)
doc says:But is
0
out of range? Yes.Maybe this is the cause: https://github.com/crystal-lang/crystal/blob/14bfa992e/src/array.cr#L661
System info:
The text was updated successfully, but these errors were encountered: