compiler: support alias to pointer type as method receiver

Fixes golang/go#28252.
    
    Reviewed-on: https://go-review.googlesource.com/c/160077

From-SVN: r268397
This commit is contained in:
Ian Lance Taylor 2019-01-30 15:57:46 +00:00
parent 8ff7780cb2
commit 284fdc4c15
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
5af8ee0693944c280b1f529450dbfd4ec1ee451d 2206f40fc1e0e1e2ba3eacb7388dd26b72729bde
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.

View File

@ -1944,6 +1944,10 @@ Gogo::start_function(const std::string& name, Function_type* type,
go_assert(at_top_level); go_assert(at_top_level);
Type* rtype = type->receiver()->type(); 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 // We want to look through the pointer created by the
// parser, without getting an error if the type is not yet // parser, without getting an error if the type is not yet
// defined. // defined.