proposal: go/types: add StrictlyComparable function #72059
Labels
LibraryProposal
Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool
Proposal
Milestone
Proposal Details
Background
From #56773:
Whether an exported type is strictly comparable should be considered a part of its API. As such, it would be useful if this property were exposed through
go/types
.Determining whether a type is spec-comparable is exposed via
types.Comparable
:go/src/go/types/predicates.go
Lines 155 to 158 in b199d97
In the call
comparableType(T, true, nil, nil)
, the boolean parameter indicates spec-comparability (true
). Setting this parameter tofalse
indicates strict comparability.Proposal
Add the following function to
go/types
:The text was updated successfully, but these errors were encountered: