Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“error: repeated argument not allowed here” when varargs are present in the codebase #30

Open
rajcspsg opened this issue May 26, 2021 · 0 comments

Comments

@rajcspsg
Copy link

I'm using varargs like below in my code base.

     def acceptVarargs[S](s: S*): Unit = {}
     def toVarArgs[T](s: Seq[T]) = acceptVarargs(s: _*)

I'm using autofix plugin in my sbt project.

I'm following the steps here to run the scalafix command.

When I run the command sbt> scalafixAll dependency:[email protected]:autofix:3.0.8-1 I get below Error.

[error] /Users/rajkumar.natarajan/Documents/Coding/misc/varargs-scalafix-error/src/main/scala/Utils.scala:3: error: repeated argument not allowed here
[error] def toVarArgs[T](s: Seq[T]) = acceptVarargs(s: _*)
[error] ^
[error] at scala.meta.internal.parsers.Reporter.syntaxError(Reporter.scala:16)
[error] at scala.meta.internal.parsers.Reporter.syntaxError$(Reporter.scala:16)
[error] at scala.meta.internal.parsers.Reporter$$anon$1.syntaxError(Reporter.scala:22)
[error] at scala.meta.internal.parsers.Reporter.syntaxError(Reporter.scala:17)
[error] at scala.meta.internal.parsers.Reporter.syntaxError$(Reporter.scala:17)

The complete error stack trace is here

The project in github here

Other details -

sbt version - 1.5.2
scala version - 2.12.10
java version - 11.0.10-zulu

What is wrong in my codebase with varargs? How can I fix this error?

Related SO question as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant