[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>
This commit is contained in:
Dan Scales 2021-01-30 21:15:40 -08:00
parent 13a7412983
commit 3d5c715bf2
6 changed files with 149 additions and 95 deletions

View file

@ -190,6 +190,7 @@ const (
OGT // Left > Right
ODEREF // *Left
OINDEX // Left[Right] (index of array or slice)
OLIST // list of expressions
OINDEXMAP // Left[Right] (index of map)
OKEY // Left:Right (key:value in struct/array/map literal)
OSTRUCTKEY // Sym:Left (key:value in struct literal, after type checking)