compiler: support alias to pointer type as method receiver
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 30 Jan 2019 15:57:46 +0000 (15:57 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 30 Jan 2019 15:57:46 +0000 (15:57 +0000)
    Fixes golang/go#28252.

    Reviewed-on: https://go-review.googlesource.com/c/160077

From-SVN: r268397

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/gogo.cc

index 10e20cebfcd8991ab21a0494d27255b8aac9ff36..c9d68e1d6a4c950e90684fcb37409d2e980ba5d1 100644 (file)
@@ -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 d0d6f3b3b54bc94fe925ac891d4b12549fb9ba54..b03051c2e803abe8a8a3845f36133a3726b981f7 100644 (file)
@@ -1944,6 +1944,10 @@ Gogo::start_function(const std::string& name, Function_type* type,
          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.