mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
Fix the forward test
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
discard """
|
||||
disabled: true
|
||||
output: '''
|
||||
0
|
||||
x
|
||||
e
|
||||
'''
|
||||
@@ -11,7 +10,7 @@ import asyncjs
|
||||
|
||||
# demonstrate forward definition
|
||||
# for js
|
||||
proc y(e: int): Future[string]
|
||||
proc y(e: int): Future[string] {.async.}
|
||||
|
||||
proc e: int {.discardable.} =
|
||||
echo "e"
|
||||
@@ -23,8 +22,10 @@ proc x(e: int): Future[void] {.async.} =
|
||||
e()
|
||||
|
||||
proc y(e: int): Future[string] {.async.} =
|
||||
echo 0
|
||||
return "x"
|
||||
if e > 0:
|
||||
return await y(0)
|
||||
else:
|
||||
return "x"
|
||||
|
||||
|
||||
discard x(2)
|
||||
|
||||
Reference in New Issue
Block a user