This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Error for same name for receiver and parameter
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Fri, 11 Oct 2013 11:28:06 -0700
- Subject: Go patch committed: Error for same name for receiver and parameter
- Authentication-results: sourceware.org; auth=none
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)