Open btracey opened 11 years ago
Here is a similar example of the same problem. It's a little contrived because there are errors because my example uses an outside package and so there are more errors, however: http://play.golang.org/p/CDR-Lpn2Wi We see that the error is on line 114: syntax error: unexpected ). The real issue is that Optimize on line 13 does not have a closed }. In between there are a constant, type, and variable declarations, none of which would be acceptable in a function before it finally triggers an error for unexpected ). It would be awesome if this error could be more localized, (closer to line 13), or at least it would look at the whole code to see if there's ever a balanced closed bracket, and then throw an error that there is no matching closed bracket.
Another example it would be nice to change http://play.golang.org/p/Q7-VnoRnEH The error in Main() is reported before the error about Foo. In my actual code, Foo was called a bunch so the error to Foo got buried
Another: http://play.golang.org/p/OE16PMdDTY The actual error is typing "type" instead of "func" for what is supposed to be the error method call. Saying something like "expected semicolon or newline after type declaration block" would trigger "Huh? That's not a type declaration block... oh wait"