aqua/aqua-src/antithesis.aqua

48 lines
905 B
Plaintext
Raw Normal View History

aqua Main
export bugLNG346
ability Promise:
yield() -> string
func done_nil() -> string:
<- ""
func done() -> Promise:
<- Promise(yield = done_nil)
ability Compute:
yield() -> string
alias WorkerYield: -> string
alias Yield: WorkerYield -> Promise
func wait_for() -> Yield:
wait = func (cb: -> string) -> Promise:
yield = func () -> string:
e <- cb()
<- e
<- Promise(yield = yield)
<- wait
ability Function:
run(dealId: string) -> string
func simple{Compute}(yield: Yield) -> Function:
deal_run = func () -> string:
c_yield = func () -> string:
<- Compute.yield()
yieeld <- yield(c_yield)
res <- yieeld.yield()
<- res
<- Function(run = deal_run)
func bugLNG346() -> string:
res: *string
yieeld = func () -> string:
res <<- "hello"
<- ""
c = Compute(yield = yieeld)
fn = simple{c}(wait_for())
r <- fn.run("")
<- res!