Patchwork Go patch committed: Don't look for methods on named pointer types

login
register
mail settings
Submitter Ian Taylor
Date March 3, 2011, 3:31 a.m.
Message ID <mcrsjv43mnr.fsf@google.com>
Download mbox | patch
Permalink /patch/85219/
State New
Headers show

Comments

Ian Taylor - March 3, 2011, 3:31 a.m.
Methods are not permitted on named pointer types, so there is no reason
to look for them there.  This patch changes the Go frontend to not do
that.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

Patch

diff -r e71cf771cab1 go/types.cc
--- a/go/types.cc	Wed Mar 02 18:06:48 2011 -0800
+++ b/go/types.cc	Wed Mar 02 19:30:05 2011 -0800
@@ -7963,9 +7963,7 @@ 
   if (type->deref()->is_error_type())
     return Expression::make_error(location);
 
-  const Named_type* nt = type->named_type();
-  if (nt == NULL)
-    nt = type->deref()->named_type();
+  const Named_type* nt = type->deref()->named_type();
   const Struct_type* st = type->deref()->struct_type();
   const Interface_type* it = type->deref()->interface_type();