diff options
Diffstat (limited to 'src/cmd/compile/internal/types2/typeparam.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typeparam.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/cmd/compile/internal/types2/typeparam.go b/src/cmd/compile/internal/types2/typeparam.go index 0d76dd1a6e..445337fee8 100644 --- a/src/cmd/compile/internal/types2/typeparam.go +++ b/src/cmd/compile/internal/types2/typeparam.go @@ -83,40 +83,6 @@ func (t *TypeParam) SetConstraint(bound Type) { 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 []*TypeParam } - -// Len returns the number of type parameters in the list. -// It is safe to call on a nil receiver. -func (tps *TParamList) Len() int { - return len(tps.list()) -} - -// At returns the i'th type parameter in the list. -func (tps *TParamList) At(i int) *TypeParam { - return tps.list()[i] -} - -func (tps *TParamList) list() []*TypeParam { - if tps == nil { - return nil - } - return tps.tparams -} - -func bindTParams(list []*TypeParam) *TParamList { - if len(list) == 0 { - return nil - } - for i, typ := range list { - if typ.index >= 0 { - panic("type parameter bound more than once") - } - typ.index = i - } - return &TParamList{tparams: list} -} - // ---------------------------------------------------------------------------- // Implementation |