Skip to content
Snippets Groups Projects
Commit 28171b9d authored by Ian Lance Taylor's avatar Ian Lance Taylor
Browse files

compiler: fix spurious redefinition error for anon struct

    
    Change Struct_type::do_mangled_name to incorporate the field
    names even for hidden symbols. This is needed in cases where
    a package imports a type "S" that has an anonymous struct, e.g.
    
      // imported from some other package
      type S struct {
        X struct{ _ struct{} }
      }
    
    and then defines a local type that uses a structurally identical
    anonymous struct, e.g.
    
      // defined locally
      type T struct {
        U struct{ _ struct{} }
      }
    
    In the case above both types triggered the creation of hash/equal
    methods, but the method names were clashing (since both structs
    had the same mangled name).
    
    Fixes golang/go#18414
    
    Reviewed-on: https://go-review.googlesource.com/34621

From-SVN: r243899
parent cb663820
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment