-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
component:compilerIssue pertaining to compilerIssue pertaining to compilerissue-type:bugSomething isn't workingSomething isn't working
Description
Hi,
there appears to be an issue when trying to define an async generator in Basilisp:
SyntaxError: 'return' with value in async generator
To reproduce:
- Open the REPL and try to define an async generator that yield values, the above error is thrown
> basilisp repl
basilisp.user=> (defasync agen
[]
(dotimes [i 5]
(yield i)))
Traceback (most recent call last):
File "C:\src\basilisp\src\basilisp\cli.py", line 583, in repl
result = eval_str(lsrc, ctx, ns, eof)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\src\basilisp\src\basilisp\cli.py", line 54, in eval_str
last = compiler.compile_and_exec_form(form, ctx, ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\src\basilisp\src\basilisp\lang\compiler\__init__.py", line 186, in compile_and_exec_form
bytecode = compile(ast_module, ctx.filename, "exec")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<REPL Input>", line 1
SyntaxError: 'return' with value in async generatorThe above example works correctly outside an async context
> basilisp repl
basilisp.user=> (defn gen
[]
(dotimes [i 5]
(yield i)))
#'basilisp.user/gen
basilisp.user=> (vec (gen))
[0 1 2 3 4]Thanks
qubit55 and amano-kenji
Metadata
Metadata
Assignees
Labels
component:compilerIssue pertaining to compilerIssue pertaining to compilerissue-type:bugSomething isn't workingSomething isn't working