case TPTR32, TPTR64:
elem := SubstAny(t.Elem(), types)
if elem != t.Elem() {
- t = t.Copy()
+ t = t.copy()
t.Extra = Ptr{Elem: elem}
}
case TARRAY:
elem := SubstAny(t.Elem(), types)
if elem != t.Elem() {
- t = t.Copy()
+ t = t.copy()
t.Extra.(*Array).Elem = elem
}
case TSLICE:
elem := SubstAny(t.Elem(), types)
if elem != t.Elem() {
- t = t.Copy()
+ t = t.copy()
t.Extra = Slice{Elem: elem}
}
case TCHAN:
elem := SubstAny(t.Elem(), types)
if elem != t.Elem() {
- t = t.Copy()
+ t = t.copy()
t.Extra.(*Chan).Elem = elem
}
key := SubstAny(t.Key(), types)
val := SubstAny(t.Val(), types)
if key != t.Key() || val != t.Val() {
- t = t.Copy()
+ t = t.copy()
t.Extra.(*Map).Key = key
t.Extra.(*Map).Val = val
}
params := SubstAny(t.Params(), types)
results := SubstAny(t.Results(), types)
if recvs != t.Recvs() || params != t.Params() || results != t.Results() {
- t = t.Copy()
+ t = t.copy()
t.FuncType().Receiver = recvs
t.FuncType().Results = results
t.FuncType().Params = params
nfs[i].Type = nft
}
if nfs != nil {
- t = t.Copy()
+ t = t.copy()
t.SetFields(nfs)
}
}
return t
}
-// Copy returns a shallow copy of the Type.
-func (t *Type) Copy() *Type {
+// copy returns a shallow copy of the Type.
+func (t *Type) copy() *Type {
if t == nil {
return nil
}