mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/syntax: better error recovery after missing type
R=go1.11. This is just a copy of the fix for #23434: https://go-review.googlesource.com/c/go/+/87898. Test pending test harness for the syntax package. Change-Id: I52409aebe13ec784ddd7e41190a81c7e126bdd0c Reviewed-on: https://go-review.googlesource.com/87901 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
be9a1774f2
commit
670494827c
1 changed files with 1 additions and 1 deletions
|
|
@ -1036,7 +1036,7 @@ func (p *parser) type_() Expr {
|
|||
if typ == nil {
|
||||
typ = p.bad()
|
||||
p.syntax_error("expecting type")
|
||||
p.advance()
|
||||
p.advance(_Comma, _Colon, _Semi, _Rparen, _Rbrack, _Rbrace)
|
||||
}
|
||||
|
||||
return typ
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue