This issue tracks the adoption in gopls of go1.22's new types.Alias type. We will need to audit every place that type-switches or type-asserts a types.Type to ensure that it works correctly with the new type. Initially the type checker will not produce instances of these types unless GODEBUG=gotypesalias=1 is set.

Things to resolve: - https://github.com/golang/go/issues/64584 (done) - waiting for cmd/compile support for writing aliases (done) - gcimporter support for reading and writing aliases (done) - sprinkling Unalias in a great many places (done) - supporting parameterized aliases (for now my goal is just to support with the new representation of simple aliases). - adding tests to each x/tools package with aliases, both ordinary and parameterized. - working with @dominikh to upgrade staticcheck in a similar way. (https://github.com/dominikh/go-tools/issues/1523) - working with the vulncheck folks to do the same (done)

Related: - https://github.com/golang/go/issues/65294

@gri @findleyr

Comment From: gopherbot

Change https://go.dev/cl/547876 mentions this issue: gopls: updates for go1.22 types.Alias

Comment From: adonovan

I tested gopls using tip GOROOT after hardwiring types.Checker.enablealias to true. (We can't use GODEBUG=gotypesalias=1 to control it yet because this environment variable would be inherited by 'go list' and the Go compiler, which doesn't yet have support for writing out Alias types, so it crashes.)

I added rudimentary support to the gcimporter package used by gopls for reading and writing aliases, and sprinkled lots of Unalias operations throughout the tree, and was able to get all but three tests (of vulncheck and staticheck) to pass. So I think it's in good shape for the 1.22 release, though we have a lot of work to do after the release.

Comment From: gopherbot

Change https://go.dev/cl/574717 mentions this issue: internal/gcimporter: support materialized aliases

Comment From: gopherbot

Change https://go.dev/cl/574737 mentions this issue: go/types: changes to support materialized aliases

Comment From: gopherbot

Change https://go.dev/cl/577576 mentions this issue: internal/apidiff: support materialized aliases

Comment From: gopherbot

Change https://go.dev/cl/579756 mentions this issue: gopls/internal/test/integration/misc: reenable staticcheck test

Comment From: gopherbot

Change https://go.dev/cl/580455 mentions this issue: gopls: cleanups related to gotypesalias

Comment From: findleyr

Is this now completed?

Comment From: adonovan

Yeah, I think so.

Never has the Close button felt so good to press.

Comment From: gopherbot

Change https://go.dev/cl/577657 mentions this issue: x/tools: eliminate TODOs related to gotypesalias=1

Comment From: gopherbot

Change https://go.dev/cl/600135 mentions this issue: internal/pkgbits: remove dead field