mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
doc/go1.18: minor tweaks to generics section
This CL reorders the bullet points in the generics section to more closely match what I think users will consider most important. I put the ~ token before the mention of ~T in interfaces to avoid a forward reference, though I wonder if we actually want to spent a couple more sentences saying what union and ~T types are, since most people are going to care about that a lot more than they care about the low-level detail that there's a new token. For #47694. Change-Id: Ib84f096ef6346a711801268ce362b64fa423d3f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/369734 Trust: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
765cc726b6
commit
9ecb853cf2
|
@ -41,10 +41,6 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
For details see the <a href="https://golang.org/ref/spec">language spec</a>.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
The new token <code>~</code> is added to the set of
|
||||
<a href="https://golang.org/ref/spec#Operators_and_punctuation">operators and punctuation</a>.
|
||||
</li>
|
||||
<li>
|
||||
The syntax for
|
||||
<a href="https://golang.org/ref/spec#Function_declarations">Function</a> and
|
||||
|
@ -52,6 +48,14 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
now accepts
|
||||
<a href="https://golang.org/ref/spec#Type_parameters">type parameters</a>.
|
||||
</li>
|
||||
<li>
|
||||
Parameterized functions and types can be instantiated by following them with a list of
|
||||
type arguments in square brackets.
|
||||
</li>
|
||||
<li>
|
||||
The new token <code>~</code> has been added to the set of
|
||||
<a href="https://golang.org/ref/spec#Operators_and_punctuation">operators and punctuation</a>.
|
||||
</li>
|
||||
<li>
|
||||
The syntax for
|
||||
<a href="https://golang.org/ref/spec#Interface_types">Interface types</a>
|
||||
|
@ -60,10 +64,6 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
as type constraints.
|
||||
An interface now defines a set of types as well as a set of methods.
|
||||
</li>
|
||||
<li>
|
||||
Parameterized functions and types can be instantiated by following them with a list of
|
||||
type arguments in square brackets.
|
||||
</li>
|
||||
<li>
|
||||
The new
|
||||
<a href="https://golang.org/ref/spec#Predeclared_identifiers">predeclared identifier</a>
|
||||
|
|
Loading…
Reference in a new issue