use typeof instead type (#16962)
This commit is contained in:
parent
4fac8af0c9
commit
d447c0fe3f
31 changed files with 253 additions and 253 deletions
|
|
@ -242,7 +242,7 @@ template addFrameEntry(s: var string, f: StackTraceEntry|PFrame) =
|
|||
for k in 1..max(1, 25-(s.len-oldLen)): add(s, ' ')
|
||||
add(s, f.procname)
|
||||
when NimStackTraceMsgs:
|
||||
when type(f) is StackTraceEntry:
|
||||
when typeof(f) is StackTraceEntry:
|
||||
add(s, f.frameMsg)
|
||||
else:
|
||||
var first = if f.prev == nil: 0 else: f.prev.frameMsgLen
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ iterator fields*[T: tuple|object](x: T): RootObj {.
|
|||
## that affects symbol binding in the loop body.
|
||||
runnableExamples:
|
||||
var t = (1, "foo")
|
||||
for v in fields(t): v = default(type(v))
|
||||
for v in fields(t): v = default(typeof(v))
|
||||
doAssert t == (0, "")
|
||||
|
||||
iterator fields*[S:tuple|object, T:tuple|object](x: S, y: T): tuple[key: string, val: RootObj] {.
|
||||
|
|
@ -252,7 +252,7 @@ iterator fields*[S:tuple|object, T:tuple|object](x: S, y: T): tuple[key: string,
|
|||
## in the loop body.
|
||||
runnableExamples:
|
||||
var t1 = (1, "foo")
|
||||
var t2 = default(type(t1))
|
||||
var t2 = default(typeof(t1))
|
||||
for v1, v2 in fields(t1, t2): v2 = v1
|
||||
doAssert t1 == t2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue