This method used to be needed so the legacy typechecker could report
type declaration loops, but that's handled by types2 now.
Change-Id: Ie0d89e6dcff277778b12ed960b6b31669fd903a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/403838
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
func (n *Name) doChildren(do func(Node) bool) bool { return false }
func (n *Name) editChildren(edit func(Node) Node) {}
-// TypeDefn returns the type definition for a named OTYPE.
-// That is, given "type T Defn", it returns Defn.
-// It is used by package types.
-func (n *Name) TypeDefn() *types.Type {
- if n.Ntype != nil {
- return n.Ntype.Type()
- }
- return n.Type()
-}
-
// RecordFrameOffset records the frame offset for the name.
// It is used by package types when laying out function arguments.
func (n *Name) RecordFrameOffset(offset int64) {
Type() *Type
}
-// A TypeObject is an Object representing a named type.
-type TypeObject interface {
- Object
- TypeDefn() *Type // for "type T Defn", returns Defn
-}
-
//go:generate stringer -type Kind -trimprefix T type.go
// Kind describes a kind of type.
// type should be set later via SetUnderlying(). References to the type are
// maintained until the type is filled in, so those references can be updated when
// the type is complete.
-func NewNamed(obj TypeObject) *Type {
+func NewNamed(obj Object) *Type {
t := newType(TFORW)
t.sym = obj.Sym()
t.nod = obj