diff --git a/doc/go_spec.html b/doc/go_spec.html index 6c6f982854..e8061f94b9 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -987,7 +987,7 @@ built-in function cap(a).

-A new, initialized slice value for a given element type T is +A new, initialized slice value for a given element type T may be made using the built-in function make, which takes a slice type @@ -1422,7 +1422,7 @@ interface { ~int } -// An interface representing all types with underlying type int which implement the String method. +// An interface representing all types with underlying type int that implement the String method. interface { ~int String() string @@ -1455,32 +1455,32 @@ Union elements denote unions of type sets:

-// The Floats interface represents all floating-point types
+// The Float interface represents all floating-point types
 // (including any named types whose underlying types are
 // either float32 or float64).
-type Floats interface {
+type Float interface {
 	~float32 | ~float64
 }
 

-In a union, 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:

 interface {
-	P                 // illegal: the term P is a type parameter
-	int | P           // illegal: the term P is a type parameter
-	~int | MyInt      // illegal: the type sets for ~int and MyInt are not disjoint (~int includes MyInt)
-	float32 | Floats  // overlapping type sets but Floats is an interface
+	P                // illegal: P is a type parameter
+	int | P          // illegal: P is a type parameter
+	~int | MyInt     // illegal: the type sets for ~int and MyInt are not disjoint (~int includes MyInt)
+	float32 | Float  // overlapping type sets but Float is an interface
 }
 

Implementation restriction: -A union with more than one term cannot contain the +A union (with more than one term) cannot contain the predeclared identifier comparable or interfaces that specify methods, or embed comparable or interfaces that specify methods. @@ -1494,12 +1494,12 @@ non-interface types.

-var x Floats                     // illegal: Floats is not a basic interface
+var x Float                     // illegal: Float is not a basic interface
 
-var x interface{} = Floats(nil)  // illegal
+var x interface{} = Float(nil)  // illegal
 
 type Floatish struct {
-	f Floats                 // illegal
+	f Float                 // illegal
 }
 
@@ -1545,7 +1545,7 @@ A type T implements an interface I if

-A value x of type T implements an interface if T +A value of type T implements an interface if T implements the interface.

@@ -1701,10 +1701,9 @@ Each type T has an underlying type: If T is one of the predeclared boolean, numeric, or string types, or a type literal, the corresponding underlying type is T itself. Otherwise, T's underlying type is the underlying type of the -type to which T refers in its type -declaration. The underlying type of a type parameter is the -underlying type of its type constraint, which -is always an interface. +type to which T refers in its declaration. +For a type parameter that is the underlying type of its +type constraint, which is always an interface.

@@ -1755,7 +1754,7 @@ direction.
 
 
 

-All other interfaces don't have a core type. +No other interfaces have a core type.

@@ -1795,7 +1794,7 @@ interface{ ~[]*data; String() string } // []*data

-Examples of interfaces whithout core types: +Examples of interfaces without core types:

@@ -1973,21 +1972,21 @@ defined type while the latter is a type literal
 

Assignability

-A value x is assignable to a variable of type T +A value x of type V is assignable to a variable of type T ("x is assignable to T") if one of the following conditions applies:

-The given type cannot be a type parameter in a type definition. +In a type definition the given type cannot be a type parameter.

@@ -2604,8 +2598,8 @@ func f[T any]() {
 

-A generic type may also have methods associated with it. In this case, -the method receivers must declare the same number of type parameters as +A generic type may also have methods associated with it. +In this case, the method receivers must declare the same number of type parameters as present in the generic type definition.

@@ -2899,12 +2893,12 @@ func IndexRune(s string, r rune) int {

If the function declaration specifies type parameters, the function name denotes a generic function. -Generic functions must be instantiated when they -are used. +A generic function must be instantiated before it can be +called or used as a value.

-func min[T constraints.Ordered](x, y T) T {
+func min[T ~int|~float64](x, y T) T {
 	if x < y {
 		return x
 	}
@@ -2963,7 +2957,7 @@ the non-blank method and field names must be distinct.
 

-Given defined type Point, the declarations +Given defined type Point the declarations

@@ -3758,7 +3752,7 @@ The following rules apply:
 

-If a is not a map: +If a is neither a map nor a type parameter: