diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-02-08 02:46:07 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 09:46:07 +0100 |
commit | d447c0fe3f39114f0913df5804e5f7a3406d6edb (patch) | |
tree | a1ec482ca0b184819dc0fdffe463e53cf6959b72 /lib/core | |
parent | 4fac8af0c9408ee2a8d454693d17fd84067d24c3 (diff) | |
download | Nim-d447c0fe3f39114f0913df5804e5f7a3406d6edb.tar.gz |
use typeof instead type (#16962)
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/macros.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 6e1089b39..57cdf0ccd 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -791,7 +791,7 @@ when declared(float128): proc newLit*(arg: enum): NimNode {.compileTime.} = result = newCall( - arg.type.getTypeInst[1], + arg.typeof.getTypeInst[1], newLit(int(arg)) ) @@ -801,13 +801,13 @@ proc newLit*[T](s: set[T]): NimNode {.compileTime.} proc newLit*[T: tuple](arg: T): NimNode {.compileTime.} proc newLit*(arg: object): NimNode {.compileTime.} = - result = nnkObjConstr.newTree(arg.type.getTypeInst[1]) + result = nnkObjConstr.newTree(arg.typeof.getTypeInst[1]) for a, b in arg.fieldPairs: result.add nnkExprColonExpr.newTree( newIdentNode(a), newLit(b) ) proc newLit*(arg: ref object): NimNode {.compileTime.} = ## produces a new ref type literal node. - result = nnkObjConstr.newTree(arg.type.getTypeInst[1]) + result = nnkObjConstr.newTree(arg.typeof.getTypeInst[1]) for a, b in fieldPairs(arg[]): result.add nnkExprColonExpr.newTree(newIdentNode(a), newLit(b)) |