From: Robert Griesemer Date: Tue, 12 Dec 2023 02:22:59 +0000 (-0800) Subject: doc: emphasize gotypesalias GODEBUG flag in go 1.22 release notes X-Git-Tag: go1.22rc1~33 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7baaa20e38613efb820892abb3abeadcd2198800;p=gostls13.git doc: emphasize gotypesalias GODEBUG flag in go 1.22 release notes Per discussion with rfindley. Change-Id: Ia1cff05aff724eb8c919ffcc1fac121ca017efe9 Reviewed-on: https://go-review.googlesource.com/c/go/+/549056 Auto-Submit: Robert Griesemer Reviewed-by: Robert Griesemer TryBot-Bypass: Robert Griesemer Reviewed-by: Robert Findley --- diff --git a/doc/go1.22.html b/doc/go1.22.html index e5fac31ae6..f1e713cb9e 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -503,18 +503,22 @@ defer func() { 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 + The new representation retains the intermediate Alias. + This enables improved error reporting (the name of a type 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. + Clients of go/types are urged to adjust their code as soon as possible + to work with gotypesalias=1 to eliminate problems early.