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.
- TODO: https://go.dev/issue/52463: formally deprecate Object +
+ The following declarations related to
+ syntactic identifier resolution
+ are now deprecated:
+ Ident.Obj,
+ Object,
+ Scope,
+ File.Scope,
+ File.Unresolved,
+ Importer,
+ Package,
+ NewPackage.
- TODO: https://go.dev/cl/504915: go/ast: deprecate Object; modified api/go1.21.txt +
+ 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.