]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: accept string|[]byte-constrained 2nd argument in append
authorRobert Griesemer <gri@golang.org>
Fri, 7 Jan 2022 02:02:30 +0000 (18:02 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 7 Jan 2022 22:40:23 +0000 (22:40 +0000)
commitc74be77e63c0281abb45dbf9de31fa05a6824934
tree7d9c195b07ab12ad80fc5f408969b406cf155db9
parentbe26ca972d2149df09e70789fdf284da01c5e9d8
cmd/compile: accept string|[]byte-constrained 2nd argument in append

Similarly to what we do for the built-in function `copy`,
where we allow a string as 2nd argument to append, also
permit a type parameter constrained by string|[]byte.

While at it, change date in the manual.go2 test files so
that we don't need to constantly correct it when copying
a test case from that file into a proper test file.

Fixes #50281.

Change-Id: I23fed66736aa07bb3c481fe97313e828425ac448
Reviewed-on: https://go-review.googlesource.com/c/go/+/376214
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue50281.go2 [new file with mode: 0644]
src/cmd/compile/internal/types2/testdata/manual.go2
src/go/types/builtins.go
src/go/types/testdata/fixedbugs/issue50281.go2 [new file with mode: 0644]
src/go/types/testdata/manual.go2
test/typeparam/issue376214.go [new file with mode: 0644]