From d645a88dfe342f2dc557796014a598578f81c548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 3 Jan 2019 21:47:32 +0100 Subject: [PATCH] fix breakage with Nim HEAD --- ranges/typedranges.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranges/typedranges.nim b/ranges/typedranges.nim index c43649c..31994ad 100644 --- a/ranges/typedranges.nim +++ b/ranges/typedranges.nim @@ -160,7 +160,10 @@ proc `[]=`*[T, U, V](r: MutRange[T], s: HSlice[U, V], v: openarray[T]) = raise newException(RangeError, "different lengths for slice assignment") template toOpenArray*[T](r: Range[T]): auto = - when (NimMajor,NimMinor,NimPatch)>=(0,19,9): + when false: + # when (NimMajor,NimMinor,NimPatch)>=(0,19,9): + # error message in Nim HEAD 2019-01-02: + # "for a 'var' type a variable needs to be passed, but 'toOpenArray(cast[ptr UncheckedArray[T]](curHash.start), 0, high(curHash))' is immutable" toOpenArray(cast[ptr UncheckedArray[T]](r.start), 0, r.high) else: # NOTE: `0` in `array[0, T]` is irrelevant