diff options
| author | Dan Scales <danscales@google.com> | 2021-01-30 21:15:40 -0800 |
|---|---|---|
| committer | Dan Scales <danscales@google.com> | 2021-02-02 19:14:08 +0000 |
| commit | 3d5c715bf299fb662104d70d612f3f0303e542d9 (patch) | |
| tree | 00a3f165808fd0f7c4d31ab69b15b13339a06a29 /src/cmd/compile/internal/ir/expr.go | |
| parent | 13a741298377d30fc2b3fc51fa9aa52eed6d56e4 (diff) | |
| download | go-git-3d5c715bf299fb662104d70d612f3f0303e542d9.tar.gz | |
[dev.typeparams] Handling multiple type arguments for call via new node OLIST
Will now run "go tool compile -G=2 -W=2" on a simple generic function
with multiple type parameters and a call to that function with multiple
explicit type arguments.
We will likely move to have a separate function/type instantiation node,
in order distinguish these cases from normal index expressions.
Change-Id: I0a571902d63785cc06240ed4ba0495923403b511
Reviewed-on: https://go-review.googlesource.com/c/go/+/288433
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ir/expr.go')
| -rw-r--r-- | src/cmd/compile/internal/ir/expr.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ir/expr.go b/src/cmd/compile/internal/ir/expr.go index 92f93e98b8..7c60334c04 100644 --- a/src/cmd/compile/internal/ir/expr.go +++ b/src/cmd/compile/internal/ir/expr.go @@ -307,6 +307,20 @@ func (n *IndexExpr) SetOp(op Op) { } } +// A ListExpr is list of expressions +type ListExpr struct { + miniExpr + List Nodes +} + +func NewListExpr(pos src.XPos, list []Node) *ListExpr { + n := &ListExpr{} + n.pos = pos + n.op = OLIST + n.List = list + return n +} + // A KeyExpr is a Key: Value composite literal key. type KeyExpr struct { miniExpr |
