In the .Net world F# was the first mover for async syntax, but then C# won with async/await. At least that’s what I see. Scala does have generalized async/await now. Furthermore, the JVM might get something like native coroutine support with Loom. So my conclusion is that adding new syntax to the language now is premature. Let’s see first how async/await and Loom play out.
Cannot retypecheck after frontend phase
## Minimized code ```bash git clone https://github.com/Atry/dotty-retypechec…k.git && cd dotty-retypecheck && sbt Test/compile ``` ## Output ``` Cloning into 'dotty-retypecheck'... remote: Enumerating objects: 22, done. remote: Counting objects: 100% (22/22), done. remote: Compressing objects: 100% (14/14), done. remote: Total 22 (delta 0), reused 19 (delta 0), pack-reused 0 Unpacking objects: 100% (22/22), done. [info] welcome to sbt 1.3.13 (Oracle Corporation Java 10.0.1) [info] loading settings for project global-plugins from console.sbt ... [info] loading global plugins from /Users/atry/.sbt/1.0/plugins [info] loading settings for project dotty-retypecheck-build from plugins.sbt ... [info] loading project definition from /private/tmp/dotty-retypecheck/project [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings. [info] loading settings for project dotty-retypecheck from build.sbt ... [info] set current project to dotty-retypecheck (in build file:/private/tmp/dotty-retypecheck/) [info] Compiling 2 Scala sources to /private/tmp/dotty-retypecheck/target/scala-0.26/classes ... [info] Compiling 1 Scala source to /private/tmp/dotty-retypecheck/target/scala-0.26/test-classes ... [info] result of /private/tmp/dotty-retypecheck/src/test/scala/mypackage/Main.scala after typer: [info] package mypackage { [info] final lazy module val Main: mypackage.Main$ = new mypackage.Main$() [info] final module class Main$() extends Object(), _root_.scala.Serializable { [info] this: mypackage.Main.type => [info] def main(args: Array[String]): Unit = [info] if math.random().>(0.5) then [info] { [info] println(identity[String]("then")) [info] } [info] else [info] { [info] println(identity[String]("else")) [info] } [info] } [info] } [info] result of /private/tmp/dotty-retypecheck/src/test/scala/mypackage/Main.scala after inlinedPositions: [info] Unchanged since typer [error] -- Error: /private/tmp/dotty-retypecheck/src/test/scala/mypackage/Main.scala:4:12 [error] 4 | println(identity("then")) [error] | ^^^^^^^^ [error] | cannot infer type; expected type <?> is not fully defined [info] result of /private/tmp/dotty-retypecheck/src/test/scala/mypackage/Main.scala after MyCompilerPlugin: [info] package mypackage { [info] final lazy module val Main: mypackage.Main$ = new mypackage.Main$() [info] final module class Main$() extends Object(), _root_.scala.Serializable { [info] this: mypackage.Main.type => [info] def main(args: Array[String]): Unit = [info] mypackage.MyHooks.ifThenElse[Unit](math.random().>(0.5), [info] { [info] println( [info] identity[ [info] <error cannot infer type; expected type <?> is not fully defined> [info] ]("then") [info] ) [info] } [info] , [info] { [info] println(identity[<error unspecified error>]("else")) [info] } [info] ) [info] } [info] } [error] one error found [error] (Test / compileIncremental) Compilation failed [error] Total time: 4 s, completed Aug 8, 2020, 10:31:48 PM ``` ## Expectation It should compile.