mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
* Add test case * Use .toStrLit() on param node first This means that more complex types are fully rendered
20 lines
402 B
Nim
20 lines
402 B
Nim
discard """
|
|
action: "run"
|
|
"""
|
|
import asyncdispatch
|
|
type
|
|
Sync = object
|
|
Async = object
|
|
SyncRes = (Sync, string)
|
|
AsyncRes = (Async, string)
|
|
|
|
proc foo(val: Sync | Async): Future[(Async, string) | (Sync, string)] {.multisync.} =
|
|
return (val, "hello")
|
|
|
|
let
|
|
myAsync = Async()
|
|
mySync = Sync()
|
|
|
|
doAssert typeof(waitFor foo(myAsync)) is AsyncRes
|
|
doAssert typeof(foo(mySync)) is SyncRes
|