compiler: avoid aliases in receiver types
authorIan Lance Taylor <iant@golang.org>
Mon, 19 Jul 2021 18:53:05 +0000 (11:53 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 19 Jul 2021 23:47:40 +0000 (16:47 -0700)
commit476242fa5ceaa91393562814471c385ebfdd41f3
tree3e54922e73dc77862f32e9e786318a65b7801af3
parent4e2fa18262660d7753f10f84cc49d85fac1c8798
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/MERGE
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/types.cc