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
Confusing Unmatched closing brace errors #2968
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2968?orig=1
|
@Sciss said: /Users/rutz/Documents/devel/Kontur/src/de/sciss/kontur/gui/TrackComponent.scala:32: error: Unmatched closing brace '}' ignored here |
@lindydonna said: |
@axel22 said: Thanks |
Nick Vrvilo (daowen) said: |
Nick Vrvilo (daowen) said (edited on Oct 21, 2012 6:18:02 PM UTC): I've tested the attached braces.scala with both 2.9.2 and 2.10.0 RC1. Both have the same misleading line numbers in the error messages. I reopend this ticket after posting a question to StackOverflow related to this issue (http://stackoverflow.com/questions/12050166/scalac-missing-closing-brace-error-reports-with-weird-line-number). One of the members there commented that the Scala team believes that helpful error messages are important, and that I should post this issue to the bug tracker. I was surprised to find that an identical issue had been posted back in January 2010, but was never resolved. I hope that the example I've provided along with the lengthy description of the issue over at StackOverflow will help to resolve this issue. |
@paulp said: |
@retronym said: case class Const {
} // missing '{' assumed here
class Var
{
It's actually a remarkably specific bug. Just take a look at the variations below, each of which is competently handled by the missing brace department. case class Const
{
}
class Var
{
// missing '{' assumed here class Const {
}
class Var
{
// missing '{' assumed here object Const {
}
class Var
{
// missing '{' assumed here final case class Const {
}
class Var
{
// missing '{' assumed here @foo case class Const {
}
class Var
{
// missing '{' assumed here case
class Const {
}
class Var
{
// missing '{' assumed here case class
Const {
}
class Var
{
// missing '{' assumed here |
@retronym said: |
@retronym said: |
@adriaanm said: |
@retronym said: |
Particularly with longer source files, introducing a wrong or missing brace or paranthesis may result in a compiler error that spots the mistake at a perfectly fine spot, making it practically impossible to find the real mistake. Finding the mistake in the attached source will take me twenty to thirty minutes.
Expected behaviour: the compiler should report the most likely spot for the mistake, instead of giving up at an arbitrary position.
The text was updated successfully, but these errors were encountered: