Skip to content

Commit f524a2b

Browse files
builtin: clarify that interface types do not implement comparable
Fixes #51083 Change-Id: Ic9207ae4104b06749925186e0eb4f18edf1b5007 Reviewed-on: https://go-review.googlesource.com/c/go/+/384235 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 275aedc commit f524a2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/builtin/builtin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ type rune = int32
9595
type any = interface{}
9696

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

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

0 commit comments

Comments
 (0)