Hello,
I’m trying to switch from Scala 2 to Scala 3 and I’d like to find out more about new Scala 3 features. Does anyone know what is the proper/formal name of this syntax:
@main def helloWorld = println(“Hello, world”)
This function shows in “sbt run” as “helloWorld” (no class name). Defining the same function in another class throws an error:
helloWorld is already defined as method helloWorld in (another class)
Note that overloaded methods must all be defined in the same group of toplevel definitions
I’d like to find out more about this syntax, like why was it added and what issues does it solve/improve on. If anyone knows where to find such info I’d appreciate a hint.
Thanks!