cmd/compile, go/parser: disallow "type T = p.T" - must use "=>"

I had added this originally so we can play with different notations
but it doesn't make sense to keep it around since gofmt will convert
a type alias declaration using "=" into one using "=>" anyhow. More
importantly, the spec doesn't permit it.

Change-Id: Icb010b5a9976aebf877e48b3ce9d7245559ca494
Reviewed-on: https://go-review.googlesource.com/32105
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-10-27 11:20:20 -07:00
parent 8b07ec20f7
commit 89632aa183
6 changed files with 4 additions and 10 deletions

View file

@ -365,8 +365,7 @@ func (p *parser) typeDecl(group *Group) Decl {
}
name := p.name()
// permit both: type T => p.T and: type T = p.T for now
if p.got(_Rarrow) || p.got(_Assign) {
if p.got(_Rarrow) {
return p.aliasDecl(Type, name, group)
}