This issue is for tracking the work needed to enable type parameterized aliases (#46477) in the unified IR and 'i' export data formats.

Here are the know steps in an admissible order:

  • [x] cmd/compile/internal/importer.ReadPackage sets pkgReader.enableAlias=true.
  • [x] improve the x/tools ureader panic message to tell users to update if the unified IR version is too new.
  • [x] Support more go module versions than go1.14 in cmd/internal/testdir.
  • [x] {go/internal/gcimporter,cmd/compile/internal/importer}/iimport.go support 'B' tag for type aliases with type parameters.
  • [x] Add a Version type to internal/pkgbits and documentation to better track version changes.
  • [x] Expose version of bitstream via internal/pkgbits.PkgDecoder.version via {PkgDecoder,Decoder}.Version(). Store the current version being written and expose it via {PkgEncoder,Encoder}.Version().
  • [x] Only read/write 'has init' and 'derived func info' fields in unified IR until version 1 in {go/internal/gcimporter,cmd/compile/internal/importer}/ureader.go and cmd/compile/internal/noder.
  • [x] Only read/write 'derived info needed' field in unified IR until version 1 in {go/internal/gcimporter,cmd/compile/internal/importer}/ureader.go and cmd/compile/internal/noder.
  • [x] Only read/write typeParamNames() in unified IR after version 2.
  • [x] x/tools: copy iimport.go changes to support reading 'B' tag.
  • [x] x/tools: update iexport.go changes to support writing 'B' tag.
  • [x] x/tools: copy ureader.go changes for version 1 and version 2.
  • [x] revendor x/tools in src/cmd for cmd/internal/moddeps.TestAllDependencies
  • [x] x/tools: release a new minor version.
  • [x] Change the version being written to 2 when the aliastypeparams GOEXPERIMENT is on.
  • [x] Add optional test builds where GOEXPERIMENT=aliastypeparams=1 for compiler and x/tools.
  • [x] Switch optional test builds to presubmit build where GOEXPERIMENT=aliastypeparams=1 for compiler and x/tools.
  • [x] Add longtest postsubmit builds where GOEXPERIMENT=aliastypeparams=1 for compiler and x/tools.
  • [x] Flip the aliastypeparams GOEXPERIMENT default value to true.

This will be updated as the plan updates.

@griesemer @dr2chase @findleyr @adonovan @mdempsky @cuonglm 

Comment From: gopherbot

Change https://go.dev/cl/604099 mentions this issue: cmd/compile/internal/importer: enable aliases

Comment From: gopherbot

Change https://go.dev/cl/604102 mentions this issue: cmd/internal/testdir: add a -gomodversion flag

Comment From: gopherbot

Change https://go.dev/cl/604635 mentions this issue: go/internal/gcimporter: indexed format imports for type parameters aliases

Comment From: gopherbot

Change https://go.dev/cl/604596 mentions this issue: internal/pkgbits: improve ureader panic message

Comment From: gopherbot

Change https://go.dev/cl/605655 mentions this issue: internal/pkgbits: add Version type

Comment From: gopherbot

Change https://go.dev/cl/606035 mentions this issue: cmd/compile: deprecate has init and derived func instance

Comment From: gopherbot

Change https://go.dev/cl/606335 mentions this issue: internal/gcimporter: support type parameterized aliases in indexed format

Comment From: gopherbot

Change https://go.dev/cl/607235 mentions this issue: cmd/compile/internal: write type parameters for aliases

Comment From: gopherbot

Change https://go.dev/cl/607495 mentions this issue: internal/gcimporter: move indexed format docs

Comment From: gopherbot

Change https://go.dev/cl/607535 mentions this issue: internal/aliases: add type parameters argument to NewAliases

Comment From: gopherbot

Change https://go.dev/cl/607498 mentions this issue: go/internal/gcimporter: parse materialized aliases

Comment From: gopherbot

Change https://go.dev/cl/608215 mentions this issue: internal/pkgbits: add DerivedInfoNeeded

Comment From: gopherbot

Change https://go.dev/cl/608216 mentions this issue: cmd/compile: deprecate derived info needed field

Comment From: gopherbot

Change https://go.dev/cl/608595 mentions this issue: cmd/compile/internal/noder: write V2 bitstream aliastypeparams=1

Comment From: gopherbot

Change https://go.dev/cl/609317 mentions this issue: internal/gcimporter: copy over ureader changes

Comment From: gopherbot

Change https://go.dev/cl/609316 mentions this issue: internal/pkgbits: copy over changes for V2

Comment From: gopherbot

Change https://go.dev/cl/610036 mentions this issue: cmd: vendor golang.org/x/tools@2db563b

Comment From: timothy-king

Included in x/tools, 0.25.0 https://github.com/golang/tools/commits/v0.25.0/

Comment From: gopherbot

Change https://go.dev/cl/613236 mentions this issue: all: enable alias type parameters GOEXPERIMENT by default