https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100537

--- Comment #13 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
(In reply to Ian Lance Taylor from comment #12)
> A change to go-gcc.cc should not change any of the error messages emitted by
> the Go frontend.  It should not change the way that issue4458.go is handled.
> Those errors messages are emitted long before any of the code in go-gcc.cc
> is called.  I'm not sure what is happening.

It is interesting,  I rerun for trunk (without the patch), the message is
"error: type has no method 'foo'"
With the patch, the message is "error: method 'foo' is ambiguous"

At expressions.cc:14655
          if (!is_ambiguous)
            go_error_at(location, "type has no method %<%s%>",
                        Gogo::message_name(name).c_str());
          else
            go_error_at(location, "method %<%s%> is ambiguous",
                        Gogo::message_name(name).c_str());

is_ambiguous:
  if (nt != NULL)
    method = nt->method_function(name, &is_ambiguous);
  else if (st != NULL)
    method = st->method_function(name, &is_ambiguous);

Reply via email to