Go patch committed: Check for pointer to error when fetching method

Message ID mcrd3p21xcp.fsf@google.com
State New
Headers show

Commit Message

Ian Taylor Dec. 15, 2010, 10:32 p.m.
This patch to the Go frontend checks for a pointer to an error type, as
well a plain error type, when trying to find a method for a type.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.



diff -r 00e1f21bd95f go/types.cc
--- a/go/types.cc	Wed Dec 15 14:06:51 2010 -0800
+++ b/go/types.cc	Wed Dec 15 14:26:33 2010 -0800
@@ -7564,7 +7564,7 @@ 
 			   const std::string& name,
 			   source_location location)
-  if (type->is_error_type())
+  if (type->deref()->is_error_type())
     return Expression::make_error(location);
   const Named_type* nt = type->named_type();