From d447c0fe3f39114f0913df5804e5f7a3406d6edb Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:46:07 -0600 Subject: use typeof instead type (#16962) --- lib/std/wrapnils.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/std/wrapnils.nim') 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) -- cgit 1.4.1-2-gfad0