mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/syntax: correct an error string
When we have an error in a function type used in an expression
we don't know until we see an opening { whether we have a function
literal or a function type. Use "function type" as context because
that's always correct in the specific error message.
Change-Id: I9aad8fcddf31ae53daa53cebd2c2001f08eabde0
Reviewed-on: https://go-review.googlesource.com/c/go/+/401316
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
This commit is contained in:
parent
c75befeec2
commit
e49b80a754
2 changed files with 3 additions and 2 deletions
|
|
@ -991,7 +991,7 @@ func (p *parser) operand(keep_parens bool) Expr {
|
|||
case _Func:
|
||||
pos := p.pos()
|
||||
p.next()
|
||||
_, ftyp := p.funcType("function literal")
|
||||
_, ftyp := p.funcType("function type")
|
||||
if p.tok == _Lbrace {
|
||||
p.xnest++
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue