@@ -1529,12 +1529,6 @@ func extractSpec(tw *trap.Writer, spec ast.Spec, parent trap.Label, idx int) {
15291529 extractNodeLocation (tw , spec , lbl )
15301530}
15311531
1532- // Determines whether the given type is an alias.
1533- func isAlias (tp types.Type ) bool {
1534- _ , ok := tp .(* types.Alias )
1535- return ok
1536- }
1537-
15381532// extractType extracts type information for `tp` and returns its associated label;
15391533// types are only extracted once, so the second time `extractType` is invoked it simply returns the label
15401534func extractType (tw * trap.Writer , tp types.Type ) trap.Label {
@@ -1644,7 +1638,6 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
16441638 dbscheme .TypeNameTable .Emit (tw , lbl , origintp .Obj ().Name ())
16451639 underlying := origintp .Underlying ()
16461640 extractUnderlyingType (tw , lbl , underlying )
1647- trackInstantiatedStructFields (tw , tp , origintp )
16481641
16491642 entitylbl , exists := tw .Labeler .LookupObjectID (origintp .Obj (), lbl )
16501643 if entitylbl == trap .InvalidLabel {
@@ -2035,36 +2028,6 @@ func getObjectBeingUsed(tw *trap.Writer, ident *ast.Ident) types.Object {
20352028 }
20362029}
20372030
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-
20682031func getTypeParamParentLabel (tw * trap.Writer , tp * types.TypeParam ) trap.Label {
20692032 parent , exists := typeParamParent [tp ]
20702033 if ! exists {
0 commit comments