Skip to content

Commit ef4cb2f

Browse files
committed
cmd/compile/internal/types: change NewNamed to use TypeObject
Semantically, TypeObject is the interface that go/types.TypeName would implement, so we might as well use that instead of the more generic Object (analog to go/types.Object) for NewNamed. In practice, this doesn't really matter though, because we use *ir.Name for almost all Objects anyway. Also, remove VarObject: its last use was removed in CL 302071 (March 2021). Change-Id: I6e987ecd419105e09f74fc8d60cadb61bcbc751f Reviewed-on: https://go-review.googlesource.com/c/go/+/345810 Trust: Matthew Dempsky <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 5fb1771 commit ef4cb2f

File tree

1 file changed

+1
-7
lines changed
  • src/cmd/compile/internal/types

1 file changed

+1
-7
lines changed

src/cmd/compile/internal/types/type.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ type TypeObject interface {
2727
TypeDefn() *Type // for "type T Defn", returns Defn
2828
}
2929

30-
// A VarObject is an Object representing a function argument, variable, or struct field.
31-
type VarObject interface {
32-
Object
33-
RecordFrameOffset(int64) // save frame offset
34-
}
35-
3630
//go:generate stringer -type Kind -trimprefix T type.go
3731

3832
// Kind describes a kind of type.
@@ -1726,7 +1720,7 @@ var (
17261720
// type should be set later via SetUnderlying(). References to the type are
17271721
// maintained until the type is filled in, so those references can be updated when
17281722
// the type is complete.
1729-
func NewNamed(obj Object) *Type {
1723+
func NewNamed(obj TypeObject) *Type {
17301724
t := newType(TFORW)
17311725
t.sym = obj.Sym()
17321726
t.nod = obj

0 commit comments

Comments
 (0)