Commit 67049482 authored by Robert Griesemer's avatar Robert Griesemer

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/87901Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent be9a1774
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment