]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: do not declare new methods on instantiated types
authorRobert Griesemer <gri@golang.org>
Thu, 26 Aug 2021 19:27:06 +0000 (12:27 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 26 Aug 2021 20:39:56 +0000 (20:39 +0000)
commitaf80af22b507ae23ae04372f30b98f7720c85f8a
tree4736603bb7007667634985efcb7759825d75ab05
parent03db2c24136939416903b284a19905d97ceea40d
cmd/compile/internal/types2: do not declare new methods on instantiated types

Report an error if an alias is used to declare a method on an
instantiated type.

Also, when resolving the receiver type, don't use asNamed to
avoid premature expansion of the type.

Fixes #47968.

Change-Id: Ie5acc4cfb1944deaaeeaee98707f31e256f8ef5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/345472
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/types2/signature.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue47968.go2 [new file with mode: 0644]