spec: several sections require core types and don't mention []byte | string
#52859
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
https://tip.golang.org/ref/spec#Slice_expressions states that
https://tip.golang.org/ref/spec#Appending_and_copying_slices states for
append
thatand for
copy
thatAll three passages require that the types have core types. append and copy do allow for two different core types (string and []byte) for the two arguments, but they don't allow
[]byte | string
for the second argument. The compiler, however, special-cases[]byte | string
in all these places, as can be seen in the following function, which compiles:/cc @findleyr
The text was updated successfully, but these errors were encountered: