diff options
author | Alan Donovan <adonovan@google.com> | 2024-02-20 10:24:21 -0500 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2024-04-18 22:17:27 +0000 |
commit | 01064622a21f921a54c4442ef9f5436c89e998c7 (patch) | |
tree | 70afcc4ef2212f3b90c36d8fc5237faf72e3ce8a /doc | |
parent | dfc86e922cd033155339c22aff64e109f6c8cc89 (diff) | |
download | go-01064622a21f921a54c4442ef9f5436c89e998c7.tar.gz go-01064622a21f921a54c4442ef9f5436c89e998c7.zip |
go/types: add Func.Signature method
Unfortunately we can't enforce the repr invariant
that Func.typ != nil without thinking about the
object color invariants. For now, return a trivial
Signature if typ == nil, which should never happen
in bug-free client code.
Fixes golang/go#65772
Change-Id: I7f89c6d8fdc8dcd4b8880572e54bb0ed9b6136eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/565375
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/next/6-stdlib/99-minor/go/types/65772.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/next/6-stdlib/99-minor/go/types/65772.md b/doc/next/6-stdlib/99-minor/go/types/65772.md new file mode 100644 index 0000000000..33e949db3d --- /dev/null +++ b/doc/next/6-stdlib/99-minor/go/types/65772.md @@ -0,0 +1,4 @@ +The [`Func`](/go/types#Func) type, which represents a function or +method symbol, now has a [`Signature`](/go/types#Func.Signature) +method that returns the function's type, which is always a +`Signature`.
\ No newline at end of file |