aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/signature.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types2/signature.go')
-rw-r--r--src/cmd/compile/internal/types2/signature.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/types2/signature.go b/src/cmd/compile/internal/types2/signature.go
index e319e65211..f1bf60ae8e 100644
--- a/src/cmd/compile/internal/types2/signature.go
+++ b/src/cmd/compile/internal/types2/signature.go
@@ -57,13 +57,13 @@ func (s *Signature) Recv() *Var { return s.recv }
func (s *Signature) TParams() *TParamList { return s.tparams }
// SetTParams sets the type parameters of signature s.
-func (s *Signature) SetTParams(tparams []*TypeName) { s.tparams = bindTParams(tparams) }
+func (s *Signature) SetTParams(tparams []*TypeParam) { s.tparams = bindTParams(tparams) }
// RParams returns the receiver type parameters of signature s, or nil.
func (s *Signature) RParams() *TParamList { return s.rparams }
// SetRParams sets the receiver type params of signature s.
-func (s *Signature) SetRParams(rparams []*TypeName) { s.rparams = bindTParams(rparams) }
+func (s *Signature) SetRParams(rparams []*TypeParam) { s.rparams = bindTParams(rparams) }
// Params returns the parameters of signature s, or nil.
func (s *Signature) Params() *Tuple { return s.params }
@@ -119,14 +119,14 @@ func (check *Checker) funcType(sig *Signature, recvPar *syntax.Field, tparams []
// blank identifiers were found => use rewritten receiver type
recvTyp = isubst(recvPar.Type, smap)
}
- rlist := make([]*TypeName, len(rparams))
+ rlist := make([]*TypeParam, len(rparams))
for i, rparam := range rparams {
rlist[i] = check.declareTypeParam(rparam)
}
sig.rparams = bindTParams(rlist)
// determine receiver type to get its type parameters
// and the respective type parameter bounds
- var recvTParams []*TypeName
+ var recvTParams []*TypeParam
if rname != nil {
// recv should be a Named type (otherwise an error is reported elsewhere)
// Also: Don't report an error via genericType since it will be reported
@@ -142,19 +142,19 @@ func (check *Checker) funcType(sig *Signature, recvPar *syntax.Field, tparams []
// We have a list of *TypeNames but we need a list of Types.
list := make([]Type, sig.RParams().Len())
for i, t := range sig.RParams().list() {
- list[i] = t.typ
+ list[i] = t
}
smap := makeSubstMap(recvTParams, list)
- for i, tname := range sig.RParams().list() {
- bound := recvTParams[i].typ.(*TypeParam).bound
+ for i, tpar := range sig.RParams().list() {
+ bound := recvTParams[i].bound
// bound is (possibly) parameterized in the context of the
// receiver type declaration. Substitute parameters for the
// current context.
// TODO(gri) should we assume now that bounds always exist?
// (no bound == empty interface)
if bound != nil {
- bound = check.subst(tname.pos, bound, smap, nil)
- tname.typ.(*TypeParam).bound = bound
+ bound = check.subst(tpar.obj.pos, bound, smap, nil)
+ tpar.bound = bound
}
}
}