fixes #22860; suppress AnyEnumConv warning when iterating over set (#22904)

fixes #22860

(cherry picked from commit af556841ac)
This commit is contained in:
ringabout
2023-11-04 15:52:30 +08:00
committed by narimiran
parent 3ae3050b80
commit 683a1213db

View File

@@ -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 T is enum and not defined(js):
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.} =