]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: deal correctly with unnamed function params during stenciling
authorDan Scales <danscales@google.com>
Tue, 30 Mar 2021 20:42:14 +0000 (13:42 -0700)
committerDan Scales <danscales@google.com>
Wed, 31 Mar 2021 00:52:26 +0000 (00:52 +0000)
commitf2717b31b5cf235457631fea1afd6d9df578737c
tree7e7da7c3cb5cb09323736474399a0be965f0a011
parent606e0aba74eda01e15a8c9697ccd82b802bb3501
cmd/compile: deal correctly with unnamed function params during stenciling

During substitution of the function type during stenciling, we must set
the Name nodes of the param/result fields of the func type. We get those
name nodes from the substituted Dcl nodes of the PPARAMS and PPARAMOUTs.
But we must check that the names match with the Dcl nodes, so that we
skip any param fields that correspond to unnamed (in) parameters.

Added a few tests to typelist.go by removing a variety of unneeded
function parameter names.

Change-Id: If786961b64549da6f18eeeb5060ea58fab874eb9
Reviewed-on: https://go-review.googlesource.com/c/go/+/305912
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/typelist.go