Skip to content

Problem running @main methods with command line arguments #14541

Closed
@spamegg1

Description

@spamegg1

Compiler version

3.1.1

Minimized code

// In file echoargs.scala
@main def echo(args: String*) =
  println(args.mkString(" "))

Output

First compile

$ scalac echoargs.scala

Then run the main method:

$ scala echo hello world
echo hello world hello world

Expectation

$ scala echo hello world
hello world

Edit: this was the output using the scala command of 3.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugregressionThis worked in a previous version but doesn't anymore

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions