diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-01-29 05:26:36 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 12:26:36 +0100 |
commit | 4e1e231e29491b856ed55c79712201a4843f9854 (patch) | |
tree | aa4c96ac05e15f639ef8d11b1d3582452c0f2389 /lib/core/macros.nim | |
parent | 44f672a515a2cc88f98f3e249a590fc4eb09a751 (diff) | |
download | Nim-4e1e231e29491b856ed55c79712201a4843f9854.tar.gz |
fix floats slice (#16853)
* see whether it breaks * fix * fix * minor * fix * add enum * use Ordinal types * fix tests * fix * another style * fix remainning cases
Diffstat (limited to 'lib/core/macros.nim')
-rw-r--r-- | lib/core/macros.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index e579d6b30..6e1089b39 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -175,7 +175,7 @@ proc `[]`*(n: NimNode, i: BackwardsIndex): NimNode = n[n.len - i.int] template `^^`(n: NimNode, i: untyped): untyped = (when i is BackwardsIndex: n.len - int(i) else: int(i)) -proc `[]`*[T, U](n: NimNode, x: HSlice[T, U]): seq[NimNode] = +proc `[]`*[T, U: Ordinal](n: NimNode, x: HSlice[T, U]): seq[NimNode] = ## Slice operation for NimNode. ## Returns a seq of child of `n` who inclusive range [n[x.a], n[x.b]]. let xa = n ^^ x.a |