Skip to content

cmd/compile: more clever syntax error reporting #5129

@btracey

Description

@btracey
Using the go 1.0.3 compiler, the code at http://play.golang.org/p/mSSyjMd_MU gives a
syntax error on line 15 that there is an unexpected ), while the actual error is that
there is a missing } on line 10. In this specific case, hypothetically the compiler
could realize the error is before line 15, because there are two return statements (line
10 and 12) otherwise. 

I imagine finding the "true" location of the syntax error in the general case
is hard to do, but I figured I would document the behavior in case something could be
done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions