multisync now allows tuples in return type (#21074)
* Add test case * Use .toStrLit() on param node first This means that more complex types are fully rendered
This commit is contained in:
parent
1585bfec3b
commit
c7493bbdd0
2 changed files with 21 additions and 2 deletions
|
|
@ -286,8 +286,8 @@ macro async*(prc: untyped): untyped =
|
|||
proc splitParamType(paramType: NimNode, async: bool): NimNode =
|
||||
result = paramType
|
||||
if paramType.kind == nnkInfix and paramType[0].strVal in ["|", "or"]:
|
||||
let firstAsync = "async" in paramType[1].strVal.normalize
|
||||
let secondAsync = "async" in paramType[2].strVal.normalize
|
||||
let firstAsync = "async" in paramType[1].toStrLit().strVal.normalize
|
||||
let secondAsync = "async" in paramType[2].toStrLit().strVal.normalize
|
||||
|
||||
if firstAsync:
|
||||
result = paramType[if async: 1 else: 2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue