]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: delay all call transforms if in a generic function
authorDan Scales <danscales@google.com>
Mon, 1 Nov 2021 02:45:21 +0000 (19:45 -0700)
committerDan Scales <danscales@google.com>
Thu, 24 Feb 2022 17:35:40 +0000 (17:35 +0000)
commit4edefe95689c31846a73e36b3e0723c924def45d
tree6175460dddf6eb65d0e25a05d76ec493d00ad4c9
parent8c5904f149a4863183925c71ce4118413e7e0167
cmd/compile: delay all call transforms if in a generic function

We changed to delaying all transforms of generic functions, since there
are so many complicated situations where type params can be used. We
missed changing so that all Call expressions(not just some) are delayed
if in a generic function. This changes to delaying all transforms on
calls in generic functions. Had to convert Call() to g.callExpr() (so we
can access g.delayTransform()). By always delaying transforms on calls
in generic functions, we actually simplify the code a bit both in
g.CallExpr() and stencil.go.

Fixes #51236

Change-Id: I0342c7995254082c4baf709b0b92a06ec14425e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/386220
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/noder/expr.go
src/cmd/compile/internal/noder/helpers.go
src/cmd/compile/internal/noder/stencil.go
test/typeparam/issue51236.go [new file with mode: 0644]