summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-10-17 12:46:49 +0200
committerAraq <rumpf_a@web.de>2017-10-17 12:46:49 +0200
commit45d74f408151f21f1593bfc04bd29ea7509ddae9 (patch)
tree3fa1400ea556c6295977d25f87b3f25643ce5b12 /lib
parent7ee825a6e5979a23cb0e0323f8d8069edc3285ba (diff)
downloadNim-45d74f408151f21f1593bfc04bd29ea7509ddae9.tar.gz
destructors: preparations for upcoming changes
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index d19a406cb..d85f272f2 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -292,6 +292,13 @@ when defined(nimArrIdx):
   proc `[]=`*[I: Ordinal;T,S](a: T; i: I;
     x: S) {.noSideEffect, magic: "ArrPut".}
   proc `=`*[T](dest: var T; src: T) {.noSideEffect, magic: "Asgn".}
+  when defined(nimNewRuntime):
+    template `=destroy`*[T](x: var T) =
+      ## generic `destructor`:idx: implementation that can be overriden.
+      discard
+    template `=sink`*[T](x: var T; y: T) =
+      ## generic `sink`:idx: implementation that can be overriden.
+      shallowCopy(x, y)
 
 type
   Slice*[T] = object ## builtin slice type