// Make sure the base generic type exists in type1 (it may
// not yet if we are referecing an imported generic type, as
// opposed to a generic type declared in this package).
- _ = g.obj(typ.Orig().Obj())
+ _ = g.obj(typ.Origin().Obj())
// Create a forwarding type first and put it in the g.typs
// map, in order to deal with recursive generic types
// Obj returns the type name for the declaration defining the named type t. For
// instantiated types, this is the type name of the base type.
-func (t *Named) Obj() *TypeName {
- return t.orig.obj // for non-instances this is the same as t.obj
-}
+func (t *Named) Obj() *TypeName { return t.orig.obj } // for non-instances this is the same as t.obj
-// Orig returns the original generic type an instantiated type is derived from.
-// If t is not an instantiated type, the result is t.
-func (t *Named) Orig() *Named { return t.orig }
+// Origin returns the parameterized type from which the named type t is
+// instantiated. If t is not an instantiated type, the result is t.
+func (t *Named) Origin() *Named { return t.orig }
// TODO(gri) Come up with a better representation and API to distinguish
// between parameterized instantiated and non-instantiated types.