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

@ -103,7 +103,7 @@ since (1, 1):
doAssert 12.MyInt.distinctBase == 12
doAssert 12.distinctBase == 12
when T is distinct:
distinctBase(type(a))(a)
distinctBase(typeof(a))(a)
else: # avoids hint ConvFromXtoItselfNotNeeded
a
@ -124,7 +124,7 @@ since (1, 1):
runnableExamples:
doAssert tupleLen((1, 2)) == 2
tupleLen(type(t))
tupleLen(typeof(t))
template get*(T: typedesc[tuple], i: static int): untyped =
## Returns the `i`-th element of `T`.
@ -132,7 +132,7 @@ since (1, 1):
runnableExamples:
doAssert get((int, int, float, string), 2) is float
type(default(T)[i])
typeof(default(T)[i])
type StaticParam*[value: static type] = object
## Used to wrap a static value in `genericParams <#genericParams.t,typedesc>`_.