typo: enmRange => enumElementsAsSet (#18394)
This commit is contained in:
parent
97fc95012d
commit
36d24846b6
1 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ template toSet*(iter: untyped): untyped =
|
||||||
incl(result, x)
|
incl(result, x)
|
||||||
result
|
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: typedesc): set[T] {.inline.} = # xxx would give: Error: ordinal type expected
|
||||||
func fullSet*[T](U: typedesc[T]): set[T] {.inline.} =
|
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:
|
when T is Ordinal:
|
||||||
{T.low..T.high}
|
{T.low..T.high}
|
||||||
else: # Hole filled enum
|
else: # Hole filled enum
|
||||||
enmRange(T)
|
enumElementsAsSet(T)
|
||||||
|
|
||||||
func complement*[T](s: set[T]): set[T] {.inline.} =
|
func complement*[T](s: set[T]): set[T] {.inline.} =
|
||||||
## Returns the set complement of `a`.
|
## Returns the set complement of `a`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue