spec: clarify that comparable cannot be a union element

For #49602.

Change-Id: I0d3ff8f087dffb3409918494147fd1dceff7514d
Reviewed-on: https://go-review.googlesource.com/c/go/+/372694
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Robert Griesemer 2021-12-15 20:03:11 -08:00
parent 55a25aa6ca
commit 2bdf34f3e8

View file

@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification - Go 1.18 Draft (incomplete)",
"Subtitle": "Version of Dec 13, 2021",
"Subtitle": "Version of Dec 16, 2021",
"Path": "/ref/spec"
}-->
@ -1532,7 +1532,9 @@ interface {
<p>
Implementation restriction:
A union with more than one term cannot contain interface types
with non-empty <a href="#Method_sets">method sets</a>.
with non-empty <a href="#Method_sets">method sets</a> or which
are or embed the <a href="#Predeclared_identifiers">predeclared identifier</a>
<code>comparable</code>.
</p>
<p>