1
0
mirror of https://github.com/golang/go synced 2024-11-26 15:56:57 -07:00
go/doc
Alan Donovan a27a525d1b go/types: set correct Var.scopePos for parameters/results
Previously, its value was unset (NoPos), but the correct
value is a point after the signature (FuncType.End) and
before the body.

Also, fix a bug in Scope.Innermost whereby it would return
the wrong (outer) scope when the query position was in
the FuncType portion of a Func{Decl,Lit}.
The fix is to set the scope's pos/end to those of the
complete Func{Decl,Lit}. This is now documented at
Info.Scopes, along with other missing information.

Also, fix a bug in the go/types (but not types2) scope
test, in which comments were discarded by the parser,
causing the entire test to be a no-op (!).

Also, make failures of TestScopeLookupParent more
informative.

Also, add a release note about the change in behavior.

Fixes #64292
Fixes #64295

Change-Id: Ib681f59d1b0b43de977666db08302d7524d3305f
Reviewed-on: https://go-review.googlesource.com/c/go/+/544035
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Robert Griesemer <gri@google.com>
2023-11-30 01:15:55 +00:00
..
asm.html doc: document PCALIGN directive 2023-11-28 19:15:27 +00:00
go1.17_spec.html doc: fix html tags 2023-08-03 14:43:29 +00:00
go1.22.html go/types: set correct Var.scopePos for parameters/results 2023-11-30 01:15:55 +00:00
go_mem.html doc: fix html tags 2023-08-03 14:43:29 +00:00
go_spec.html spec: document range over integer expression 2023-11-02 03:57:56 +00:00
godebug.md crypto/tls: disable ExportKeyingMaterial without EMS 2023-11-21 16:29:49 +00:00