@@ -1644,7 +1644,6 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
16441644 dbscheme .TypeNameTable .Emit (tw , lbl , origintp .Obj ().Name ())
16451645 underlying := origintp .Underlying ()
16461646 extractUnderlyingType (tw , lbl , underlying )
1647- trackInstantiatedStructFields (tw , tp , origintp )
16481647
16491648 entitylbl , exists := tw .Labeler .LookupObjectID (origintp .Obj (), lbl )
16501649 if entitylbl == trap .InvalidLabel {
@@ -2035,36 +2034,6 @@ func getObjectBeingUsed(tw *trap.Writer, ident *ast.Ident) types.Object {
20352034 }
20362035}
20372036
2038- // trackInstantiatedStructFields tries to give the fields of an instantiated
2039- // struct type underlying `tp` the same labels as the corresponding fields of
2040- // the generic struct type. This is so that when we come across the
2041- // instantiated field in `tw.Package.TypesInfo.Uses` we will get the label for
2042- // the generic field instead.
2043- func trackInstantiatedStructFields (tw * trap.Writer , tp , origintp * types.Named ) {
2044- if tp == origintp {
2045- return
2046- }
2047-
2048- if instantiatedStruct , ok := tp .Underlying ().(* types.Struct ); ok {
2049- genericStruct , ok2 := origintp .Underlying ().(* types.Struct )
2050- if ! ok2 {
2051- log .Fatalf (
2052- "Error: underlying type of instantiated type is a struct but underlying type of generic type is %s" ,
2053- origintp .Underlying ())
2054- }
2055-
2056- if instantiatedStruct .NumFields () != genericStruct .NumFields () {
2057- log .Fatalf (
2058- "Error: instantiated struct %s has different number of fields than the generic version %s (%d != %d)" ,
2059- instantiatedStruct , genericStruct , instantiatedStruct .NumFields (), genericStruct .NumFields ())
2060- }
2061-
2062- for i := 0 ; i < instantiatedStruct .NumFields (); i ++ {
2063- tw .ObjectsOverride [instantiatedStruct .Field (i )] = genericStruct .Field (i )
2064- }
2065- }
2066- }
2067-
20682037func getTypeParamParentLabel (tw * trap.Writer , tp * types.TypeParam ) trap.Label {
20692038 parent , exists := typeParamParent [tp ]
20702039 if ! exists {
0 commit comments