Skip to content

Commit 32e45a4

Browse files
committed
add @main entrypoint support for Scala 3
mainargs 0.2.3 added support for scala3 🎉 com-lihaoyi/mainargs#18 The first attempt to upgrade and enable mainargs was com-lihaoyi#1298, but the build changes were better handled by com-lihaoyi#1301 So the only thing left is reenabling mainargs for Scala 3.
1 parent 5a06226 commit 32e45a4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

amm/src/main/scala/ammonite/main/Scripts.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ object Scripts {
1717
scriptArgs: Seq[String] = Nil) = {
1818
interp.watch(path)
1919
val (pkg, wrapper) = Util.pathToPackageWrapper(Seq(), path relativeTo wd)
20-
21-
22-
val genRoutesCode =
23-
// Entrypoints are not supported in Scala 3 for now (its macros are Scala 2-only)
24-
if (interp.compilerBuilder.scalaVersion.startsWith("3.")) "null"
25-
else "mainargs.ParserForMethods[$routesOuter.type]($routesOuter)"
20+
val genRoutesCode = "mainargs.ParserForMethods[$routesOuter.type]($routesOuter)"
2621

2722
for{
2823
scriptTxt <- try Res.Success(Util.normalizeNewlines(os.read(path))) catch{

0 commit comments

Comments
 (0)