@@ -208,16 +208,6 @@ type Type struct {
208
208
// Note that for pointers, this is always PtrSize even if the element type
209
209
// is NotInHeap. See size.go:PtrDataSize for details.
210
210
ptrBytes int64
211
-
212
- // For defined (named) generic types, a pointer to the list of type params
213
- // (in order) of this type that need to be instantiated. For instantiated
214
- // generic types, this is the targs used to instantiate them. These targs
215
- // may be typeparams (for re-instantiated types such as Value[T2]) or
216
- // concrete types (for fully instantiated types such as Value[int]).
217
- // rparams is only set for named types that are generic or are fully
218
- // instantiated from a generic type, and is otherwise set to nil.
219
- // TODO(danscales): choose a better name.
220
- rparams * []* Type
221
211
}
222
212
223
213
// Registers returns the number of integer and floating-point
@@ -240,19 +230,24 @@ const (
240
230
typeRecur
241
231
typeIsShape // represents a set of closely related types, for generics
242
232
typeHasShape // there is a shape somewhere in the type
233
+ // typeIsFullyInstantiated reports whether a type is fully instantiated generic type; i.e.
234
+ // an instantiated generic type where all type arguments are non-generic or fully instantiated generic types.
235
+ typeIsFullyInstantiated
243
236
)
244
237
245
- func (t * Type ) NotInHeap () bool { return t .flags & typeNotInHeap != 0 }
246
- func (t * Type ) Noalg () bool { return t .flags & typeNoalg != 0 }
247
- func (t * Type ) Deferwidth () bool { return t .flags & typeDeferwidth != 0 }
248
- func (t * Type ) Recur () bool { return t .flags & typeRecur != 0 }
249
- func (t * Type ) IsShape () bool { return t .flags & typeIsShape != 0 }
250
- func (t * Type ) HasShape () bool { return t .flags & typeHasShape != 0 }
238
+ func (t * Type ) NotInHeap () bool { return t .flags & typeNotInHeap != 0 }
239
+ func (t * Type ) Noalg () bool { return t .flags & typeNoalg != 0 }
240
+ func (t * Type ) Deferwidth () bool { return t .flags & typeDeferwidth != 0 }
241
+ func (t * Type ) Recur () bool { return t .flags & typeRecur != 0 }
242
+ func (t * Type ) IsShape () bool { return t .flags & typeIsShape != 0 }
243
+ func (t * Type ) HasShape () bool { return t .flags & typeHasShape != 0 }
244
+ func (t * Type ) IsFullyInstantiated () bool { return t .flags & typeIsFullyInstantiated != 0 }
251
245
252
- func (t * Type ) SetNotInHeap (b bool ) { t .flags .set (typeNotInHeap , b ) }
253
- func (t * Type ) SetNoalg (b bool ) { t .flags .set (typeNoalg , b ) }
254
- func (t * Type ) SetDeferwidth (b bool ) { t .flags .set (typeDeferwidth , b ) }
255
- func (t * Type ) SetRecur (b bool ) { t .flags .set (typeRecur , b ) }
246
+ func (t * Type ) SetNotInHeap (b bool ) { t .flags .set (typeNotInHeap , b ) }
247
+ func (t * Type ) SetNoalg (b bool ) { t .flags .set (typeNoalg , b ) }
248
+ func (t * Type ) SetDeferwidth (b bool ) { t .flags .set (typeDeferwidth , b ) }
249
+ func (t * Type ) SetRecur (b bool ) { t .flags .set (typeRecur , b ) }
250
+ func (t * Type ) SetIsFullyInstantiated (b bool ) { t .flags .set (typeIsFullyInstantiated , b ) }
256
251
257
252
// Should always do SetHasShape(true) when doing SetIsShape(true).
258
253
func (t * Type ) SetIsShape (b bool ) { t .flags .set (typeIsShape , b ) }
@@ -281,34 +276,6 @@ func (t *Type) Pos() src.XPos {
281
276
return src .NoXPos
282
277
}
283
278
284
- func (t * Type ) RParams () []* Type {
285
- if t .rparams == nil {
286
- return nil
287
- }
288
- return * t .rparams
289
- }
290
-
291
- func (t * Type ) SetRParams (rparams []* Type ) {
292
- if len (rparams ) == 0 {
293
- base .Fatalf ("Setting nil or zero-length rparams" )
294
- }
295
- t .rparams = & rparams
296
- // HasShape should be set if any type argument is or has a shape type.
297
- for _ , rparam := range rparams {
298
- if rparam .HasShape () {
299
- t .SetHasShape (true )
300
- break
301
- }
302
- }
303
- }
304
-
305
- // IsFullyInstantiated reports whether t is a fully instantiated generic type; i.e. an
306
- // instantiated generic type where all type arguments are non-generic or fully
307
- // instantiated generic types.
308
- func (t * Type ) IsFullyInstantiated () bool {
309
- return len (t .RParams ()) > 0
310
- }
311
-
312
279
// Map contains Type fields specific to maps.
313
280
type Map struct {
314
281
Key * Type // Key type
0 commit comments