typedParams will now handle parameters with pragmas
This commit is contained in:
parent
a695d9e7bd
commit
f003557674
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue