summary refs log tree commit diff stats
path: root/lib/std/wrapnils.nim
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-02-08 02:46:07 -0600
committerGitHub <noreply@github.com>2021-02-08 09:46:07 +0100
commitd447c0fe3f39114f0913df5804e5f7a3406d6edb (patch)
treea1ec482ca0b184819dc0fdffe463e53cf6959b72 /lib/std/wrapnils.nim
parent4fac8af0c9408ee2a8d454693d17fd84067d24c3 (diff)
downloadNim-d447c0fe3f39114f0913df5804e5f7a3406d6edb.tar.gz
use typeof instead type (#16962)
Diffstat (limited to 'lib/std/wrapnils.nim')
-rw-r--r--lib/std/wrapnils.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/wrapnils.nim b/lib/std/wrapnils.nim
index 5b2dd9769..c9120e1b7 100644
--- a/lib/std/wrapnils.nim
+++ b/lib/std/wrapnils.nim
@@ -45,9 +45,9 @@ template `.`*(a: Wrapnil, b): untyped =
   ## See top-level example.
   let a1 = a # to avoid double evaluations
   let a2 = a1.valueImpl
-  type T = Wrapnil[type(a2.b)]
+  type T = Wrapnil[typeof(a2.b)]
   if a1.validImpl:
-    when type(a2) is ref|ptr:
+    when typeof(a2) is ref|ptr:
       if a2 == nil:
         default(T)
       else:
@@ -72,13 +72,13 @@ template `[]`*[I](a: Wrapnil, i: I): untyped =
     # correctly will raise IndexDefect if a is valid but wraps an empty container
     wrapnil(a1.valueImpl[i])
   else:
-    default(Wrapnil[type(a1.valueImpl[i])])
+    default(Wrapnil[typeof(a1.valueImpl[i])])
 
 template `[]`*(a: Wrapnil): untyped =
   ## See top-level example.
   let a1 = a # to avoid double evaluations
   let a2 = a1.valueImpl
-  type T = Wrapnil[type(a2[])]
+  type T = Wrapnil[typeof(a2[])]
   if a1.validImpl:
     if a2 == nil:
       default(T)