diff options
author | hlaaftana <10591326+hlaaftana@users.noreply.github.com> | 2020-04-24 10:22:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 09:22:12 +0200 |
commit | b2141fc2a12b239c4b24f38ffbd3ca629278630e (patch) | |
tree | 4ceb2352280d4d6637f91f6ae028ca8e71fef146 /doc | |
parent | dd5ccc3e5aeb927a65ac40117113a1ca6b02d48c (diff) | |
download | Nim-b2141fc2a12b239c4b24f38ffbd3ca629278630e.tar.gz |
changed type() to typeof() in docs and error messages (#14084)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/destructors.rst | 4 | ||||
-rw-r--r-- | doc/manual.rst | 2 | ||||
-rw-r--r-- | doc/manual_experimental.rst | 4 | ||||
-rw-r--r-- | doc/tut2.rst | 2 |
4 files changed, 6 insertions, 6 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 diff --git a/doc/manual.rst b/doc/manual.rst index 595ddfcef..8cfb08cdb 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -2354,7 +2354,7 @@ The convertible relation can be relaxed by a user-defined type echo x # => 97 The type conversion ``T(a)`` is an L-value if ``a`` is an L-value and -``typeEqualsOrDistinct(T, type(a))`` holds. +``typeEqualsOrDistinct(T, typeof(a))`` holds. Assignment compatibility diff --git a/doc/manual_experimental.rst b/doc/manual_experimental.rst index f65c0933b..70bb225fa 100644 --- a/doc/manual_experimental.rst +++ b/doc/manual_experimental.rst @@ -619,7 +619,7 @@ type is an instance of it: type Functor[A] = concept f - type MatchedGenericType = genericHead(f.type) + type MatchedGenericType = genericHead(typeof(f)) # `f` will be a value of a type such as `Option[T]` # `MatchedGenericType` will become the `Option` type @@ -652,7 +652,7 @@ matched to a concrete type: t1 < t2 is bool - type TimeSpan = type(t1 - t2) + type TimeSpan = typeof(t1 - t2) TimeSpan * int is TimeSpan TimeSpan + TimeSpan is TimeSpan diff --git a/doc/tut2.rst b/doc/tut2.rst index 419e06930..0338bdb1a 100644 --- a/doc/tut2.rst +++ b/doc/tut2.rst @@ -651,7 +651,7 @@ Example: Lifting Procs ## # now abs(@[@[1,-2], @[-2,-3]]) == @[@[1,2], @[2,3]] proc fname[T](x: openarray[T]): auto = var temp: T - type outType = type(fname(temp)) + type outType = typeof(fname(temp)) result = newSeq[outType](x.len) for i in 0..<x.len: result[i] = fname(x[i]) |