Follow-up on CL 462856 which missed a few places.
Fixed manually.
Change-Id: I924560ecae8923d9228027016805a3cc892f8ac2
Reviewed-on: https://go-review.googlesource.com/c/go/+/463749
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
// expression and not the current constant declaration. Use
// the constant identifier position for any errors during
// init expression evaluation since that is all we have
- // (see issues #42991, #42992).
+ // (see issues go.dev/issue/42991, go.dev/issue/42992).
check.errpos = obj.pos
}
check.expr(&x, init)
if isUntyped(y.typ) {
// Caution: Check for representability here, rather than in the switch
- // below, because isInteger includes untyped integers (was bug #43697).
+ // below, because isInteger includes untyped integers (was bug go.dev/issue/43697).
check.representable(y, Typ[Uint])
if y.mode == invalid {
x.mode = invalid
}
case isUntyped(y.typ):
// This is incorrect, but preserves pre-existing behavior.
- // See also bug #47410.
+ // See also go.dev/issue/47410.
check.convertUntyped(y, Typ[Uint])
if y.mode == invalid {
x.mode = invalid
// init expression/func declaration which contains
// them: use existing package-level declaration info.
decl := check.decl // capture for use in closure below
- iota := check.iota // capture for use in closure below (#22345)
+ iota := check.iota // capture for use in closure below (go.dev/issue/22345)
// Don't type-check right away because the function may
// be part of a type definition to which the function
// body refers. Instead, type-check as soon as possible,
- // but before the enclosing scope contents changes (#22992).
+ // but before the enclosing scope contents changes (go.dev/issue/22992).
check.later(func() {
check.funcBody(decl, "<function literal>", sig, e.Body, iota)
}).describef(e, "func literal")
// For instance, given [P T1|T2, ...] where the type argument for P is (named
// type) T1, and T1 and T2 have the same built-in (named) type T0 as underlying
// type, the core type will be the named type T0, which doesn't match T1.
- // Yet the instantiation of P with T1 is clearly valid (see #53650).
+ // Yet the instantiation of P with T1 is clearly valid (see go.dev/issue/53650).
// Reporting an error if unification fails would be incorrect in this case.
// On the other hand, it is safe to ignore failing unification during constraint
// type inference because if the failure is true, an error will be reported when
altS, mS := check.funcString(alt, false), check.funcString(m, false)
if altS == mS {
- // Would tell the user that Foo isn't a Foo, add package information to disambiguate. See #54258.
+ // Would tell the user that Foo isn't a Foo, add package information to disambiguate.
+ // See go.dev/issue/54258.
altS, mS = check.funcString(alt, true), check.funcString(m, true)
}
} else if len(tparams) < len(recvTParams) {
// Reporting an error here is a stop-gap measure to avoid crashes in the
// compiler when a type parameter/argument cannot be inferred later. It
- // may lead to follow-on errors (see issues #51339, #51343).
+ // may lead to follow-on errors (see issues go.dev/issue/51339, go.dev/issue/51343).
// TODO(gri) find a better solution
got := measure(len(tparams), "type parameter")
check.errorf(recvPar, BadRecv, "got %s, but receiver base type declares %d", got, len(recvTParams))
sig.recv = recv
// Delay validation of receiver type as it may cause premature expansion
- // of types the receiver type is dependent on (see issues #51232, #51233).
+ // of types the receiver type is dependent on (see issues go.dev/issue/51232, go.dev/issue/51233).
check.later(func() {
// spec: "The receiver type must be of the form T or *T where T is a type name."
rtyp, _ := deref(recv.typ)
var excluded = map[string]bool{
"builtin": true,
- // See #46027: some imports are missing for this submodule.
+ // go.dev/issue/46027: some imports are missing for this submodule.
"crypto/internal/edwards25519/field/_asm": true,
"crypto/internal/bigmod/_asm": true,
}
}
obj := NewVar(lhs.Pos(), check.pkg, lhs.Value, T)
// TODO(mdempsky): Just use clause.Colon? Why did I even suggest
- // "at the end of the TypeSwitchCase" in #16794 instead?
+ // "at the end of the TypeSwitchCase" in go.dev/issue/16794 instead?
scopePos := clause.Pos() // for default clause (len(List) == 0)
if n := len(cases); n > 0 {
scopePos = syntax.EndPos(cases[n-1])
// If typ.base is invalid, it's unlikely that *base is particularly
// useful - even a valid dereferenciation will lead to an invalid
// type again, and in some cases we get unexpected follow-on errors
- // (e.g., see #49005). Return an invalid type instead.
+ // (e.g., go.dev/issue/49005). Return an invalid type instead.
if typ.base == Typ[Invalid] {
return Typ[Invalid]
}
const (
// Upper limit for recursion depth. Used to catch infinite recursions
- // due to implementation issues (e.g., see issues #48619, #48656).
+ // due to implementation issues (e.g., see issues go.dev/issue/48619, go.dev/issue/48656).
unificationDepthLimit = 50
// Whether to panic when unificationDepthLimit is reached.
// We can type-check this fine but we're introducing a synthetic
// type parameter for the result. It's not clear what the API
- // implications are here. Report an error for 1.18 (see #50912),
+ // implications are here. Report an error for 1.18 (see go.dev/issue/50912),
// but continue type-checking.
var code Code
switch id {
// expression and not the current constant declaration. Use
// the constant identifier position for any errors during
// init expression evaluation since that is all we have
- // (see issues #42991, #42992).
+ // (see issues go.dev/issue/42991, go.dev/issue/42992).
check.errpos = atPos(obj.pos)
}
check.expr(&x, init)
if !hasNil(target) {
return nil, nil, InvalidUntypedConversion
}
- // Preserve the type of nil as UntypedNil: see #13061.
+ // Preserve the type of nil as UntypedNil: see go.dev/issue/13061.
return Typ[UntypedNil], nil, 0
default:
return nil, nil, InvalidUntypedConversion
}) {
return nil, nil, InvalidUntypedConversion
}
- // keep nil untyped (was bug #39755)
+ // keep nil untyped (was bug go.dev/issue/39755)
if x.isNil() {
return Typ[UntypedNil], nil, 0
}
if isUntyped(y.typ) {
// Caution: Check for representability here, rather than in the switch
- // below, because isInteger includes untyped integers (was bug #43697).
+ // below, because isInteger includes untyped integers (was bug go.dev/issue/43697).
check.representable(y, Typ[Uint])
if y.mode == invalid {
x.mode = invalid
}
case isUntyped(y.typ):
// This is incorrect, but preserves pre-existing behavior.
- // See also bug #47410.
+ // See also go.dev/issue/47410.
check.convertUntyped(y, Typ[Uint])
if y.mode == invalid {
x.mode = invalid
// init expression/func declaration which contains
// them: use existing package-level declaration info.
decl := check.decl // capture for use in closure below
- iota := check.iota // capture for use in closure below (#22345)
+ iota := check.iota // capture for use in closure below (go.dev/issue/22345)
// Don't type-check right away because the function may
// be part of a type definition to which the function
// body refers. Instead, type-check as soon as possible,
- // but before the enclosing scope contents changes (#22992).
+ // but before the enclosing scope contents changes (go.dev/issue/22992).
check.later(func() {
check.funcBody(decl, "<function literal>", sig, e.Body, iota)
}).describef(e, "func literal")
// For instance, given [P T1|T2, ...] where the type argument for P is (named
// type) T1, and T1 and T2 have the same built-in (named) type T0 as underlying
// type, the core type will be the named type T0, which doesn't match T1.
- // Yet the instantiation of P with T1 is clearly valid (see #53650).
+ // Yet the instantiation of P with T1 is clearly valid (see go.dev/issue/53650).
// Reporting an error if unification fails would be incorrect in this case.
// On the other hand, it is safe to ignore failing unification during constraint
// type inference because if the failure is true, an error will be reported when
altS, mS := check.funcString(alt, false), check.funcString(m, false)
if altS == mS {
- // Would tell the user that Foo isn't a Foo, add package information to disambiguate. See #54258.
+ // Would tell the user that Foo isn't a Foo, add package information to disambiguate.
+ // See go.dev/issue/54258.
altS, mS = check.funcString(alt, true), check.funcString(m, true)
}
} else if len(tparams) < len(recvTParams) {
// Reporting an error here is a stop-gap measure to avoid crashes in the
// compiler when a type parameter/argument cannot be inferred later. It
- // may lead to follow-on errors (see issues #51339, #51343).
+ // may lead to follow-on errors (see issues go.dev/issue/51339, go.dev/issue/51343).
// TODO(gri) find a better solution
got := measure(len(tparams), "type parameter")
check.errorf(recvPar, BadRecv, "got %s, but receiver base type declares %d", got, len(recvTParams))
sig.recv = recv
// Delay validation of receiver type as it may cause premature expansion
- // of types the receiver type is dependent on (see issues #51232, #51233).
+ // of types the receiver type is dependent on (see issues go.dev/issue/51232, go.dev/issue/51233).
check.later(func() {
// spec: "The receiver type must be of the form T or *T where T is a type name."
rtyp, _ := deref(recv.typ)
"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", // go.dev/issue/34333 which was exposed with fix for #34151
+ "bug251.go", // go.dev/issue/34333 which was exposed with fix for go.dev/issue/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
var excluded = map[string]bool{
"builtin": true,
- // See #46027: some imports are missing for this submodule.
+ // See go.dev/issue/46027: some imports are missing for this submodule.
"crypto/internal/edwards25519/field/_asm": true,
"crypto/internal/bigmod/_asm": true,
}
// 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
+// TODO(gri) Once go.dev/issue/52080 is fixed, this file can be
// deleted in favor of the re-enabled tests
// in the shared file.
const (
// Upper limit for recursion depth. Used to catch infinite recursions
- // due to implementation issues (e.g., see issues #48619, #48656).
+ // due to implementation issues (e.g., see issues go.dev/issue/48619, go.dev/issue/48656).
unificationDepthLimit = 50
// Whether to panic when unificationDepthLimit is reached.