]> Cypherpunks repositories - gostls13.git/commit
spec: fix spec on conversions to match implementations
authorRobert Griesemer <gri@golang.org>
Fri, 21 Jun 2013 23:11:13 +0000 (16:11 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Jun 2013 23:11:13 +0000 (16:11 -0700)
commitde47f68c99e9c86a32261b45752819a86cac74f2
tree7b9d1acd58cbc43207d4923675f94bc5c5b88021
parentfc1e298ba1dfa404e2036d7461110511fdc28422
spec: fix spec on conversions to match implementations

The existing compilers convert empty strings to empty
but non-nil byte and rune slices. The spec required
a nil byte and rune slice in those cases. That seems
an odd additional requirement. Adjust the spec to
match the reality.

Also, removed over-specification for conversions of
nil []byte and []rune: such nil slices already act
like empty slices and thus don't need extra language.
Added extra examples instead.

Fixes #5704.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/10440045
doc/go_spec.html
test/fixedbugs/issue5704.go [new file with mode: 0644]