mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
go/types: track gotypesalias non-default behavior
Fixes #66216. Change-Id: I04d7389e5712b35db078844ce424e10f5b96156c Reviewed-on: https://go-review.googlesource.com/c/go/+/579936 Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
9101bf1916
commit
e718aee5f5
3 changed files with 12 additions and 1 deletions
|
|
@ -607,6 +607,13 @@ func (check *Checker) typeDecl(obj *TypeName, tdecl *ast.TypeSpec, def *TypeName
|
||||||
alias.fromRHS = rhs
|
alias.fromRHS = rhs
|
||||||
Unalias(alias) // resolve alias.actual
|
Unalias(alias) // resolve alias.actual
|
||||||
} else {
|
} else {
|
||||||
|
// With Go1.23, the default behavior is to use Alias nodes,
|
||||||
|
// reflected by check.enableAlias. Signal non-default behavior.
|
||||||
|
//
|
||||||
|
// TODO(gri) Testing runs tests in both modes. Do we need to exclude
|
||||||
|
// tracking of non-default behavior for tests?
|
||||||
|
gotypesalias.IncNonDefault()
|
||||||
|
|
||||||
if !versionErr && tparam0 != nil {
|
if !versionErr && tparam0 != nil {
|
||||||
check.error(tdecl, UnsupportedFeature, "generic type alias requires GODEBUG=gotypesalias=1 or unset")
|
check.error(tdecl, UnsupportedFeature, "generic type alias requires GODEBUG=gotypesalias=1 or unset")
|
||||||
versionErr = true
|
versionErr = true
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ var All = []Info{
|
||||||
{Name: "gocachehash", Package: "cmd/go"},
|
{Name: "gocachehash", Package: "cmd/go"},
|
||||||
{Name: "gocachetest", Package: "cmd/go"},
|
{Name: "gocachetest", Package: "cmd/go"},
|
||||||
{Name: "gocacheverify", Package: "cmd/go"},
|
{Name: "gocacheverify", Package: "cmd/go"},
|
||||||
{Name: "gotypesalias", Package: "go/types", Changed: 23, Old: "0", Opaque: true}, // bug #66216: remove Opaque
|
{Name: "gotypesalias", Package: "go/types", Changed: 23, Old: "0"},
|
||||||
{Name: "http2client", Package: "net/http"},
|
{Name: "http2client", Package: "net/http"},
|
||||||
{Name: "http2debug", Package: "net/http", Opaque: true},
|
{Name: "http2debug", Package: "net/http", Opaque: true},
|
||||||
{Name: "http2server", Package: "net/http"},
|
{Name: "http2server", Package: "net/http"},
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,10 @@ Below is the full list of supported metrics, ordered lexicographically.
|
||||||
The number of non-default behaviors executed by the cmd/go
|
The number of non-default behaviors executed by the cmd/go
|
||||||
package due to a non-default GODEBUG=gocacheverify=... setting.
|
package due to a non-default GODEBUG=gocacheverify=... setting.
|
||||||
|
|
||||||
|
/godebug/non-default-behavior/gotypesalias:events
|
||||||
|
The number of non-default behaviors executed by the go/types
|
||||||
|
package due to a non-default GODEBUG=gotypesalias=... setting.
|
||||||
|
|
||||||
/godebug/non-default-behavior/http2client:events
|
/godebug/non-default-behavior/http2client:events
|
||||||
The number of non-default behaviors executed by the net/http
|
The number of non-default behaviors executed by the net/http
|
||||||
package due to a non-default GODEBUG=http2client=... setting.
|
package due to a non-default GODEBUG=http2client=... setting.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue