fix floats slice (#16853)

* see whether it breaks

* fix

* fix

* minor

* fix

* add enum

* use Ordinal types

* fix tests

* fix

* another style

* fix remainning cases
This commit is contained in:
flywind
2021-01-29 05:26:36 -06:00
committed by GitHub
parent 44f672a515
commit 4e1e231e29
4 changed files with 11 additions and 11 deletions

View File

@@ -87,7 +87,7 @@ iterator items*[T: enum](E: typedesc[T]): T =
for v in low(E) .. high(E):
yield v
iterator items*[T](s: HSlice[T, T]): T =
iterator items*[T: Ordinal](s: Slice[T]): T =
## Iterates over the slice `s`, yielding each value between `s.a` and `s.b`
## (inclusively).
for x in s.a .. s.b: