]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.22: document ast.Object deprecation
authorAlan Donovan <adonovan@google.com>
Tue, 5 Dec 2023 20:16:18 +0000 (15:16 -0500)
committerAlan Donovan <adonovan@google.com>
Tue, 5 Dec 2023 21:18:08 +0000 (21:18 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>

api/go1.22.txt
doc/go1.22.html

index 90ab686b1115deaea693a272840568fadec21253..d2a1ae7a8874807bbdd384a820b13ad7be0ca479 100644 (file)
@@ -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
index 1393be1dc9e4e2902c74a6e903662b54b695930e..a7dd391aeb5ac0fe04449daa22462c60c8a38815 100644 (file)
@@ -340,12 +340,30 @@ Do not send CLs removing the interior tags from such phrases.
 
 <dl id="go/ast"><dt><a href="/pkg/go/ast/">go/ast</a></dt>
   <dd>
-    <p><!-- https://go.dev/issue/52463 -->
-      TODO: <a href="https://go.dev/issue/52463">https://go.dev/issue/52463</a>: formally deprecate Object
-    </p>
-
-    <p><!-- CL 504915 -->
-      TODO: <a href="https://go.dev/cl/504915">https://go.dev/cl/504915</a>: go/ast: deprecate Object; modified api/go1.21.txt
+    <p><!-- https://go.dev/issue/52463, https://go/dev/cl/504915 -->
+      The following declarations related to
+      <a href='https://pkg.go.dev/go/ast#Object'>syntactic identifier resolution</a>
+      are now <a href="https://go.dev/issue/52463">deprecated</a>:
+      <code>Ident.Obj</code>,
+      <code>Object</code>,
+      <code>Scope</code>,
+      <code>File.Scope</code>,
+      <code>File.Unresolved</code>,
+      <code>Importer</code>,
+      <code>Package</code>,
+      <code>NewPackage</code>.
+    </p>
+    <p>
+      Identifiers cannot be accurately resolved without type information.
+      Consider, for example, the identifier <code>K</code>
+      in <code>T{K: ""}</code>: 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.
+    </p>
+    <p>
+      New programs should use the <a href='/pkg/go/types'>go/types</a>
+      package to resolve identifiers;
+      see <code>Object</code>, <code>Info.Uses</code>,
+      and <code>Info.Defs</code> for details.
     </p>
   </dd>
 </dl><!-- go/ast -->