summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-07-01 02:14:01 -0700
committerGitHub <noreply@github.com>2021-07-01 11:14:01 +0200
commit779b4e307bdeb018bb2884920144a8c0d1f3b377 (patch)
tree62e8053c94cebd280e9ba05c81dfc5c71c5c7c2a /lib
parent41c29cb3a1674a8b85844888e831b79050d91293 (diff)
downloadNim-779b4e307bdeb018bb2884920144a8c0d1f3b377.tar.gz
don't use `{.rtl.}` for generics, otherwise `-d:useNimRtl` gives `ambiguous identifier` nimrtl error (#18406)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/strutils.nim2
-rw-r--r--lib/system/inclrtl.nim13
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 8e0a6158b..9e0837942 100644
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -1760,7 +1760,7 @@ func join*(a: openArray[string], sep: string = ""): string {.rtl,
   else:
     result = ""
 
-func join*[T: not string](a: openArray[T], sep: string = ""): string {.rtl.} =
+func 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:
diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim
index 0bc51d693..ca41f39c6 100644
--- a/lib/system/inclrtl.nim
+++ b/lib/system/inclrtl.nim
@@ -30,12 +30,13 @@ when defined(createNimRtl):
   {.pragma: inl.}
   {.pragma: compilerRtl, compilerproc, exportc: "nimrtl_$1", dynlib.}
 elif defined(useNimRtl):
-  when defined(windows):
-    const nimrtl* = "nimrtl.dll"
-  elif defined(macosx):
-    const nimrtl* = "libnimrtl.dylib"
-  else:
-    const nimrtl* = "libnimrtl.so"
+  #[
+  `{.rtl.}` should only be used for non-generic procs.
+  ]#
+  const nimrtl* =
+    when defined(windows): "nimrtl.dll"
+    elif defined(macosx): "libnimrtl.dylib"
+    else: "libnimrtl.so"
   {.pragma: rtl, importc: "nimrtl_$1", dynlib: nimrtl, gcsafe.}
   {.pragma: inl.}
   {.pragma: compilerRtl, compilerproc, importc: "nimrtl_$1", dynlib: nimrtl.}