]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: remove references to under function in comments
authorRobert Griesemer <gri@google.com>
Thu, 16 Oct 2025 23:09:11 +0000 (16:09 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 17 Oct 2025 17:23:05 +0000 (10:23 -0700)
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>

12 files changed:
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/named.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/unify.go
src/go/types/call.go
src/go/types/infer.go
src/go/types/lookup.go
src/go/types/named.go
src/go/types/predicates.go
src/go/types/unify.go

index aca205ad985013a6ad3fd0d7db75a5e06e00da11..7128ad78668e9ba64be1143a92cc1b5e705da9d4 100644 (file)
@@ -57,7 +57,7 @@ func (check *Checker) funcInst(T *target, pos syntax.Pos, x *operand, inst *synt
 
        // Check the number of type arguments (got) vs number of type parameters (want).
        // Note that x is a function value, not a type expression, so we don't need to
-       // call under below.
+       // call Underlying below.
        sig := x.typ.(*Signature)
        got, want := len(targs), sig.TypeParams().Len()
        if got > want {
index e7c5959737241396bd2ab9595ee1d36c86781799..996f6a510905850dd3fe09799bb7d110a0586728 100644 (file)
@@ -427,7 +427,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type,
                                // Note that if t0 was a signature, t1 must be a signature, and t1
                                // can only be a generic signature if it originated from a generic
                                // function argument. Those signatures are never defined types and
-                               // thus there is no need to call under below.
+                               // thus there is no need to call Underlying below.
                                // TODO(gri) Consider doing this in Checker.subst.
                                //           Then this would fall out automatically here and also
                                //           in instantiation (where we also explicitly nil out
index 0b9282e1a7cfc2444eb689fc72dde5375e64213f..3e18db09f5c4982f772e03a0148d82033d5ba542 100644 (file)
@@ -145,8 +145,8 @@ func lookupFieldOrMethodImpl(T Type, addressable bool, pkg *Package, name string
                return // blank fields/methods are never found
        }
 
-       // Importantly, we must not call under before the call to deref below (nor
-       // does deref call under), as doing so could incorrectly result in finding
+       // Importantly, we must not call Underlying before the call to deref below (nor
+       // does deref call Underlying), as doing so could incorrectly result in finding
        // methods of the pointer base type when T is a (*Named) pointer type.
        typ, isPtr := deref(T)
 
index 4a28929c513a9b9d0566b4909ce8bd4998c8a885..80247e63ded8c84652298fc09ad2419e7798950a 100644 (file)
@@ -521,8 +521,8 @@ func (n *Named) Underlying() Type {
        n.resolve()
 
        // The gccimporter depends on writing a nil underlying via NewNamed and
-       // immediately reading it back. Rather than putting that in under() and
-       // complicating things there, we just check for that special case here.
+       // immediately reading it back. Rather than putting that in Named.under
+       // and complicating things there, we just check for that special case here.
        if n.fromRHS == nil {
                assert(n.allowNilRHS)
                if n.allowNilUnderlying {
index 60147c5e21138c9c80d9968dd498e0ff979a6999..b0578c2991c9bb2731c6756dc85cec2278ddec6e 100644 (file)
@@ -85,7 +85,7 @@ func isTypeLit(t Type) bool {
 // Safe to call from types that are not fully set up.
 func isTyped(t Type) bool {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        b, _ := t.(*Basic)
        return b == nil || b.info&IsUntyped == 0
 }
@@ -100,7 +100,7 @@ func isUntyped(t Type) bool {
 // Safe to call from types that are not fully set up.
 func isUntypedNumeric(t Type) bool {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        b, _ := t.(*Basic)
        return b != nil && b.info&IsUntyped != 0 && b.info&IsNumeric != 0
 }
@@ -519,7 +519,7 @@ func identicalInstance(xorig Type, xargs []Type, yorig Type, yargs []Type) bool
 // for untyped nil is untyped nil.
 func Default(t Type) Type {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        if t, _ := t.(*Basic); t != nil {
                switch t.kind {
                case UntypedBool:
index eecef455ac577c2f76580a6e948a8cd8ef0953e9..f4f24f4d1b7ec0612bbc0bfaf41d33bbd1c8a67d 100644 (file)
@@ -779,7 +779,7 @@ func (u *unifier) nify(x, y Type, mode unifyMode, p *ifacePair) (result bool) {
                                }
                                // If y is a defined type, it may not match against cx which
                                // is an underlying type (incl. int, string, etc.). Use assign
-                               // mode here so that the unifier automatically takes under(y)
+                               // mode here so that the unifier automatically uses y.Underlying()
                                // if necessary.
                                return u.nify(cx, yorig, assign, p)
                        }
index 44549b8727cf0bfb80a982808a094b12cb7b2baa..98498763c82516945d030baaf8375eda4ecb404c 100644 (file)
@@ -58,7 +58,7 @@ func (check *Checker) funcInst(T *target, pos token.Pos, x *operand, ix *indexed
 
        // Check the number of type arguments (got) vs number of type parameters (want).
        // Note that x is a function value, not a type expression, so we don't need to
-       // call under below.
+       // call Underlying below.
        sig := x.typ.(*Signature)
        got, want := len(targs), sig.TypeParams().Len()
        if got > want {
index a8da7ac674abf9247c88af18b64cdc5d8013236c..25a26b38a5eadf739bf97833d0ae9381668643bd 100644 (file)
@@ -430,7 +430,7 @@ func (check *Checker) infer(posn positioner, tparams []*TypeParam, targs []Type,
                                // Note that if t0 was a signature, t1 must be a signature, and t1
                                // can only be a generic signature if it originated from a generic
                                // function argument. Those signatures are never defined types and
-                               // thus there is no need to call under below.
+                               // thus there is no need to call Underlying below.
                                // TODO(gri) Consider doing this in Checker.subst.
                                //           Then this would fall out automatically here and also
                                //           in instantiation (where we also explicitly nil out
index c479303a350b8ce0b81e9b92565193be163baa74..97debb7395e129feb246221b0f63a3086d6660f7 100644 (file)
@@ -148,8 +148,8 @@ func lookupFieldOrMethodImpl(T Type, addressable bool, pkg *Package, name string
                return // blank fields/methods are never found
        }
 
-       // Importantly, we must not call under before the call to deref below (nor
-       // does deref call under), as doing so could incorrectly result in finding
+       // Importantly, we must not call Underlying before the call to deref below (nor
+       // does deref call Underlying), as doing so could incorrectly result in finding
        // methods of the pointer base type when T is a (*Named) pointer type.
        typ, isPtr := deref(T)
 
index d7e4c2479634fca36bf12201d41b5d73a629d0f6..faa7bc2a706a3ccd5aad482cf54a0d119a8779f1 100644 (file)
@@ -524,8 +524,8 @@ func (n *Named) Underlying() Type {
        n.resolve()
 
        // The gccimporter depends on writing a nil underlying via NewNamed and
-       // immediately reading it back. Rather than putting that in under() and
-       // complicating things there, we just check for that special case here.
+       // immediately reading it back. Rather than putting that in Named.under
+       // and complicating things there, we just check for that special case here.
        if n.fromRHS == nil {
                assert(n.allowNilRHS)
                if n.allowNilUnderlying {
index ad929db2667eba0c22ffc4db862ac1ce45a6829f..7a48c2c96c263f7f1bde6ae5b7e6a17a0fcad6ac 100644 (file)
@@ -88,7 +88,7 @@ func isTypeLit(t Type) bool {
 // Safe to call from types that are not fully set up.
 func isTyped(t Type) bool {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        b, _ := t.(*Basic)
        return b == nil || b.info&IsUntyped == 0
 }
@@ -103,7 +103,7 @@ func isUntyped(t Type) bool {
 // Safe to call from types that are not fully set up.
 func isUntypedNumeric(t Type) bool {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        b, _ := t.(*Basic)
        return b != nil && b.info&IsUntyped != 0 && b.info&IsNumeric != 0
 }
@@ -522,7 +522,7 @@ func identicalInstance(xorig Type, xargs []Type, yorig Type, yargs []Type) bool
 // for untyped nil is untyped nil.
 func Default(t Type) Type {
        // Alias and named types cannot denote untyped types
-       // so there's no need to call Unalias or under, below.
+       // so there's no need to call Unalias or Underlying, below.
        if t, _ := t.(*Basic); t != nil {
                switch t.kind {
                case UntypedBool:
index ea96de82f0f2974969bc3944a23c4d9a91fc472d..3b52e6e1e67350868fee42928873b72506177dcc 100644 (file)
@@ -782,7 +782,7 @@ func (u *unifier) nify(x, y Type, mode unifyMode, p *ifacePair) (result bool) {
                                }
                                // If y is a defined type, it may not match against cx which
                                // is an underlying type (incl. int, string, etc.). Use assign
-                               // mode here so that the unifier automatically takes under(y)
+                               // mode here so that the unifier automatically uses y.Underlying()
                                // if necessary.
                                return u.nify(cx, yorig, assign, p)
                        }