From 7f6afa9e9b554799cf9a39d0f8cc7d35e47a2cb4 Mon Sep 17 00:00:00 2001 From: Alexander Ivanov Date: Tue, 19 Dec 2017 13:57:37 +0200 Subject: Make asyncjs Future[void] play nicely with last line discardable calls --- tests/js/tasync.nim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/js') diff --git a/tests/js/tasync.nim b/tests/js/tasync.nim index a164827d2..8cc972a62 100644 --- a/tests/js/tasync.nim +++ b/tests/js/tasync.nim @@ -3,6 +3,7 @@ discard """ output: ''' 0 x +e ''' """ @@ -12,15 +13,19 @@ import asyncjs # for js proc y(e: int): Future[string] -proc x(e: int) {.async.} = +proc e: int {.discardable.} = + echo "e" + return 2 + +proc x(e: int): Future[void] {.async.} = var s = await y(e) echo s + e() proc y(e: int): Future[string] {.async.} = echo 0 return "x" - discard x(2) -- cgit 1.4.1-2-gfad0