From 4e1e231e29491b856ed55c79712201a4843f9854 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Fri, 29 Jan 2021 05:26:36 -0600 Subject: 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 --- lib/core/macros.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/core/macros.nim') 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 -- cgit 1.4.1-2-gfad0