summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-05 17:34:06 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-03-05 17:34:06 +0100
commitdb67e95bb230f1ce0c503e1ecf86b392d089b663 (patch)
tree1dd73b629000db0c654c253026c97c817f279e88 /lib
parentcc925d97f41c7909cf911102365929aabc7aae2e (diff)
downloadNim-db67e95bb230f1ce0c503e1ecf86b392d089b663.tar.gz
fixes JS regression
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index f3ef770fc..241f55224 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3286,10 +3286,12 @@ proc `/=`*[T: float|float32](x: var T, y: T) {.inline, noSideEffect.} =
   x = x / y
 
 proc `&=`* (x: var string, y: string) {.magic: "AppendStrStr", noSideEffect.}
-template `&=`*(x, y: typed) = add(x, y)
-template `&=`*(f: File, x: typed) = write(f, x)
+template `&=`*(x, y: typed) =
   ## generic 'sink' operator for Nim. For files an alias for ``write``.
   ## If not specialized further an alias for ``add``.
+  add(x, y)
+when declared(File):
+  template `&=`*(f: File, x: typed) = write(f, x)
 
 proc astToStr*[T](x: T): string {.magic: "AstToStr", noSideEffect.}
   ## converts the AST of `x` into a string representation. This is very useful