From: Robert Griesemer Date: Thu, 19 Jan 2023 23:53:54 +0000 (-0800) Subject: go/types, types2: use go.dev/issue/nnnnn when referring to an issue (cleanup) X-Git-Tag: go1.21rc1~1851 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5724daa6825db0a9097254060633439e6538d845;p=gostls13.git go/types, types2: use go.dev/issue/nnnnn when referring to an issue (cleanup) Apply the following regex substitutions, in order: golang/go#(\d+) => go.dev/issue/$1 issue #?(\d+) => go.dev/issue/$1 Providing a link uniformly makes it easier to find the respective issue. Change-Id: I9b60ffa1adb95be181f6711c2f171be3afe2b315 Reviewed-on: https://go-review.googlesource.com/c/go/+/462856 TryBot-Result: Gopher Robot Reviewed-by: Robert Findley Reviewed-by: Robert Griesemer Run-TryBot: Robert Griesemer Auto-Submit: Robert Griesemer --- diff --git a/src/cmd/compile/internal/types2/api_test.go b/src/cmd/compile/internal/types2/api_test.go index 6d03935ca1..41ee641f59 100644 --- a/src/cmd/compile/internal/types2/api_test.go +++ b/src/cmd/compile/internal/types2/api_test.go @@ -131,8 +131,8 @@ func TestValuesInfo(t *testing.T) { {`package f6b; var _ = 1e-2000i`, `1e-2000i`, `complex128`, `(0 + 0i)`}, {`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`}, - {`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341 - {`package g1; var(j int32; s int; n = 1.0< shiftBound { check.errorf(y, InvalidShiftCount, invalidOp+"invalid shift count %s", y) @@ -1039,7 +1039,7 @@ func (check *Checker) shift(x, y *operand, e syntax.Expr, op syntax.Operator) { // the same expr node still just leads to one entry for // that node, and it can only be deleted once). // Be cautious and check for presence of entry. - // Example: var e, f = int(1<<""[f]) // issue 11347 + // Example: var e, f = int(1<<""[f]) // go.dev/issue/11347 if info, found := check.untyped[x.expr]; found { info.isLhs = true check.untyped[x.expr] = info @@ -1190,7 +1190,7 @@ func (check *Checker) binary(x *operand, e syntax.Expr, lhs, rhs syntax.Expr, op return } - // check for divisor underflow in complex division (see issue 20227) + // check for divisor underflow in complex division (see go.dev/issue/20227) if x.mode == constant_ && y.mode == constant_ && isComplex(x.typ) { re, im := constant.Real(y.val), constant.Imag(y.val) re2, im2 := constant.BinaryOp(re, token.MUL, re), constant.BinaryOp(im, token.MUL, im) @@ -1288,7 +1288,7 @@ func (check *Checker) nonGeneric(x *operand) { // Must only be called by rawExpr. func (check *Checker) exprInternal(x *operand, e syntax.Expr, hint Type) exprKind { // make sure x has a valid state in case of bailout - // (was issue 5770) + // (was go.dev/issue/5770) x.mode = invalid x.typ = Typ[Invalid] @@ -1339,7 +1339,7 @@ func (check *Checker) exprInternal(x *operand, e syntax.Expr, hint Type) exprKin check.errorf(e, InvalidConstVal, "malformed constant: %s", e.Value) goto Error } - // Ensure that integer values don't overflow (issue #54280). + // Ensure that integer values don't overflow (go.dev/issue/54280). x.expr = e // make sure that check.overflow below has an error position check.overflow(x) @@ -1476,7 +1476,7 @@ func (check *Checker) exprInternal(x *operand, e syntax.Expr, hint Type) exprKin } case *Array: - // Prevent crash if the array referred to is not yet set up. Was issue #18643. + // Prevent crash if the array referred to is not yet set up. Was go.dev/issue/18643. // This is a stop-gap solution. Should use Checker.objPath to report entire // path starting with earliest declaration in the source. TODO(gri) fix this. if utyp.elem == nil { @@ -1491,7 +1491,7 @@ func (check *Checker) exprInternal(x *operand, e syntax.Expr, hint Type) exprKin // length the same here because it makes sense to "guess" the length for // the latter if we have a composite literal; e.g. for [n]int{1, 2, 3} // where n is invalid for some reason, it seems fair to assume it should - // be 3 (see also Checked.arrayLength and issue #27346). + // be 3 (see also Checked.arrayLength and go.dev/issue/27346). if utyp.len < 0 { utyp.len = n // e.Type is missing if we have a composite literal element diff --git a/src/cmd/compile/internal/types2/infer.go b/src/cmd/compile/internal/types2/infer.go index 9f57476c57..84279afedf 100644 --- a/src/cmd/compile/internal/types2/infer.go +++ b/src/cmd/compile/internal/types2/infer.go @@ -72,7 +72,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type, // named and unnamed types are passed to parameters with identical type, different types // (named vs underlying) may be inferred depending on the order of the arguments. // By ensuring that named types are seen first, order dependence is avoided and unification - // succeeds where it can (issue #43056). + // succeeds where it can (go.dev/issue/43056). const enableArgSorting = true if m := len(args); m >= 2 && enableArgSorting { // Determine indices of arguments with named and unnamed types. @@ -631,7 +631,7 @@ func (check *Checker) inferB(tparams []*TypeParam, targs []Type) (types []Type, // Once nothing changes anymore, we may still have type parameters left; // e.g., a constraint with core type *P may match a type parameter Q but - // we don't have any type arguments to fill in for *P or Q (issue #45548). + // we don't have any type arguments to fill in for *P or Q (go.dev/issue/45548). // Don't let such inferences escape, instead nil them out. for i, typ := range types { if typ != nil && isParameterized(tparams, typ) { diff --git a/src/cmd/compile/internal/types2/instantiate.go b/src/cmd/compile/internal/types2/instantiate.go index 17cdc497bc..9f5eb268ac 100644 --- a/src/cmd/compile/internal/types2/instantiate.go +++ b/src/cmd/compile/internal/types2/instantiate.go @@ -168,7 +168,7 @@ func (check *Checker) validateTArgLen(pos syntax.Pos, ntparams, ntargs int) bool func (check *Checker) verify(pos syntax.Pos, tparams []*TypeParam, targs []Type, ctxt *Context) (int, error) { smap := makeSubstMap(tparams, targs) for i, tpar := range tparams { - // Ensure that we have a (possibly implicit) interface as type bound (issue #51048). + // Ensure that we have a (possibly implicit) interface as type bound (go.dev/issue/51048). tpar.iface() // The type parameter bound is parameterized with the same type parameters // as the instantiated type; before we can use it for bounds checking we @@ -196,7 +196,7 @@ func (check *Checker) implements(V, T Type, constraint bool, cause *string) bool return true // avoid follow-on errors } if p, _ := Vu.(*Pointer); p != nil && under(p.base) == Typ[Invalid] { - return true // avoid follow-on errors (see issue #49541 for an example) + return true // avoid follow-on errors (see go.dev/issue/49541 for an example) } verb := "implement" diff --git a/src/cmd/compile/internal/types2/lookup.go b/src/cmd/compile/internal/types2/lookup.go index f66f2ef98e..96d87fe66a 100644 --- a/src/cmd/compile/internal/types2/lookup.go +++ b/src/cmd/compile/internal/types2/lookup.go @@ -52,7 +52,7 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o // in the same package as the method."). // Thus, if we have a named pointer type, proceed with the underlying // pointer type but discard the result if it is a method since we would - // not have found it for T (see also issue 8590). + // not have found it for T (see also go.dev/issue/8590). if t, _ := T.(*Named); t != nil { if p, _ := t.Underlying().(*Pointer); p != nil { obj, index, indirect = lookupFieldOrMethod(p, false, pkg, name, false) @@ -69,7 +69,7 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o // see if there is a matching field (but not a method, those need to be declared // explicitly in the constraint). If the constraint is a named pointer type (see // above), we are ok here because only fields are accepted as results. - const enableTParamFieldLookup = false // see issue #51576 + const enableTParamFieldLookup = false // see go.dev/issue/51576 if enableTParamFieldLookup && obj == nil && isTypeParam(T) { if t := coreType(T); t != nil { obj, index, indirect = lookupFieldOrMethod(t, addressable, pkg, name, false) diff --git a/src/cmd/compile/internal/types2/named.go b/src/cmd/compile/internal/types2/named.go index 2cf6d3871f..5408c7e77f 100644 --- a/src/cmd/compile/internal/types2/named.go +++ b/src/cmd/compile/internal/types2/named.go @@ -539,7 +539,7 @@ loop: for n := range seen { // We should never have to update the underlying type of an imported type; // those underlying types should have been resolved during the import. - // Also, doing so would lead to a race condition (was issue #31749). + // Also, doing so would lead to a race condition (was go.dev/issue/31749). // Do this check always, not just in debug mode (it's cheap). if n.obj.pkg != check.pkg { panic("imported type with unresolved underlying type") diff --git a/src/cmd/compile/internal/types2/named_test.go b/src/cmd/compile/internal/types2/named_test.go index 7938904a93..0b1819bbf9 100644 --- a/src/cmd/compile/internal/types2/named_test.go +++ b/src/cmd/compile/internal/types2/named_test.go @@ -72,7 +72,7 @@ func mustInstantiate(tb testing.TB, orig Type, targs ...Type) Type { return inst } -// Test that types do not expand infinitely, as in golang/go#52715. +// Test that types do not expand infinitely, as in go.dev/issue/52715. func TestFiniteTypeExpansion(t *testing.T) { const src = ` package p diff --git a/src/cmd/compile/internal/types2/object_test.go b/src/cmd/compile/internal/types2/object_test.go index ce47003474..85b9e697ee 100644 --- a/src/cmd/compile/internal/types2/object_test.go +++ b/src/cmd/compile/internal/types2/object_test.go @@ -53,7 +53,7 @@ func TestIsAlias(t *testing.T) { } // TestEmbeddedMethod checks that an embedded method is represented by -// the same Func Object as the original method. See also issue #34421. +// the same Func Object as the original method. See also go.dev/issue/34421. func TestEmbeddedMethod(t *testing.T) { const src = `package p; type I interface { error }` pkg := mustTypecheck("p", src, nil, nil) diff --git a/src/cmd/compile/internal/types2/resolver.go b/src/cmd/compile/internal/types2/resolver.go index cb29f720b2..8aeafceadb 100644 --- a/src/cmd/compile/internal/types2/resolver.go +++ b/src/cmd/compile/internal/types2/resolver.go @@ -312,7 +312,7 @@ func (check *Checker) collectObjects() { // (Do not use check.declare because it modifies the object // via Object.setScopePos, which leads to a race condition; // the object may be imported into more than one file scope - // concurrently. See issue #32154.) + // concurrently. See go.dev/issue/32154.) if alt := fileScope.Lookup(name); alt != nil { var err error_ err.code = DuplicateDecl @@ -658,7 +658,7 @@ func (check *Checker) packageObjects() { // We process non-alias type declarations first, followed by alias declarations, // and then everything else. This appears to avoid most situations where the type // of an alias is needed before it is available. - // There may still be cases where this is not good enough (see also issue #25838). + // There may still be cases where this is not good enough (see also go.dev/issue/25838). // In those cases Checker.ident will report an error ("invalid use of type alias"). var aliasList []*TypeName var othersList []Object // everything that's not a type diff --git a/src/cmd/compile/internal/types2/return.go b/src/cmd/compile/internal/types2/return.go index 7cdea99e08..ab611ef9b2 100644 --- a/src/cmd/compile/internal/types2/return.go +++ b/src/cmd/compile/internal/types2/return.go @@ -64,7 +64,7 @@ func (check *Checker) isTerminating(s syntax.Stmt, label string) bool { case *syntax.ForStmt: if _, ok := s.Init.(*syntax.RangeClause); ok { // Range clauses guarantee that the loop terminates, - // so the loop is not a terminating statement. See issue 49003. + // so the loop is not a terminating statement. See go.dev/issue/49003. break } if s.Cond == nil && !hasBreak(s.Body, label, true) { diff --git a/src/cmd/compile/internal/types2/sizes_test.go b/src/cmd/compile/internal/types2/sizes_test.go index 664eff3cf0..f2e4a87c71 100644 --- a/src/cmd/compile/internal/types2/sizes_test.go +++ b/src/cmd/compile/internal/types2/sizes_test.go @@ -30,7 +30,7 @@ func findStructTypeConfig(t *testing.T, src string, conf *types2.Config) *types2 return nil } -// Issue 16316 +// go.dev/issue/16316 func TestMultipleSizeUse(t *testing.T) { const src = ` package main @@ -53,7 +53,7 @@ type S struct { } } -// Issue 16464 +// go.dev/issue/16464 func TestAlignofNaclSlice(t *testing.T) { const src = ` package main @@ -96,7 +96,7 @@ const _ = unsafe.Offsetof(struct{ x int64 }{}.x) } } -// Issue #53884. +// go.dev/issue/53884. func TestAtomicAlign(t *testing.T) { testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files. diff --git a/src/cmd/compile/internal/types2/stmt.go b/src/cmd/compile/internal/types2/stmt.go index 01debc66c1..1ddaef39ab 100644 --- a/src/cmd/compile/internal/types2/stmt.go +++ b/src/cmd/compile/internal/types2/stmt.go @@ -887,7 +887,7 @@ func (check *Checker) rangeStmt(inner stmtContext, s *syntax.ForStmt, rclause *s } // Open the for-statement block scope now, after the range clause. - // Iteration variables declared with := need to go in this scope (was issue #51437). + // Iteration variables declared with := need to go in this scope (was go.dev/issue/51437). check.openScope(s, "range") defer check.closeScope() diff --git a/src/cmd/compile/internal/types2/struct.go b/src/cmd/compile/internal/types2/struct.go index 5e93cb9ea5..5de3fa8f42 100644 --- a/src/cmd/compile/internal/types2/struct.go +++ b/src/cmd/compile/internal/types2/struct.go @@ -100,7 +100,7 @@ func (check *Checker) structType(styp *Struct, e *syntax.StructType) { // addInvalid adds an embedded field of invalid type to the struct for // fields with errors; this keeps the number of struct fields in sync // with the source as long as the fields are _ or have different names - // (issue #25627). + // (go.dev/issue/25627). addInvalid := func(ident *syntax.Name, pos syntax.Pos) { typ = Typ[Invalid] tag = "" diff --git a/src/cmd/compile/internal/types2/typeset.go b/src/cmd/compile/internal/types2/typeset.go index 673cadca90..af5aa40949 100644 --- a/src/cmd/compile/internal/types2/typeset.go +++ b/src/cmd/compile/internal/types2/typeset.go @@ -204,7 +204,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_ // the method m in an interface that embeds interface I. On the other hand, // if a method is embedded via multiple overlapping embedded interfaces, we // don't provide a guarantee which "original m" got chosen for the embedding - // interface. See also issue #34421. + // interface. See also go.dev/issue/34421. // // If we don't care to provide this identity guarantee anymore, instead of // reusing the original method in embeddings, we can clone the method's Func @@ -233,7 +233,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_ check.report(&err) default: // We have a duplicate method name in an embedded (not explicitly declared) method. - // Check method signatures after all types are computed (issue #33656). + // Check method signatures after all types are computed (go.dev/issue/33656). // If we're pre-go1.14 (overlapping embeddings are not permitted), report that // error here as well (even though we could do it eagerly) because it's the same // error message. diff --git a/src/cmd/compile/internal/types2/typestring.go b/src/cmd/compile/internal/types2/typestring.go index 2307b6139d..ecabe013e3 100644 --- a/src/cmd/compile/internal/types2/typestring.go +++ b/src/cmd/compile/internal/types2/typestring.go @@ -160,7 +160,7 @@ func (w *typeWriter) typ(typ Type) { // This doesn't do the right thing for embedded type // aliases where we should print the alias name, not - // the aliased type (see issue #44410). + // the aliased type (see go.dev/issue/44410). if !f.embedded { w.string(f.name) w.byte(' ') diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go index 0f3106d70a..cddc7f070b 100644 --- a/src/cmd/compile/internal/types2/typexpr.go +++ b/src/cmd/compile/internal/types2/typexpr.go @@ -56,7 +56,7 @@ func (check *Checker) ident(x *operand, e *syntax.Name, def *Named, wantType boo // a cycle which needs to be reported). Otherwise we can skip the // call and avoid a possible cycle error in favor of the more // informative "not a type/value" error that this function's caller - // will issue (see issue #25790). + // will issue (see go.dev/issue/25790). typ := obj.Type() if _, gotType := obj.(*TypeName); typ == nil || gotType && wantType { check.objDecl(obj, def) @@ -96,7 +96,7 @@ func (check *Checker) ident(x *operand, e *syntax.Name, def *Named, wantType boo case *TypeName: if check.isBrokenAlias(obj) { - check.errorf(e, InvalidDeclCycle, "invalid use of type alias %s in recursive type (see issue #50729)", obj.name) + check.errorf(e, InvalidDeclCycle, "invalid use of type alias %s in recursive type (see go.dev/issue/50729)", obj.name) return } x.mode = typexpr @@ -359,7 +359,7 @@ func (check *Checker) typInternal(e0 syntax.Expr, def *Named) (T Type) { // function, map, or slice." // // Delay this check because it requires fully setup types; - // it is safe to continue in any case (was issue 6667). + // it is safe to continue in any case (was go.dev/issue/6667). check.later(func() { if !Comparable(typ.key) { var why string diff --git a/src/cmd/compile/internal/types2/unify.go b/src/cmd/compile/internal/types2/unify.go index 7063789f3f..08508c0e60 100644 --- a/src/cmd/compile/internal/types2/unify.go +++ b/src/cmd/compile/internal/types2/unify.go @@ -357,7 +357,7 @@ func (u *unifier) nify(x, y Type, p *ifacePair) (result bool) { // If we get here and x or y is a type parameter, they are type parameters // from outside our declaration list. Try to unify their core types, if any - // (see issue #50755 for a test case). + // (see go.dev/issue/50755 for a test case). if enableCoreTypeUnification && !u.exact { if isTypeParam(x) && !hasName(y) { // When considering the type parameter for unification diff --git a/src/cmd/compile/internal/types2/union.go b/src/cmd/compile/internal/types2/union.go index 1fafb052c1..8f354a708f 100644 --- a/src/cmd/compile/internal/types2/union.go +++ b/src/cmd/compile/internal/types2/union.go @@ -143,7 +143,7 @@ func parseTilde(check *Checker, tx syntax.Expr) *Term { tilde = true } typ := check.typ(x) - // Embedding stand-alone type parameters is not permitted (issue #47127). + // Embedding stand-alone type parameters is not permitted (go.dev/issue/47127). // We don't need this restriction anymore if we make the underlying type of a type // parameter its constraint interface: if we embed a lone type parameter, we will // simply use its underlying type (like we do for other named, embedded interfaces), diff --git a/src/go/types/api_test.go b/src/go/types/api_test.go index b154ad5852..7cfad422e9 100644 --- a/src/go/types/api_test.go +++ b/src/go/types/api_test.go @@ -134,8 +134,8 @@ func TestValuesInfo(t *testing.T) { {`package f6b; var _ = 1e-2000i`, `1e-2000i`, `complex128`, `(0 + 0i)`}, {`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`}, - {`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341 - {`package g1; var(j int32; s int; n = 1.0< shiftBound { check.errorf(y, InvalidShiftCount, invalidOp+"invalid shift count %s", y) @@ -1020,7 +1020,7 @@ func (check *Checker) shift(x, y *operand, e ast.Expr, op token.Token) { // the same expr node still just leads to one entry for // that node, and it can only be deleted once). // Be cautious and check for presence of entry. - // Example: var e, f = int(1<<""[f]) // issue 11347 + // Example: var e, f = int(1<<""[f]) // go.dev/issue/11347 if info, found := check.untyped[x.expr]; found { info.isLhs = true check.untyped[x.expr] = info @@ -1175,7 +1175,7 @@ func (check *Checker) binary(x *operand, e ast.Expr, lhs, rhs ast.Expr, op token return } - // check for divisor underflow in complex division (see issue 20227) + // check for divisor underflow in complex division (see go.dev/issue/20227) if x.mode == constant_ && y.mode == constant_ && isComplex(x.typ) { re, im := constant.Real(y.val), constant.Imag(y.val) re2, im2 := constant.BinaryOp(re, token.MUL, re), constant.BinaryOp(im, token.MUL, im) @@ -1272,7 +1272,7 @@ func (check *Checker) nonGeneric(x *operand) { // Must only be called by rawExpr. func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { // make sure x has a valid state in case of bailout - // (was issue 5770) + // (was go.dev/issue/5770) x.mode = invalid x.typ = Typ[Invalid] @@ -1317,7 +1317,7 @@ func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { check.errorf(e, InvalidConstVal, "malformed constant: %s", e.Value) goto Error } - // Ensure that integer values don't overflow (issue #54280). + // Ensure that integer values don't overflow (go.dev/issue/54280). check.overflow(x, e.Pos()) case *ast.FuncLit: @@ -1457,7 +1457,7 @@ func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { } case *Array: - // Prevent crash if the array referred to is not yet set up. Was issue #18643. + // Prevent crash if the array referred to is not yet set up. Was go.dev/issue/18643. // This is a stop-gap solution. Should use Checker.objPath to report entire // path starting with earliest declaration in the source. TODO(gri) fix this. if utyp.elem == nil { @@ -1472,7 +1472,7 @@ func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { // length the same here because it makes sense to "guess" the length for // the latter if we have a composite literal; e.g. for [n]int{1, 2, 3} // where n is invalid for some reason, it seems fair to assume it should - // be 3 (see also Checked.arrayLength and issue #27346). + // be 3 (see also Checked.arrayLength and go.dev/issue/27346). if utyp.len < 0 { utyp.len = n // e.Type is missing if we have a composite literal element diff --git a/src/go/types/infer.go b/src/go/types/infer.go index 2dc9ad17f9..ef14353540 100644 --- a/src/go/types/infer.go +++ b/src/go/types/infer.go @@ -74,7 +74,7 @@ func (check *Checker) infer(posn positioner, tparams []*TypeParam, targs []Type, // named and unnamed types are passed to parameters with identical type, different types // (named vs underlying) may be inferred depending on the order of the arguments. // By ensuring that named types are seen first, order dependence is avoided and unification - // succeeds where it can (issue #43056). + // succeeds where it can (go.dev/issue/43056). const enableArgSorting = true if m := len(args); m >= 2 && enableArgSorting { // Determine indices of arguments with named and unnamed types. @@ -633,7 +633,7 @@ func (check *Checker) inferB(tparams []*TypeParam, targs []Type) (types []Type, // Once nothing changes anymore, we may still have type parameters left; // e.g., a constraint with core type *P may match a type parameter Q but - // we don't have any type arguments to fill in for *P or Q (issue #45548). + // we don't have any type arguments to fill in for *P or Q (go.dev/issue/45548). // Don't let such inferences escape, instead nil them out. for i, typ := range types { if typ != nil && isParameterized(tparams, typ) { diff --git a/src/go/types/instantiate.go b/src/go/types/instantiate.go index 726e84d7ab..ab3a9451c0 100644 --- a/src/go/types/instantiate.go +++ b/src/go/types/instantiate.go @@ -170,7 +170,7 @@ func (check *Checker) validateTArgLen(pos token.Pos, ntparams, ntargs int) bool func (check *Checker) verify(pos token.Pos, tparams []*TypeParam, targs []Type, ctxt *Context) (int, error) { smap := makeSubstMap(tparams, targs) for i, tpar := range tparams { - // Ensure that we have a (possibly implicit) interface as type bound (issue #51048). + // Ensure that we have a (possibly implicit) interface as type bound (go.dev/issue/51048). tpar.iface() // The type parameter bound is parameterized with the same type parameters // as the instantiated type; before we can use it for bounds checking we @@ -198,7 +198,7 @@ func (check *Checker) implements(V, T Type, constraint bool, cause *string) bool return true // avoid follow-on errors } if p, _ := Vu.(*Pointer); p != nil && under(p.base) == Typ[Invalid] { - return true // avoid follow-on errors (see issue #49541 for an example) + return true // avoid follow-on errors (see go.dev/issue/49541 for an example) } verb := "implement" diff --git a/src/go/types/issues_test.go b/src/go/types/issues_test.go index 2b7618cbd0..888ca3cc70 100644 --- a/src/go/types/issues_test.go +++ b/src/go/types/issues_test.go @@ -578,7 +578,7 @@ import ( "html/template" ) -// Issue #46905: make sure template is not the first package qualified. +// go.dev/issue/46905: make sure template is not the first package qualified. var _ fmt.Stringer = 1 // ERRORx "cannot use 1.*as fmt\\.Stringer" // Packages should be fully qualified when there is ambiguity in reachable diff --git a/src/go/types/lookup.go b/src/go/types/lookup.go index 7ed367ee86..fa2b7b2f4b 100644 --- a/src/go/types/lookup.go +++ b/src/go/types/lookup.go @@ -54,7 +54,7 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o // in the same package as the method."). // Thus, if we have a named pointer type, proceed with the underlying // pointer type but discard the result if it is a method since we would - // not have found it for T (see also issue 8590). + // not have found it for T (see also go.dev/issue/8590). if t, _ := T.(*Named); t != nil { if p, _ := t.Underlying().(*Pointer); p != nil { obj, index, indirect = lookupFieldOrMethod(p, false, pkg, name, false) @@ -71,7 +71,7 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o // see if there is a matching field (but not a method, those need to be declared // explicitly in the constraint). If the constraint is a named pointer type (see // above), we are ok here because only fields are accepted as results. - const enableTParamFieldLookup = false // see issue #51576 + const enableTParamFieldLookup = false // see go.dev/issue/51576 if enableTParamFieldLookup && obj == nil && isTypeParam(T) { if t := coreType(T); t != nil { obj, index, indirect = lookupFieldOrMethod(t, addressable, pkg, name, false) diff --git a/src/go/types/methodset_test.go b/src/go/types/methodset_test.go index 13ccf9623e..3f8a0b1a10 100644 --- a/src/go/types/methodset_test.go +++ b/src/go/types/methodset_test.go @@ -65,7 +65,7 @@ func TestNewMethodSet(t *testing.T) { "var a struct{ E1; *E2 }; type ( E1 interface{ f() }; E2 struct{ f int })": {}, "var a struct{ E1; *E2 }; type ( E1 struct{ f int }; E2 struct{} ); func (E2) f() {}": {}, - // recursive generic types; see golang/go#52715 + // recursive generic types; see go.dev/issue/52715 "var a T[int]; type ( T[P any] struct { *N[P] }; N[P any] struct { *T[P] } ); func (N[P]) m() {}": {{"m", []int{0, 0}, true}}, "var a T[int]; type ( T[P any] struct { *N[P] }; N[P any] struct { *T[P] } ); func (T[P]) m() {}": {{"m", []int{0}, false}}, } @@ -75,11 +75,11 @@ func TestNewMethodSet(t *testing.T) { "type C interface{ f() }; func g[T C](a T){}": {{"f", []int{0}, true}}, "type C interface{ f() }; func g[T C]() { var a T; _ = a }": {{"f", []int{0}, true}}, - // Issue #43621: We don't allow this anymore. Keep this code in case we + // go.dev/issue/43621: We don't allow this anymore. Keep this code in case we // decide to revisit this decision. // "type C interface{ f() }; func g[T C]() { var a struct{T}; _ = a }": {{"f", []int{0, 0}, true}}, - // Issue #45639: We also don't allow this anymore. + // go.dev/issue/45639: We also don't allow this anymore. // "type C interface{ f() }; func g[T C]() { type Y T; var a Y; _ = a }": {}, } @@ -125,7 +125,7 @@ func TestNewMethodSet(t *testing.T) { } } -// Test for golang/go#52715 +// Test for go.dev/issue/52715 func TestNewMethodSet_RecursiveGeneric(t *testing.T) { const src = ` package pkg diff --git a/src/go/types/named.go b/src/go/types/named.go index 586f1af880..f1b2685ec3 100644 --- a/src/go/types/named.go +++ b/src/go/types/named.go @@ -541,7 +541,7 @@ loop: for n := range seen { // We should never have to update the underlying type of an imported type; // those underlying types should have been resolved during the import. - // Also, doing so would lead to a race condition (was issue #31749). + // Also, doing so would lead to a race condition (was go.dev/issue/31749). // Do this check always, not just in debug mode (it's cheap). if n.obj.pkg != check.pkg { panic("imported type with unresolved underlying type") diff --git a/src/go/types/named_test.go b/src/go/types/named_test.go index 3cbe1ef83b..55c0021398 100644 --- a/src/go/types/named_test.go +++ b/src/go/types/named_test.go @@ -86,7 +86,7 @@ func mustInstantiate(tb testing.TB, orig Type, targs ...Type) Type { return inst } -// Test that types do not expand infinitely, as in golang/go#52715. +// Test that types do not expand infinitely, as in go.dev/issue/52715. func TestFiniteTypeExpansion(t *testing.T) { const src = ` package p diff --git a/src/go/types/object_test.go b/src/go/types/object_test.go index 912716b9e0..b0459260a1 100644 --- a/src/go/types/object_test.go +++ b/src/go/types/object_test.go @@ -55,7 +55,7 @@ func TestIsAlias(t *testing.T) { } // TestEmbeddedMethod checks that an embedded method is represented by -// the same Func Object as the original method. See also issue #34421. +// the same Func Object as the original method. See also go.dev/issue/34421. func TestEmbeddedMethod(t *testing.T) { const src = `package p; type I interface { error }` pkg := mustTypecheck("p", src, nil, nil) diff --git a/src/go/types/resolver.go b/src/go/types/resolver.go index f1038c151f..f7a78d2eb2 100644 --- a/src/go/types/resolver.go +++ b/src/go/types/resolver.go @@ -325,7 +325,7 @@ func (check *Checker) collectObjects() { // (Do not use check.declare because it modifies the object // via Object.setScopePos, which leads to a race condition; // the object may be imported into more than one file scope - // concurrently. See issue #32154.) + // concurrently. See go.dev/issue/32154.) if alt := fileScope.Lookup(name); alt != nil { check.errorf(d.spec.Name, DuplicateDecl, "%s redeclared in this block", alt.Name()) check.reportAltDecl(alt) @@ -637,7 +637,7 @@ func (check *Checker) packageObjects() { // We process non-alias type declarations first, followed by alias declarations, // and then everything else. This appears to avoid most situations where the type // of an alias is needed before it is available. - // There may still be cases where this is not good enough (see also issue #25838). + // There may still be cases where this is not good enough (see also go.dev/issue/25838). // In those cases Checker.ident will report an error ("invalid use of type alias"). var aliasList []*TypeName var othersList []Object // everything that's not a type diff --git a/src/go/types/sizes_test.go b/src/go/types/sizes_test.go index 7fbafd82c4..4964bf2cf9 100644 --- a/src/go/types/sizes_test.go +++ b/src/go/types/sizes_test.go @@ -31,7 +31,7 @@ func findStructTypeConfig(t *testing.T, src string, conf *types.Config) *types.S return nil } -// Issue 16316 +// go.dev/issue/16316 func TestMultipleSizeUse(t *testing.T) { const src = ` package main @@ -54,7 +54,7 @@ type S struct { } } -// Issue 16464 +// go.dev/issue/16464 func TestAlignofNaclSlice(t *testing.T) { const src = ` package main @@ -97,7 +97,7 @@ const _ = unsafe.Offsetof(struct{ x int64 }{}.x) } } -// Issue #53884. +// go.dev/issue/53884. func TestAtomicAlign(t *testing.T) { testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files. diff --git a/src/go/types/stdlib_test.go b/src/go/types/stdlib_test.go index c0c9fcf7dc..afc413c914 100644 --- a/src/go/types/stdlib_test.go +++ b/src/go/types/stdlib_test.go @@ -192,7 +192,7 @@ func TestStdFixed(t *testing.T) { "issue22200b.go", // go/types does not have constraints on stack size "issue25507.go", // go/types does not have constraints on stack size "issue20780.go", // go/types does not have constraints on stack size - "bug251.go", // issue #34333 which was exposed with fix for #34151 + "bug251.go", // go.dev/issue/34333 which was exposed with fix for #34151 "issue42058a.go", // go/types does not have constraints on channel element size "issue42058b.go", // go/types does not have constraints on channel element size "issue48097.go", // go/types doesn't check validity of //go:xxx directives, and non-init bodyless function diff --git a/src/go/types/stmt.go b/src/go/types/stmt.go index 2a8cf6757f..3571ca0245 100644 --- a/src/go/types/stmt.go +++ b/src/go/types/stmt.go @@ -862,7 +862,7 @@ func (check *Checker) stmt(ctxt stmtContext, s ast.Stmt) { } // Open the for-statement block scope now, after the range clause. - // Iteration variables declared with := need to go in this scope (was issue #51437). + // Iteration variables declared with := need to go in this scope (was go.dev/issue/51437). check.openScope(s, "range") defer check.closeScope() diff --git a/src/go/types/struct.go b/src/go/types/struct.go index 2ed0e6d89a..89aea02cca 100644 --- a/src/go/types/struct.go +++ b/src/go/types/struct.go @@ -102,7 +102,7 @@ func (check *Checker) structType(styp *Struct, e *ast.StructType) { // addInvalid adds an embedded field of invalid type to the struct for // fields with errors; this keeps the number of struct fields in sync // with the source as long as the fields are _ or have different names - // (issue #25627). + // (go.dev/issue/25627). addInvalid := func(ident *ast.Ident, pos token.Pos) { typ = Typ[Invalid] tag = "" diff --git a/src/go/types/testdata/local/shifts.go b/src/go/types/testdata/local/shifts.go index cf847d3e44..a9b50035d7 100644 --- a/src/go/types/testdata/local/shifts.go +++ b/src/go/types/testdata/local/shifts.go @@ -4,7 +4,7 @@ // The following shift tests are disabled in the shared // testdata/check/shifts.go file because they don't work -// correctly with types2 at the moment. See issue #52080. +// correctly with types2 at the moment. See go.dev/issue/52080. // Make sure we keep testing them with go/types. // // TODO(gri) Once #52080 is fixed, this file can be diff --git a/src/go/types/typeset.go b/src/go/types/typeset.go index f86e73849d..926bb86677 100644 --- a/src/go/types/typeset.go +++ b/src/go/types/typeset.go @@ -208,7 +208,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T // the method m in an interface that embeds interface I. On the other hand, // if a method is embedded via multiple overlapping embedded interfaces, we // don't provide a guarantee which "original m" got chosen for the embedding - // interface. See also issue #34421. + // interface. See also go.dev/issue/34421. // // If we don't care to provide this identity guarantee anymore, instead of // reusing the original method in embeddings, we can clone the method's Func @@ -234,7 +234,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T check.errorf(atPos(mpos[other.(*Func)]), DuplicateDecl, "\tother declaration of %s", m.name) // secondary error, \t indented default: // We have a duplicate method name in an embedded (not explicitly declared) method. - // Check method signatures after all types are computed (issue #33656). + // Check method signatures after all types are computed (go.dev/issue/33656). // If we're pre-go1.14 (overlapping embeddings are not permitted), report that // error here as well (even though we could do it eagerly) because it's the same // error message. diff --git a/src/go/types/typestring.go b/src/go/types/typestring.go index cfeb7eb404..9683a0ad1d 100644 --- a/src/go/types/typestring.go +++ b/src/go/types/typestring.go @@ -161,7 +161,7 @@ func (w *typeWriter) typ(typ Type) { // This doesn't do the right thing for embedded type // aliases where we should print the alias name, not - // the aliased type (see issue #44410). + // the aliased type (see go.dev/issue/44410). if !f.embedded { w.string(f.name) w.byte(' ') diff --git a/src/go/types/typexpr.go b/src/go/types/typexpr.go index 57ac3b6d48..861290098d 100644 --- a/src/go/types/typexpr.go +++ b/src/go/types/typexpr.go @@ -57,7 +57,7 @@ func (check *Checker) ident(x *operand, e *ast.Ident, def *Named, wantType bool) // a cycle which needs to be reported). Otherwise we can skip the // call and avoid a possible cycle error in favor of the more // informative "not a type/value" error that this function's caller - // will issue (see issue #25790). + // will issue (see go.dev/issue/25790). typ := obj.Type() if _, gotType := obj.(*TypeName); typ == nil || gotType && wantType { check.objDecl(obj, def) @@ -97,7 +97,7 @@ func (check *Checker) ident(x *operand, e *ast.Ident, def *Named, wantType bool) case *TypeName: if check.isBrokenAlias(obj) { - check.errorf(e, InvalidDeclCycle, "invalid use of type alias %s in recursive type (see issue #50729)", obj.name) + check.errorf(e, InvalidDeclCycle, "invalid use of type alias %s in recursive type (see go.dev/issue/50729)", obj.name) return } x.mode = typexpr @@ -350,7 +350,7 @@ func (check *Checker) typInternal(e0 ast.Expr, def *Named) (T Type) { // function, map, or slice." // // Delay this check because it requires fully setup types; - // it is safe to continue in any case (was issue 6667). + // it is safe to continue in any case (was go.dev/issue/6667). check.later(func() { if !Comparable(typ.key) { var why string diff --git a/src/go/types/unify.go b/src/go/types/unify.go index 58f2eedf8a..9db63ca9ec 100644 --- a/src/go/types/unify.go +++ b/src/go/types/unify.go @@ -359,7 +359,7 @@ func (u *unifier) nify(x, y Type, p *ifacePair) (result bool) { // If we get here and x or y is a type parameter, they are type parameters // from outside our declaration list. Try to unify their core types, if any - // (see issue #50755 for a test case). + // (see go.dev/issue/50755 for a test case). if enableCoreTypeUnification && !u.exact { if isTypeParam(x) && !hasName(y) { // When considering the type parameter for unification diff --git a/src/go/types/union.go b/src/go/types/union.go index 9509afe7a4..085f507ad3 100644 --- a/src/go/types/union.go +++ b/src/go/types/union.go @@ -144,7 +144,7 @@ func parseTilde(check *Checker, tx ast.Expr) *Term { tilde = true } typ := check.typ(x) - // Embedding stand-alone type parameters is not permitted (issue #47127). + // Embedding stand-alone type parameters is not permitted (go.dev/issue/47127). // We don't need this restriction anymore if we make the underlying type of a type // parameter its constraint interface: if we embed a lone type parameter, we will // simply use its underlying type (like we do for other named, embedded interfaces),