Skip to content

Commit 3c31998

Browse files
griesemergopherbot
authored andcommitted
doc: re-arrange release notes for go/types
Better order in description of changes to go/types. Move go/types section up so it's in alphabetical order again. No changes to actual content. Change-Id: If2f085b665b412489e5dfdba79b7f93598ff2785 Reviewed-on: https://go-review.googlesource.com/c/go/+/546359 Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Auto-Submit: Robert Griesemer <[email protected]> TryBot-Bypass: Robert Griesemer <[email protected]>
1 parent 1e9de4d commit 3c31998

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

doc/go1.22.html

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,54 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
368368
</dd>
369369
</dl><!-- go/ast -->
370370

371+
<dl id="go/types"><dt><a href="/pkg/go/types/">go/types</a></dt>
372+
<dd>
373+
<p><!-- https://go.dev/issue/63223, CL 521956, CL 541737 -->
374+
The new <a href="/pkg/go/types#Alias"><code>Alias</code></a> type represents type aliases.
375+
Previously, type aliases were not represented explicitly, so a reference to a type alias was equivalent
376+
to spelling out the aliased type, and the name of the alias was lost.
377+
The new representation retains the intermediate Alias.
378+
This enables improved error reporting (the name of an alias can be reported), and allows for better handling
379+
of cyclic type declarations involving type aliases.
380+
In a future release, <code>Alias</code> types will also carry <a href="https://go.dev/issue/46477">type parameter information</a>.
381+
The new function <a href="/pkg/go/types#Unalias"><code>Unalias</code></a> returns the actual type denoted by an
382+
<code>Alias</code> type (or any other <a href="/pkg/go/types#Type"><code>Type</code></a> for that matter).
383+
Because <code>Alias</code> types may break existing type switches that do not know to check for them,
384+
this functionality is controlled by a <a href="/doc/godebug"><code>GODEBUG</code></a> field named <code>gotypesalias</code>.
385+
With <code>gotypesalias=0</code>, everything behaves as before, and <code>Alias</code> types are never created.
386+
With <code>gotypesalias=1</code>, <code>Alias</code> types are created and clients must expect them.
387+
The default is <code>gotypesalias=0</code>.
388+
In a future release, the default will be changed to <code>gotypesalias=1</code>.
389+
</p>
390+
391+
<p><!-- https://go.dev/issue/62605, CL 540056 -->
392+
The <a href="/pkg/go/types#Info"><code>Info</code></a> struct now exports the
393+
<a href="/pkg/go/types#Info.FileVersions"><code>FileVersions</code></a> map
394+
which provides per-file Go version information.
395+
</p>
396+
397+
<p><!-- https://go.dev/issue/62037, CL 541575 -->
398+
The new helper method <a href="/pkg/go/types#Info.PkgNameOf"><code>PkgNameOf</code></a> returns the local package name
399+
for the given import declaration.
400+
</p>
401+
402+
<p><!-- https://go.dev/issue/61035, multiple CLs, see issue for details -->
403+
The implementation of <a href="/pkg/go/types#SizesFor"><code>SizesFor</code></a> has been adjusted to compute
404+
the same type sizes as the compiler when the compiler argument for <code>SizesFor</code> is <code>"gc"</code>.
405+
The default <a href="/pkg/go/types#Sizes"><code>Sizes</code></a> implementation used by the type checker is now
406+
<code>types.SizesFor("gc", "amd64")</code>.
407+
</p>
408+
409+
<p><!-- https://go.dev/issue/64295, CL 544035 -->
410+
The start position (<a href="/pkg/go/types#Scope.Pos"><code>Pos</code></a>)
411+
of the lexical environment block (<a href="/pkg/go/types#Scope"><code>Scope</code></a>)
412+
that represents a function body has changed:
413+
it used to start at the opening curly brace of the function body,
414+
but now starts at the function's <code>func</code> token.
415+
</p>
416+
</dd>
417+
</dl>
418+
371419
<dl id="go/version"><dt><a href="/pkg/go/version/">go/version</a></dt>
372420
<dd>
373421
<p><!-- https://go.dev/issue/62039 -->
@@ -506,54 +554,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
506554
</dd>
507555
</dl><!-- os/exec -->
508556

509-
<dl id="go/types"><dt><a href="/pkg/go/types/">go/types</a></dt>
510-
<dd>
511-
<p><!-- https://go.dev/issue/62037, CL 541575 -->
512-
The new helper method <a href="/pkg/go/types#Info.PkgNameOf"><code>PkgNameOf</code></a> returns the local package name
513-
for the given import declaration.
514-
</p>
515-
516-
<p><!-- https://go.dev/issue/63223, CL 521956, CL 541737 -->
517-
The new <a href="/pkg/go/types#Alias"><code>Alias</code></a> type represents type aliases.
518-
Previously, type aliases were not represented explicitly, so a reference to a type alias was equivalent
519-
to spelling out the aliased type, and the name of the alias was lost.
520-
The new representation retains the intermediate Alias.
521-
This enables improved error reporting (the name of an alias can be reported), and allows for better handling
522-
of cyclic type declarations involving type aliases.
523-
In a future release, <code>Alias</code> types will also carry <a href="https://go.dev/issue/46477">type parameter information</a>.
524-
The new function <a href="/pkg/go/types#Unalias"><code>Unalias</code></a> returns the actual type denoted by an
525-
<code>Alias</code> type (or any other <a href="/pkg/go/types#Type"><code>Type</code></a> for that matter).
526-
Because <code>Alias</code> types may break existing type switches that do not know to check for them,
527-
this functionality is controlled by a <a href="/doc/godebug"><code>GODEBUG</code></a> field named <code>gotypesalias</code>.
528-
With <code>gotypesalias=0</code>, everything behaves as before, and <code>Alias</code> types are never created.
529-
With <code>gotypesalias=1</code>, <code>Alias</code> types are created and clients must expect them.
530-
The default is <code>gotypesalias=0</code>.
531-
In a future release, the default will be changed to <code>gotypesalias=1</code>.
532-
</p>
533-
534-
<p><!-- https://go.dev/issue/61035, multiple CLs, see issue for details -->
535-
The implementation of <a href="/pkg/go/types#SizesFor"><code>SizesFor</code></a> has been adjusted to compute
536-
the same type sizes as the compiler when the compiler argument for <code>SizesFor</code> is <code>"gc"</code>.
537-
The default <a href="/pkg/go/types#Sizes"><code>Sizes</code></a> implementation used by the type checker is now
538-
<code>types.SizesFor("gc", "amd64")</code>.
539-
</p>
540-
541-
<p><!-- https://go.dev/issue/64295, CL 544035 -->
542-
The start position (<a href="/pkg/go/types#Scope.Pos"><code>Pos</code></a>)
543-
of the lexical environment block (<a href="/pkg/go/types#Scope"><code>Scope</code></a>)
544-
that represents a function body has changed:
545-
it used to start at the opening curly brace of the function body,
546-
but now starts at the function's <code>func</code> token.
547-
</p>
548-
549-
<p><!-- https://go.dev/issue/62605, CL 540056 -->
550-
The <a href="/pkg/go/types#Info"><code>Info</code></a> struct now exports the
551-
<a href="/pkg/go/types#Info.FileVersions"><code>FileVersions</code></a> map
552-
which provides per-file Go version information.
553-
</p>
554-
</dd>
555-
</dl>
556-
557557
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
558558
<dd>
559559
<p><!-- https://go.dev/issue/61827, CL 517777 -->

0 commit comments

Comments
 (0)