Commit c42b3e21 authored by Robert Griesemer's avatar Robert Griesemer

go/parser: package name must not be the blank identifier

R=r, r2, rsc1
CC=golang-dev
https://golang.org/cl/4343045
parent 7b40095e
......@@ -2209,6 +2209,9 @@ func (p *parser) parseFile() *ast.File {
// Go spec: The package clause is not a declaration;
// the package name does not appear in any scope.
ident := p.parseIdent()
if ident.Name == "_" {
p.error(p.pos, "invalid package name _")
}
p.expectSemi()
var decls []ast.Decl
......
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