-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
109 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,48 @@ | ||
aqua Job declares * | ||
aqua Main | ||
|
||
import someString from "hack" | ||
use timeout, someString from "hack.aqua" as P | ||
export bugLNG346 | ||
|
||
export timeout | ||
ability Promise: | ||
yield() -> string | ||
|
||
func timeout() -> string: | ||
res <- P.timeout() | ||
b = someString() | ||
a = P.someString() | ||
<- res | ||
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
integration-tests/aqua/examples/abilitiesClosureRename.aqua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
aqua AbilitiesClosureRename | ||
|
||
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { | ||
bugLNG346 | ||
} from "../compiled/examples/abilitiesClosureRename.js"; | ||
|
||
export async function bugLNG346Call(): Promise<string> { | ||
return await bugLNG346(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters