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
commit 4e1e231e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: