Closed
Description
Compiler version
3.1.1-RC1
Minimized code
import annotation.experimental
@main
@experimental
def run(): Unit = {}
Output
[error] method run is marked @experimental and therefore may only be used in an experimental scope.
[error] @main
[error] ^
Expectation
As the code below compiles successfully
import annotation.experimental
object Main:
@experimental
def main(args: Array[String]): Unit = {}
I would expect the variant with @main @experimental
to work as well unless for some reason we decide it would be better not to have experimental main methods at all, in which case we should disallow marking main methods in objects as @experimental
.