Skip to content

Commit

Permalink
fixes #22844; suppress warnings of iterating sets of holeyenums
Browse files Browse the repository at this point in the history
fixes #22844
  • Loading branch information
ringabout authored Oct 19, 2023
1 parent 05a7c0f commit 174376b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/system/iterators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ iterator items*[T](a: set[T]): T {.inline.} =
## able to hold).
var i = low(T).int
while i <= high(T).int:
if T(i) in a: yield T(i)
when not defined(nimHasCastExtendedVm):
if cast[T](i) in a: yield cast[T](i)
else:
if T(i) in a: yield T(i)
unCheckedInc(i)

iterator items*(a: cstring): char {.inline.} =
Expand Down

0 comments on commit 174376b

Please sign in to comment.