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

Failed to generate semanticdb: repeated argument not allowed #65

Closed
ZiluTian opened this issue Nov 6, 2019 · 1 comment
Closed

Failed to generate semanticdb: repeated argument not allowed #65

ZiluTian opened this issue Nov 6, 2019 · 1 comment

Comments

@ZiluTian
Copy link

ZiluTian commented Nov 6, 2019

Hello,

I am having trouble with setting up the code nagivation for Squid on VSCode. When I import build, I keep getting error messages complaining about "repeated argument not allowed" when generating semanticdb. All tests passed when I ran bin/testAll.sh. I am using Master branch and default build.sbt. Please let me know what I missed. Thanks!

failed to generate semanticdb for /*local-squid-path*/squid/src/main/scala/squid/OptimTestDSL.scala:
/*local-squid-path*/squid/src/main/scala/squid/OptimTestDSL.scala:58: error: repeated argument not allowed here
      code"List(${ xs map (r => code"$f($r)"): _* })"
                                               ^
	at scala.meta.internal.parsers.Reporter.syntaxError(Reporter.scala:16)
       ...

And the same error message repeated for others as well:

failed to generate semanticdb for /*local-squid-path*/squid/src/test/scala/squid/feature/Antiquotation.scala:
/*local-squid-path*/squid/src/test/scala/squid/feature/Antiquotation.scala:106: error: repeated argument not allowed here
    eqt(code{List(${Seq(x,y):_*})}, code"List(1,2)")
failed to generate semanticdb for /*local-squid-path*/squid/src/test/scala/squid/feature/Quasicode.scala:
/Users/ztian/Desktop/squid/src/test/scala/squid/feature/Quasicode.scala:44: error: repeated argument not allowed here
    eqt(ls, code"List(${seq: _*})")

...

Thanks,
Zilu

@LPTK
Copy link
Member

LPTK commented Nov 6, 2019

Interesting. This is a mismatch between what the Scala compiler and Semanticdb think is correct. It's quite rare in my experience, but this is a corner case where we kind of abuse the power of macros (so I'm not even sure it's worth opening an issue at https://github.com/scalameta/scalameta).

Of course, the Scala compiler's opinion is the one that matters, since it's the Scala compiler that's used to build the code — Semanticdb is just an IDE helper. So you can safely ignore these messages.

This is a niche, seldom used syntax anyway. It shouldn't impede code navigation at all. I'm closing, because there's nothing special to do on our side, except perhaps using another syntax for unquoting repeated arguments, or opening an issue at https://github.com/scalameta/scalameta.

@LPTK LPTK closed this as completed Nov 6, 2019
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

2 participants