]>
Cypherpunks repositories - gostls13.git/commit
go/types, types2: first argument to append must never be be nil
The current implementation followed the spec faithfully for
the special case for append. Per the spec:
As a special case, append also accepts a first argument assignable to
type []byte with a second argument of string type followed by ... .
As it happens, nil is assignable to []byte, so append(nil, ""...)
didn't get an error message but a subsequent assertion failed.
This CL ensures that the first argument to append is never nil and
always a slice. We should make the spec more precise (separate CL).
Fixes #76220.
Change-Id: I581d11827a75afbb257077814beea813d4fe2441
Reviewed-on: https://go-review.googlesource.com/c/go/+/718860
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Brett Howell <devbrett90@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>