use typeof instead type (#16962)

This commit is contained in:
flywind 2021-02-08 02:46:07 -06:00 • committed by GitHub
commit d447c0fe3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 253 additions and 253 deletions

View file

@ -379,9 +379,9 @@ proc formatInt(n: SomeNumber; radix: int;
result = "0"
else:
result = ""
while v > type(v)(0):
let d = v mod type(v)(radix)
v = v div type(v)(radix)
while v > typeof(v)(0):
let d = v mod typeof(v)(radix)
v = v div typeof(v)(radix)
result.add(mkDigit(d.int, spec.typ))
for idx in 0..<(result.len div 2):
swap result[idx], result[result.len - idx - 1]