mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: rename newNamedTypeWithSym, add some commemnts
Renamed newNamedTypeWithSym to newIncompleteNamedType. Added some extra comments to types.NewNamed and types.SetUnderlying. Change-Id: Idc5a6379991c26b429d91bae9fe1adef8457a75c Reviewed-on: https://go-review.googlesource.com/c/go/+/307029 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Ingo Oeser <nightlyone@googlemail.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
fe587ce856
commit
6986c02d72
3 changed files with 10 additions and 6 deletions
|
|
@ -716,7 +716,7 @@ func (subst *subster) typ(t *types.Type) *types.Type {
|
|||
// In order to deal with recursive generic types, create a TFORW
|
||||
// type initially and set the Def field of its sym, so it can be
|
||||
// found if this type appears recursively within the type.
|
||||
forw = newNamedTypeWithSym(t.Pos(), newsym)
|
||||
forw = newIncompleteNamedType(t.Pos(), newsym)
|
||||
//println("Creating new type by sub", newsym.Name, forw.HasTParam())
|
||||
forw.SetRParams(neededTargs)
|
||||
}
|
||||
|
|
@ -896,9 +896,9 @@ func deref(t *types.Type) *types.Type {
|
|||
return t
|
||||
}
|
||||
|
||||
// newNamedTypeWithSym returns a TFORW type t with name specified by sym, such
|
||||
// newIncompleteNamedType returns a TFORW type t with name specified by sym, such
|
||||
// that t.nod and sym.Def are set correctly.
|
||||
func newNamedTypeWithSym(pos src.XPos, sym *types.Sym) *types.Type {
|
||||
func newIncompleteNamedType(pos src.XPos, sym *types.Sym) *types.Type {
|
||||
name := ir.NewDeclNameAt(pos, ir.OTYPE, sym)
|
||||
forw := types.NewNamed(name)
|
||||
name.SetType(forw)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue