]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: avoid aliases in receiver types
authorIan Lance Taylor <iant@golang.org>
Mon, 19 Jul 2021 23:47:05 +0000 (16:47 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 19 Jul 2021 23:47:05 +0000 (16:47 -0700)
commitd34f3a9312ea407812e1fab5ce3594ebe8139c0c
tree161ab2669aacff453782e3486836ce6efa4f3b62
parentac0efe3c6fc6231b20ffd684956a4a5c3c54a96b
compiler: avoid aliases in receiver types

If a package declares a method on an alias type, the alias would be
used in the export data.  This would then trigger a compiler
assertion on import: we should not be adding methods to aliases.

Fix the problem by ensuring that receiver types do not use alias types.
This seems preferable to consistently avoiding aliases in export data,
as aliases can cross packages.  And it's painful to try to patch this
while writing the export data, as at that point all the types are known.

Test case is https://golang.org/cl/335172.

Fixes golang/go#47131

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/335729
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/types.cc