From 174376b5c387f711c355f6c4678afa1e1c72763a Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:19:03 +0800 Subject: [PATCH] fixes #22844; suppress warnings of iterating sets of holeyenums fixes #22844 --- lib/system/iterators.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/system/iterators.nim b/lib/system/iterators.nim index e511f25087d69..d4ce7a71e32a6 100644 --- a/lib/system/iterators.nim +++ b/lib/system/iterators.nim @@ -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.} =