Robert Griesemer
fe537dc8d5
`` strings should not accept newlines as characters
...
R=r
DELTA=17 (17 added, 0 deleted, 0 changed)
OCL=30417
CL=30422
2009-06-17 11:44:51 -07:00
Rob Pike
acaba18bba
bug163: ideographs are not letters
...
also update golden.out from bug162
R=rsc
DELTA=16 (16 added, 0 deleted, 0 changed)
OCL=30298
CL=30324
2009-06-15 21:13:28 -07:00
Russ Cox
bf5c0c957c
bug: pointer arithmetic involving large offsets
...
needs to dereference the base pointer to make
sure it catches nil.
R=r,ken
DELTA=21 (21 added, 0 deleted, 0 changed)
OCL=30083
CL=30101
2009-06-09 09:45:30 -07:00
Russ Cox
3751b259cb
bug140 is fixed
...
R=ken
OCL=29989
CL=29999
2009-06-06 19:28:01 -07:00
Russ Cox
0d2c63a0b9
update golden.out with new compiler errors
...
R=r
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=29986
CL=29988
2009-06-06 17:01:14 -07:00
Russ Cox
b014be75d2
fix 386 malloc tests,
...
detect 386 darwin breakpoint line.
R=r
DELTA=22 (4 added, 0 deleted, 18 changed)
OCL=29929
CL=29944
2009-06-05 10:59:37 -07:00
Rob Pike
6739b8d606
string([]int) is now implemented
...
R=rsc
DELTA=18 (10 added, 2 deleted, 6 changed)
OCL=29909
CL=29909
2009-06-04 16:51:47 -07:00
Russ Cox
2f2577a4f6
bug161, fixed
...
R=ken
OCL=29907
CL=29907
2009-06-04 16:18:13 -07:00
Russ Cox
3a0df4c451
more 386 runtime fixes.
...
can pass many tests;
current stumbling block is an 8l bug.
R=r
DELTA=122 (83 added, 8 deleted, 31 changed)
OCL=29872
CL=29876
2009-06-04 11:16:03 -07:00
Russ Cox
f51ca384eb
fix handling of floating point zero constant 0p+0
...
R=r
DELTA=25 (25 added, 0 deleted, 0 changed)
OCL=29875
CL=29875
2009-06-04 11:06:37 -07:00
Russ Cox
70ce47058e
bug in parallel assignment
...
R=r
DELTA=40 (40 added, 0 deleted, 0 changed)
OCL=29850
CL=29855
2009-06-03 17:26:53 -07:00
Russ Cox
9e0fec9c9c
update Go tree to use new syscall package.
...
R=r
DELTA=713 (109 added, 386 deleted, 218 changed)
OCL=29707
CL=29722
2009-06-01 22:14:39 -07:00
Ken Thompson
c17ce9f94f
prevent multiple similar errors
...
in complex literals. side effect is
fix of error in initializerr.go
R=r
OCL=29667
CL=29667
2009-05-31 13:02:24 -07:00
Russ Cox
ead9f8be3a
new 64-bit math test.
...
allow multiline recipes in run.
R=r
DELTA=712 (708 added, 2 deleted, 2 changed)
OCL=29641
CL=29666
2009-05-31 12:35:11 -07:00
Ian Lance Taylor
8cbb5d03bf
Adjust expected errors to work with gccgo.
...
The change to assign.go is because the gcc testsuite fails to
handle .* in a normal way: it matches against the entire
compiler output, not just a single line.
assign.go:15:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key')
assign.go:19:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key')
assign.go:23:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key')
assign.go:27:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key')
chan/perm.go:14:5: error: incompatible types in assignment
chan/perm.go:15:5: error: incompatible types in assignment
chan/perm.go:16:6: error: incompatible types in assignment
chan/perm.go:17:6: error: incompatible types in assignment
chan/perm.go:24:7: error: invalid send on receive-only channel
chan/perm.go:25:12: error: invalid send on receive-only channel
chan/perm.go:31:4: error: invalid receive on send-only channel
chan/perm.go:32:9: error: invalid receive on send-only channel
chan/perm.go:38:2: error: invalid send on receive-only channel
chan/perm.go:42:2: error: invalid receive on send-only channel
initializerr.go:14:17: error: reference to undefined variable 'X'
initializerr.go:14:19: error: mixture of field and value initializers
initializerr.go:15:26: error: duplicate value for field 'Y'
initializerr.go:16:10: error: too many values in struct composite literal
initializerr.go:18:19: error: index expression is not integer constant
initializerr.go:17:11: error: too many elements in composite literal
R=rsc
DELTA=12 (0 added, 0 deleted, 12 changed)
OCL=29657
CL=29665
2009-05-31 11:18:52 -07:00
Russ Cox
d6a9817051
bug157
...
R=ken
OCL=29651
CL=29653
2009-05-30 21:18:15 -07:00
Ken Thompson
be63b6dc44
bug 158
...
R=r
OCL=29646
CL=29646
2009-05-30 17:06:51 -07:00
Robert Griesemer
705f9af38e
Replacement for abandoned CL 29626:
...
bug157 and bug158
R=rsc
DELTA=59 (59 added, 0 deleted, 0 changed)
OCL=29632
CL=29634
2009-05-29 16:43:24 -07:00
Ken Thompson
fbcbcdbb1d
bug 156
...
R=r
OCL=29623
CL=29623
2009-05-29 15:34:47 -07:00
Ken Thompson
1c7bee0567
bug 155
...
R=r
OCL=29619
CL=29619
2009-05-29 14:42:24 -07:00
Russ Cox
cc7c31baa4
64-bit integer math bugs
...
R=r
DELTA=46 (46 added, 0 deleted, 0 changed)
OCL=29569
CL=29614
2009-05-29 13:46:43 -07:00
Ken Thompson
3b37b02834
bug 149
...
R=r
OCL=29612
CL=29612
2009-05-29 13:44:30 -07:00
Russ Cox
5d1d8a8258
integer conversions and test.
...
R=ken
OCL=29577
CL=29589
2009-05-29 09:17:35 -07:00
Ken Thompson
b3f303ec9a
bug 153
...
R=r
OCL=29479
CL=29479
2009-05-27 18:37:02 -07:00
Russ Cox
18890eebbf
fix bug154; tweak bug153 exit status
...
R=ken
OCL=29448
CL=29448
2009-05-27 10:16:13 -07:00
Robert Griesemer
fec0c01e7f
floating point bug
...
R=rsc
DELTA=35 (35 added, 0 deleted, 0 changed)
OCL=29442
CL=29444
2009-05-27 09:57:44 -07:00
Robert Griesemer
c376d5d7fc
bad error message
...
TBR=rsc
DELTA=14 (14 added, 0 deleted, 0 changed)
OCL=29441
CL=29441
2009-05-27 09:47:13 -07:00
Russ Cox
750a856742
bug151, bug152 -> fixedbugs
...
R=ken
OCL=29425
CL=29427
2009-05-26 21:11:43 -07:00
Ken Thompson
646927e48a
and the golden file
...
R=r
OCL=29421
CL=29421
2009-05-26 19:58:59 -07:00
Rob Pike
70d711dfb8
bug150 is fixed
...
R=ken
OCL=29407
CL=29407
2009-05-26 16:06:03 -07:00
Russ Cox
54b0065777
another interface conversion test
...
R=r
DELTA=21 (21 added, 0 deleted, 0 changed)
OCL=29212
CL=29249
2009-05-22 09:53:37 -07:00
Russ Cox
d33d763781
channel direction tests
...
(will submit with compiler fixes).
R=r
DELTA=44 (44 added, 0 deleted, 0 changed)
OCL=29211
CL=29248
2009-05-22 09:53:25 -07:00
Russ Cox
c2fa45b973
allow type name as key to accomodate anonymous fields.
...
update tests.
R=ken
OCL=29207
CL=29207
2009-05-21 16:31:10 -07:00
Russ Cox
d5269d0008
tests for new initializer syntax
...
R=r
DELTA=79 (79 added, 0 deleted, 0 changed)
OCL=29196
CL=29202
2009-05-21 14:46:13 -07:00
Russ Cox
8b6b380605
stricter rules for assignment.
...
when assigning a multifield object
(structs or arrays of structs) they
must not contain any fields that could
not be assigned individually.
R=ken
OCL=29192
CL=29194
2009-05-21 14:06:24 -07:00
Russ Cox
b9159722dd
add test for yesterday's interface rule change (interface/convert1.go).
...
move interface tests to subdirectory.
R=r
DELTA=1632 (827 added, 804 deleted, 1 changed)
OCL=29181
CL=29191
2009-05-21 13:46:20 -07:00
Russ Cox
2da5022bcf
change representation of interface values.
...
this is not a user-visible change.
before, all interface values were
struct Itype {
Sigt *type;
Sigi *inter;
void *method[n];
}
struct Iface {
void *addr;
Itype *itype;
}
the itype is basically a vtable, but it's unnecessary
if the static type is interface{ }.
for interface values with static type empty, the
new representation is
struct Eface {
void *addr;
Sigt *type;
}
this complicates the code somewhat, but
it reduces the number of Itypes that
have to be computed and cached,
it opens up opportunities to avoid function
calls in a few common cases,
and it will make it possible to lay out
interface{} values at compile time,
which i think i'll need for the new reflection.
R=ken
OCL=28701
CL=29121
2009-05-20 14:57:55 -07:00
Ian Lance Taylor
bc5620c2e0
Match gccgo error messages.
...
bug117.go:13:12: error: reference to undefined field or method
import1.go:9:2: error: redefinition of '.main.bufio'
import1.go:8:2: note: previous definition of '.main.bufio' was here
import1.go:9:2: error: incompatible imported type 'bufio.Error'
interface9.go:25:5: error: incompatible types in assignment (method P requires a pointer)
interface9.go:30:5: error: incompatible types in assignment (method P requires a pointer)
R=rsc
DELTA=5 (0 added, 0 deleted, 5 changed)
OCL=29044
CL=29055
2009-05-19 15:23:43 -07:00
Ian Lance Taylor
49fceff6af
Don't bother to import "os" just so that we can call
...
os.Exit(0) at the end of main.
R=rsc
DELTA=6 (0 added, 6 deleted, 0 changed)
OCL=28967
CL=28969
2009-05-16 23:12:28 -07:00
Russ Cox
a2ea790b1b
bug152: literal []slice{ } as range expression
...
R=ken
OCL=28918
CL=28918
2009-05-15 13:17:07 -07:00
Ian Lance Taylor
025506d0a3
A comparison of two values with a type equivalent to string
...
gives an type mismatch error, although both values appear to
have the same type.
R=ken,rsc
DELTA=23 (23 added, 0 deleted, 0 changed)
OCL=28786
CL=28805
2009-05-14 06:25:40 -07:00
Russ Cox
7cf30cd49e
bug150
...
R=ken
OCL=28785
CL=28785
2009-05-13 18:05:27 -07:00
Russ Cox
c7d30bceb2
describe each interface test
...
R=r
DELTA=20 (20 added, 0 deleted, 0 changed)
OCL=28707
CL=28716
2009-05-12 16:09:47 -07:00
Russ Cox
28516d4c78
update reflect for upcoming interface representation change.
...
test case for new change.
both work with the current compiler too.
R=r
DELTA=150 (145 added, 2 deleted, 3 changed)
OCL=28703
CL=28715
2009-05-12 16:08:16 -07:00
Russ Cox
3619f1ea6a
change utf8.FullRuneInString and utf8.DecodeRuneInString
...
to use single string argument instead of string, index.
R=r
DELTA=136 (9 added, 7 deleted, 120 changed)
OCL=28642
CL=28644
2009-05-11 14:10:34 -07:00
Russ Cox
9a861b6aaa
check for redeclaration of package name
...
R=r
DELTA=10 (10 added, 0 deleted, 0 changed)
OCL=28585
CL=28591
2009-05-08 16:40:55 -07:00
Russ Cox
917aa35f8f
implications of stricter type equality:
...
if both types are named, they must be
the same type (arising from the same
declaration).
R=r,gri
DELTA=44 (21 added, 4 deleted, 19 changed)
OCL=28436
CL=28577
2009-05-08 15:40:14 -07:00
Russ Cox
918afd9491
move things out of sys into os and runtime
...
R=r
OCL=28569
CL=28573
2009-05-08 15:21:41 -07:00
Rob Pike
c367d1b789
Move sys.Reflect and sys.Unreflect into unsafe.
...
R=rsc
DELTA=19 (4 added, 5 deleted, 10 changed)
OCL=28563
CL=28566
2009-05-08 14:57:56 -07:00
Robert Griesemer
b3b3e0da94
conversion bug
...
R=r
DELTA=24 (24 added, 0 deleted, 0 changed)
OCL=28451
CL=28508
2009-05-08 09:58:25 -07:00
Russ Cox
9ab8129ebe
test of struct with embedded interface.
...
also tests method calls on ptr to interface value.
R=r
DELTA=74 (74 added, 0 deleted, 0 changed)
OCL=28419
CL=28424
2009-05-07 13:43:00 -07:00
Russ Cox
b5e212ffdd
6g: error messages
...
replace "shape error across CALL" with more information.
x.go:7: not enough arguments to CALL
a int, b int
int
x.go:10: assignment count mismatch: 3 = 2
x.go:12: too many arguments to RETURN
[no arguments expected]
int, int, int
also leave type alone after conversion failure,
for later errors:
bug049.go:6: cannot convert nil constant to string
bug049.go:6: illegal types for operand: EQ
string
nil # this used to be blank
R=ken
OCL=28405
CL=28407
2009-05-07 10:29:35 -07:00
Russ Cox
e508c55760
interface method tests
...
R=r
DELTA=134 (134 added, 0 deleted, 0 changed)
OCL=28373
CL=28380
2009-05-06 17:05:55 -07:00
Ken Thompson
876c637e42
added a distinguishing string to the error prints
...
R=r
OCL=28321
CL=28357
2009-05-06 12:43:09 -07:00
Ken Thompson
c4de24981a
signs on div and mod
...
R=r
OCL=28319
CL=28319
2009-05-05 21:19:58 -07:00
Robert Griesemer
cc35ca529b
wrong type used for dynamic type test
...
R=r
DELTA=40 (40 added, 0 deleted, 0 changed)
OCL=28308
CL=28311
2009-05-05 17:05:58 -07:00
Russ Cox
b8dd218e2e
bug117 is fixed in 6g; now an errchk
...
R=r
DELTA=42 (20 added, 22 deleted, 0 changed)
OCL=28295
CL=28295
2009-05-05 13:41:46 -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
Ian Lance Taylor
be827826ef
Verify that a send on a sychronous channel waits until the
...
value has been received. This failed with gccgo before
today.
R=ken,r
DELTA=18 (18 added, 0 deleted, 0 changed)
OCL=28185
CL=28190
2009-05-02 12:47:33 -07:00
Russ Cox
83e976d53e
bug146: array/slice conversion before I left missed conversions
...
R=ken
OCL=28120
CL=28124
2009-04-30 13:49:58 -07:00
Ian Lance Taylor
625866a977
Conversion from array to slices should work like assignment:
...
you should be able to convert a pointer to an array to a
slice, you should not be able to convert an array to a slice.
Currently 6g works the other way around.
R=ken,rsc
DELTA=17 (17 added, 0 deleted, 0 changed)
OCL=28033
CL=28067
2009-04-29 20:15:59 -07:00
Ken Thompson
91ce0ef8f3
bug 139
...
R=r
OCL=27987
CL=27987
2009-04-28 13:52:56 -07:00
Ken Thompson
f2714e38a4
bug131 has been fixed with no change
...
R=r
OCL=27980
CL=27980
2009-04-28 13:04:01 -07:00
Ken Thompson
ad36c39211
bug 145
...
R=r
OCL=27979
CL=27979
2009-04-28 12:28:31 -07:00
Ian Lance Taylor
905338a845
Recognize gcco error messages.
...
declbad.go:15:3: error: variables redeclared but no variable is new
declbad.go:20:3: error: redefinition of 'f'
declbad.go:19:3: note: previous definition of 'f' was here
declbad.go:25:3: error: redefinition of 'i'
declbad.go:24:3: note: previous definition of 'i' was here
declbad.go:30:3: error: variables redeclared but no variable is new
declbad.go:35:3: error: redefinition of 'i'
declbad.go:34:3: note: previous definition of 'i' was here
declbad.go:40:3: error: variables redeclared but no variable is new
declbad.go:45:3: error: variables redeclared but no variable is new
R=r
DELTA=10 (0 added, 0 deleted, 10 changed)
OCL=27934
CL=27957
2009-04-28 07:16:03 -07:00
Robert Griesemer
eaba458ee6
cannot declare a variable in new scope with same name as type in outer scope
...
(same as bug144.go but for types instead of constants)
TBR=ken
DELTA=17 (17 added, 0 deleted, 0 changed)
OCL=27855
CL=27855
2009-04-25 13:41:56 -07:00
Ken Thompson
b03b541b7a
recognize a defined constant
...
as a new name in a later declaration
(bug 144)
R=r
OCL=27850
CL=27850
2009-04-24 16:43:31 -07:00
Robert Griesemer
516bf6535c
- cannot declare local variable named like a constant in outer scope
...
- submitted per discussion w/ ken
TBR=ken
DELTA=25 (25 added, 0 deleted, 0 changed)
OCL=27824
CL=27826
2009-04-23 21:54:07 -07:00
David Symonds
2f8a2dc193
Extend fixedbugs/bug143.go with function return values,
...
as a regression test for the fix made in s2/27706.
R=r
APPROVED=r
DELTA=14 (13 added, 0 deleted, 1 changed)
OCL=27707
CL=27709
2009-04-21 20:26:26 -07:00
Rob Pike
227fe8c530
bug143 is fixed
...
R=dsymonds
DELTA=58 (26 added, 32 deleted, 0 changed)
OCL=27698
CL=27698
2009-04-21 18:11:34 -07:00
Rob Pike
5689e6472c
update golden for bug 143
...
R=dsymonds
DELTA=6 (6 added, 0 deleted, 0 changed)
OCL=27654
CL=27654
2009-04-21 00:05:19 -07:00
David Symonds
d5fa81e1a9
Add bug143 to demonstrate bug with "v, ok :=" on pointers to maps.
...
R=r
APPROVED=r
DELTA=26 (26 added, 0 deleted, 0 changed)
OCL=27651
CL=27651
2009-04-20 21:03:38 -07:00
Robert Griesemer
0dd5be48aa
missing '}' (found by pretty)
...
R=r
DELTA=1 (1 added, 0 deleted, 0 changed)
OCL=27633
CL=27639
2009-04-20 15:23:21 -07:00
Rob Pike
f1820b50ff
typo in message
...
R=ken
OCL=27621
CL=27621
2009-04-19 21:12:48 -07:00
Rob Pike
f83f245c8c
add another test to decl to see that result vars are redeclarable.
...
R=ken
OCL=27620
CL=27620
2009-04-19 21:12:13 -07:00
Rob Pike
549a60046b
tests for redeclaration in :=
...
R=ken
DELTA=71 (71 added, 0 deleted, 0 changed)
OCL=27616
CL=27616
2009-04-18 17:21:00 -07:00
Rob Pike
aaf63f8d06
Step 1 of the Big Error Shift: make os.Error an interface and replace *os.Errors with os.Errors.
...
lib/template updated to use new setup; its clients also updated.
Step 2 will make os's error support internally much cleaner.
R=rsc
OCL=27586
CL=27586
2009-04-17 00:08:24 -07:00
Russ Cox
e2bf22715d
make string take []byte only, so have to use *[10]byte to convert
...
R=r
DELTA=4 (0 added, 0 deleted, 4 changed)
OCL=27578
CL=27584
2009-04-16 23:07:15 -07:00
Russ Cox
1f6463f823
Convert go tree to hierarchical pkg directory:
...
import (
"vector" -> "container/vector"
"ast" -> "go/ast"
"sha1" -> "hash/sha1"
etc.
)
and update Makefiles. Because I did the conversion
semi-automatically, I sorted all the import blocks
as a post-processing. Some files have therefore
changed that didn't strictly need to.
Rename local packages to lower case.
The upper/lower distinction doesn't work on OS X
and complicates the "single-package directories
with the same package name as directory name"
heuristic used by gobuild and godoc to create
the correlation between source and binary locations.
Now that we have a plan to avoid globally unique
names, the upper/lower is unnecessary.
The renamings will cause trouble for a few users,
but so will the change in import paths.
This way, the two maintenance fixes are rolled into
one inconvenience.
R=r
OCL=27573
CL=27575
2009-04-16 20:52:37 -07:00
Russ Cox
60ce95d7a1
code changes for array conversion.
...
as a reminder, the old conversion
was that you could write
var arr [10]byte;
var slice []byte;
slice = arr;
but now you have to write
slice = &arr;
the change eliminates an implicit &, so that
the only implicit &s left are in the . operator
and in string(arr).
also, removed utf8.EncodeRuneToString
in favor of string(rune).
R=r
DELTA=83 (1 added, 23 deleted, 59 changed)
OCL=27531
CL=27534
2009-04-15 20:27:45 -07:00
Russ Cox
a62467af93
fix stringrange test
...
R=ken
OCL=27353
CL=27353
2009-04-13 05:31:44 -07:00
Rob Pike
54ec719391
fix string range to have full unicode range (up to 10FFFF).
...
add test for string range.
test has minor failure: after loop the index == len(s); should be len(s)-1
in this case. according to spec, vars are left at position at last
iteration.
R=ken,rsc
DELTA=259 (161 added, 96 deleted, 2 changed)
OCL=27343
CL=27343
2009-04-12 17:01:17 -07:00
Rob Pike
72d867660d
bug142 is fixed
...
R=rsc
OCL=27331
CL=27331
2009-04-10 17:58:10 -07:00
Russ Cox
78edbfdcf4
test for new string bug
...
TBR=r
OCL=27306
CL=27306
2009-04-10 06:22:41 -07:00
Rob Pike
7d6c0018fb
messages changed; updated golden.out for bug037
...
R=rsc
OCL=27248
CL=27248
2009-04-08 23:34:44 -07:00
Russ Cox
b8035ab5a5
bug142
...
R=ken
OCL=27202
CL=27202
2009-04-07 23:30:59 -07:00
Russ Cox
3067781ab9
func f() (int, int);
...
x := f();
used to give
fatal error: dowidth fn struct struct { int; int }
now gives
assignment count mismatch: 1 = 2
R=ken
OCL=27198
CL=27201
2009-04-07 22:20:37 -07:00
Rob Pike
a888d4d233
not a bug by current understanding, so delete this file.
...
6g says: bug138.go:8: constant -1 overflows uint
gccgo says: bug138.go:8:16: error: integer constant overflow
R=rsc
DELTA=19 (0 added, 19 deleted, 0 changed)
OCL=27099
CL=27149
2009-04-07 00:15:49 -07:00
Russ Cox
4b536c1e07
test for and fix bug involving reflect v.Interface() and ==.
...
R=r
DELTA=156 (149 added, 2 deleted, 5 changed)
OCL=26973
CL=26973
2009-03-31 17:33:04 -07:00
Russ Cox
a99a7f60c3
tests changed - throw calls panic directly now
...
instead of dereferencing nil, so no more SIGSEGVs.
R=r
DELTA=28 (0 added, 14 deleted, 14 changed)
OCL=26881
CL=26881
2009-03-30 00:28:08 -07:00
Ken Thompson
a805e54a38
golden
...
R=r
OCL=26699
CL=26699
2009-03-24 16:47:33 -07:00
Ken Thompson
b8be809c10
^ type(const) now inverts "enough" bits
...
^ signed(const) becomes illegal
^ unsigned(const) becomes legal
R=r
OCL=26697
CL=26697
2009-03-24 16:40:38 -07:00
Russ Cox
13584f4a23
add test for close/closed, fix a few implementation bugs.
...
R=ken
OCL=26664
CL=26664
2009-03-23 18:50:35 -07:00
Russ Cox
86145611b0
allow range on nil maps
...
R=ken
OCL=26663
CL=26663
2009-03-23 18:32:37 -07:00
Rob Pike
7525e085d2
bug141 is fixed
...
R=ken
DELTA=56 (26 added, 30 deleted, 0 changed)
OCL=26628
CL=26628
2009-03-22 21:02:17 -07:00
Ian Lance Taylor
90943c8ee4
Test that interfaces work in type switches.
...
R=ken,rsc
DELTA=30 (30 added, 0 deleted, 0 changed)
OCL=26599
CL=26604
2009-03-20 16:30:54 -07:00
Russ Cox
54aa835b44
range over channels.
...
also fix multiple-evaluation bug in range over arrays.
R=ken
OCL=26576
CL=26576
2009-03-20 11:32:58 -07:00
Ian Lance Taylor
386845b23f
Match gccgo error messages.
...
bug090.go:41:6: error: floating point constant truncated to integer
bug090.go:32:6: error: floating point constant truncated to integer
bug090.go:34:14: error: floating point constant truncated to integer
bug090.go:37:5: error: incompatible types in assignment
bug090.go:40:5: error: incompatible types in assignment
R=rsc
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=26564
CL=26574
2009-03-20 10:34:46 -07:00
Ian Lance Taylor
8b3df525a2
Modify error regexps to match gccgo error messages.
...
const1.go:23:13: error: integer constant overflow
const1.go:25:13: error: integer constant overflow
const1.go:26:14: error: integer constant overflow
const1.go:27:18: error: integer constant overflow
const1.go:28:19: error: integer constant overflow
const1.go:29:16: error: integer constant overflow
const1.go:29:25: error: integer constant overflow
const1.go:30:13: error: integer constant overflow
const1.go:33:14: error: integer constant overflow
const1.go:34:14: error: integer constant overflow
const1.go:36:22: error: integer constant overflow
const1.go:37:7: error: integer constant overflow
const1.go:38:8: error: integer constant overflow
const1.go:39:7: error: integer constant overflow
const1.go:40:7: error: integer constant overflow
const1.go:41:8: error: integer constant overflow
const1.go:44:23: error: integer constant overflow
const1.go:46:13: error: integer constant overflow
const1.go:47:24: error: integer constant overflow
const1.go:48:24: error: integer constant overflow
const1.go:49:22: error: integer constant overflow
const1.go:51:23: error: integer constant overflow
const1.go:52:19: error: division by zero
const1.go:58:11: error: division by zero
const1.go:43:17: error: integer constant overflow
const1.go:45:13: error: integer constant overflow
const1.go:55:19: error: floating point overflow
const1.go:56:28: error: floating point overflow
const1.go:57:11: error: floating point overflow
const1.go:64:2: error: argument 0 has wrong type
const1.go:65:2: error: argument 0 has wrong type
const1.go:66:2: error: argument 0 has wrong type
const1.go:68:2: error: argument 0 has wrong type
const1.go:69:2: error: argument 0 has wrong type
const1.go:70:4: error: floating point constant truncated to integer
const1.go:72:2: error: argument 0 has wrong type
const1.go:73:2: error: argument 0 has wrong type
const1.go:74:2: error: argument 0 has wrong type
R=rsc
DELTA=34 (0 added, 0 deleted, 34 changed)
OCL=26560
CL=26560
2009-03-19 17:33:28 -07:00
Rob Pike
08eeb2535d
simplify test to eliminate now-deprecated forms of switch.
...
R=rsc
DELTA=76 (0 added, 63 deleted, 13 changed)
OCL=26439
CL=26490
2009-03-18 14:05:05 -07:00
Ken Thompson
1cdcfda140
remove assignment cases from switch
...
R=r
OCL=26480
CL=26480
2009-03-18 12:13:42 -07:00
Rob Pike
bd3c478f93
add value checks to the other switch - should have done this in prior round
...
R=rsc
OCL=26438
CL=26438
2009-03-17 20:57:54 -07:00
Rob Pike
bcb464d221
add test for type switches
...
R=rsc
DELTA=169 (169 added, 0 deleted, 0 changed)
OCL=26433
CL=26437
2009-03-17 20:55:42 -07:00
Ian Lance Taylor
bd64e81041
Recognize gccgo error message.
...
const2.go:7:9: error: expected '='
Uses '.' to recognize the quotation marks, as the actual
characters printed depend on the user's locale.
R=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=26360
CL=26373
2009-03-16 21:48:07 -07:00
Ian Lance Taylor
1e39143966
Don't try to define the same label twice, as that produces a
...
label redefinition error.
R=gri
DELTA=6 (0 added, 0 deleted, 6 changed)
OCL=26357
CL=26372
2009-03-16 21:47:38 -07:00
Robert Griesemer
5a27079801
spec and implementation disagree with respect to label declarations
...
R=rsc
DELTA=19 (19 added, 0 deleted, 0 changed)
OCL=26284
CL=26336
2009-03-16 11:21:58 -07:00
Robert Griesemer
b260916a55
internal compiler error
...
R=rsc
DELTA=18 (18 added, 0 deleted, 0 changed)
OCL=26266
CL=26266
2009-03-13 14:14:50 -07:00
Russ Cox
5fbadf0bc3
warn -> yyerror in mparith.
...
close two more bugs.
R=ken
OCL=26226
CL=26226
2009-03-12 19:57:30 -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
Ken Thompson
767845b6fa
bug 125
...
R=r
OCL=26146
CL=26146
2009-03-11 17:37:04 -07:00
Ken Thompson
48f6b516e2
bug 137
...
R=r
OCL=26142
CL=26142
2009-03-11 16:25:45 -07:00
Russ Cox
4eb7ceba58
complain when trying to put T into an interface
...
if T has pointer methods. this is just a heuristic
but it catches the problem robert ran into and
lets me put the larger interface issues aside for
now. found one bug in pretty.
R=ken
OCL=26141
CL=26141
2009-03-11 16:06:17 -07:00
Ken Thompson
d27e9f528d
bug086
...
R=r
OCL=26090
CL=26090
2009-03-10 19:16:31 -07:00
Robert Griesemer
b2e91a9a29
constant conversion of int (non-ideal) constant doesn't work
...
R=rsc
DELTA=20 (20 added, 0 deleted, 0 changed)
OCL=26054
CL=26062
2009-03-10 16:39:23 -07:00
Rob Pike
99d00eae3c
delete vestigial references to package syscall
...
R=rsc
DELTA=8 (0 added, 5 deleted, 3 changed)
OCL=25857
CL=25861
2009-03-06 16:03:59 -08:00
Russ Cox
63985b489b
bug085 bug129
...
R=ken
OCL=25787
CL=25791
2009-03-05 15:57:03 -08:00
Rob Pike
5ef8e1d47e
update missed test case to {}
...
R=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=25648
CL=25654
2009-03-03 16:09:12 -08:00
Russ Cox
be2edb5761
Automated g4 rollback of changelist 25024,
...
plus significant hand editing.
Back to T{x} for composite literals.
R=r
OCL=25612
CL=25632
2009-03-03 08:39:12 -08:00
Rob Pike
88b1f8594a
bug130 is fixed
...
R=ken
OCL=25448
CL=25448
2009-02-25 16:31:42 -08:00
Russ Cox
ebc10db3e1
allow parens to disambiguate types.
...
examples:
chan <- (chan int)
chan (<- chan int)
(map[string]func())("a": main)
R=ken
OCL=25151
CL=25151
2009-02-18 10:07:46 -08:00
Russ Cox
d3d0c256be
bug123
...
R=ken
OCL=25075
CL=25075
2009-02-16 17:44:05 -08:00
Robert Griesemer
127526649f
- vector package (identical to array except for names)
...
- updated some file (but not all - left array package in place for now)
R=rsc
DELTA=530 (483 added, 0 deleted, 47 changed)
OCL=25025
CL=25025
2009-02-13 15:07:56 -08:00
Russ Cox
9f8f2e6130
convert composite literals from { } to ( ).
...
only non-trivial changes are in
convlit1.go
golden.out
R=gri
OCL=25019
CL=25024
2009-02-13 14:48:32 -08:00
Robert Griesemer
920ab67b4c
label declarations not handled properly
...
R=rsc
DELTA=27 (27 added, 0 deleted, 0 changed)
OCL=25015
CL=25015
2009-02-13 13:42:43 -08:00
Russ Cox
49e2087848
insert type assertions when narrowing.
...
R=r
OCL=24349
CL=24913
2009-02-11 17:55:16 -08:00
Robert Griesemer
a85e06f302
bug: empty statement not properly recognized in conjunction w/ labels
...
R=r
DELTA=14 (14 added, 0 deleted, 0 changed)
OCL=24610
CL=24610
2009-02-06 16:45:37 -08:00
Ian Lance Taylor
1103d78c84
Recognize gccgo error messages:
...
func4.go:8:11: error: invalid operand for unary '&'
func4.go:9:8: error: invalid left hand side of assignment
R=rsc
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=24294
CL=24603
2009-02-06 15:57:02 -08:00
Rob Pike
ee9b5a15a1
powser cleanup.
...
- don't need *struct
- don't need item/rat both
- closures make the inner slaves easier
- delete some old BUG comments
powser2 is left mostly alone, for variety.
R=rsc
DELTA=134 (2 added, 20 deleted, 112 changed)
OCL=24579
CL=24581
2009-02-06 15:03:14 -08:00
Russ Cox
0f4f2a6183
closures - runtime and debugger support, test case
...
R=r
DELTA=257 (250 added, 1 deleted, 6 changed)
OCL=24509
CL=24565
2009-02-06 13:46:56 -08:00
Russ Cox
b0009bef20
bug064
...
make f(g()) work when g returns multiple
args with names different than f expects.
func swap(a, b int) (c, d int) {
return b, a
}
swap(swap(1,2))
R=ken
OCL=24474
CL=24476
2009-02-05 15:22:49 -08:00
Ian Lance Taylor
58c277955a
Rename function to avoid function redefinition error. Remove
...
.* from regexp since it confuses DejaGNU which runs gcc's
testsuite.
R=rsc
DELTA=3 (0 added, 0 deleted, 3 changed)
OCL=24435
CL=24438
2009-02-05 12:54:15 -08:00
Rob Pike
f9cc900ae8
bugs cleanup, including deleting one near-identical duplicate bug
...
R=rsc
DELTA=52 (15 added, 37 deleted, 0 changed)
OCL=24274
CL=24274
2009-02-03 16:59:26 -08:00
Russ Cox
4cf7711568
update go code tree to new func rules.
...
R=r
DELTA=367 (111 added, 59 deleted, 197 changed)
OCL=23957
CL=23960
2009-01-30 14:39:31 -08:00
Russ Cox
391425ae55
if take address of local, move to heap.
...
heuristic to not print bogus strings.
fix one error message format.
R=ken
OCL=23849
CL=23851
2009-01-29 17:38:58 -08:00
Russ Cox
6ee6d6ec55
add stack test
...
R=r
DELTA=48 (48 added, 0 deleted, 0 changed)
OCL=23715
CL=23732
2009-01-28 16:58:48 -08:00
Robert Griesemer
cb659ece0e
additions to array container:
...
- added Slice, Cut, InsertArray, AppendArray
- renamed Remove -> Delete (so we have: Insert, Delete, Cut)
- more factoring of code
- extra tests (could use some more)
R=r,rsc
DELTA=179 (127 added, 22 deleted, 30 changed)
OCL=23648
CL=23685
2009-01-28 13:32:31 -08:00
Rob Pike
712522a6d8
bug135 is fixed
...
TBR=ken
OCL=23650
CL=23650
2009-01-27 19:30:44 -08:00
Rob Pike
c8476472d9
test for defer
...
R=rsc
DELTA=48 (48 added, 0 deleted, 0 changed)
OCL=23624
CL=23626
2009-01-27 15:08:08 -08:00
Rob Pike
fa615a3b30
f, ok := i.(Foo) does not compile if i already is equivalent to Foo
...
R=rsc
DELTA=18 (18 added, 0 deleted, 0 changed)
OCL=23544
CL=23547
2009-01-26 18:35:18 -08:00
Russ Cox
1ce17918e3
gc #0 . mark and sweep collector.
...
R=r,gri
DELTA=472 (423 added, 2 deleted, 47 changed)
OCL=23522
CL=23541
2009-01-26 17:37:05 -08:00
Russ Cox
f1fe21a08f
bug134
...
R=ken
OCL=23532
CL=23532
2009-01-26 17:06:20 -08:00
Russ Cox
4efad58d0a
bug133
...
R=ken
OCL=23528
CL=23528
2009-01-26 16:57:24 -08:00
Russ Cox
9b6d385cb5
interface speedups and fixes.
...
more caching, better hash functions, proper locking.
fixed a bug in interface comparison too.
R=ken
DELTA=177 (124 added, 10 deleted, 43 changed)
OCL=23491
CL=23493
2009-01-26 12:36:21 -08:00
Ken Thompson
7859ae8a2f
removed a:b in range syntax
...
added another channel test
R=r
OCL=23488
CL=23488
2009-01-26 11:34:38 -08:00
Ian Lance Taylor
2a4f4dd842
Add a test for a case where 6g thinks that a field is visible
...
when it should not be. I couldn't get this any simpler; the
error seems to have to do with the order of the imports in
bug2.go.
R=rsc
DELTA=26 (26 added, 0 deleted, 0 changed)
OCL=23450
CL=23482
2009-01-26 09:59:59 -08:00
Russ Cox
a7f6d4066e
implement new restrictions on what
...
can be compared/hashed.
R=r
DELTA=351 (201 added, 80 deleted, 70 changed)
OCL=23423
CL=23481
2009-01-26 09:56:42 -08:00
Russ Cox
d2117ad438
make test/chan/nonblock work even with real os threads
...
R=ken
OCL=23422
CL=23422
2009-01-23 17:04:56 -08:00
Robert Griesemer
e1e158a90c
- added comment with various viewpoints so we have whole story
...
once we close this
R=r
OCL=23239
CL=23239
2009-01-21 14:57:47 -08:00
Russ Cox
61590c4c44
disallow P.t for lowercase t and not our package P.
...
implement hiding lowercase methods m in
signatures by adding in a hash of the package name
to the type hash code.
remove remaining checks for internally-generated _ names:
they are all gone.
R=ken
OCL=23236
CL=23238
2009-01-21 14:51:57 -08:00
Robert Griesemer
41644d7138
- duplicate struct field not diagnosed
...
R=rsc
DELTA=16 (16 added, 0 deleted, 0 changed)
OCL=23224
CL=23229
2009-01-21 14:11:54 -08:00