Skip to content

Mill Scala Scripts don't work for Scala 2 #6412

@lihaoyi

Description

@lihaoyi
compiling 3 Scala sources to out/mill-build/compile.dest/classes ...
8714]   done compiling
8714]   Compiling compiler interface...
8714]   compiling 1 Scala source to out/Foo.scala/compile0.dest/classes ...
8714]   [error] Foo.scala:17:1
8714]   type main = mainargs.main; def _millScriptMainSelf = this; object _MillScriptMain { def main(args: Array[String]): Unit = this.getClass.getMethods.find(m => m.getName == "main" && m.getParameters.map(_.getType) == Seq(classOf[Array[String]]) && m.getReturnType == classOf[Unit]) match{ case Some(m) => m.invoke(_millScriptMainSelf, args); case None => mainargs.Parser(_millScriptMainSelf).runOrExit(args) }}
8714]   ^
8714]   expected class or object definition
8714]   
8714] [error] Foo.scala:17:28
8714]   type main = mainargs.main; def _millScriptMainSelf = this; object _MillScriptMain { def main(args: Array[String]): Unit = this.getClass.getMethods.find(m => m.getName == "main" && m.getParameters.map(_.getType) == Seq(classOf[Array[String]]) && m.getReturnType == classOf[Unit]) match{ case Some(m) => m.invoke(_millScriptMainSelf, args); case None => mainargs.Parser(_millScriptMainSelf).runOrExit(args) }}
8714]                              ^
8714]   expected class or object definition
8714]   
8714] [error] two errors found
8714]   [error] Foo.scala:compile0 Compilation failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions