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

Unhelpful error on trailing comma on last element in Seq literal #369

Open
blast-hardcheese opened this issue May 11, 2022 · 1 comment
Open

Comments

@blast-hardcheese
Copy link

Minimal reproducing case:

object Foo {
  val bar: Seq[Long] = Seq(
    1,
    2,
  )
}

yields:

illegal start of simple expression: Token(RPAREN,),57,))

though when this appears elsewhere in otherwise production code, the error may be

expected start of definition, but was Token(VAL,val,22414,val)

Interestingly, the Scala compiler doesn't mind this at all.

Incidentally, would keeping track of the line number as part of this error be feasible? Fortunately dd if=.../MyFile.scala bs=1 count=100 skip=22414 made quick work of it, but I'm wondering if these exceptional cases couldn't be made easier to debug, possibly leading to straightforward reproduction cases as well.

Thank you for your work

@mccartney
Copy link
Contributor

Related to #276 (or even a duplicate?)

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