Scala 3: Use @main for main methods, don’t use App

I was just reminded that the “object MyApp extends App” syntax is basically deprecated in Dotty. The correct approach in Scala 3 is to use an @main method, or to manually define a main method.

In my case I was trying to run an old Scala 2 futures example with Dotty without updating the App syntax, and ran into a problem. Once I switched to using the @main method everything worked as expected.

Many thanks to Guillaume Martres for his help!