Message ID | mcrli5wlvpl.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r f250c0138323 go/gogo.cc --- a/go/gogo.cc Tue Jun 25 09:27:11 2013 -0700 +++ b/go/gogo.cc Wed Jun 26 08:46:11 2013 -0700 @@ -1278,6 +1278,14 @@ n.c_str()); inform(pf->second, "%qs imported here", n.c_str()); } + + // No package scope identifier may be named "init". + if (!p->second->is_function() + && Gogo::unpack_hidden_name(p->second->name()) == "init") + { + error_at(p->second->location(), + "cannot declare init - must be func"); + } } }