golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.95k stars 17.66k forks source link

x/tools: get tests passing with GODEBUG=gotypesalias=1 #65294

Closed findleyr closed 7 months ago

findleyr commented 9 months ago

We need to get x/tools tests passing with GODEBUG=gotypesalias=1 (which enables explicit nodes for type aliases) before we can change the default value of this flag (x/tools test run as a TryBot for the main repo, and in any case we can't break x/tools...)

Therefore, this is somewhat time-sensitive. @adonovan, @timothy-king, and I can collaborate on this. We should divvy up packages.

Possibly incomplete list of packages that fail:

[Edit: the checkboxes above are such a tiny sample of the tip of the iceberg that they paint a misleading picture of the work involved --adonovan]

Note that this change only addresses behavior preservation. Additional changes are needed where explicit aliases (and, later, generic aliases) require either new features or new algorithms. The most obvious candidates are type import and export, and gopls features.

Related:

CC @griesemer @mdempsky

gopherbot commented 9 months ago

Change https://go.dev/cl/559915 mentions this issue: go/types/typeutil: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559935 mentions this issue: internal/apidiff: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559936 mentions this issue: cmd/deadcode: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559916 mentions this issue: go/analysis/passes/deepequalerrors: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559917 mentions this issue: go/analysis/passes/stringintconv: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559937 mentions this issue: go/callgraph/rta: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/559995 mentions this issue: internal/aliases: Adds an internal alias package.

gopherbot commented 9 months ago

Change https://go.dev/cl/562036 mentions this issue: internal/refactor/inline: audit for types.Alias safety

gopherbot commented 9 months ago

Change https://go.dev/cl/562037 mentions this issue: gopls/doc: audit for types.Alias safety

gopherbot commented 8 months ago

Change https://go.dev/cl/565035 mentions this issue: x/tools: add explicit Unalias operations

gopherbot commented 8 months ago

Change https://go.dev/cl/565075 mentions this issue: internal/typesinternal: add ReceiverNamed helper

gopherbot commented 8 months ago

Change https://go.dev/cl/565476 mentions this issue: gopls: rationalize "deref" helpers

gopherbot commented 8 months ago

Change https://go.dev/cl/565456 mentions this issue: internal/typesparams: add Deref

gopherbot commented 8 months ago

Change https://go.dev/cl/567842 mentions this issue: refactor/rename: fix renaming of aliases

gopherbot commented 7 months ago

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

gopherbot commented 7 months ago

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

gopherbot commented 7 months ago

Change https://go.dev/cl/575315 mentions this issue: cmd: update vendored x/tools to 904c6ba

gopherbot commented 7 months ago

Change https://go.dev/cl/575698 mentions this issue: gopls/internal/test: temporarily disable staticcheck with gotypesalias=1

gopherbot commented 7 months ago

Change https://go.dev/cl/575699 mentions this issue: internal/analysisinternal: ZeroValue support materialized aliases

gopherbot commented 7 months ago

Change https://go.dev/cl/576137 mentions this issue: gopls/internal/analysis/fillreturns: skip test if gotypesalias=1

gopherbot commented 7 months ago

Change https://go.dev/cl/576139 mentions this issue: internal/gcimporter: renable tests of issue50259.go

gopherbot commented 7 months ago

Change https://go.dev/cl/576975 mentions this issue: go/types: fix bug in premature Unalias of alias cycle

gopherbot commented 7 months ago

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

gopherbot commented 7 months ago

Change https://go.dev/cl/577616 mentions this issue: cmd/compile/internal/types2: revert to three-phase alias resolution

adonovan commented 7 months ago

Phew.

gopherbot commented 6 months ago

Change https://go.dev/cl/578041 mentions this issue: x/tools: make tests agnostic as to whether gotypesalias="" => 0 or 1

gopherbot commented 6 months ago

Change https://go.dev/cl/578324 mentions this issue: doc: enforce gotypesalias=0 behavior until go1.23

gopherbot commented 6 months ago

Change https://go.dev/cl/579015 mentions this issue: cmd/compile/internal/types2: port CL 576975 to types2

gopherbot commented 6 months ago

Change https://go.dev/cl/579075 mentions this issue: go/types, types2: simplify TestUnaliasTooSoonInCycle (cleanup)

gopherbot commented 6 months ago

Change https://go.dev/cl/579298 mentions this issue: go/types: renable 2x execution of tests with gotypesalias={0,1}

gopherbot commented 5 months ago

Change https://go.dev/cl/586236 mentions this issue: go/types: re-enable suppressed gcimporter tests