From ed30ee6c56505905880e63266641de32666e1c0b Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Tue, 5 Dec 2023 15:16:18 -0500 Subject: [PATCH] doc/go1.22: document ast.Object deprecation The api.txt changes were originally recorded by mistake (sorry) into go1.21.txt; see CL 504915, which made the actual change in August. Change-Id: If46b48d9714f01605888a6e975c1a03ccfce3b3e Reviewed-on: https://go-review.googlesource.com/c/go/+/547637 LUCI-TryBot-Result: Go LUCI Reviewed-by: Robert Griesemer Auto-Submit: Alan Donovan Commit-Queue: Alan Donovan --- api/go1.22.txt | 5 +++++ doc/go1.22.html | 30 ++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/api/go1.22.txt b/api/go1.22.txt index 90ab686b11..d2a1ae7a88 100644 --- a/api/go1.22.txt +++ b/api/go1.22.txt @@ -48,7 +48,12 @@ pkg encoding/base64, method (*Encoding) AppendDecode([]uint8, []uint8) ([]uint8, pkg encoding/base64, method (*Encoding) AppendEncode([]uint8, []uint8) []uint8 #53693 pkg encoding/hex, func AppendDecode([]uint8, []uint8) ([]uint8, error) #53693 pkg encoding/hex, func AppendEncode([]uint8, []uint8) []uint8 #53693 +pkg go/ast, func NewPackage //deprecated #52463 pkg go/ast, func Unparen(Expr) Expr #60061 +pkg go/ast, type Importer //deprecated #52463 +pkg go/ast, type Object //deprecated #52463 +pkg go/ast, type Package //deprecated #52463 +pkg go/ast, type Scope //deprecated #52463 pkg go/types, func NewAlias(*TypeName, Type) *Alias #63223 pkg go/types, func Unalias(Type) Type #63223 pkg go/types, method (*Alias) Obj() *TypeName #63223 diff --git a/doc/go1.22.html b/doc/go1.22.html index 1393be1dc9..a7dd391aeb 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -340,12 +340,30 @@ Do not send CLs removing the interior tags from such phrases.
go/ast
-

- TODO: https://go.dev/issue/52463: formally deprecate Object -

- -

- TODO: https://go.dev/cl/504915: go/ast: deprecate Object; modified api/go1.21.txt +

+ The following declarations related to + syntactic identifier resolution + are now deprecated: + Ident.Obj, + Object, + Scope, + File.Scope, + File.Unresolved, + Importer, + Package, + NewPackage. +

+

+ Identifiers cannot be accurately resolved without type information. + Consider, for example, the identifier K + in T{K: ""}: it could be the name of a local variable + if T is a map type, or the name of a field if T is a struct type. +

+

+ New programs should use the go/types + package to resolve identifiers; + see Object, Info.Uses, + and Info.Defs for details.

-- 2.48.1