Change information
Commit message:
go/types, types2: handle unconstrained type parameters correctly in a few places
When iterating over a type set via a range clause, am unconstrained
type set produces a single (nil, nil) result. This was not properly
accounted for in a few places:
- In the code for the append and copy built-in, handle the (nil, nil)
case.
- Likewise, in NewSignatureType, panic with the correct (string) error
in this case.
Check all remaining places where we iterate over type sets with range
for correctness.
Fixes #78163.
Change-Id: If0f33f43dad59b4b5ef4c310f80522c25c6e251f
Files:
- M src/cmd/compile/internal/types2/builtins.go
- M src/cmd/compile/internal/types2/issues_test.go
- M src/cmd/compile/internal/types2/signature.go
- M src/cmd/compile/internal/types2/under.go
- M src/go/types/builtins.go
- M src/go/types/issues_test.go
- M src/go/types/signature.go
- M src/go/types/under.go
- A src/internal/types/testdata/fixedbugs/issue78163.go
Change size: S
Delta: 9 files changed, 37 insertions(+), 12 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Mark Freeman, +1 by Robert Griesemer
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI