diff options
| author | Robert Griesemer <gri@golang.org> | 2014-01-09 14:51:23 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2014-01-09 14:51:23 -0800 |
| commit | 8a089c07ec13c2c9d3f721f2236624f6284b7877 (patch) | |
| tree | 3c73b847cc6405219100446da21e454a856fa6ba /src | |
| parent | e598bf1c887e565d37bfccf7145fd01a2c655e31 (diff) | |
| download | go-8a089c07ec13c2c9d3f721f2236624f6284b7877.tar.xz | |
go/parser: slightly improved error message by adding hint
It's difficult to make this much better w/o much
more effort. This is a rare case and probably not
worth it.
Fixes #6052.
R=golang-codereviews, bradfitz, adonovan
CC=golang-codereviews
https://golang.org/cl/49740045
Diffstat (limited to 'src')
| -rw-r--r-- | src/pkg/go/parser/parser.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go index c4523318f2..d8cde99de2 100644 --- a/src/pkg/go/parser/parser.go +++ b/src/pkg/go/parser/parser.go @@ -1752,7 +1752,7 @@ func (p *parser) makeExpr(s ast.Stmt) ast.Expr { if es, isExpr := s.(*ast.ExprStmt); isExpr { return p.checkExpr(es.X) } - p.error(s.Pos(), "expected condition, found simple statement") + p.error(s.Pos(), "expected condition, found simple statement (missing parentheses around composite literal?)") return &ast.BadExpr{From: s.Pos(), To: s.End()} } |
