go/types: relax NewSignatureType for append(slice, str...) #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CL 688815 contained a partial fix for the reported bug, but NewSignatureType contined to panic. This change relaxes it to permit construction of the type "func([]byte, B) []byte" where "type B []byte". We must do so because a client may instantiate the type "func([]byte, T...)" where [T
string|[]byte] at T=B, and may have no way to know that they are dealing with this very special edge case of append.Added a regression test of NewSignatureType, which I should have done in the earlier CL.
Also, make typestring less pedantic and fragile.
Updates tailscale/corp#31755
Change-Id: I3d8f8609582149f9c9f8402a04ad516c2c63bbc6