Skip to content

Commit 5137c47

Browse files
Robert Griesemergopherbot
authored andcommitted
go/types, types2: remove references to under function in comments
Follow-up on CL 712400 which removed the under function. Change-Id: I253c8adbbaa058150f26e311e37b4c1644b6554d Reviewed-on: https://go-review.googlesource.com/c/go/+/712520 Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com>
1 parent dbbb1bf commit 5137c47

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

src/cmd/compile/internal/types2/call.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (check *Checker) funcInst(T *target, pos syntax.Pos, x *operand, inst *synt
5757

5858
// Check the number of type arguments (got) vs number of type parameters (want).
5959
// Note that x is a function value, not a type expression, so we don't need to
60-
// call under below.
60+
// call Underlying below.
6161
sig := x.typ.(*Signature)
6262
got, want := len(targs), sig.TypeParams().Len()
6363
if got > want {

src/cmd/compile/internal/types2/infer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type,
427427
// Note that if t0 was a signature, t1 must be a signature, and t1
428428
// can only be a generic signature if it originated from a generic
429429
// function argument. Those signatures are never defined types and
430-
// thus there is no need to call under below.
430+
// thus there is no need to call Underlying below.
431431
// TODO(gri) Consider doing this in Checker.subst.
432432
// Then this would fall out automatically here and also
433433
// in instantiation (where we also explicitly nil out

src/cmd/compile/internal/types2/lookup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ func lookupFieldOrMethodImpl(T Type, addressable bool, pkg *Package, name string
145145
return // blank fields/methods are never found
146146
}
147147

148-
// Importantly, we must not call under before the call to deref below (nor
149-
// does deref call under), as doing so could incorrectly result in finding
148+
// Importantly, we must not call Underlying before the call to deref below (nor
149+
// does deref call Underlying), as doing so could incorrectly result in finding
150150
// methods of the pointer base type when T is a (*Named) pointer type.
151151
typ, isPtr := deref(T)
152152

src/cmd/compile/internal/types2/named.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ func (n *Named) Underlying() Type {
521521
n.resolve()
522522

523523
// The gccimporter depends on writing a nil underlying via NewNamed and
524-
// immediately reading it back. Rather than putting that in under() and
525-
// complicating things there, we just check for that special case here.
524+
// immediately reading it back. Rather than putting that in Named.under
525+
// and complicating things there, we just check for that special case here.
526526
if n.fromRHS == nil {
527527
assert(n.allowNilRHS)
528528
if n.allowNilUnderlying {

src/cmd/compile/internal/types2/predicates.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func isTypeLit(t Type) bool {
8585
// Safe to call from types that are not fully set up.
8686
func isTyped(t Type) bool {
8787
// Alias and named types cannot denote untyped types
88-
// so there's no need to call Unalias or under, below.
88+
// so there's no need to call Unalias or Underlying, below.
8989
b, _ := t.(*Basic)
9090
return b == nil || b.info&IsUntyped == 0
9191
}
@@ -100,7 +100,7 @@ func isUntyped(t Type) bool {
100100
// Safe to call from types that are not fully set up.
101101
func isUntypedNumeric(t Type) bool {
102102
// Alias and named types cannot denote untyped types
103-
// so there's no need to call Unalias or under, below.
103+
// so there's no need to call Unalias or Underlying, below.
104104
b, _ := t.(*Basic)
105105
return b != nil && b.info&IsUntyped != 0 && b.info&IsNumeric != 0
106106
}
@@ -519,7 +519,7 @@ func identicalInstance(xorig Type, xargs []Type, yorig Type, yargs []Type) bool
519519
// for untyped nil is untyped nil.
520520
func Default(t Type) Type {
521521
// Alias and named types cannot denote untyped types
522-
// so there's no need to call Unalias or under, below.
522+
// so there's no need to call Unalias or Underlying, below.
523523
if t, _ := t.(*Basic); t != nil {
524524
switch t.kind {
525525
case UntypedBool:

src/cmd/compile/internal/types2/unify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ func (u *unifier) nify(x, y Type, mode unifyMode, p *ifacePair) (result bool) {
779779
}
780780
// If y is a defined type, it may not match against cx which
781781
// is an underlying type (incl. int, string, etc.). Use assign
782-
// mode here so that the unifier automatically takes under(y)
782+
// mode here so that the unifier automatically uses y.Underlying()
783783
// if necessary.
784784
return u.nify(cx, yorig, assign, p)
785785
}

src/go/types/call.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (check *Checker) funcInst(T *target, pos token.Pos, x *operand, ix *indexed
5858

5959
// Check the number of type arguments (got) vs number of type parameters (want).
6060
// Note that x is a function value, not a type expression, so we don't need to
61-
// call under below.
61+
// call Underlying below.
6262
sig := x.typ.(*Signature)
6363
got, want := len(targs), sig.TypeParams().Len()
6464
if got > want {

src/go/types/infer.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/go/types/lookup.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/go/types/named.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)