A named interface type may not have methods. Therefore, there is no reason to check whether the same name is used for an interface method and a regular method. This patch removes this useless test. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 932221f27f0b go/types.cc --- a/go/types.cc Mon Mar 28 11:32:23 2011 -0700 +++ b/go/types.cc Mon Mar 28 14:12:12 2011 -0700 @@ -7029,9 +7029,8 @@ if (this->local_methods_ != NULL) { Struct_type* st = this->type_->struct_type(); - Interface_type* it = this->type_->interface_type(); bool found_dup = false; - if (st != NULL || it != NULL) + if (st != NULL) { for (Bindings::const_declarations_iterator p = this->local_methods_->begin_declarations(); @@ -7046,13 +7045,6 @@ Gogo::message_name(name).c_str()); found_dup = true; } - if (it != NULL && it->find_method(name) != NULL) - { - error_at(p->second->location(), - "method %qs redeclares interface method name", - Gogo::message_name(name).c_str()); - found_dup = true; - } } } if (found_dup)