diff options
Diffstat (limited to 'src/cmd/compile/internal/types2/typeparam.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typeparam.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/types2/typeparam.go b/src/cmd/compile/internal/types2/typeparam.go index f666fae7ed..0d76dd1a6e 100644 --- a/src/cmd/compile/internal/types2/typeparam.go +++ b/src/cmd/compile/internal/types2/typeparam.go @@ -84,7 +84,7 @@ func (t *TypeParam) Underlying() Type { return t } func (t *TypeParam) String() string { return TypeString(t, nil) } // TParamList holds a list of type parameters bound to a type. -type TParamList struct{ tparams []*TypeName } +type TParamList struct{ tparams []*TypeParam } // Len returns the number of type parameters in the list. // It is safe to call on a nil receiver. @@ -93,23 +93,22 @@ func (tps *TParamList) Len() int { } // At returns the i'th type parameter in the list. -func (tps *TParamList) At(i int) *TypeName { +func (tps *TParamList) At(i int) *TypeParam { return tps.list()[i] } -func (tps *TParamList) list() []*TypeName { +func (tps *TParamList) list() []*TypeParam { if tps == nil { return nil } return tps.tparams } -func bindTParams(list []*TypeName) *TParamList { +func bindTParams(list []*TypeParam) *TParamList { if len(list) == 0 { return nil } - for i, tp := range list { - typ := tp.Type().(*TypeParam) + for i, typ := range list { if typ.index >= 0 { panic("type parameter bound more than once") } |