mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
go/types: document that Defs[id] may be missing in ill-typed code
Updates #70968 Change-Id: Id0a4acd6bad917ba8a5c439625bca14469b6eb7c Reviewed-on: https://go-review.googlesource.com/c/go/+/663895 Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
559b5d814f
commit
8433412b74
@ -254,6 +254,9 @@ type Info struct {
|
||||
//
|
||||
// For an embedded field, Defs returns the field *Var it defines.
|
||||
//
|
||||
// In ill-typed code, such as a duplicate declaration of the
|
||||
// same name, Defs may lack an entry for a declaring identifier.
|
||||
//
|
||||
// Invariant: Defs[id] == nil || Defs[id].Pos() == id.Pos()
|
||||
Defs map[*ast.Ident]Object
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user