typedParams will now handle parameters with pragmas

This commit is contained in:
Zahary Karadjov 2020-05-23 19:55:55 +03:00
parent a695d9e7bd
commit f003557674
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
2 changed files with 6 additions and 1 deletions

View File

@ -298,7 +298,7 @@ iterator typedParams*(n: NimNode, skip = 0): (NimNode, NimNode) =
let paramType = paramNodes[^2]
for j in 0 ..< paramNodes.len - 2:
yield (paramNodes[j], paramType)
yield (skipPragma paramNodes[j], paramType)
macro unpackArgs*(callee: typed, args: untyped): untyped =
result = newCall(callee)

View File

@ -42,6 +42,8 @@ suite "Objects":
Bar = object
x: RootRef not nil
DistinctBar = distinct Bar
proc foo(x: int): string =
discard
@ -57,6 +59,7 @@ suite "Objects":
T3 = typeof foo(declval(lent int))
T4 = typeof foo(declval(Bar))
T5 = typeof foo(declval(var Bar))
T6 = typeof declval(DistinctBar)
check:
T1 is string
@ -64,4 +67,6 @@ suite "Objects":
T3 is string
T4 is int
T5 is int
T6 is DistinctBar
T6 isnot Bar