]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] go/types, types2: use correct parameter list when checking...
authorRobert Griesemer <gri@golang.org>
Mon, 14 Aug 2023 22:56:08 +0000 (15:56 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 21:05:04 +0000 (21:05 +0000)
commitd91843ff67f7acc433bd169d2b189656627ebbb8
tree4349fc7f75291bcfaf2e807f7a4f3a66957445ef
parent7437db10858fa147da00a2b67444ed42200bf161
[release-branch.go1.21] go/types, types2: use correct parameter list when checking argument passing

The existing code was simply wrong: we cannot ever use the result
signature parameter list (rsig.params) if sigParams was adjusted
for variadic functions. If it was adjusted, we always must either
use sigParams or its separately instantiated version.

In the condition "n > 0 && adjusted", the "n > 0" should have
been in either of the respective "if statement" branches.

Simplified the code by merging with the result signature parameter
update.

Fixes #61932.

Change-Id: I5d39bc8bbc4dd85c7c985055d29532b4b176955e
Reviewed-on: https://go-review.googlesource.com/c/go/+/519456
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/519417
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/issues_test.go
src/go/types/call.go
src/go/types/issues_test.go