I doubt that. Scala async is a compiler phase that’s running on typed trees late in the pipeline. It could probably be a plugin in Dotty, or else a compiler phase enabled by a -Y option, the way it is done now. I see no evidence that any of this has to run before typer.
@odersky, what do you think if I create a PR to Dotty as an experiment. After all, this is the only way to start the experiment in Dotty since we cannot generate untyped AST from compiler plugins or macros.
A PR that ported Scala async to Dotty would be awesome.
Related: A project that re-does for expressions to drop withFilter and use a zero instead would also be very welcome. This would fix the long standing issue Scala Wart: Convoluted de-sugaring of for-comprehensions · Issue #2573 · lampepfl/dotty · GitHub. I guess it’s not going to be easy to wean Scala off withFilter. But we’d have to do this work before we can consider any further extensions to for expressions.