mirror of https://github.com/golang/go.git
go/doc: mark comparable predeclared
Add comparable to the list of predeclared types. Fixes golang/go#51141. Change-Id: I4a2d4e7e5680e115de9bca03b6c8ad454551cb82 Reviewed-on: https://go-review.googlesource.com/c/go/+/385114 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
e50f0f372b
commit
f2ec001845
|
|
@ -927,6 +927,7 @@ var predeclaredTypes = map[string]bool{
|
||||||
"any": true,
|
"any": true,
|
||||||
"bool": true,
|
"bool": true,
|
||||||
"byte": true,
|
"byte": true,
|
||||||
|
"comparable": true,
|
||||||
"complex64": true,
|
"complex64": true,
|
||||||
"complex128": true,
|
"complex128": true,
|
||||||
"error": true,
|
"error": true,
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@ VARIABLES
|
||||||
|
|
||||||
|
|
||||||
FUNCTIONS
|
FUNCTIONS
|
||||||
|
// Associated with comparable type if AllDecls is set.
|
||||||
|
func ComparableFactory() comparable
|
||||||
|
|
||||||
//
|
//
|
||||||
func F(x int) int
|
func F(x int) int
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,12 @@ TYPES
|
||||||
//
|
//
|
||||||
func (x *T) M()
|
func (x *T) M()
|
||||||
|
|
||||||
|
// Should only appear if AllDecls is set.
|
||||||
|
type comparable struct{} // overrides a predeclared type comparable
|
||||||
|
|
||||||
|
// Associated with comparable type if AllDecls is set.
|
||||||
|
func ComparableFactory() comparable
|
||||||
|
|
||||||
//
|
//
|
||||||
type notExported int
|
type notExported int
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@ VARIABLES
|
||||||
|
|
||||||
|
|
||||||
FUNCTIONS
|
FUNCTIONS
|
||||||
|
// Associated with comparable type if AllDecls is set.
|
||||||
|
func ComparableFactory() comparable
|
||||||
|
|
||||||
//
|
//
|
||||||
func F(x int) int
|
func F(x int) int
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,15 @@ func UintFactory() uint {}
|
||||||
// Associated with uint type if AllDecls is set.
|
// Associated with uint type if AllDecls is set.
|
||||||
func uintFactory() uint {}
|
func uintFactory() uint {}
|
||||||
|
|
||||||
|
// Associated with comparable type if AllDecls is set.
|
||||||
|
func ComparableFactory() comparable {}
|
||||||
|
|
||||||
// Should only appear if AllDecls is set.
|
// Should only appear if AllDecls is set.
|
||||||
type uint struct{} // overrides a predeclared type uint
|
type uint struct{} // overrides a predeclared type uint
|
||||||
|
|
||||||
|
// Should only appear if AllDecls is set.
|
||||||
|
type comparable struct{} // overrides a predeclared type comparable
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Exported declarations associated with non-exported types must always be shown.
|
// Exported declarations associated with non-exported types must always be shown.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue