Commit Graph

246 Commits

Author SHA1 Message Date
Russ Cox
5fe4cd83a8 do not set t->recur on basic types.
the comment talked about printing, but now
t->recur is only used for typehash.
in typehash it is important to compute different
hashes for the different basic types.

add test that makes sure an interface { X() int8 }
cannot be used as interface { X() int64 }

R=ken
OCL=17396
CL=17396
2008-10-17 17:51:29 -07:00
Rob Pike
4bcfffb761 update fixed bugs (and delete an irrelevant one)
R=rsc
DELTA=328  (158 added, 170 deleted, 0 changed)
OCL=17353
CL=17359
2008-10-17 11:48:51 -07:00
Russ Cox
925454e932 make sure errchk only says BUG once,
so that run's count is correct

R=iant,r
DELTA=20  (12 added, 0 deleted, 8 changed)
OCL=17329
CL=17342
2008-10-17 07:41:18 -07:00
Russ Cox
1163b1db6f diagnose various conversion problems
R=ken
OCL=17320
CL=17320
2008-10-16 15:59:31 -07:00
Russ Cox
493a9d2f42 put toplevel & check back and add test
R=ken
OCL=17307
CL=17307
2008-10-16 14:02:20 -07:00
Russ Cox
59167e5bdb diagnose export of incomplete type
R=ken
OCL=17253
CL=17253
2008-10-15 17:51:23 -07:00
Ken Thompson
8973e1ffb7 basic types/interfaces test
R=r
OCL=17247
CL=17247
2008-10-15 17:15:47 -07:00
Rob Pike
13508ceabe bug is fixed
R=ken
OCL=17208
CL=17208
2008-10-15 11:49:34 -07:00
Rob Pike
151c0de8bc update bug list
R=ken
OCL=17169
CL=17169
2008-10-14 19:41:05 -07:00
Russ Cox
82e41cc533 allow trailing comma in braced initialized list
R=ken
OCL=17141
CL=17143
2008-10-14 17:10:39 -07:00
Rob Pike
99c5b2ed4d 6g thinks a struct with one entry yields a composite that is a basic conversion
R=rsc
DELTA=12  (12 added, 0 deleted, 0 changed)
OCL=16989
CL=16998
2008-10-13 12:26:58 -07:00
Robert Griesemer
32d00e6cc6 - added missing ';' according to new rules
(no effect on the test, but now parseable)

R=r
OCL=16936
CL=16936
2008-10-10 16:18:01 -07:00
Robert Griesemer
e7c8e78879 - removed extra package clause
R=rsc
DELTA=2  (0 added, 2 deleted, 0 changed)
OCL=16927
CL=16927
2008-10-10 14:50:23 -07:00
Russ Cox
7e241107f1 test of new empty productions
R=gri
DELTA=8  (8 added, 0 deleted, 0 changed)
OCL=16765
CL=16767
2008-10-08 15:33:18 -07:00
Russ Cox
b4f8e01acb more interface checks:
- pointer to interface cannot have methods
	- record type names for better runtime error

R=r,ken
DELTA=85  (80 added, 0 deleted, 5 changed)
OCL=16658
CL=16722
2008-10-08 09:21:57 -07:00
Russ Cox
e6cd1e445b remove uses of *T as an implicit forward declaration of T
R=gri,r
OCL=16648
CL=16652
2008-10-07 12:59:54 -07:00
Russ Cox
eb452f4b6e test that mutually recursive interfaces compile
R=r
DELTA=18  (18 added, 0 deleted, 0 changed)
OCL=16639
CL=16647
2008-10-07 12:36:39 -07:00
Russ Cox
983f06bdb6 update code to follow new semicolon rules:
*  1. all statements and declarations are terminated by semicolons
 *  2. semicolons can be omitted at top level.
 *  3. semicolons can be omitted before and after the closing ) or }
 *	on a list of statements or declarations.

/home/rsc/bin/addsemi and then diff+tweak.

R=r,gri
OCL=16620
CL=16643
2008-10-07 12:31:31 -07:00
Rob Pike
7ee60b174d sys.stringtorune doesn't need a length parameter.
R=rsc
DELTA=7  (0 added, 0 deleted, 7 changed)
OCL=16600
CL=16630
2008-10-07 10:03:34 -07:00
Russ Cox
74e2e087e2 change type names to go live at the name, so that
type T struct {
		next *T
	}

and

	type T *struct {
		next T
	}

are valid without needing forward declarations.

add "type T struct" syntax for forward struct declarations.

add "type T interface" syntax, but commented out
	(need to fix semicolons first)

R=ken
DELTA=452  (259 added, 115 deleted, 78 changed)
OCL=16580
CL=16584
2008-10-06 16:44:17 -07:00
Rob Pike
717de79976 change in spec results in non-error
R=gri
DELTA=4  (0 added, 3 deleted, 1 changed)
OCL=16565
CL=16579
2008-10-06 16:27:14 -07:00
Ian Lance Taylor
be0c25ee93 Change old-style export declaration to new style export of
type definition.

R=r
DELTA=3  (0 added, 2 deleted, 1 changed)
OCL=16537
CL=16545
2008-10-06 13:12:03 -07:00
Rob Pike
98c208ee1d bug026 and bug060 are fixed. update.
R=rsc
DELTA=87  (37 added, 50 deleted, 0 changed)
OCL=16498
CL=16507
2008-10-05 08:34:48 -07:00
Russ Cox
f464beb61d fix method use bug in powser1.
R=r
DELTA=7  (2 added, 2 deleted, 3 changed)
OCL=16495
CL=16499
2008-10-04 22:11:26 -07:00
Russ Cox
2e1bb4a4cf add method test & fix method name bugs
R=ken,r
DELTA=86  (72 added, 9 deleted, 5 changed)
OCL=16488
CL=16488
2008-10-04 02:51:03 -07:00
Russ Cox
7766b12ead const bug, name bug - working on both
R=r
DELTA=43  (43 added, 0 deleted, 0 changed)
OCL=16468
CL=16475
2008-10-03 17:06:24 -07:00
Russ Cox
b8babed7c2 new import/export format
package flag
	export type flag.Flag struct { name flag.string; usage flag.string; \
		value flag.Value; next *flag.Flag }
	type flag.string string
	type flag.Value interface { AsBool () (? *flag.BoolValue); \
		AsInt () (? *flag.IntValue); AsString () (? *flag.StringValue); \
		IsBool () (? flag.bool); IsInt () (? flag.bool); IsString () (? flag.bool); \
		Str () (? flag.string); ValidValue (str flag.string) (? flag.bool) }
	type flag.BoolValue struct { val flag.bool; p *flag.bool }
	type flag.IntValue struct { val flag.int64; p *flag.int64 }
	type flag.StringValue struct { val flag.string; p *flag.string }
	type flag.bool bool
	func (e *flag.StringValue) AsBool () (? *flag.BoolValue)
	func (e *flag.StringValue) AsInt () (? *flag.IntValue)
	...

the \ continuations are for this message, not real.

changed delimiter for import from (( )) to $$ $$.

replaced mksys.bash with mksys.c

changed sys.go to use leading export,
	fake package name is now SYS not foop

don't always require ; on forward func decls

R=ken,r
DELTA=1827  (446 added, 1083 deleted, 298 changed)
OCL=16433
CL=16463
2008-10-03 16:15:55 -07:00
Ian Lance Taylor
8d0ed065dc With the cleanup of method types, this test case is now
invalid.  The receiver type is not permitted to be a pointer
type.  Since 6g currently accepts it, this moves the test case
back to the bugs directory.

R=gri
DELTA=22  (11 added, 11 deleted, 0 changed)
OCL=16284
CL=16336
2008-10-01 17:01:42 -07:00
Russ Cox
77a911bcc1 update golden.out
R=r
OCL=16250
CL=16250
2008-09-30 15:45:49 -07:00
Russ Cox
5ed04d71fb tests of new func arg code
R=r
DELTA=41  (41 added, 0 deleted, 0 changed)
OCL=16212
CL=16223
2008-09-30 14:08:43 -07:00
Rob Pike
ca6d4238a4 update golden for new error messages
R=rsc
OCL=16213
CL=16213
2008-09-30 13:07:38 -07:00
Rob Pike
fa2b4cbf44 104, 107, 108: they are known to fail, so mark them appropriately.
update golden
add the "goroutines" test

R=iant
DELTA=74  (36 added, 23 deleted, 15 changed)
OCL=16194
CL=16206
2008-09-30 12:31:47 -07:00
Ian Lance Taylor
aadd32223d Test that floating point constants resolve to type "float".
Currently 6g seems to resolve them to type "double".

R=ken,r
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=16132
CL=16152
2008-09-29 18:17:42 -07:00
Russ Cox
785afb0847 make bugs not fail
R=r
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=16110
CL=16114
2008-09-29 13:16:22 -07:00
Ian Lance Taylor
08df4dcf7d Storing an out of range constant into a variable should
ideally cause the compiler to give an error.  Right now 6g
warns about large shifts but does not give an error.  This CL
removes the out of range shift from shift.go, so that it will
work with gccgo, and adds a test case in bugs/ to be fixed at
a later date.

R=ken,r
DELTA=23  (9 added, 14 deleted, 0 changed)
OCL=16085
CL=16088
2008-09-29 11:03:21 -07:00
Russ Cox
43c5e63c00 Darwin kqueue/kevent-based network FDs
R=r
OCL=15998
CL=16004
2008-09-26 14:46:28 -07:00
Russ Cox
d448d18cb4 test and fix non-blocking chan ops on buffered chans
R=ken
DELTA=68  (19 added, 0 deleted, 49 changed)
OCL=15966
CL=15969
2008-09-26 11:47:04 -07:00
Ian Lance Taylor
6270e70b76 Add test case for 6g bug: result variable does not hide the
package name in the scope.

R=r
DELTA=12  (12 added, 0 deleted, 0 changed)
OCL=15913
CL=15926
2008-09-25 20:31:03 -07:00
Russ Cox
eeeaf6b931 6g misparses negative constants in imports
R=r
DELTA=8  (8 added, 0 deleted, 0 changed)
OCL=15893
CL=15898
2008-09-25 16:32:39 -07:00
Robert Griesemer
b6429768c6 bug: package identifier not visible
(should be in the scope chain like any other identifier)

R=r
DELTA=16  (16 added, 0 deleted, 0 changed)
OCL=15884
CL=15884
2008-09-25 15:45:19 -07:00
Ian Lance Taylor
b70d42f323 6g currently accepts setting a string value to an integer
constant without an explicit conversion.  I think that is a
bug.  This adds a test case for it.

Also, change errchk to include the string BUG in error
messages, so that failures are included in the count reported
by the run shell script.

R=r,ken
DELTA=11  (7 added, 0 deleted, 4 changed)
OCL=15857
CL=15880
2008-09-25 15:08:52 -07:00
Russ Cox
5383e28ea0 change string([]byte) to pass array, rather than &a[0],
to string convert.  if the byte array has length 0,
the computation of &a[0] throws an index bounds error.

for fixed size arrays, this ends up invoking arrays2d
unnecessarily, but it works.

R=ken
DELTA=304  (44 added, 28 deleted, 232 changed)
OCL=15674
CL=15678
2008-09-22 20:12:15 -07:00
Rob Pike
4d12c0e170 add os.Getenv()
R=rsc
DELTA=51  (50 added, 0 deleted, 1 changed)
OCL=15665
CL=15667
2008-09-22 17:31:41 -07:00
Russ Cox
c14924bcc8 implement zoneinfo reader
R=r
DELTA=348  (338 added, 0 deleted, 10 changed)
OCL=15648
CL=15660
2008-09-22 16:41:14 -07:00
Russ Cox
173ca8a2d0 re-fix bug067, update golden.out
R=r
DELTA=9  (4 added, 3 deleted, 2 changed)
OCL=15655
CL=15655
2008-09-22 16:16:22 -07:00
Russ Cox
fb40f88c40 test cleanup
- do not print tracebacks if $GOTRACEBACK=0
	- set GOTRACEBACK=0 during tests
	- filter out pc numbers in errors

R=r
DELTA=70  (22 added, 30 deleted, 18 changed)
OCL=15618
CL=15642
2008-09-22 13:47:53 -07:00
Russ Cox
fb2c66710c compiler changes:
export.c:
		- only expose explicitly exported types to importer
		- fix behind your back
	go.h:
		- add deep() prototype (fixes 64-bit linux crash on time.go)
	go.y:
		- add a new syntax error case
	walk.c:
		- allow a,b = f() where f is func ptr (fixes bug088)

R=ken
OCL=15617
CL=15630
2008-09-22 12:45:01 -07:00
Ken Thompson
8a9752dcfb another async select bug
R=r
OCL=15599
CL=15599
2008-09-20 19:56:40 -07:00
Rob Pike
9ebd9d3b7d fix some tests
R=ken
OCL=15598
CL=15598
2008-09-20 15:16:48 -07:00
Ken Thompson
934a19fa4b channel test
R=r
OCL=15587
CL=15587
2008-09-19 20:52:59 -07:00