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
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()}
}