]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: clarify that interface types do not implement comparable
authorIan Lance Taylor <iant@golang.org>
Tue, 8 Feb 2022 21:11:09 +0000 (13:11 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 8 Feb 2022 21:59:36 +0000 (21:59 +0000)
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>
src/builtin/builtin.go

index 08ae7ed313add4fb435b154605d143188747f302..5657be45642f33450aab1d6507bea0f3c9fa22a9 100644 (file)
@@ -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)