cmd/api: api checker should check types for change in comparability #56773
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FeatureRequest
Issues asking for a new feature that does not need a proposal.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The api checker checks that we don't change our APIs in a backward-incompatible way.
Generics introduced the constraint
comparable
which denotes the set of all types which are strictly comparable. An API may define an exported typeT
which may be strictly comparable (see #56548 for terminology) and such a typeT
may successfully be used as type argument forcomparable
type parameters elsewhere.It's possible to change
T
without visible API change so that it's not strictly comparable anymore. For instance, givenone can add a new,
unexported
field that is not strictly comparableThe visible API has not changed but
T
is not not strictly comparable anymore. This may prevent it's use elsewhere.The api checker should treat such changes as API changes.
Marking for 1.20 as it would be a useful check and could be added late in the cycle.
The text was updated successfully, but these errors were encountered: