summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/semcall.nim2
-rwxr-xr-xlib/system.nim4
-rwxr-xr-xlib/system/sysstr.nim13
-rwxr-xr-xtests/reject/trecinca.nim2
4 files changed, 11 insertions, 10 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 67d157261..68c627a39 100755
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -85,7 +85,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
     #writeMatches(alt)
     if c.inCompilesContext > 0: 
       # quick error message for performance of 'compiles' built-in:
-      GlobalError(n.Info, errAmbiguousCallXYZ, "")
+      GlobalError(n.Info, errGenerated, "ambiguous call")
     elif gErrorCounter == 0:
       # don't cascade errors
       var args = "("
diff --git a/lib/system.nim b/lib/system.nim
index db78d2740..5f9a24ba9 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1532,7 +1532,7 @@ iterator fieldPairs*[S: tuple|object, T: tuple|object](x: S, y: T): tuple[
   ## The current implementation also has a bug that affects symbol binding
   ## in the loop body.
 
-proc `==`*[T: tuple|object](x, y: T): bool = 
+proc `==`*[T: tuple](x, y: T): bool = 
   ## generic ``==`` operator for tuples that is lifted from the components
   ## of `x` and `y`.
   for a, b in fields(x, y):
@@ -1557,7 +1557,7 @@ proc `<`*[T: tuple](x, y: T): bool =
     if c > 0: return false
   return false
 
-proc `$`*[T: tuple|object](x: T): string = 
+proc `$`*[T: tuple](x: T): string = 
   ## generic ``$`` operator for tuples that is lifted from the components
   ## of `x`. Example:
   ##
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index 2e60c6153..d62a987ff 100755
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -73,12 +73,13 @@ proc cstrToNimstr(str: CString): NimString {.compilerRtl.} =
   result = toNimstr(str, c_strlen(str))
 
 proc copyString(src: NimString): NimString {.compilerRtl.} =
-  if (src.reserved and seqShallowFlag) != 0:
-    result = src
-  elif src != nil:
-    result = rawNewString(src.space)
-    result.len = src.len
-    c_memcpy(result.data, src.data, (src.len + 1) * sizeof(Char))
+  if src != nil:
+    if (src.reserved and seqShallowFlag) != 0:
+      result = src
+    else:
+      result = rawNewString(src.space)
+      result.len = src.len
+      c_memcpy(result.data, src.data, (src.len + 1) * sizeof(Char))
 
 proc copyStringRC1(src: NimString): NimString {.compilerRtl.} =
   if src != nil:
diff --git a/tests/reject/trecinca.nim b/tests/reject/trecinca.nim
index bedea8d7e..73a0ec937 100755
--- a/tests/reject/trecinca.nim
+++ b/tests/reject/trecinca.nim
@@ -1,7 +1,7 @@
 discard """
   file: "tests/reject/trecincb.nim"
   line: 9
-  errormsg: "recursive dependency: 'trecincb.nim'"
+  errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
 """
 # Test recursive includes