This patch to the Go compiler makes it give an error if the same name is
used for a method receiver and some parameter to the method.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline. Will commit to 4.8 branch when the branch
reopens.
Ian
diff -r 09a1bcee0ad3 go/parse.cc
--- a/go/parse.cc Fri Oct 11 11:09:28 2013 -0700
+++ b/go/parse.cc Fri Oct 11 11:26:45 2013 -0700
@@ -744,6 +744,8 @@
return NULL;
Parse::Names names;
+ if (receiver != NULL)
+ names[receiver->name()] = receiver;
if (params != NULL)
this->check_signature_names(params, &names);
if (results != NULL)