diff --git a/doc/go_spec.html b/doc/go_spec.html index 63bc6a546e..7c53a1eb91 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,16 +1,14 @@ -
- -For the pre-Go1.18 spec see +For the pre-Go1.18 specification without generics support see The Go Programming Language Specification. -
*T
-to a defined type *T
+to a defined type T
(where T
is neither a pointer nor an interface)
is the set of all methods declared with receiver *T
or T
.
@@ -1415,9 +1414,9 @@ type ReadCloser interface {
-Finally, in their most general form, an interface element may be an arbitrary type
-T
, a type term of the form ~T
, or a union of type terms
-T1 | T2 | … Tn
.
+Finally, in their most general form, an interface element may also be an arbitrary type term
+T
, or a term of the form ~T
specifying the underlying type T
,
+or a union of terms t1|t2|…|tn
.
Together with method specifications, these elements enable the precise
definition of an interface's type set as follows:
T
.
- T1 | T2 | … Tn
+ t1|t2|…|tn
is the union of the type sets of the terms.
-Union expressions denote unions of type sets: +Union elements denote unions of type sets:
@@ -1500,7 +1500,7 @@ type Floats interface {
-In a union expression, a term cannot be a type parameter, and the type sets of all
+In a union, a term cannot be a type parameter, and the type sets of all
non-interface terms must be pairwise disjoint (the pairwise intersection of the type sets must be empty).
Given a type parameter P
:
Implementation restriction: -A union expression with more than one term cannot contain interface types +A union with more than one term cannot contain interface types with non-empty method sets.
-Interfaces that contain union or tilde terms (not just methods) may only be used
-as type constraints, or as elements of other interfaces used as constraints. They
-cannot be the types of values or variables, or components of other, non-interface types.
+Interfaces that contain non-interface types, terms of the form ~T
,
+or unions may only be used as type constraints, or as elements of other interfaces used
+as constraints. They cannot be the types of values or variables, or components of other,
+non-interface types.