mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
typo: enmRange => enumElementsAsSet (#18394)
This commit is contained in:
@@ -36,7 +36,7 @@ template toSet*(iter: untyped): untyped =
|
||||
incl(result, x)
|
||||
result
|
||||
|
||||
macro enmRange(enm: typed): untyped = result = newNimNode(nnkCurly).add(enm.getType[1][1..^1])
|
||||
macro enumElementsAsSet(enm: typed): untyped = result = newNimNode(nnkCurly).add(enm.getType[1][1..^1])
|
||||
|
||||
# func fullSet*(T: typedesc): set[T] {.inline.} = # xxx would give: Error: ordinal type expected
|
||||
func fullSet*[T](U: typedesc[T]): set[T] {.inline.} =
|
||||
@@ -49,7 +49,7 @@ func fullSet*[T](U: typedesc[T]): set[T] {.inline.} =
|
||||
when T is Ordinal:
|
||||
{T.low..T.high}
|
||||
else: # Hole filled enum
|
||||
enmRange(T)
|
||||
enumElementsAsSet(T)
|
||||
|
||||
func complement*[T](s: set[T]): set[T] {.inline.} =
|
||||
## Returns the set complement of `a`.
|
||||
|
||||
Reference in New Issue
Block a user