mirror of
https://github.com/golang/go.git
synced 2025-05-26 01:41:25 +00:00
cmd/compile: remove ir.Name.TypeDefn
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>
This commit is contained in:
parent
115c3bfad5
commit
e94fe09c33
@ -141,16 +141,6 @@ func (n *Name) copy() Node { panic(n.no("copy")) }
|
||||
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) {
|
||||
|
@ -21,12 +21,6 @@ type Object interface {
|
||||
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.
|
||||
@ -1722,7 +1716,7 @@ var (
|
||||
// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user