Closed
Description
Various x/tools tests fail when run from a module that has go1.23 in its go directive, or (more likely) when using a go.work file that says go1.23, because the tests themselves assume go1.22 semantics.
In particular, tests of the internal/aliases package that assume a default GODEBUG value for gotypesalias are broken.
> cat go.mod
module mod.test
go 1.24
require golang.org/x/tools v0.26.1-0.20241028184645-73d6794ebbd4
> go test golang.org/x/tools/internal/aliases
--- FAIL: TestNewAlias (0.00s)
--- FAIL: TestNewAlias/#00 (0.00s)
aliases_test.go:77: Expected A.Type() to not be a types.Alias(). got "p.A"
FAIL
FAIL golang.org/x/tools/internal/aliases 0.018s
FAIL
I think we should relax these assertions, since they are not valid in all testing scenarios.