From 6c150113e818a1bf0adca25981511330d4567d7f Mon Sep 17 00:00:00 2001 From: Stefan Salewski Date: Thu, 20 Oct 2022 12:43:28 +0200 Subject: [PATCH] fix for latest Nim compiler --- tests/maxby.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/maxby.nim b/tests/maxby.nim index 105538b..7303e00 100644 --- a/tests/maxby.nim +++ b/tests/maxby.nim @@ -95,7 +95,7 @@ template minIndex*(seq1, el, op: untyped): untyped = result = cmp(a, b)) result -func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T = +func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): T = ## Returns the maximum value of all elements in s. ## Comparison is done by cmp() proc. ## @@ -110,7 +110,7 @@ func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T = if cmp(s[i], result) > 0: result = s[i] -func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T = +func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): T = ## Returns the minimum value of all elements in s. ## Comparison is done by cmp() proc. ## @@ -189,7 +189,7 @@ template minValue*(seq1, el, op: untyped): untyped = result = cmp(a, b)) result -func minMaxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): (T, T) = +func minMaxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): (T, T) = ## Returns the minimum and maximum values of all elements in s. ## Comparison is done by cmp() proc. ##