This patch by Ben Shi to the Go frontend fixes it to support an aliases to a pointer type as a method receiver. This fixes https://golang.org/issue/28252. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 268369) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -5af8ee0693944c280b1f529450dbfd4ec1ee451d +2206f40fc1e0e1e2ba3eacb7388dd26b72729bde The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/gogo.cc =================================================================== --- gcc/go/gofrontend/gogo.cc (revision 268369) +++ gcc/go/gofrontend/gogo.cc (working copy) @@ -1944,6 +1944,10 @@ Gogo::start_function(const std::string& go_assert(at_top_level); Type* rtype = type->receiver()->type(); + while (rtype->named_type() != NULL + && rtype->named_type()->is_alias()) + rtype = rtype->named_type()->real_type()->forwarded(); + // We want to look through the pointer created by the // parser, without getting an error if the type is not yet // defined.