diff options
author | Robert Griesemer <gri@golang.org> | 2016-10-27 11:20:20 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2016-10-27 19:24:47 +0000 |
commit | 89632aa1832a02e36acd458b3b35257d8133ae0c (patch) | |
tree | 6ace87fbe809a1a9300f3586800ae735f7099460 /src/go/parser/parser.go | |
parent | 8b07ec20f7a971edce9eaf413b20e453c50858c6 (diff) | |
download | go-89632aa1832a02e36acd458b3b35257d8133ae0c.tar.gz go-89632aa1832a02e36acd458b3b35257d8133ae0c.zip |
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>
Diffstat (limited to 'src/go/parser/parser.go')
-rw-r--r-- | src/go/parser/parser.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/go/parser/parser.go b/src/go/parser/parser.go index 0cff9f005e..375ae03e86 100644 --- a/src/go/parser/parser.go +++ b/src/go/parser/parser.go @@ -2343,8 +2343,7 @@ func (p *parser) parseTypeSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast. } ident := p.parseIdent() - // permit both: type T => p.T and: type T = p.T for now - if p.tok == token.ALIAS || p.tok == token.ASSIGN { + if p.tok == token.ALIAS { p.next() return p.parseAliasSpec(doc, ast.Typ, ident) } |