Open
Description
Example 1
when true:
# nim r -b:js main
import std/asyncjs
import std/sugar
let fn1 = (a:int) {.noSideEffect.} => 0 # ok
let fn2 = (a:int) {.async.} => 0 # Error: implementation of ':anonymous' expected
Current Output:
Error: implementation of ':anonymous' expected
Example 2
when true:
# nim r main
import std/async
import std/sugar
let fn1 = (a:int) {.noSideEffect.} => 0 # ok
let fn2 = (a:int) {.async.} => 0 # Error: Expected return type of 'Future' got 'auto'
Current Output:
Error: Expected return type of 'Future' got 'auto'
Proposed Solution
see #17254 (comment) which is a working POC
Additional Information
- 1.5.1 507873b
- this follows asyncjs: declaring .async proc inside an .async proc gives CT error #17177 which was fixed recently
- when fixing this, un-disable the test disabled in followup #16871 asyncjs.then: allow pipelining procs returning futures #17189