mirror of
https://github.com/golang/go
synced 2024-11-24 08:40:14 -07:00
go/types: export Named._Orig as Named.Origin
Export the _Orig method for Named types, and rename to Origin. As discussed in #47916, Orig is easily confused with Original, which is not as good a name. Spelling out 'Origin' resolves the ambiguity. Updates #47916 Change-Id: I377c73de82310d3f6aa0bd82dddcd60ee067155b Reviewed-on: https://go-review.googlesource.com/c/go/+/350996 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
b6dddaccd7
commit
988f18d61d
@ -91,9 +91,9 @@ func (t *Named) Obj() *TypeName {
|
|||||||
return t.orig.obj // for non-instances this is the same as t.obj
|
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.
|
// Origin returns the parameterized type from which the named type t is
|
||||||
// If t is not an instantiated type, the result is t.
|
// instantiated. If t is not an instantiated type, the result is t.
|
||||||
func (t *Named) _Orig() *Named { return t.orig }
|
func (t *Named) Origin() *Named { return t.orig }
|
||||||
|
|
||||||
// TODO(gri) Come up with a better representation and API to distinguish
|
// TODO(gri) Come up with a better representation and API to distinguish
|
||||||
// between parameterized instantiated and non-instantiated types.
|
// between parameterized instantiated and non-instantiated types.
|
||||||
|
Loading…
Reference in New Issue
Block a user