proposal: Go 2: Move cmp.Ordered to builtin.orderable #62041
Labels
FrozenDueToAge
LanguageChange
Suggested changes to the Go language
Proposal
v2
An incompatible library change
Milestone
Go 1.20 added
comparable
type constraint, Go 1.21 addedcmp.Ordered
type constraint.It is probably late now, but wouldn't it be better, for the sake of consistency, to name this interface
orderable
, place it inbuiltin
package, and use it in same manner ascomparable
interface, because both are related to comparison operators and built-in types.Because of backwards compatibility, we could patch
cmp.Ordered
to be alias oforderable
type constraint that would be placed besidescomparable
andany
type constraint.Changes:
File builtin.go:
File cmp.go:
The text was updated successfully, but these errors were encountered: