Russ Cox
6e3e380923
allow direct conversion between string and named []byte, []rune
...
The allowed conversions before and after are:
type Tstring string
type Tbyte []byte
type Trune []rune
string <-> string // ok
string <-> []byte // ok
string <-> []rune // ok
string <-> Tstring // ok
string <-> Tbyte // was illegal, now ok
string <-> Trune // was illegal, now ok
Tstring <-> string // ok
Tstring <-> []byte // ok
Tstring <-> []rune // ok
Tstring <-> Tstring // ok
Tstring <-> Tbyte // was illegal, now ok
Tstring <-> Trune // was illegal, now ok
Update spec, compiler, tests. Use in a few packages.
We agreed on this a few months ago but never implemented it.
Fixes #1707 .
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5421057
2011-11-22 12:30:02 -05:00
Russ Cox
db33959797
cgo, goyacc, go/build, html, http, path, path/filepath, testing/quick, test: use rune
...
Nothing terribly interesting here.
R=golang-dev, bradfitz, gri, r
CC=golang-dev
https://golang.org/cl/5300043
2011-10-25 22:20:02 -07:00
Russ Cox
f2b5a07453
delete float, complex - code changes
...
also:
cmplx -> complex
float64(1.0) -> 1.0
float64(1) -> 1.0
R=gri, r, gri1, r2
CC=golang-dev
https://golang.org/cl/3991043
2011-01-19 23:09:00 -05:00
Rob Pike
4f61fc96b2
test: remove semiocolons.
...
The ken directory is untouched so we have some examples with explicit semis.
R=gri
CC=golang-dev
https://golang.org/cl/2157041
2010-09-04 10:36:13 +10:00
Russ Cox
3910161307
gc: implement []int(string) and []byte(string)
...
R=ken2
CC=golang-dev
https://golang.org/cl/224060
2010-02-25 15:11:07 -08:00
Russ Cox
9dc22b6d6f
more 6g reorg; checkpoint.
...
typecheck.c is now responsible for all type checking
except for assignment and function argument "..."
R=ken
OCL=32661
CL=32667
2009-08-03 11:58:52 -07:00
Russ Cox
21c9f82f40
update convlit.go to current spec
...
R=r
DELTA=17 (2 added, 9 deleted, 6 changed)
OCL=28286
CL=28286
2009-05-05 11:23:39 -07:00
Russ Cox
8f194bf5ff
make 6g constants behave as ken proposes. (i hope.)
...
various bug fixes and tests involving constants.
test/const1.go is the major new test case.
R=ken
OCL=26216
CL=26224
2009-03-12 19:04:38 -07:00
Russ Cox
a1585b676b
fix the easy parts of bug120
...
R=r,ken
DELTA=66 (52 added, 3 deleted, 11 changed)
OCL=19386
CL=19389
2008-11-17 13:58:45 -08:00
Ian Lance Taylor
7dbee69b58
Match gccgo error messages.
...
convlit.go:17: error: incompatible type in initialization
convlit.go:18: error: incompatible types in binary expression
convlit.go:19: error: incompatible types in binary expression
convlit.go:20: error: incompatible types in binary expression
convlit.go:21: error: incompatible types in binary expression
convlit.go:23: error: cannot convert non-integer constant
convlit.go:24: error: integer type overflow
convlit.go:25: error: floating point overflow
R=rsc
DELTA=5 (0 added, 0 deleted, 5 changed)
OCL=17649
CL=17661
2008-10-22 16:09:24 -07:00
Russ Cox
1163b1db6f
diagnose various conversion problems
...
R=ken
OCL=17320
CL=17320
2008-10-16 15:59:31 -07:00