1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:21:20 -06:00
Commit Graph

962 Commits

Author SHA1 Message Date
Ian Lance Taylor
22a6747999 Per discussion earlier today with r and gri: when an interface
object has a value of type "int", it should not automatically
convert to type "int32".  That is, the type alias "int" should
be regarded as having been defined as though "type int int32"
appeared outside of the package, and as therefore being a
different type from "int32".

R=ken
DELTA=21  (20 added, 0 deleted, 1 changed)
OCL=17587
CL=17842
2008-10-24 22:40:32 -07:00
Rob Pike
a785e8ac6d replaced baked-in address with @ so test passes on linux
R=rsc
OCL=17841
CL=17841
2008-10-24 21:02:51 -07:00
Ken Thompson
b379d54dea another step toward interface subtypes
put explicit ./ on some runtime tests

R=r
OCL=17839
CL=17839
2008-10-24 20:14:28 -07:00
Russ Cox
cc4dc5a22a avoid JMP to ATEXT in xfol
R=ken
OCL=17833
CL=17833
2008-10-24 17:10:51 -07:00
Russ Cox
e2fa41ab3b fix JMP main(SB)
R=ken
OCL=17832
CL=17832
2008-10-24 16:43:12 -07:00
Rob Pike
418b97c670 add printf to fmt.
uses reflection to determine arguments.
for now, the arguments must be provided as a struct; the compiler
will soon do the packaging automatically for "..." parameters.

R=rsc
DELTA=1436  (909 added, 520 deleted, 7 changed)
OCL=17823
CL=17831
2008-10-24 16:33:29 -07:00
Russ Cox
689b28fd96 fix method function type compare bug (again)
R=ken
OCL=17819
CL=17819
2008-10-24 14:56:54 -07:00
Russ Cox
c14c961ae4 Automated g4 rollback of changelist 17815.
*** Reason for rollback ***

  now it's comparing function parameter names...

*** Original change description ***

fix method function type compare bug

R=ken
OCL=17816
CL=17816
2008-10-24 14:32:48 -07:00
Russ Cox
0be746d581 fix method function type compare bug
R=ken
OCL=17815
CL=17815
2008-10-24 14:29:01 -07:00
Robert Griesemer
63ed2b710b - missing file
R=r
OCL=17813
CL=17813
2008-10-24 14:08:01 -07:00
Robert Griesemer
ad863046f8 - set initial value in flag variable if provided
R=r
DELTA=10  (9 added, 0 deleted, 1 changed)
OCL=17806
CL=17812
2008-10-24 14:05:42 -07:00
Robert Griesemer
cec64a2dd5 - some factoring of scan/parse phase so we can attach other functionality
easily (for instance import dependency extraction)
- support for new "..." syntax
- minor cleanup

R=r
OCL=17811
CL=17811
2008-10-24 14:04:54 -07:00
Robert Griesemer
2bfa95741f Preparation for varargs: Proposal for syntax.
DELTA=11  (7 added, 0 deleted, 4 changed)
OCL=17772
CL=17804
2008-10-24 13:13:12 -07:00
Rob Pike
7466b61ba4 make fmt a directory
some build dependencies need rearrangement because fmt will depend on reflect

R=rsc
DELTA=1091  (567 added, 521 deleted, 3 changed)
OCL=17792
CL=17796
2008-10-24 10:42:54 -07:00
Robert Griesemer
816c1cefff - expanded parsing heuristics to deal with new(T, ...)
- fixed an issue with select
- added all bugs and fixedbugs tests that are syntactically correct to the test suite
- minor cosmetic changes

R=r
OCL=17759
CL=17759
2008-10-23 17:56:54 -07:00
Rob Pike
8327b54169 make reflect compile again
R=rsc
DELTA=9  (4 added, 4 deleted, 1 changed)
OCL=17753
CL=17755
2008-10-23 17:39:15 -07:00
Robert Griesemer
4712165b17 - clarified that composites are values created every time they
are evaluated, removed corresponding TODO.

R=r
DELTA=5  (3 added, 1 deleted, 1 changed)
OCL=17746
CL=17751
2008-10-23 17:19:56 -07:00
Rob Pike
536b1f2e98 add reflect to build, clean up test
R=rsc
DELTA=341  (188 added, 151 deleted, 2 changed)
OCL=17678
CL=17750
2008-10-23 17:13:34 -07:00
Russ Cox
de13727f0f use &T{1,2,3} constructor for simple new cases
R=r
OCL=17691
CL=17719
2008-10-23 12:41:06 -07:00
Robert Griesemer
071c91bf48 First cut at incorporating anonymous fields of pointer types into the
spec.

I have deliberately removed the wording about receivers where it was
before because I think it needs to be more precise. There is a TODO.

DELTA=90  (54 added, 0 deleted, 36 changed)
OCL=17597
CL=17716
2008-10-23 12:04:45 -07:00
Russ Cox
8d3a3dd904 update golden.out
R=iant
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=17680
CL=17711
2008-10-23 11:44:01 -07:00
Ken Thompson
7ed8fc611d embedded types
auto & on methods

R=r
OCL=17682
CL=17682
2008-10-22 18:18:08 -07:00
Russ Cox
ad48706a24 do not use fake names on anonymous function return values
R=ken
OCL=17679
CL=17679
2008-10-22 17:45:47 -07:00
Ken Thompson
6fecb76eea embedded types
R=r
OCL=17676
CL=17676
2008-10-22 17:25:10 -07:00
Rob Pike
5d30161ca7 move reflection code into final place.
this is just a branch.
next cl will update and add to build

R=rsc
DELTA=4528  (2264 added, 2264 deleted, 0 changed)
OCL=17670
CL=17672
2008-10-22 17:12:07 -07:00
Rob Pike
34b8873722 Reflection values.
R=rsc
DELTA=206  (79 added, 25 deleted, 102 changed)
OCL=17652
CL=17669
2008-10-22 16:48:17 -07: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
21617250f4 import/export of embedded types
R=ken
OCL=17643
CL=17643
2008-10-22 13:22:56 -07:00
Russ Cox
40fa690d75 fix handling of *f() = 1
R=ken
OCL=17625
CL=17641
2008-10-22 13:13:01 -07:00
Rob Pike
0061e56196 Add names to types to avoid recursive explosion and to get
the right answer when a type name redefines an existing type.

R=rsc
DELTA=133  (53 added, 8 deleted, 72 changed)
OCL=17637
CL=17639
2008-10-22 13:02:43 -07:00
Robert Griesemer
79985fa569 - exclude newfn.go from tests - cannot be parsed syntactically alone
in general

R=rsc
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=17624
CL=17624
2008-10-22 11:27:18 -07:00
Rob Pike
fac3dfe638 More reflection code.
Beginnings of values.
typestrings are grabbed from the environment.

R=rsc
APPROVED=rsc
DELTA=1046  (952 added, 3 deleted, 91 changed)
OCL=17593
CL=17621
2008-10-22 11:02:56 -07:00
Ken Thompson
14c639161a elided dots
R=r
OCL=17601
CL=17601
2008-10-21 20:55:40 -07:00
Russ Cox
dbabeb1d7a reject new of function type
R=ken
OCL=17598
CL=17598
2008-10-21 18:03:25 -07:00
Rob Pike
f0e93e8cc5 fix a couple of inconsequential glitches in regexp code.
R=rsc
DELTA=2  (0 added, 1 deleted, 1 changed)
OCL=17589
CL=17595
2008-10-21 17:18:34 -07:00
Russ Cox
beee6915f8 rewrite &Point{1, 2} as allocation
R=ken
OCL=17592
CL=17592
2008-10-21 16:53:54 -07:00
Russ Cox
2c3ddf5ef6 include local types in typestrings
R=r
DELTA=16  (14 added, 1 deleted, 1 changed)
OCL=17584
CL=17584
2008-10-21 15:57:38 -07:00
Russ Cox
44b0ecc5ca 6g: use full type in sigt[0].name
sys: add sys.reflect
runtime: add canfail flag for later

R=ken
OCL=17583
CL=17583
2008-10-21 15:38:26 -07:00
Ken Thompson
0347e95b63 changes to imbedded
R=r
OCL=17572
CL=17572
2008-10-21 15:04:10 -07:00
Russ Cox
1a149ca1be stop looking for type names beginning with _.
they're gone.

R=ken
OCL=17569
CL=17569
2008-10-21 14:44:31 -07:00
Russ Cox
aacfbb461b 6g:
* print int as int, not P.int
	* write type info for non-exported types
	   in its own new section.

ar:
	skip over rest of line after $$

R=ken
OCL=17568
CL=17568
2008-10-21 14:34:45 -07:00
Russ Cox
0532f89b1f 6l: invent gotypestrings if needed
R=r
DELTA=419  (409 added, 5 deleted, 5 changed)
OCL=17524
CL=17530
2008-10-21 10:40:16 -07:00
Robert Griesemer
71d6cda6b2 - remove inconsistent directory from tests
R=rsc
DELTA=1  (0 added, 1 deleted, 0 changed)
OCL=17514
CL=17514
2008-10-20 17:37:48 -07:00
Russ Cox
a570eaabcd 6l:
use libbio instead of maintaining own buffer

libbio:
	always use vlong offsets; die if off_t is too small

R=r
DELTA=163  (23 added, 63 deleted, 77 changed)
OCL=17508
CL=17512
2008-10-20 17:33:51 -07:00
Robert Griesemer
baac04b518 enable tests that verify that pretty-printed code can be compiled with 6g again
R=r
OCL=17510
CL=17510
2008-10-20 17:13:02 -07:00
Ian Lance Taylor
6ae1df9b99 Match error messages generated by gccgo:
convlit1.go:6:15: error: composite literal requires array, map, or struct type
convlit1.go:5:16: error: incompatible type for element 0 in composite literal
convlit1.go:10:15: error: incompatible types in binary expression

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=17506
CL=17509
2008-10-20 17:10:03 -07:00
Robert Griesemer
9d20c85ae9 - fixed missing parens in some cases of unary expressions
- added validation test verifying that pretty output compiles with 6g again (disabled at the moment)
- replaced another recursive function with an interative solution

R=r
OCL=17505
CL=17505
2008-10-20 16:44:03 -07:00
Russ Cox
28912ce03f fix compiler warnings
R=r
DELTA=44  (10 added, 9 deleted, 25 changed)
OCL=17502
CL=17502
2008-10-20 15:26:38 -07:00
Russ Cox
bfc70d0f0a use Biobuf not fd for reading objects.
will make reading type info easier.

R=r
DELTA=21  (2 added, 1 deleted, 18 changed)
OCL=17491
CL=17501
2008-10-20 15:21:59 -07:00
Russ Cox
aff914c6ec add nuke
R=r
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=17497
CL=17500
2008-10-20 15:21:52 -07:00