diff options
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)) |