From 1e9de4db88089f0959462f2932666c9aed273d70 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 4 Dec 2023 13:24:13 -0800 Subject: [PATCH] doc: add release note for go/types.Alias type and Unalias function Also, add some missing tags. For #63223. Change-Id: I570b82be830b3c124420c5715ab1165ca53725f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/546358 Auto-Submit: Robert Griesemer Reviewed-by: Alan Donovan Reviewed-by: Robert Griesemer TryBot-Bypass: Robert Griesemer --- doc/go1.22.html | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/go1.22.html b/doc/go1.22.html index 7642ff5bfd..9a84d3dd74 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -513,8 +513,22 @@ Do not send CLs removing the interior tags from such phrases. for the given import declaration.

-

- TODO: https://go.dev/issue/63223: API changes to support explicit Alias nodes +

+ The new Alias type represents type aliases. + Previously, type aliases were not represented explicitly, so a reference to a type alias was equivalent + to spelling out the aliased type, and the name of the alias was lost. + The new representation retains the intermediate Alias. + This enables improved error reporting (the name of an alias can be reported), and allows for better handling + of cyclic type declarations involving type aliases. + In a future release, Alias types will also carry type parameter information. + The new function Unalias returns the actual type denoted by an + Alias type (or any other Type for that matter). + Because Alias types may break existing type switches that do not know to check for them, + this functionality is controlled by a GODEBUG field named gotypesalias. + With gotypesalias=0, everything behaves as before, and Alias types are never created. + With gotypesalias=1, Alias types are created and clients must expect them. + The default is gotypesalias=0. + In a future release, the default will be changed to gotypesalias=1.

@@ -524,13 +538,9 @@ Do not send CLs removing the interior tags from such phrases. types.SizesFor("gc", "amd64").

-

- TODO: https://go.dev/cl/541737: go/types, types2: implement Alias proposal (export API); modified api/next/63223.txt -

-

- The start position (Pos) - of the lexical environment block (Scope) + The start position (Pos) + of the lexical environment block (Scope) that represents a function body has changed: it used to start at the opening curly brace of the function body, but now starts at the function's func token.