aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/type.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2021-04-16 14:06:50 -0700
committerKeith Randall <khr@golang.org>2021-06-02 20:23:12 +0000
commit7b876def6c4936cfae774d3007f8265876a9fbf7 (patch)
tree74d0b022c50ea68dfe1dbe4dbded11161ebaedaa /src/cmd/compile/internal/types/type.go
parentaa9cfdf775692a9fa6cc4ea9768415d73323c0cc (diff)
downloadgo-7b876def6c4936cfae774d3007f8265876a9fbf7.tar.gz
go-7b876def6c4936cfae774d3007f8265876a9fbf7.zip
[dev.typeparams] cmd/compile: add dictionary argument to generic functions
When converting from a generic function to a concrete implementation, add a dictionary argument to the generic function (both an actual argument at each callsite, and a formal argument of each implementation). The dictionary argument comes before all other arguments (including any receiver). The dictionary argument is checked for validity, but is otherwise unused. Subsequent CLs will start using the dictionary for, e.g., converting a value of generic type to interface{}. Import/export required adding support for LINKSYMOFFSET, which is used by the dictionary checking code. Change-Id: I16a7a8d23c7bd6a897e0da87c69f273be9103bd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/323272 Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/type.go')
-rw-r--r--src/cmd/compile/internal/types/type.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go
index 08855f518c..7a05230a78 100644
--- a/src/cmd/compile/internal/types/type.go
+++ b/src/cmd/compile/internal/types/type.go
@@ -958,7 +958,7 @@ func (t *Type) FuncArgs() *Type {
return t.Extra.(FuncArgs).T
}
-// IsFuncArgStruct reports whether t is a struct representing function parameters.
+// IsFuncArgStruct reports whether t is a struct representing function parameters or results.
func (t *Type) IsFuncArgStruct() bool {
return t.kind == TSTRUCT && t.Extra.(*Struct).Funarg != FunargNone
}