mirror of
https://github.com/golang/go
synced 2024-11-11 18:51:37 -07:00
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 <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>
This commit is contained in:
parent
5686b650cc
commit
ed30ee6c56
@ -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
|
||||
|
@ -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><!-- 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><!-- 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>
|
||||
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 -->
|
||||
|
Loading…
Reference in New Issue
Block a user