Open beef331 opened 3 years ago
After further investigation, seems it's the same for both openArray
and iterable
using either in a type class results in failure. So relates to: https://github.com/nim-lang/Nim/issues/15722
proc doThing(a: openArray[int] or int) = echo a
doThing(@[10, 20, 30]) # This fails
doThing([10, 20, 30]) # This aswell
#doThing(1) This works
Iterable cannot be combined with other types for a typeclass.
Example
Current Output
Expected Output
Compiles fine.
Possible Solution
If the only matches are ones that use
iterable[T]
, check ifitems
/pairs
match theT
.