summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-01-18 14:36:38 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-01-18 14:36:38 +0100
commit8399e0f78ad7ef81183cb6797fa78f8c8116e502 (patch)
tree4ad0ca835491596fce133330ba7a9c34449f73a3 /lib/system.nim
parent6fb618da4b1c46551793bc1f6d70fa8c76e68cd1 (diff)
downloadNim-8399e0f78ad7ef81183cb6797fa78f8c8116e502.tar.gz
deprecate += and friends for bool and enum (#10336)
* fixes #10257
* add version to deprecation
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/system.nim b/lib/system.nim
index b479b920a..d4a86e53b 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3886,15 +3886,21 @@ proc gorgeEx*(command: string, input = "", cache = ""): tuple[output: string,
   ## Same as `gorge` but also returns the precious exit code.
   discard
 
-proc `+=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {.
+proc `+=`*[T: SomeInteger](x: var T, y: T) {.
   magic: "Inc", noSideEffect.}
-  ## Increments an ordinal
+  ## Increments an integer
 
-proc `-=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {.
+proc `+=`*[T: enum|bool](x: var T, y: T) {.
+  magic: "Inc", noSideEffect, deprecated: "use `inc` instead".}
+
+proc `-=`*[T: SomeInteger](x: var T, y: T) {.
   magic: "Dec", noSideEffect.}
   ## Decrements an ordinal
 
-proc `*=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {.
+proc `-=`*[T: enum|bool](x: var T, y: T) {.
+  magic: "Dec", noSideEffect, deprecated: "0.20.0, use `dec` instead".}
+
+proc `*=`*[T: SomeInteger](x: var T, y: T) {.
   inline, noSideEffect.} =
   ## Binary `*=` operator for ordinals
   x = x * y