Skip to content

Commit

Permalink
builtin: clarify that interface types do not implement comparable
Browse files Browse the repository at this point in the history
Fixes #51083

Change-Id: Ic9207ae4104b06749925186e0eb4f18edf1b5007
Reviewed-on: https://go-review.googlesource.com/c/go/+/384235
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
  • Loading branch information
ianlancetaylor committed Feb 8, 2022
1 parent 275aedc commit f524a2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ type rune = int32
type any = interface{}

// comparable is an interface that is implemented by all comparable types
// (booleans, numbers, strings, pointers, channels, interfaces,
// arrays of comparable types, structs whose fields are all comparable types).
// (booleans, numbers, strings, pointers, channels, arrays of comparable types,
// structs whose fields are all comparable types).
// The comparable interface may only be used as a type parameter constraint,
// not as the type of a variable.
type comparable comparable
type comparable interface{ comparable }

// iota is a predeclared identifier representing the untyped integer ordinal
// number of the current const specification in a (usually parenthesized)
Expand Down

0 comments on commit f524a2b

Please sign in to comment.