If named types with similar names are defined inside of methods
with similar names, it was possible that the mangled type names would be
the same, leading to multiple definitions of type descriptor and
garbage collection info variables.
This can only occur with similarly named methods across different
receivers, so we use the receiver name to distinguish.
Fixes issue 33.
From-SVN: r219214
ret.append(1, '.');
if (in_function != NULL)
{
+ const Typed_identifier* rcvr =
+ in_function->func_value()->type()->receiver();
+ if (rcvr != NULL)
+ {
+ Named_type* rcvr_type = rcvr->type()->deref()->named_type();
+ ret.append(Gogo::unpack_hidden_name(rcvr_type->name()));
+ ret.append(1, '.');
+ }
ret.append(Gogo::unpack_hidden_name(in_function->name()));
ret.append(1, '.');
if (index > 0)
name.append(1, '.');
if (this->in_function_ != NULL)
{
+ const Typed_identifier* rcvr =
+ this->in_function_->func_value()->type()->receiver();
+ if (rcvr != NULL)
+ {
+ Named_type* rcvr_type = rcvr->type()->deref()->named_type();
+ name.append(Gogo::unpack_hidden_name(rcvr_type->name()));
+ name.append(1, '.');
+ }
name.append(Gogo::unpack_hidden_name(this->in_function_->name()));
name.append(1, '$');
if (this->in_function_index_ > 0)