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

Trailing commas lead to very confusing scalastyle errors #72

Open
steinybot opened this issue Oct 17, 2018 · 2 comments
Open

Trailing commas lead to very confusing scalastyle errors #72

steinybot opened this issue Oct 17, 2018 · 2 comments

Comments

@steinybot
Copy link

Trailing commas lead to very confusing errors. Trailing commas were added in SIP-27 (Scala 2.12.2). I don't actually use them intentionally but it can take a very long time to find it since scalac passes but scalastyle fails without any line information and usually on an unrelated token.

For example:

[error] MySpec.scala: illegal start of simple expression: Token(RPAREN,),295,))
import org.scalatest.FlatSpec
import org.scalatest.prop.GeneratorDrivenPropertyChecks

class MySpec extends FlatSpec with GeneratorDrivenPropertyChecks {

  case class Foo(a: String, b: Int)

  Foo(
    "hello",
    123,
  )
}
@jtjeferreira
Copy link

Relevant ticket is scalastyle/scalastyle#276

@BardurArantsson
Copy link

This comment may be of interest scalastyle/scalastyle#327 (comment)

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

3 participants