summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-09-30 12:27:27 +0800
committerGitHub <noreply@github.com>2023-09-30 06:27:27 +0200
commit5eeafbf55029816e5022d9d6aa9ed3b0acf2d3ba (patch)
tree919c912b6235d0819beb62c2b9a0b85516cc0255
parent0c179db6579ee5ae853603bf8d8efe23785cb7ab (diff)
downloadNim-5eeafbf55029816e5022d9d6aa9ed3b0acf2d3ba.tar.gz
fixes #22696; func `strutils.join` for non-strings uses proc `$` which can have side effects (#22770)
fixes #22696
partially revert https://github.com/nim-lang/Nim/pull/16281

`join` calls `$` interally, which might introduce a sideeffect call.
-rw-r--r--lib/pure/strutils.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 7ab3d37c8..5e41705a7 100644
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -1875,7 +1875,7 @@ func join*(a: openArray[string], sep: string = ""): string {.rtl,
   else:
     result = ""
 
-func join*[T: not string](a: openArray[T], sep: string = ""): string =
+proc join*[T: not string](a: openArray[T], sep: string = ""): string =
   ## Converts all elements in the container `a` to strings using `$`,
   ## and concatenates them with `sep`.
   runnableExamples: