summary refs log tree commit diff stats
path: root/doc/destructors.rst
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-04-24 10:22:12 +0300
committerGitHub <noreply@github.com>2020-04-24 09:22:12 +0200
commitb2141fc2a12b239c4b24f38ffbd3ca629278630e (patch)
tree4ceb2352280d4d6637f91f6ae028ca8e71fef146 /doc/destructors.rst
parentdd5ccc3e5aeb927a65ac40117113a1ca6b02d48c (diff)
downloadNim-b2141fc2a12b239c4b24f38ffbd3ca629278630e.tar.gz
changed type() to typeof() in docs and error messages (#14084)
Diffstat (limited to 'doc/destructors.rst')
-rw-r--r--doc/destructors.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/destructors.rst b/doc/destructors.rst
index 0d4a6c985..2b1222778 100644
--- a/doc/destructors.rst
+++ b/doc/destructors.rst
@@ -48,7 +48,7 @@ written as:
     a.len = b.len
     a.cap = b.cap
     if b.data != nil:
-      a.data = cast[type(a.data)](alloc(a.cap * sizeof(T)))
+      a.data = cast[typeof(a.data)](alloc(a.cap * sizeof(T)))
       for i in 0..<a.len:
         a.data[i] = b.data[i]
 
@@ -76,7 +76,7 @@ written as:
   proc createSeq*[T](elems: varargs[T]): myseq[T] =
     result.cap = elems.len
     result.len = elems.len
-    result.data = cast[type(result.data)](alloc(result.cap * sizeof(T)))
+    result.data = cast[typeof(result.data)](alloc(result.cap * sizeof(T)))
     for i in 0..<result.len: result.data[i] = elems[i]
 
   proc len*[T](x: myseq[T]): int {.inline.} = x.len