Mon Apr 29 15:32:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
2
3         * statement.cs (Statement.Warning_DeadCodeFound): Factorize code.
4         (While): Report dead code here too.
5
6         (Statement): Added Resolve virtual method to allow
7         for resolution split from the emit code.
8
9 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10
11         * statement.cs (EmitBoolExpression): No longer try to resolve the
12         expression here.    
13         (MakeBoolean): New utility function that resolve, implicitly
14         converts to boolean and tags the expression. 
15         
16
17         (If, Do): Implement dead code elimination.
18         (While): Implement loop inversion
19
20         (Do, While, For, If): Resolve the expression prior to calling our
21         code generation.
22
23 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
24
25         * class.cs:
26           - added method Report28 (warning: program has more than one entry point)
27           - added method IsEntryPoint, implements paragraph 10.1 of the spec
28           - modified method Method.Define, the part at the end of the method
29
30         * rootcontext.cs: added static public Location EntryPointLocation;
31           
32         * ../errors/cs0028.cs : Add test case for the above warning.              
33
34         * typemanager.cs:
35           - modified method CSharpName to allow arrays of primitive type to
36             be printed nicely (e.g. instead of System.Int32[][] it now prints
37             int[][])
38           - added method CSharpSignature: returns the signature of a method
39             in string format to be used in reporting errors, warnings, etc.
40
41         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
42         with String.Empty.
43         
44 2002-04-26  Ravi Pratap  <ravi@ximian.com>
45
46         * delegate.cs (Define): Fix extremely silly bug where I was
47         setting the type of the 'object' parameter of the BeginInvoke
48         method to System.IAsyncResult instead of System.Object ;-)
49
50 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
51
52         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
53         here. 
54
55         (Constructor.Emit): return if we fail to initialize the
56         constructor.  Another door closed!  
57
58         * expression.cs (New.DoResolve): Improve error message (from -6 to
59         1501).  Use DeclaredOnly lookup to find the exact constructor.
60
61         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
62         loop.  This is useful.
63
64         * cs-parser.jay: Adjust the default parameters so that destructors
65         have the proper signature.
66
67 2002-04-26  Martin Baulig  <martin@gnome.org>
68
69         * driver.cs (LoadAssembly): If `assembly' contains any characters
70         which are only valid in path names and not in assembly names
71         (currently slash, backslash and point), use Assembly.LoadFrom ()
72         instead of Assembly.Load () on the `assembly' (before iteration
73         over the link_paths).
74
75 2002-04-26  Martin Baulig  <martin@gnome.org>
76
77         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
78
79 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
80
81         * class.cs (Property): use the new typemanager.MemberLookup
82
83         (TypeContainer.MemberLookup): Implement using the
84         TypeManager.MemberLookup now. 
85         
86         * typemanager.cs: Make MemberLookup a function of the TypeManager,
87         and return MemberInfos, so that these can be used without an
88         EmitContext (what we had before).
89
90 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
91
92         * expression.cs: Fix the case where the argument to params if the
93         type of the params.  I omitted handling this before.   Fixed
94
95 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
96
97         * driver.cs: Call BootCorlib_PopulateCoreType
98
99         * class.cs (Property.CheckBase): Check for properties only, not
100         for all members. 
101
102         * interface.cs: Temporary hack: try/catch around the
103         CustomAttributeBuilder, because I am getting an exception that I
104         do not understand.
105
106         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
107         types whose definitions are required to be there (attributes are
108         defined before standard types).
109
110         Compute definitions as we boot the various types, as they are used
111         immediately (value_type class will need object_type, but if we do
112         not initialize object_type, we will pass a null, which will let
113         the runtime pick the System.Object from the existing corlib, which
114         is not what we want).
115
116 2002-04-22  Patrik Torstensson <totte@labs2.com>
117
118         * cs-tokenizer.cs: fixed a number of trim() issues.
119
120 2002-04-22  Ravi Pratap  <ravi@ximian.com>
121
122         * expression.cs (Argument.Type): Ensure that we return the correct
123         type when we have out or ref parameters [in which case we 
124         append a "&"].
125         
126 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
127
128         * class.cs (Property, Indexer): Allow extern modifier in there. 
129
130         * typemanager.cs (InitBaseTypes): Initializes object_type and
131         value_type, since those will be used early on during the bootstrap
132         process to compile corlib.
133
134         (InitCoreTypes): Move code from here to InitBaseTypes.
135
136 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
137
138         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
139         single-dimension arrays as using the ldlen opcode.  
140
141         Daniel Lewis discovered this optimization.  
142
143         * typemanager.cs: Add signature for System.Array::get_Length
144
145 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
146
147         * statement.cs: report the error when the foreach does not apply to an
148         array nor a collection.
149
150 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
151
152         * expression.cs: Add implicit conversions to the operator ~.
153
154         * constant.cs (DecimalConstant.Emit): Emit decimal value.
155
156         * typemanager.cs: Locate the decimal constructor.
157
158 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
159
160         * attribute.cs: use the new property of TypeOf.
161         * expression.cs: added 'get' property around typearg.
162
163         These changes fix a build breaker reported by NickD. Is this the
164         correct way to fix?  If not, please, revert my changes and make it
165         work :-).
166
167 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
168
169         * attribute.cs: Add support for typeof in attribute invocations.
170         I am not sure that this is right though.
171
172 2002-04-14  Duncan Mak  <duncan@ximian.com>
173
174         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
175         Binary.Operator.Division case.
176
177 2002-04-13  Ravi Pratap  <ravi@ximian.com>
178
179         * class.cs (DefineType): Ensure that we do a proper check on
180         attribute types and also register it with the TypeManager.
181
182         (TypeContainer.Targets): The default for attribute types is
183         AttributeTargets.All.
184         
185         * attribute.cs (ApplyAttributes): Registering the attribute type
186         is done elsewhere, not when we discover we have a Usage attribute.
187
188 2002-04-12  Ravi Pratap  <ravi@ximian.com>
189
190         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
191         and get rid of is_delegate parameter.
192
193         * everywhere : update.
194         
195 2002-04-12  Ravi Pratap  <ravi@ximian.com>
196
197         * cs-parser.jay (compilation_unit): Revamp completely to use
198         some new ideas that I got from Rhys' grammar to solve the problems
199         with assembly level attributes.
200
201         (outer_declaration): New grammar production.
202
203         (attribute_sections): Add.
204
205         (opt_attributes): Base on attribute_sections
206
207         (namespace_declaration): Allow opt_attributes to tackle the case
208         when we have assembly level attributes - we are clever in this
209         regard now ;-)
210
211         * attribute.cs (ApplyAttributes): Do not worry about assembly 
212         attributes in the non-global context.
213
214         * rootcontext.cs (AddGlobalAttributes): Go back to using this
215         instead of SetGlobalAttributes.
216
217         * class.cs, rootcontext.cs : Ensure we define and generate 
218         attribute types before anything else.
219
220         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
221         and flag the new error -20 for the case when the attribute type
222         does not have valid targets specified. csc does not catch this.
223
224         * ../errors/errors.txt : update for error # -20
225
226 2002-04-11  Ravi Pratap  <ravi@ximian.com>
227
228         * support.cs (InternalParameters.ParameterModifier): Do some null
229         checking and return sane values.
230
231         * class.cs (Method.Define): If we are a PInvoke method, ensure
232         that we are static and extern. Report error # 601
233
234         * ../errors/cs0601.cs : Add test case for the above error.
235
236 2002-04-07  Ravi Pratap  <ravi@ximian.com>
237
238         * rootcontext.cs (attribute_types): We need to keep type of
239         all attribute types separately and emit code for them first.
240
241         (RegisterAttribute) : Implement.
242
243         * class.cs (DefineType): Check if the current Type is a custom
244         attribute type and register it accordingly.
245
246         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
247         adding the first attribute twice and rename to
248
249         (SetGlobalAttributes): this.
250
251         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
252         lookups.
253
254         * attribute.cs (ApplyAttributes): Take an additional argument telling us
255         if we are processing global arguments. Hmm, I am unsure of this.
256
257 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
258
259         * expression.cs: added static array of strings to avoid calling
260         Enum.ToString () for Operator in Binary. Significant recover of
261         performance.
262
263 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
264
265         * class.cs (FindMembers): Allow the Builders of the various
266         members to be null.  If they are skip them.  This only happens
267         during the PInvoke declaration.
268
269 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
270
271         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
272         failure, so we do not keep going afterwards.
273
274         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
275         wanted to pass `false' as the `is_delegate' argument.  If this is
276         the case, why not use delegate_type == null to mean `is_delegate =
277         false' and anything else as is_delegate = true.
278
279 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
280
281         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
282         code for the section, not the beginning of the tests.
283
284 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
285
286         * cfold.cs: Handle operator + (Enum x, Underlying x) 
287
288         * expression.cs (Binary): same.  Warn about errors where we have
289         Enum/Enum in operator + as well.
290
291 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
292
293         * statement.cs:
294                 - added support for switch(bool)
295                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
296                 - add TableSwitchEmit() to handle table-based switch statements
297
298 2002-04-05  Ravi Pratap  <ravi@ximian.com>
299
300         * expression.cs (Invocation.OverloadResolve): Factor out code which
301         does parameter compatibility checking with arguments so that we can 
302         re-use the code even from Delegate.VerifyApplicability
303
304         (VerifyArgumentsCompat): Move above code here.
305
306         * delegate.cs (VerifyApplicability): Get rid of duplicate code
307         and instead make a call to the above method.
308
309 2002-03-31  Ravi Pratap  <ravi@ximian.com>
310
311         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
312         We use it to keep track of classes which are attribute types.
313
314 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
315
316         * delegate.cs (Delegate.Define): Correctly define the types in the
317         presence of fixed and array parameters.
318
319         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
320         doing FindMembers.
321
322         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
323         include NonPublic after the first iteration.
324
325         * class.cs (Indexer.CheckBase): Only check if both parents are
326         non-null. 
327         
328         * cs-parser.jay (accessor_body): If empty, set to null.
329
330         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
331         same code path here to resolve constants names that we did have in
332         MemberAccess.DoResolve.  There is too much code duplicated here.
333
334 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
335
336         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
337
338         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
339         to MakeUnionSet.
340
341         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
342         tokens, numbers and strings.
343
344         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
345         parenthesis.
346
347         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
348         asyncronous parameters and the regular parameters.  
349
350         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
351         specify the target directory.
352
353         * expression.cs: (This.DoResolve): Simplify
354         (As.Emit): Optimize, do not generate IsInst if the expression is
355         always of the given type.
356
357         (Is.DoResolve): Bug fix, we were reporting both always/never for
358         the is expression.
359
360         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
361         creating too many unnecessary arrays.
362
363 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
364
365         * class.cs (EmitFieldInitializer): Use Assign expression to assign
366         fields instead of rolling our own initializer.   Takes care of all
367         implicit conversions, and drops unnecessary static checks/argument.
368
369 2002-03-31  Dick Porter  <dick@ximian.com>
370
371         * driver.cs: use the GetDirectories() return values properly, and
372         use "/" as path separator.
373
374 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
375
376         * expression.cs (Unary): Optimize - - expr into expr.
377         (Binary): Optimize a + (-b) into a -b.
378
379         * codegen.cs (CodeGen): Made all methods static.
380
381 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
382
383         * rootcontext.cs: 
384
385         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
386         TypeBuilder property.
387
388         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
389         instead. 
390
391         * tree.cs: Removed the various RecordXXXX, and replaced with a
392         single RecordDecl.  Removed all the accessor methods, and just
393         left a single access point Type 
394
395         * enum.cs: Rename DefineEnum to DefineType.
396
397         * decl.cs: New abstract method `DefineType' used to unify the
398         Defines for Enumerations, Interfaces, TypeContainers and
399         Delegates.
400
401         (FindType): Moved LookupInterfaceOrClass here.  Moved the
402         LookupBaseClasses method that used to live in class.cs and
403         interface.cs here, and renamed to FindType.
404         
405         * delegate.cs: Implement DefineType.  Take advantage of the
406         refactored pattern for locating the parent builder without taking
407         the parent_builder argument (which we know does not work if we are
408         nested, and triggering a toplevel definition).
409
410 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
411
412         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
413         accessibility of a member has changed during override and report
414         an error if so.
415
416         * class.cs (Method.Define, Property.Define): Only complain on
417         overrides if the method is private, any other accessibility is
418         fine (and since we just checked the permission is the same, we are
419         good to go).
420
421         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
422         and elif are processed always.  The other pre-processing
423         directives are only processed if we are "taking" the path
424
425 2002-03-29  Martin Baulig  <martin@gnome.org>
426
427         * class.cs (Method.Emit): Only emit symbolic debugging info if the
428         current location is not Null.
429
430         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
431         a separate method so we can profile it.
432
433         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
434         `span.Seconds' are just seconds, but no minutes or hours.
435         (MainDriver): Profile the CodeGen.SaveSymbols calls.
436
437 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
438
439         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
440         Remove the gratuitous set of Final:
441
442                                 // If an interface implementation, then we can set Final.
443                                 if (((flags & MethodAttributes.Abstract) == 0) &&
444                                     implementing.DeclaringType.IsInterface)
445                                         flags |= MethodAttributes.Final;
446
447         I do not know what I was smoking when I used that.
448         
449
450         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
451         step into fixing the name resolution issues for delegates and
452         unifying the toplevel name resolution.
453
454 2002-03-28  Martin Baulig  <martin@gnome.org>
455
456         * class.cs (Method.Emit): If we have a symbol writer, call its
457         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
458         tell it about the current method.
459
460         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
461         writer that we're going to emit the first byte of IL code for a new
462         statement (a new source line).
463         (EmitContext.EmitTopBlock): If we have a symbol writer, call
464         EmitContext.Mark() before emitting any code.
465
466         * location.cs (SymbolDocument): Return null when we're Null.
467
468         * statement.cs (Statement): Moved the `Location loc' variable here.
469         (Statement.EmitBoolExpression): If we have a symbol writer, call
470         ec.Mark() before emitting any code to tell it that we're at the
471         beginning of a new statement.
472         (StatementExpression): Added `Location' argument to the constructor.
473         (Block): Added public readonly variable `StartLocation' and public
474         variable `EndLocation'.  The latter is to be set using SetEndLocation().
475         (Block): Added constructor which takes a start and end location.
476         (Block.SetEndLocation): New method. This sets the end location.
477         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
478         local variables we create.
479         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
480         each statement and do also mark the begin and end of the block.
481
482         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
483         tell it the current lexer.Location, use Location.Null for the end of the
484         block.
485         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
486         current block, set its end location using SetEndLocation().
487         (statement_expression): StatementExpression constructor now takes the
488         lexer.Location as additional argument.
489         (for_statement, declare_local_variables): Likewise.
490         (declare_local_variables): When creating a new implicit block, use the
491         new Block constructor and pass it the lexer.Location.
492
493 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
494
495         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
496         members also on the parent interfaces recursively.
497
498 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
499
500         * report.cs: Use new formats, since Gonzalo finished the missing
501         bits. 
502
503         * expression.cs (Binary.ResolveOperator): added missing operator|
504         operator& and operator^ for bool/bool.
505
506         * cs-parser.jay: CheckDef now takes a Location argument that is
507         used to report errors more precisly (instead of reporting the end
508         of a definition, we try to track something which is a lot closer
509         to the source of the problem).
510
511         * cs-tokenizer.cs: Track global token use, so we can properly flag
512         the use of #define/#undef after the first token has been seen.
513
514         Also, rename the reportXXXX to Error_DescriptiveName
515
516         * decl.cs (DeclSpace.IsTopLevel): Move property here from
517         TypeContainer, so that Enum and Interface can use this too.
518
519         * class.cs (TypeContainer.LookupInterfaceOrClass,
520         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
521         `builder' argument.  Typically this was used to pass the parent
522         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
523         the definition).  
524
525         The problem is that a nested class could trigger the definition of
526         a toplevel class, and the builder would be obviously wrong in that
527         case. 
528
529         So we drop this argument, and we compute dynamically the
530         TypeBuilder/ModuleBuilder (the correct information was available
531         to us anyways from DeclSpace.Parent)
532
533         * interface.cs (Interface.DefineInterface): Drop builder
534         parameter cleanup like class.cs
535
536         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
537         like class.cs
538
539         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
540         values. 
541
542         (Try.Emit): Propagate the returns value from the statement.
543
544         (Return.Emit): Even if we are leavning 
545
546         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
547
548         * modifiers.cs: Fix the computation of MethodAttributes flags.
549
550 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
551
552         * driver.cs: allow compilation of files that start with '/'.
553         Add a default case when checking the argument of --target.
554
555 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
556
557         * interface.cs: Implement the same search algorithm for types in
558         the interface code.
559
560         * delegate.cs: Do not allow multiple definition.
561
562         * Recovered ChangeLog that got accidentally amputated
563
564         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
565
566         * rootcontext.cs: Load manually enum to allow core classes to
567         contain enumerations.
568
569         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
570         Update to new static methods in TypeManager.
571
572         * typemanager.cs (GetMethod, GetConstructor): Use our
573         implementation of FindMembers to find the members, since during
574         corlib compilation, the types are TypeBuilders and GetMethod and
575         GetConstructor do not work.
576
577         Make all methods in TypeManager static.
578
579         (InitCodeHelpers): Split the functionality from
580         the InitCodeTypes function.
581
582         * driver.cs: Call InitCodeHelpers after we have populated the
583         types. 
584
585         * cs-parser.jay (delegate_declaration): we did not used to compute
586         the delegate name correctly for void delegates.
587
588 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
589
590         * rootcontext.cs (RootContext): Init the interface_resolve_order
591         and type_container_resolve_order always.
592
593         (ResolveCore, BootstrapCorlib_ResolveClass,
594         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
595         compiler when compiling with --nostdlib
596
597         * class.cs (TypeContainer.DefineType): Check that our parent is
598         not null.  This test is most important when we are bootstraping
599         the core types.
600
601         * codegen.cs: Split out the symbol writing code.
602
603 2002-03-25  Martin Baulig  <martin@gnome.org>
604
605         * driver.cs (-g): Made -g an alias for --debug.
606
607 2002-03-24  Martin Baulig  <martin@gnome.org>
608
609         * codegen.cs (SymbolWriter): New public variable. Returns the
610         current symbol writer.
611         (CodeGen): Added `bool want_debugging_support' argument to the
612          constructor. If true, tell the ModuleBuild that we want debugging
613         support and ask it for the ISymbolWriter.
614         (Save): If we have a symbol writer, call it's Close() method after
615         saving the assembly.
616
617         * driver.c (--debug): New command line argument to create a
618         debugger information file.
619
620         * location.cs (SymbolDocument): New public property. Returns an
621         ISymbolDocumentWriter object for the current source file or null
622         if we don't have a symbol writer.
623
624 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
625
626         * driver.cs (LoadAssembly): Correctly return when all the paths
627         have been tried and not before.
628
629         * statement.cs (Switch.Emit): return the actual coverage for this
630         statement (returns/not-returns)
631
632         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
633         switch of the statement if we are the last switch section.  That
634         kills two problems: try/catch problems (we used to emit an empty
635         nop at the end) and switch statements where all branches would
636         return. 
637
638 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
639
640         * driver.cs: Add default assemblies (the equivalent to the
641         Microsoft CSC.RSP file)
642
643         * cs-tokenizer.cs: When updating `cols and setting it to zero,
644         also update tokens_seen and set it to false.
645
646         * driver.cs: Implement --recurse for Mike.
647
648         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
649         correctly splitting out the paths.
650
651 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
652
653         * interface.cs (Interface.PopulateProperty): Instead of using
654         `parent' as the declaration space for the set parameters, use
655         `this' 
656
657         * support.cs (InternalParameters): InternalParameters constructor
658         takes a DeclSpace instead of a TypeContainer.
659
660         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
661         types are being initialized, load the address of it before calling
662         the function.  
663
664         (New): Provide a mechanism to disable the generation of local
665         value type temporaries when the caller will be providing us with
666         an address to store it.
667
668         (ArrayCreation.EmitDynamicInitializers): Use it.
669
670 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
671
672         * expression.cs (Invocation.EmitArguments): Only probe for array
673         property if there is more than one argument.  Sorry about that.
674
675         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
676         empty param arrays.
677         
678         * class.cs (Method.LabelParameters): Fix incorrect code path that
679         prevented the `ParamArrayAttribute' from being applied to the
680         params attribute.
681
682 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
683
684         * support.cs (ReflectionParameters): Correctly compute whether the
685         last argument is a params array.  Fixes the problem with
686         string.Split ('a')
687
688         * typemanager.cs: Make the assemblies array always be non-null
689         (empty, but non-null)
690
691         * tree.cs (RecordDecl): New function that abstracts the recording
692         of names.  This reports error 101, and provides a pointer to the
693         previous declaration.  Fixes a crash in the compiler.
694
695         * cs-parser.jay (constructor_declaration): Update to new grammar,
696         and provide a constructor_body that can be empty.
697
698 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
699
700         * driver.cs: Add support for --resources.
701
702         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
703         Make all types for the various array helper methods be integer.
704
705         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
706         CheckState to ConvCast.
707
708         (ConvCast): Now it takes a `checked' state argument, to avoid
709         depending on the emit context for the conversion, and just using
710         the resolve time setting.
711
712         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
713         instead of Invocation.EmitArguments.  We do not emit the original
714         arguments, instead we emit those which have been converted to
715         unsigned int expressions.
716
717         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
718
719         * codegen.cs: ditto.
720
721         * expression.cs (LocalVariableReference): Drop the use of the
722         Store function that depended on the variable index.
723
724         * statement.cs (VariableInfo): Drop the `Idx' property from this
725         class, as this is not taking into account the indexes for
726         temporaries tat we generate during the execution, getting the
727         indexes wrong.
728
729         * class.cs: First emit class initializers, then call the parent
730         constructor. 
731
732         * expression.cs (Binary): Fix opcode emision.
733         (UnaryMutator.EmitCode): Support checked code generation
734
735         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
736         matches for events for both the Static and Instance scans,
737         pointing to the same element.   Fix that.
738
739 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
740
741         * rootcontext.cs (ResolveTree): Always set the
742         interface_resolve_order, because nested interfaces will be calling
743         into us.
744
745         * class.cs (GetInterfaceOrClass): Track the same resolution
746         process used by TypeManager.LookupType.  This fixes the nested
747         type lookups in class declarations (separate path from
748         LookupType). 
749
750         (TypeContainer.DefineType): Also define nested interfaces.
751         (TypeContainer.RegisterOrder): New public function used to
752         register the order in which child interfaces need to be closed.
753
754         Nested interfaces need to be closed after their parents have been
755         created. 
756         
757         * interface.cs (InterfaceAttr): Put all the logic for computing
758         the interface attribute here. 
759
760         (DefineInterface): Register our interface order with the
761         RootContext or with the TypeContainer depending on the case.
762
763 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
764
765         * cs-parser.jay: rework foreach statement to work with the new
766         changes to the policy on SimpleNames.
767         
768         * report.cs: support Stacktrace on warnings as well.
769
770         * makefile: drop --unsafe and /unsafe from the compile.
771
772 2002-03-13  Ravi Pratap  <ravi@ximian.com>
773
774         * ecore.cs (StandardConversionExists): Modify to take an Expression
775         as the first parameter. Ensure we do null -> reference type conversion
776         checking.
777
778         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
779         temporary Expression objects.
780
781 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
782
783         * interface.cs: workaround bug in method overloading resolution
784         (there is already a bugzilla bug for it).
785
786 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
787
788         We could also solve this problem by having a separate path for
789         performing type lookups, instead of DoResolve, we could have a
790         ResolveType entry point, and only participating pieces of the
791         production (simplename, deref, array) would implement this. 
792         
793         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
794         signal SimpleName to only resolve type names and not attempt to
795         resolve anything else.
796
797         * expression.cs (Cast): Set the flag.
798
799         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
800
801         * class.cs: Only report 108 if there is no `new' modifier.
802
803         * cs-parser.jay: rework foreach statement to work with the new
804         changes to the policy on SimpleNames.
805         
806         * report.cs: support Stacktrace on warnings as well.
807
808         * makefile: drop --unsafe and /unsafe from the compile.
809
810 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
811
812         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
813         lookups here, instead of doing that at parse time.  This means
814         that our grammar will not introduce `LocalVariableReferences' as
815         expressions at this point.  That solves the problem of code like
816         this:
817
818         class X {
819            static void Main ()
820            { int X = 1;
821             { X x = null }}}
822
823         This is only half the fix.  The full fix requires parameters to
824         also be handled in this way.
825
826         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
827         makes the use more obvious of the DeclSpace.  The
828         ec.TypeContainer.TypeBuilder is now only used to pull the
829         TypeBuilder for it.
830
831         My theory is that I can get rid of the TypeBuilder completely from
832         the EmitContext, and have typecasts where it is used (from
833         DeclSpace to where it matters).  
834
835         The only pending problem is that the code that implements Aliases
836         is on TypeContainer, and probably should go in DeclSpace.
837
838         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
839         lookups here, instead of doing that at parse time.  This means
840         that our grammar will not introduce `LocalVariableReferences' as
841         expressions at this point.  That solves the problem of code like
842         this:
843
844         class X {
845            static void Main ()
846            { int X = 1;
847             { X x = null }}}
848
849         This is only half the fix.  The full fix requires parameters to
850         also be handled in this way.
851
852         * class.cs (Property.DefineMethod): When implementing an interface
853         method, set newslot, when implementing an abstract method, do not
854         set the flag (before we tried never setting it, or always setting
855         it, which is the difference).
856         (Indexer.DefineMethod): same.
857         (Method.DefineMethod): same.
858
859         * ecore.cs: Only set the status used flag if we get back a Field.
860
861         * attribute.cs: Temporary hack, so Paolo can keep working.
862
863 2002-03-08  Ravi Pratap  <ravi@ximian.com>
864
865         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
866         the unmanaged type in the case we have a MarshalAs attribute.
867
868         (Resolve): Handle the case when we are parsing the special MarshalAs
869         attribute [we need to store the unmanaged type to use later]
870         
871         * typemanager.cs (marshal_as_attr_type): Built in type for the 
872         MarshalAs Attribute.
873
874         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
875         on parameters and accordingly set the marshalling info.
876         
877 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
878
879         * class.cs: Optimizing slightly by removing redundant code after
880         we switched to the `NoTypes' return value.
881         (Property.DefineMethod): use NoTypes here too.
882
883         This fixes the bug I introduced in my last batch of changes.
884
885 2002-03-05  Ravi Pratap  <ravi@ximian.com>
886
887         * tree.cs (RecordEnum): Add. We now keep track of enums too.
888
889         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
890         Enums since those are types too. 
891
892         * cs-parser.jay (enum_declaration): Record enums as we parse them.
893         
894         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
895         thanks to a call during the lookup process.
896
897 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
898
899         * statement.cs (Foreach): Lots of work to accomodate a particular
900         kind of foreach statement that I had not kept in mind.  It is
901         possible to have foreachs on classes that provide a GetEnumerator
902         method that return objects that implement the "pattern" for using
903         a foreach, there is no need to support GetEnumerator
904         specifically. 
905
906         This is needed to compile nant.
907
908         * decl.cs: Only report 114 if the member is not `Finalize' and if
909         the warning level is at least 2.
910
911         * class.cs: Moved the compare function from Method to
912         MethodSignature. 
913
914         (MethodSignature.InheritableMemberSignatureCompare): Add new
915         filter function that is used to extract inheritable methods from a
916         class. 
917
918         (Method.Define): Use the new `inheritable_method_signature_filter'
919         delegate
920
921         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
922         command. 
923
924 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
925
926         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
927
928         * cs-parser.jay: Add opt_semicolon to the interface declaration.
929
930         * expression.cs: Pass location information to
931         ConvertImplicitStandard. 
932
933         * class.cs: Added debugging code to track return values from
934         interfaces. 
935
936 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
937
938         * expression.cs (Is.DoResolve): If either side of the `is' is an
939         interface, do not flag the warning.
940
941         * ecore.cs (ImplicitReferenceConversion): We need a separate test
942         for interfaces
943
944         * report.cs: Allow for --fatal to be used with --probe.
945         
946         * typemanager.cs (NoTypes): Move the definition for the empty Type
947         array here. 
948
949         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
950         properties. 
951         (TypeContainer.DefineProxy): New function used to proxy to parent
952         implementations when implementing interfaces.
953         (TypeContainer.ParentImplements): used to lookup if our parent
954         implements a public function that is required by an interface.
955         (TypeContainer.VerifyPendingMethods): Hook this up.
956
957         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
958         `modules' and `assemblies' arraylists into arrays.  We only grow
959         these are the very early start up of the program, so this improves
960         the speedof LookupType (nicely measured).
961
962         * expression.cs (MakeByteBlob): Replaced unsafe code with
963         BitConverter, as suggested by Paolo.
964
965         * cfold.cs (ConstantFold.Binary): Special case: perform constant
966         folding of string concatenation, but if either side is a string,
967         and the other is not, then return null, and let the runtime use
968         the concatenation on the string plus the object (using
969         `Object.ToString'). 
970
971 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
972
973         Constant Folding has been implemented now.
974         
975         * expression.cs (Unary.Reduce): Do not throw an exception, catch
976         the error instead on types that are not supported in one's
977         complement. 
978
979         * constant.cs (Constant and all children): New set of functions to
980         perform implict and explicit conversions.
981         
982         * ecore.cs (EnumConstant): Implement the new functions to perform
983         conversion by proxying to the child expression.
984
985         * codegen.cs: (ConstantCheckState): Constant evaluation has its
986         own separate setting that can not be turned off from the command
987         line using --unchecked or --checked and is only controlled using
988         the checked/unchecked statements and expressions.  This setting is
989         used by the constant folder to flag errors.
990
991         * expression.cs (CheckedExpr, UncheckedExpr): Set the
992         ConstantCheckState as well.   
993
994         During Resolve, they also have to flag the state, because the
995         constant folder runs completely in the Resolve phase.
996
997         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
998         well.
999
1000 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
1001
1002         * cfold.cs: New file, this file contains the constant folder.
1003         
1004         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
1005         argument to track whether we are using the resulting address to
1006         load or store a value and provide better error messages. 
1007
1008         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
1009         new AddressOf arguments.
1010
1011         * statement.cs (Foreach.EmitCollectionForeach): Update
1012
1013         * expression.cs (Argument.Emit): Call AddressOf with proper
1014         arguments to track usage.
1015
1016         (New.DoEmit): Call AddressOf with new arguments.
1017
1018         (Unary.Emit): Adjust AddressOf call.
1019
1020 2002-03-01  Ravi Pratap  <ravi@ximian.com>
1021
1022         * cs-parser.jay (member_access): Change the case for pre-defined types
1023         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
1024         this suggestion.
1025
1026         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
1027         a method body.
1028
1029         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
1030         essentially like methods and apply attributes like MethodImplOptions to them too.
1031
1032         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
1033         not being null.
1034
1035         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
1036         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
1037         is the DeclSpace.
1038
1039         * Update code everywhere accordingly.
1040
1041         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
1042
1043         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
1044
1045 2002-02-28  Ravi Pratap  <ravi@ximian.com>
1046
1047         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
1048         try performing lookups against those instead of jumping straight into using
1049         the 'using' clauses.
1050
1051         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
1052
1053         (LookupType): Perform lookups in implicit parents too.
1054
1055         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
1056         sequence as RootContext.LookupType. 
1057
1058         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
1059         the various cases of namespace lookups into this method.
1060
1061 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
1062
1063         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
1064         in positional arguments)
1065
1066         * class.cs (Operator): Update the AllowedModifiers to contain
1067         extern. 
1068
1069         * cs-parser.jay: Update operator declaration to allow for the
1070         operator body to be empty.
1071
1072         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
1073         values. 
1074
1075 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
1076
1077         * class.cs (Method.Emit): Label parameters.
1078
1079         * driver.cs: Return 1 or 0 as the program exit code.
1080
1081 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
1082
1083         * expression.cs: Special case the `null' object when trying to
1084         auto-compute the type, as anything can be explicitly converted to
1085         that. 
1086
1087         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
1088         spotting this Paolo.
1089
1090         (Expression.ImplicitNumericConversion): Perform comparissions of
1091         the type using the underlying type in the case of an enumeration
1092         rather than using the enumeration type for the compare.
1093
1094         Cope with the underlying == type case, which is not possible to
1095         catch before. 
1096
1097         (Expression.ConvertNumericExplicit): Perform comparissions of
1098         the type using the underlying type in the case of an enumeration
1099         rather than using the enumeration type for the compare.
1100
1101         * driver.cs: If the user does not supply an extension, assume .exe
1102
1103         * cs-parser.jay (if_statement): Rewrote so that we can track the
1104         location for the if statement.
1105
1106         * expression.cs (Binary.ConstantFold): Only concat strings when
1107         the operation is "+", not everything ;-)
1108
1109         * statement.cs (Statement.EmitBoolExpression): Take a location
1110         argument. 
1111         (If, While, Do): Track location.
1112
1113         * expression.cs (Binary.ResolveOperator): In the object + string
1114         case, I was missing a call to ConvertImplicit
1115
1116 2002-02-25  Ravi Pratap  <ravi@ximian.com>
1117
1118         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
1119         Location arguments. Ensure we use RootContext.LookupType to do our work
1120         and not try to do a direct Type.GetType and ModuleBuilder.GetType
1121
1122         * interface.cs (PopulateMethod): Handle the type of the parameter being
1123         null gracefully.
1124
1125         * expression.cs (Invocation.BetterFunction): Handle the case when we 
1126         have a params method with no fixed arguments and a call is made with no
1127         arguments.
1128
1129 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
1130
1131         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
1132         the verbatim-string-literal
1133
1134         * support.cs (InternalParameters.ParameterModifier): handle null
1135         fixed parameters.
1136         (InternalParameters.ParameterType): ditto.
1137
1138         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
1139         duplicating the name of the variable parameter.
1140         (GetParameterByName): Fix bug where we were not looking up array
1141         paramters if they were the only present (thanks Paolo!).
1142         (GetParameterInfo): We only have an empty set of types if both
1143         fixed and array are set to null.
1144         (GetParameterInfo-idx): Handle FixedParameter == null
1145
1146         * cs-parser.jay: Handle the case where there is no catch
1147         statements (missing null test).
1148
1149 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
1150
1151         * driver.cs (MainDriver): Be conservative on our command line
1152         handling.
1153
1154         Catch DirectoryNotFoundException when calling GetFiles.
1155         
1156         (SplitPathAndPattern): Used to split the input specification into
1157         a path and a pattern that we can feed to Directory.GetFiles.
1158
1159 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
1160
1161         * statement.cs (Fixed): Implement the last case of the Fixed
1162         statement (string handling).
1163
1164         * expression.cs (StringPtr): New class used to return a char * to
1165         a string;  Used by the Fixed statement.
1166
1167         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
1168
1169         * expression.cs (Binary.ResolveOperator): Remove redundant
1170         MemberLookup pn parent type.
1171         Optimize union call, we do not need a union if the types are the same.
1172         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
1173         type.
1174
1175         Specialize the use of MemberLookup everywhere, instead of using
1176         the default settings. 
1177
1178         (StackAlloc): Implement stackalloc keyword.
1179
1180         * cs-parser.jay: Add rule to parse stackalloc.
1181         
1182         * driver.cs: Handle /h, /help, /?
1183
1184         * expression.cs (MakeByteBlob): Removed the hacks we had in place
1185         before we supported unsafe code.
1186         
1187         * makefile: add --unsafe to the self compilation of mcs.
1188
1189 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
1190
1191         * expression.cs (PointerArithmetic): New class that is used to
1192         perform pointer arithmetic.
1193         (Binary.Resolve): Handle pointer arithmetic
1194         Handle pointer comparission.
1195         (ArrayPtr): Utility expression class that is used to take the
1196         address of an array.
1197
1198         (ElementAccess): Implement array access for pointers
1199         
1200         * statement.cs (Fixed): Implement fixed statement for arrays, we
1201         are missing one more case before we are done.
1202
1203         * expression.cs (Indirection): Implement EmitAssign and set the
1204         ExprClass to Variable.  This allows pointer dereferences to be
1205         treated as variables, and to have values assigned to them.
1206         
1207         * ecore.cs (Expression.StoreFromPtr): New utility function to
1208         store values dereferencing.
1209
1210 2002-02-20  Ravi Pratap  <ravi@ximian.com>
1211
1212         * expression.cs (Binary.ResolveOperator): Ensure that we are
1213         not trying to operate on a void type - this fixes the reported
1214         bug.
1215
1216         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
1217         the parent implementation is sealed.
1218
1219         * ../errors/cs0239.cs : Add.
1220
1221         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
1222
1223         * typemanager.cs (unverifiable_code_type): Corresponds to 
1224         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
1225         which have unsafe code in them.
1226
1227         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
1228         unsafe context.
1229
1230 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
1231
1232         * cs-tokenizer.cs: Add support for @"litreal strings"
1233
1234         Make tokenizer accept pre-processor directives
1235         on any column (remove the old C-like limitation). 
1236
1237         * rootcontext.cs (EmitCode): Emit any global attributes.
1238         (AddGlobalAttributes): Used to keep track of assembly attributes. 
1239
1240         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
1241
1242         * cs-parser.jay: Add support for global attributes.  
1243
1244 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
1245
1246         * expression.cs (Indirection): New helper class.  Unary will
1247         create Indirection classes to be able to implement the
1248         IMemoryLocation interface on it.
1249
1250 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
1251
1252         * cs-parser.jay (fixed_statement): reference the right statement.
1253
1254         * statement.cs (Fixed.Emit): Finish implementing the fixed
1255         statement for the &x case.
1256
1257 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
1258
1259         * class.cs (Property.Define, Method.Define): Remove newslot when
1260         `implementing'.  
1261
1262         * modifiers.cs: My use of NewSlot when `Abstract' was set was
1263         wrong.  NewSlot should only be used if the `new' keyword is present.
1264
1265         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
1266         locating our system dir.  Sorry about this.
1267
1268 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
1269
1270         * driver.cs (GetSystemDir): Compute correctly the location of our
1271         system assemblies.  I was using the compiler directory instead of
1272         the library directory.
1273
1274 2002-02-13  Ravi Pratap  <ravi@ximian.com>
1275
1276         * expression.cs (BetterFunction): Put back in what Miguel commented out
1277         since it is the correct fix. The problem is elsewhere ;-)
1278
1279         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
1280         parameters of the parms method are themselves compatible or not !
1281
1282         (StandardConversionExists): Fix very dangerous bug where we were forgetting
1283         to check that a class implements an interface before saying that an implicit
1284         conversion was allowed. Use ImplementsInterface to do the checking.
1285
1286 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
1287
1288         * class.cs (Method.Define): Track whether we are an explicit
1289         implementation or not.  And only call DefineMethodOverride if we
1290         are an explicit implementation.
1291
1292         (Property.DefineMethod): Ditto.
1293
1294 2002-02-11  Ravi Pratap  <ravi@ximian.com>
1295
1296         * expression.cs (BetterFunction): Catch hideous bug which was
1297          preventing us from detecting ambiguous calls due to implicit casts i.e
1298         cs0121.
1299
1300 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
1301
1302         * support.cs (Pair): Remove un-needed method.  I figured why I was
1303         getting the error in cs-parser.jay, the variable in a foreach loop
1304         is readonly, and the compiler does not really treat this as a variable.
1305
1306         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
1307         instead of EQUALS in grammar.  
1308
1309         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
1310
1311         * expression.cs (Unary.DoResolve): Check whether the argument is
1312         managed or not.
1313
1314 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
1315
1316         * support.cs: Api for Pair to set a value.  Despite the fact that
1317         the variables are public the MS C# compiler refuses to compile
1318         code that accesses the field if the variable is part of a foreach
1319         statement. 
1320
1321         * statement.cs (Fixed): Begin implementation of the fixed
1322         statement.
1323
1324         (Block.AddVariable): Return the VariableInfo on success and null
1325         on failure instead of true/false. 
1326
1327         * cs-parser.jay (foreach): Catch errors on variables already
1328         defined (we were ignoring this value before) and properly unwind
1329         the block hierarchy
1330
1331         (fixed_statement): grammar for the fixed statement.
1332
1333 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
1334
1335         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
1336         pointer types to be incretemented.
1337
1338         (SizeOf): Implement.
1339
1340         * cs-parser.jay (pointer_member_access): Implement
1341         expr->IDENTIFIER production.
1342
1343         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
1344         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
1345         on safe contexts.
1346
1347         (Unary): Implement indirection.
1348
1349         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
1350         use in non-unsafe context).
1351
1352         (SimpleName.DoResolve): Check for pointers in field access on safe
1353         contexts. 
1354
1355         (Expression.LoadFromPtr): Factor the load-indirect code in this
1356         function.  This was duplicated in UnboxCast and ParameterReference
1357
1358 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
1359
1360         * expression.cs (ComposedCast): report an error if a pointer cast
1361         is used in a safe region.
1362
1363         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
1364         pointer type casts in unsafe context.
1365
1366         * codegen.cs (EmitContext): Set up IsUnsafe.
1367
1368         * cs-parser.jay (non_expression_type): Add productions for pointer
1369         casts. 
1370
1371         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
1372         code.  We should not use force into static mode if the method is
1373         not virtual.  Fixes bug in MIS
1374
1375         * statement.cs (Do.Emit, While.Emit, For.Emit,
1376         Statement.EmitBoolExpression): Add support to Do and While to
1377         propagate infinite loop as `I do return' semantics.
1378
1379         Improve the For case to also test for boolean constants.
1380
1381         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
1382         to the list of attributes we can add.
1383
1384         Remove `EmitContext' argument.
1385
1386         * class.cs (Method.Define): Apply parameter attributes.
1387         (Constructor.Define): Apply parameter attributes.
1388         (MethodCore.LabelParameters): Move here the core of labeling
1389         parameters. 
1390
1391         * support.cs (ReflectionParameters.ParameterModifier,
1392         InternalParameters.ParameterModifier): Use IsByRef on the type and
1393         only return the OUT bit for these parameters instead of in/out/ref
1394         flags.
1395
1396         This is because I miss-understood things.  The ParameterInfo.IsIn
1397         and IsOut represent whether the parameter has the [In] and [Out]
1398         attributes set.  
1399
1400 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
1401
1402         * ecore.cs (FieldExpr.Emit): Release temporaries.
1403
1404         * assign.cs (LocalTemporary.Release): new function.
1405
1406         * codegen.cs (EmitContext.GetTemporaryStorage,
1407         EmitContext.FreeTemporaryStorage): Rework the way we deal with
1408         temporary storage.  Now we can "put back" localbuilders when we
1409         are done with them
1410
1411 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
1412
1413         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
1414         need to make a copy of the variable to generate verifiable code.
1415
1416 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
1417
1418         * driver.cs: Compute dynamically the system directory.
1419
1420         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
1421         Slower, but more generally useful.  Used by the abstract
1422         registering implementation. 
1423
1424         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
1425         the rules for the special rule on Type/instances.  First check if
1426         we have the same name, and if so, try that special static path
1427         rather than the instance path.
1428         
1429 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
1430
1431         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
1432         for, while and if.
1433
1434         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
1435         Enum, ValueType, Delegate or Array for non-corlib compiles.
1436
1437         * cs-tokenizer.cs: Catch long identifiers (645)
1438
1439         * typemanager.cs (IndexerPropetyName): Ravi never tested this
1440         piece of code.
1441
1442         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
1443         fix, we were returning too early, so we were not registering
1444         pending methods from abstract classes.
1445
1446         Do not register pending methods if the class is abstract.
1447
1448         * expression.cs (Conditional.DoResolve): Report circular implicit
1449         conversions when we neecd to compute it for conditional
1450         expressions. 
1451
1452         (Is.DoResolve): If the expression is always of the provided type,
1453         flag warning 183.  If the expression can not ever be of the
1454         provided type flag warning 184.
1455
1456         * class.cs: Catch 169 as well.
1457
1458         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
1459         read. 
1460
1461 2002-01-18  Nick Drochak  <ndrochak@gol.com>
1462
1463         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
1464
1465 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
1466
1467         * interface.cs: (PopulateMethod): Check for pointers being defined
1468         only if the unsafe context is active.
1469         (PopulateProperty): ditto.
1470         (PopulateIndexer): ditto.
1471
1472         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
1473         specified.  If pointers are present, make sure that they are
1474         present in an unsafe context.
1475         (Constructor, Constructor.Define): ditto.
1476         (Field, Field.Define): ditto.
1477         (Property, Property.Define): ditto.
1478         (Event, Event.Define): ditto.
1479
1480         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
1481         hashtable if there are classes or structs defined.
1482
1483         * expression.cs (LocalVariableReference.DoResolve): Simplify this
1484         code, as the constant resolution moved.
1485
1486         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
1487         the metadata, so we can flag error 133. 
1488
1489         * decl.cs (MemberCore.UnsafeOK): New function to test that a
1490         pointer is being declared in an unsafe context.
1491
1492 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
1493
1494         * modifiers.cs (Modifiers.Check): Require a Location argument.
1495         Report error 227 for Unsafe use.
1496
1497         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
1498
1499         * statement.cs (For.Emit): If the test is null, then report that
1500         we do `return', as we wont reach anything afterwards.
1501
1502         (Switch.SwitchGoverningType): Track the expression that matched
1503         the conversion.
1504
1505         * driver.cs: Allow negative numbers as an error code to flag.
1506
1507         * cs-parser.jay: Handle 1551.
1508
1509         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
1510
1511 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
1512
1513         * cs-parser.jay: Report 1518 (type declaration can only contain
1514         class, struct, interface, enum or delegate)
1515
1516         (switch_label): Report 1523 (keywords `case' or `default' must
1517         preced code)
1518
1519         (opt_switch_sections): Report 1522 (empty switch)
1520
1521         * driver.cs: Report 1515 (response file specified multiple times)
1522         Report 1516 (Source file specified multiple times).
1523
1524         * expression.cs (Argument.Resolve): Signal 1510
1525
1526         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
1527         access not allowed in static code)
1528
1529 2002-01-11  Ravi Pratap  <ravi@ximian.com>
1530
1531         * typemanager.cs (IsPointerType): Utility method which we are going
1532         to need a lot.
1533
1534         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
1535         the object type, so we take care of that.
1536
1537         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
1538         
1539         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
1540         added to non-params parameters :-)
1541
1542         * typemanager.cs (CSharpName): Include 'void' type too. 
1543
1544         (void_ptr_type): Include in the set of core types.
1545
1546         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
1547         duplicating code.
1548
1549         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
1550         an unsafe context.
1551
1552         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
1553         completely forgotten about it.
1554
1555 2002-01-10  Ravi Pratap  <ravi@ximian.com>
1556
1557         * cs-parser.jay (pointer_type): Add. This begins our implementation
1558         of parsing rules for unsafe code.
1559
1560         (unsafe_statement): Implement.
1561
1562         (embedded_statement): Modify to include the above.
1563
1564         * statement.cs (Unsafe): Implement new class for unsafe blocks.
1565
1566         * codegen.cs (EmitContext.InUnsafe): Add. This determines
1567         if the current context is an unsafe one.
1568
1569         * cs-parser.jay (local_variable_pointer_type): Since local variable types
1570         are handled differently, we need separate rules for them.
1571
1572         (local_variable_declaration): Update to use local_variable_pointer_type
1573         to allow variable declarations of unmanaged pointer types.
1574
1575         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
1576         in unsafe contexts.
1577
1578         * ../errors/cs0214.cs : Add.
1579
1580 2002-01-16  Nick Drochak  <ndrochak@gol.com>
1581
1582         * makefile: remove 'response' file when cleaning.
1583
1584 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
1585
1586         * cs-parser.jay: Report 1524.
1587
1588 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
1589
1590         * typemanager.cs (RegisterMethod): drop checking if we have
1591         registered this from here
1592
1593 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
1594
1595         * class.cs (Method.EmitDestructor): Implement calling our base
1596         destructor. 
1597
1598         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
1599         value of InFinally.
1600
1601         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
1602         this routine and will wrap the call in a try/catch block.  Deal
1603         with the case.
1604
1605 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
1606
1607         * ecore.cs (Expression.MemberLookup): instead of taking a
1608         parameter `same_type' that was used to tell whether we could
1609         access private members we compute our containing type from the
1610         EmitContext.
1611
1612         (FieldExpr): Added partial support for volatile fields.  This does
1613         not work for volatile fields exposed from assemblies, as I can not
1614         figure out how to extract the modreq from it.
1615
1616         Updated all the source files to use this.
1617
1618         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
1619         because it is referenced by MemberLookup very often. 
1620
1621 2002-01-09  Ravi Pratap  <ravi@ximian.com>
1622
1623         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
1624         TypeBuilder.GetCustomAttributes to retrieve what we need.
1625
1626         Get rid of redundant default_member_attr_type as this is the same as
1627         default_member_type which already exists.
1628
1629         * interface.cs, attribute.cs : Update accordingly.
1630         
1631 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
1632
1633         * typemanager.cs: Enable IndexerPropertyName again.  It does not
1634         work for TYpeBuilders though.  Ravi, can you please fix this?
1635
1636         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
1637
1638         * expression.cs (Argument.Emit): Handle the case of ref objects
1639         being passed to ref functions;  
1640
1641         (ParameterReference.EmitLoad): Loads the content of the pointer
1642         without dereferencing.
1643
1644 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
1645
1646         * cs-tokenizer.cs: Implemented the pre-processing expressions.
1647
1648 2002-01-08  Ravi Pratap  <ravi@ximian.com>
1649
1650         * class.cs (Indexer.DefineMethod): Incorporate the interface
1651         type in the name of the method if we are doing explicit interface
1652         implementation.
1653
1654         * expression.cs (ConversionExists): Remove as it is completely obsolete.
1655
1656         (BetterConversion): Fix extremely trivial bug where we were referring to
1657         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
1658         again !
1659
1660         * ../errors/bug16.cs : Add although we have fixed it.
1661
1662 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
1663
1664         * expression.cs (BaseIndexer): Begin implementation.
1665
1666         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
1667
1668         * cs-parser.jay (indexer_declarator): Use qualified_identifier
1669         production directly to remove a shift/reduce, and implement
1670         explicit interface implementation.
1671
1672         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
1673         after a floating point suffix.
1674
1675         * expression.cs (DoNumericPromotions): Improved the conversion for
1676         uint/uint.  If we have a constant, we avoid doing a typecast to a
1677         larger type.
1678
1679         * class.cs (Indexer): Implement explicit interface implementation
1680         for indexers.
1681         
1682 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
1683
1684         * class.cs: make the default instance constructor public and hidebysig.
1685
1686 2001-01-03  Ravi Pratap  <ravi@ximian.com>
1687
1688         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
1689         so we can call it from elsewhere.
1690
1691         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
1692         we emit it internally if the class has a defined indexer; otherwise the user
1693         emits it by decorating the class definition with the DefaultMemberAttribute.
1694
1695         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
1696         attribute is not used on a type which defines an indexer.
1697
1698         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
1699         character when we skip whitespace.
1700
1701         * ../errors/cs0646.cs : Add.
1702
1703 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
1704
1705         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
1706         again. 
1707
1708         * makefile: Add practical target `mcs3.exe' which builds the third
1709         generation compiler. 
1710
1711         * expression.cs (New): Fix structures constructor calling.
1712
1713         * class.cs (Property, Method, Indexer): Emit Final flag on the
1714         method if we are an interface implementation and we are not
1715         abstract. 
1716
1717         * ecore.cs (PropertyExpr): New public field `IsBase', tells
1718         whether this property is referencing a `base' method.
1719
1720         * expression.cs (Invocation.EmitCall): take an extra argument:
1721         is_base, this is used to determine whether the `call' or
1722         `callvirt' opcode should be used.
1723
1724         
1725         * delegate.cs: update EmitCall.
1726
1727         * class.cs (Method.Define): Set NewSlot for the cases where we are
1728         not implementing an interface method.
1729
1730         (Property.Define): ditto.
1731
1732 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
1733
1734         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
1735         'r'.  Allows mcs to parse itself fully.
1736
1737 2002-01-02  Ravi Pratap  <ravi@ximian.com>
1738
1739         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
1740         of the number of initializers that require the InitializeArray method.
1741
1742         (CheckIndices): Store the Expression in all cases - not the plain value. Also
1743         update the above field where necessary.
1744
1745         (MakeByteBlob): Update accordingly.
1746
1747         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
1748         greater than 2.
1749
1750         (EmitDynamicInitializers): Update in accordance with the new optimization.
1751
1752         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
1753         same OpCode applies.
1754
1755         * cs-parser.jay : Fix some glaring errors I introduced.
1756
1757 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
1758
1759         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
1760         so that we can check for name clashes there too.
1761
1762         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
1763         for interface indexers.
1764
1765         * interfaces.cs (Define): Emit the default member attribute.
1766
1767         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
1768         variable was being referred to while setting the value ;-)
1769
1770 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
1771
1772         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
1773         byte-by-byte information when we know the data is zero.
1774
1775         Make the block always a multiple of 4, because
1776         DefineInitializedData has a bug.
1777
1778         * assign.cs: Fix, we should assign from the temporary, not from
1779         the source. 
1780
1781         * expression.cs (MakeByteBlob): Fix my incorrect code.
1782
1783 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
1784
1785         * typemanager.cs (EnumToUnderlying): This function is used to get
1786         the underlying type from an enumeration, because it does not
1787         always work. 
1788
1789         * constant.cs: Use the I4_S form for values between -128 and 127.
1790
1791         * statement.cs (Block.LookupLabel): Looks up a label.
1792         (Block): Drop support for labeled blocks.
1793
1794         (LabeledStatement): New kind of statement that represents a label
1795         only.
1796
1797         (Goto): Finally implement this bad boy.
1798         
1799         * cs-parser.jay: Update to reflect new mechanism to implement
1800         labels.
1801
1802 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
1803
1804         * codegen.cs (EmitContext.This): a codegen property that keeps the
1805         a single instance of this instead of creating many different this
1806         instances. 
1807
1808         * delegate.cs (Delegate.DoResolve): Update to use the property;
1809
1810         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
1811
1812         * expression.cs (BaseAccess.DoResolve): Ditto.
1813
1814 2001-12-29  Ravi Pratap  <ravi@ximian.com>
1815
1816         * typemanager.cs (methodimpl_attr_type): Add to hold the type
1817         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
1818
1819         (InitCoreTypes): Update accordingly.
1820
1821         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
1822         so we can quickly store the state.
1823
1824         (ApplyAttributes): Set the correct implementation flags
1825         for InternalCall methods.
1826
1827 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
1828
1829         * expression.cs (EmitCall): if a method is not virtual, then do
1830         not use callvirt on it.
1831
1832         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
1833         user defined stuff) requires the use of stobj, which takes an
1834         address on the stack instead of an array and an index.  So emit
1835         the Ldelema operation for it.
1836
1837         (EmitStoreOpcode): Use stobj for valuetypes.
1838
1839         (UnaryMutator.EmitCode): Use the right 1 value depending on
1840         whether we are dealing with int64/uint64, float or doubles.
1841
1842         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
1843         constructors that I implemented last night.
1844
1845         (Constructor.IsDefault): Fix to work properly for static
1846         constructors.
1847
1848         * cs-parser.jay (CheckDef): report method signature errors.
1849         Update error number 103 to be 132.
1850
1851         * decl.cs: New AdditionResult enumeration value: MethodExists.
1852         Although we do this check for methods later on in the semantic
1853         analysis, catching repeated default constructors is so easy that
1854         we catch these here. 
1855         
1856         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
1857         promotions code.
1858
1859         (ParameterReference.EmitAssign, Emit): handle
1860         bools as bytes.
1861
1862         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
1863         (ArrayAccess.EmitStoreOpcode): ditto.
1864
1865         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
1866
1867         * expression.cs (MakeByteBlob): Complete all the missing types
1868         (uint, short, ushort, byte, sbyte)
1869
1870         * class.cs: Only init instance field initializers on instance
1871         constructors. 
1872
1873         Rename `constructors' to instance_constructors. 
1874
1875         (TypeContainer.AddConstructor): Only add constructors to the list
1876         if it is not static.
1877
1878         Make sure that we handle default_static_constructor independently
1879         everywhere where we handle instance_constructors
1880
1881 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
1882
1883         * class.cs: Do not lookup or create a base initializer for a
1884         static constructor.
1885
1886         (ConstructorInitializer.Resolve): use the proper type to lookup
1887         for constructors.
1888
1889         * cs-parser.jay: Report error 1585 (modifiers between type and name).
1890
1891         * enum.cs, interface.cs: Remove CloseType, this is taken care by
1892         in DeclSpace. 
1893
1894         * decl.cs: CloseType is now an virtual method, the default
1895         implementation just closes this type.
1896         
1897 2001-12-28  Ravi Pratap  <ravi@ximian.com>
1898
1899         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
1900         to PreserveSig by default. Also emit HideBySig on such methods.
1901
1902         Basically, set the defaults to standard values.
1903
1904         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
1905         argument, if candidate is better, it can't be worse than the best !
1906
1907         (Invocation): Re-write bits to differentiate between methods being
1908         applicable in their expanded form and their normal form - for params
1909         methods of course.
1910
1911         Get rid of use_standard everywhere as only standard conversions are allowed
1912         in overload resolution. 
1913
1914         More spec conformance.
1915         
1916 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
1917
1918         * driver.cs: Add --timestamp, to see where the compiler spends
1919         most of its time.
1920
1921         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
1922         `this' in static code.
1923
1924         (SimpleName.DoResolve): Implement in terms of a helper function
1925         that allows static-references to be passed upstream to
1926         MemberAccess.
1927
1928         (Expression.ResolveWithSimpleName): Resolve specially simple
1929         names when called by MemberAccess to implement the special
1930         semantics. 
1931
1932         (Expression.ImplicitReferenceConversion): Handle conversions from
1933         Null to reference types before others, as Null's type is
1934         System.Object. 
1935
1936         * expression.cs (Invocation.EmitCall): Handle the special case of
1937         calling methods declared on a reference type from a ValueType
1938         (Base classes System.Object and System.Enum)
1939
1940         (MemberAccess.Resolve): Only perform lookups on Enumerations if
1941         the left hand side is a TypeExpr, not on every enumeration. 
1942
1943         (Binary.Resolve): If types are reference types, then do a cast to
1944         object on operators != and == of both arguments.
1945         
1946         * typemanager.cs (FindMembers): Extract instance and static
1947         members if requested.
1948
1949         * interface.cs (PopulateProperty): Use void_type instead of null
1950         as the return type for the setter method.
1951
1952         (PopulateIndexer): ditto.
1953
1954 2001-12-27  Ravi Pratap  <ravi@ximian.com>
1955
1956         * support.cs (ReflectionParameters): Fix minor bug where we
1957         were examining the wrong parameter for the ParamArray attribute.
1958
1959         Cope with requests for the type of the parameter at position
1960         greater than the params parameter's. We now return the element
1961         type of the params array as that makes more sense.
1962
1963         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
1964         accordingly as we no longer have to extract the element type
1965         ourselves.
1966
1967         (Invocation.OverloadResolve): Update.
1968
1969 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
1970
1971         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
1972         against IEnumerator, test whether the return value is a descendant
1973         of the IEnumerator interface.
1974
1975         * class.cs (Indexer.Define): Use an auxiliary method to implement
1976         the other bits of the method definition.  Begin support for
1977         explicit interface implementation.
1978
1979         (Property.DefineMethod): Use TypeManager.void_type instead of null
1980         for an empty return value.
1981
1982 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
1983
1984         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
1985         dealing with a FieldExpr which is composed of a FieldBuilder, in
1986         the code path we did extract the constant, but we should have
1987         obtained the underlying value to be able to cast it (otherwise we
1988         end up in an infinite loop, this is what Ravi was running into).
1989
1990         (ArrayCreation.UpdateIndices): Arrays might be empty.
1991
1992         (MemberAccess.ResolveMemberAccess): Add support for section
1993         14.5.4.1 that deals with the special case of E.I when E is a type
1994         and something else, that I can be a reference to a static member.
1995
1996         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
1997         handle a particular array type to create byte blobs, it is just
1998         something we dont generate byteblobs for.
1999
2000         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
2001         arguments. 
2002
2003         * location.cs (Push): remove the key from the hashtable that we
2004         are about to add.   This happens for empty files.
2005
2006         * driver.cs: Dispose files after we have parsed them.
2007
2008         (tokenize): new function that only runs the tokenizer on its
2009         input, for speed testing.
2010
2011 2001-12-26  Ravi Pratap  <ravi@ximian.com>
2012
2013         * class.cs (Event.Define): Define the private field only if there
2014         are no accessors defined.
2015
2016         * expression.cs (ResolveMemberAccess): If there is no associated
2017         field with the event, that means we have an event defined with its
2018         own accessors and we should flag error cs0070 since transforming
2019         ourselves into a field is not valid in that case.
2020
2021         * ecore.cs (SimpleName.DoResolve): Same as above.
2022
2023         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
2024         and charset to sane values.
2025
2026 2001-12-25  Ravi Pratap  <ravi@ximian.com>
2027
2028         * assign.cs (DoResolve): Perform check on events only if they 
2029         are being accessed outside the declaring type.
2030
2031         * cs-parser.jay (event_declarations): Update rules to correctly
2032         set the type of the implicit parameter etc.
2033
2034         (add_accessor, remove_accessor): Set current local parameters.
2035
2036         * expression.cs (Binary): For delegate addition and subtraction,
2037         cast the return value from the method into the appropriate delegate
2038         type.
2039
2040 2001-12-24  Ravi Pratap  <ravi@ximian.com>
2041
2042         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
2043         of these as the workaround is unnecessary.
2044
2045         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
2046         delegate data - none of that is needed at all.
2047
2048         Re-write bits to extract the instance expression and the delegate method
2049         correctly.
2050
2051         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
2052         on delegates too.
2053
2054         * attribute.cs (ApplyAttributes): New method to take care of common tasks
2055         of attaching attributes instead of duplicating code everywhere.
2056
2057         * everywhere : Update code to do attribute emission using the above method.
2058
2059 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
2060
2061         * expression.cs (IsParamsMethodApplicable): if there are not
2062         parameters, return immediately.
2063
2064         * ecore.cs: The 0 literal can be implicity converted to an enum
2065         type. 
2066
2067         (SimpleName.DoResolve): First lookup the type, then lookup the
2068         members. 
2069
2070         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
2071         want to get its address.  If the InstanceExpression is not
2072         addressable, store the result in a temporary variable, then get
2073         the address of it.
2074
2075         * codegen.cs: Only display 219 errors on warning level or above. 
2076
2077         * expression.cs (ArrayAccess): Make it implement the
2078         IMemoryLocation interface.
2079
2080         (Binary.DoResolve): handle the operator == (object a, object b)
2081         and operator != (object a, object b) without incurring into a
2082         BoxedCast (because 5 != o should never be performed).
2083
2084         Handle binary enumerator operators.
2085
2086         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
2087         value type, otherwise use Ldelem_ref.
2088
2089         Use precomputed names;
2090
2091         (AddressOf): Implement address of
2092
2093         * cs-parser.jay (labeled_statement): Fix recursive block
2094         addition by reworking the production.
2095
2096         * expression.cs (New.DoEmit): New has a special case:
2097                 
2098                  If we are dealing with a ValueType, we have a few
2099                  situations to deal with:
2100                 
2101                     * The target of New is a ValueType variable, that is
2102                       easy, we just pass this as the variable reference
2103                 
2104                     * The target of New is being passed as an argument,
2105                       to a boxing operation or a function that takes a
2106                       ValueType.
2107                 
2108                       In this case, we need to create a temporary variable
2109                       that is the argument of New.
2110
2111
2112 2001-12-23  Ravi Pratap  <ravi@ximian.com>
2113
2114         * rootcontext.cs (LookupType): Check that current_type is not null before
2115         going about looking at nested types.
2116
2117         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
2118         not implement the IAssignMethod interface any more.
2119
2120         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
2121         where we tranform them into FieldExprs if they are being resolved from within
2122         the declaring type.
2123
2124         * ecore.cs (SimpleName.DoResolve): Do the same here.
2125
2126         * assign.cs (DoResolve, Emit): Clean up code considerably. 
2127
2128         * ../errors/bug10.cs : Add.
2129
2130         * ../errors/cs0070.cs : Add.
2131
2132         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
2133
2134         * assign.cs : Get rid of EventIsLocal everywhere.
2135         
2136 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
2137
2138         * ecore.cs (ConvertIntLiteral): finished the implementation.
2139
2140         * statement.cs (SwitchLabel): Convert the value we are using as a
2141         key before looking up the table.
2142
2143 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
2144
2145         * codegen.cs (EmitTopBlock): Require a Location argument now.
2146
2147         * cs-parser.jay (constructor_declarator): We need to setup
2148         current_local_parameters before we parse the
2149         opt_constructor_initializer, to allow the variables to be bound
2150         to the constructor arguments.
2151
2152         * rootcontext.cs (LookupType): First lookup nested classes in our
2153         class and our parents before we go looking outside our class.
2154
2155         * expression.cs (ConstantFold): Extract/debox the values at the
2156         beginnning. 
2157
2158         * rootcontext.cs (EmitCode): Resolve the constants first before we
2159         resolve the types.  This is not really needed, but it helps debugging.
2160
2161         * statement.cs: report location.
2162         
2163         * cs-parser.jay: pass location to throw statement.
2164
2165         * driver.cs: Small bug fix.
2166
2167         * report.cs: Updated format to be 4-zero filled digits.
2168
2169 2001-12-22  Ravi Pratap  <ravi@ximian.com>
2170
2171         * expression.cs (CheckIndices): Fix minor bug where the wrong
2172         variable was being referred to ;-)
2173
2174         (DoEmit): Do not call EmitStaticInitializers when the 
2175         underlying type is System.Object.
2176
2177 2001-12-21  Ravi Pratap  <ravi@ximian.com>
2178
2179         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
2180         and do the usual workaround for SRE.
2181
2182         * class.cs (MyEventBuilder.EventType): New member to get at the type
2183         of the event, quickly.
2184
2185         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
2186
2187         * assign.cs (Assign.DoResolve): Handle the case when the target
2188         is an EventExpr and perform the necessary checks.
2189
2190         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
2191         interface.
2192
2193         (SimpleName.MemberStaticCheck): Include check for EventExpr.
2194
2195         (EventExpr): Set the type in the constructor itself since we 
2196         are meant to be born fully resolved.
2197
2198         (EventExpr.Define): Revert code I wrote earlier.
2199                 
2200         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
2201         instance expression is null. The instance expression is a This in that case
2202         or a null, depending on whether it is a static method or not.
2203
2204         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
2205         refers to more than one method.
2206
2207         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
2208         and accordingly flag errors.
2209
2210 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
2211
2212         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
2213
2214 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
2215
2216         * location.cs (ToString): Provide useful rutine.
2217
2218 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
2219
2220         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
2221         objects, return the actual integral boxed.
2222
2223         * statement.cs (SwitchLabel): define an ILLabel for each
2224         SwitchLabel. 
2225         
2226         (Switch.CheckSwitch): If the value is a Literal, extract
2227         the underlying literal.
2228         
2229         Also in the unused hashtable we had, add the SwitchLabel so we can
2230         quickly look this value up.
2231
2232         * constant.cs: Implement a bunch of new constants.  Rewrite
2233         Literal based on this.  Made changes everywhere to adapt to this.
2234         
2235         * expression.cs (Expression.MakeByteBlob): Optimize routine by
2236         dereferencing array only once, and also copes with enumrations.
2237
2238         bytes are two bytes wide, not one.
2239
2240         (Cast): Perform constant conversions.
2241         
2242         * ecore.cs (TryImplicitIntConversion): Return literals instead of
2243         wrappers to the literals here.
2244
2245         * expression.cs (DoNumericPromotions): long literals can converted
2246         to ulong implicity (this is taken care of elsewhere, but I was
2247         missing this spot).
2248
2249         * ecore.cs (Expression.Literalize): Make the return type Literal,
2250         to improve type checking.
2251
2252         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
2253
2254 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
2255
2256         * literal.cs: Revert code from ravi that checked the bounds.  The
2257         bounds are sane by the definition of the type itself. 
2258
2259         * typemanager.cs: Fix implementation of ImplementsInterface.  We
2260         need to actually look up in our parent hierarchy for interfaces
2261         implemented. 
2262
2263         * const.cs: Use the underlying type for enumerations
2264
2265         * delegate.cs: Compute the basename for the delegate creation,
2266         that should fix the delegate test case, and restore the correct
2267         Type Lookup semantics in rootcontext
2268
2269         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
2270         referencing a nested type with the Reflection API is using the "+"
2271         sign. 
2272
2273         * cs-parser.jay: Do not require EOF token at the end.
2274
2275 2001-12-20  Ravi Pratap  <ravi@ximian.com>
2276
2277         * rootcontext.cs (LookupType): Concatenate type names with
2278         a '.' instead of a '+' The test suite passes again.
2279
2280         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
2281         field of the enumeration.
2282
2283         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
2284         the case when the member is an EventExpr.
2285
2286         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
2287         static has an associated instance expression.
2288
2289         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
2290
2291         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
2292
2293         * class.cs (Event.Define): Register event and perform appropriate checks
2294         for error #111.
2295
2296         We define the Add and Remove methods even if the use provides none because
2297         in that case, we provide default implementations ourselves.
2298
2299         Define a private field of the type of the event. This is done by the CSC compiler
2300         and we should be doing it too ;-)
2301
2302         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
2303         More methods we use in code we generate.
2304
2305         (multicast_delegate_type, delegate_type): Two separate types since the distinction
2306         is important.
2307
2308         (InitCoreTypes): Update accordingly for the above.
2309
2310         * class.cs (Event.Emit): Generate code for default accessors that we provide
2311
2312         (EmitDefaultMethod): Do the job in the above.
2313
2314         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
2315         appropriate place.
2316
2317 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
2318
2319         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
2320         builders even if we were missing one.
2321
2322         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
2323         pass the Basename as our class name instead of the Name.  The
2324         basename will be correctly composed for us.
2325
2326         * parameter.cs (Paramters): Now takes a Location argument.
2327
2328         * decl.cs (DeclSpace.LookupType): Removed convenience function and
2329         make all the code call directly LookupType in RootContext and take
2330         this chance to pass the Location information everywhere.
2331
2332         * Everywhere: pass Location information.
2333
2334 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
2335
2336         * class.cs (Constructor.Define): Updated way of detecting the
2337         length of the parameters.
2338
2339         (TypeContainer.DefineType): Use basename as the type name for
2340         nested types.
2341
2342         (TypeContainer.Define): Do not recursively define types here, as
2343         definition is taken care in order by the RootContext.
2344
2345         * tree.cs: Keep track of namespaces in a per-file basis.
2346
2347         * parameter.cs (Parameter.ComputeSignature): Update to use
2348         DeclSpace. 
2349
2350         (Parameters.GetSignature): ditto.
2351
2352         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
2353         instead of a TypeContainer.
2354
2355         (Interface.SemanticAnalysis): Use `this' instead of our parent to
2356         resolve names.  Because we need to be resolve in our context, not
2357         our parents.
2358         
2359         * driver.cs: Implement response files.
2360
2361         * class.cs (TypeContainer.DefineType): If we are defined, do not
2362         redefine ourselves.
2363         
2364         (Event.Emit): Emit the code for add/remove handlers.
2365         (Event.Define): Save the MethodBuilders for add/remove.
2366
2367         * typemanager.cs: Use pair here too.
2368
2369         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
2370         DictionaryEntry requires the first argument to be non-null.  
2371         
2372         (enum_declaration): Compute full name for registering the
2373         enumeration.
2374         
2375         (delegate_declaration): Instead of using
2376         formal_parameter_list, use opt_formal_parameter_list as the list
2377         can be empty.
2378
2379         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
2380         (EventParsing): New property that controls whether `add' and
2381         `remove' are returned as tokens or identifiers (for events);
2382
2383 2001-12-19  Ravi Pratap  <ravi@ximian.com>
2384
2385         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
2386         use MyEventBuilder only and let it wrap the real builder for us.
2387
2388         (MyEventBuilder): Revamp constructor etc.
2389
2390         Implement all operations that we perform on EventBuilder in precisely the same
2391         way here too.
2392
2393         (FindMembers): Update to use the EventBuilder member.
2394
2395         (Event.Emit): Update accordingly.
2396
2397 2001-12-18  Ravi Pratap  <ravi@ximian.com>
2398
2399         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
2400         by calling the appropriate methods.
2401
2402         (GetCustomAttributes): Make stubs as they cannot possibly do anything
2403         useful.
2404
2405         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
2406
2407 2001-12-17  Ravi Pratap  <ravi@ximian.com>
2408
2409         * delegate.cs (Delegate.Populate): Check that the return type
2410         and various parameters types are indeed accessible.
2411
2412         * class.cs (Constructor.Define): Same here.
2413
2414         (Field.Define): Ditto.
2415
2416         (Event.Define): Ditto.
2417
2418         (Operator.Define): Check that the underlying Method defined itself
2419         correctly - so it's MethodBuilder should not be null.
2420
2421         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
2422         expression happens to be null.
2423
2424         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
2425         members but as of now we don't seem to be able to do anything really useful with it.
2426
2427         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
2428         not the EventBuilder.
2429
2430 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
2431
2432         * cs-tokenizer.cs: Add support for defines.
2433         Add support for #if, #elif, #else, #endif
2434         
2435         (eval_var): evaluates a variable.
2436         (eval): stubbed for evaluating functions.
2437
2438         * cs-parser.jay: Pass the defines information
2439
2440         * driver.cs: Add --define command line option.
2441
2442         * decl.cs: Move MemberCore here.
2443
2444         Make it the base class for DeclSpace.  This allows us to catch and
2445         report 108 and 109 for everything now.
2446
2447         * class.cs (TypeContainer.Define): Extract all the members
2448         before populating and emit the warning 108 (new keyword required
2449         to override) instead of having each member implement this.
2450
2451         (MemberCore.Define): New abstract method, we will be using this in
2452         the warning reporting engine in Populate.
2453         
2454         (Operator.Define): Adjust to new MemberCore protocol. 
2455
2456         * const.cs (Const): This does not derive from Expression, it is a
2457         temporary object we use to create fields, it is a MemberCore. 
2458
2459         * class.cs (Method.Define): Allow the entry point to be in a
2460         specific class.
2461
2462         * driver.cs: Rewrite the argument handler to clean it up a bit.
2463
2464         * rootcontext.cs: Made it just an auxiliary namespace feature by
2465         making everything static.
2466
2467         * driver.cs: Adapt code to use RootContext type name instead of
2468         instance variable.
2469
2470         * delegate.cs: Remove RootContext argument.
2471
2472         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
2473         argument. 
2474
2475         * class.cs (Event.Define): The lookup can fail.
2476         
2477         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
2478
2479         * expression.cs: Resolve the this instance before invoking the code.
2480
2481 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
2482
2483         * cs-parser.jay: Add a production in element_access that allows
2484         the thing to become a "type" reference.  This way we can parse
2485         things like "(string [])" as a type.
2486
2487         Note that this still does not handle the more complex rules of
2488         casts. 
2489         
2490
2491         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
2492
2493         * ecore.cs: (CopyNewMethods): new utility function used to
2494         assemble the list of methods from running FindMembers.
2495
2496         (MemberLookup): Rework FindMembers so that 
2497
2498 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
2499
2500         * class.cs (TypeContainer): Remove Delegates who fail to be
2501         defined.
2502
2503         * delegate.cs (Populate): Verify that we dont get null return
2504         values.   TODO: Check for AsAccessible.
2505
2506         * cs-parser.jay: Use basename to emit error 574 (destructor should
2507         have the same name as container class), not the full name.
2508
2509         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
2510         possible representation.  
2511
2512         Also implements integer type suffixes U and L.
2513
2514 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
2515
2516         * expression.cs (ArrayCreation.DoResolve): We need to do the
2517         argument resolution *always*.
2518
2519         * decl.cs: Make this hold the namespace.  Hold the root context as
2520         well.
2521         (LookupType): Move here.
2522
2523         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
2524
2525         * location.cs (Row, Name): Fixed the code, it was always returning
2526         references to the first file.
2527
2528         * interface.cs: Register properties defined through interfaces.
2529
2530         * driver.cs: Add support for globbing on the command line
2531
2532         * class.cs (Field): Make it derive from MemberCore as well.
2533         (Event): ditto.
2534
2535 2001-12-15  Ravi Pratap  <ravi@ximian.com>
2536
2537         * class.cs (Event::Define): Check that the type of the event is a delegate
2538         type else flag error #66.
2539
2540         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
2541         same.
2542
2543         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
2544         values of EntryPoint, CharSet etc etc.
2545
2546         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
2547
2548         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
2549         be null and we should ignore this. I am not sure if this is really clean. Apparently,
2550         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
2551         which needs this to do its work.
2552
2553         * ../errors/cs0066.cs : Add.
2554
2555 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
2556
2557         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
2558         helper functions.
2559
2560         * class.cs: (MethodSignature.MethodSignature): Removed hack that
2561         clears out the parameters field.
2562         (MemberSignatureCompare): Cleanup
2563
2564         (MemberCore): New base class used to share code between MethodCore
2565         and Property.
2566
2567         (RegisterRequiredImplementations) BindingFlags.Public requires
2568         either BindingFlags.Instace or Static.  Use instance here.
2569
2570         (Property): Refactored code to cope better with the full spec.
2571
2572         * parameter.cs (GetParameterInfo): Return an empty array instead
2573         of null on error.
2574
2575         * class.cs (Property): Abstract or extern properties have no bodies.
2576
2577         * parameter.cs (GetParameterInfo): return a zero-sized array.
2578
2579         * class.cs (TypeContainer.MethodModifiersValid): Move all the
2580         method modifier validation to the typecontainer so we can reuse
2581         this on properties.
2582
2583         (MethodCore.ParameterTypes): return an empty sized array of types.
2584
2585         (Property.Define): Test property modifier validity.
2586
2587         Add tests for sealed/override too.
2588
2589         (Method.Emit): abstract or extern methods have no bodies.
2590
2591 2001-12-14  Ravi Pratap  <ravi@ximian.com>
2592
2593         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
2594         thing.
2595
2596         (Method::Define, ::Emit): Modify accordingly.
2597
2598         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
2599
2600         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
2601
2602         * makefile: Pass in /unsafe.
2603
2604 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
2605
2606         * class.cs (MakeKey): Kill routine.
2607         
2608         * class.cs (TypeContainer.Define): Correctly define explicit
2609         method implementations (they require the full interface name plus
2610         the method name).
2611
2612         * typemanager.cs: Deply the PtrHashtable here and stop using the
2613         lame keys.  Things work so much better.
2614
2615         This of course broke everyone who depended on `RegisterMethod' to
2616         do the `test for existance' test.  This has to be done elsewhere.
2617
2618         * support.cs (PtrHashtable): A hashtable that avoid comparing with
2619         the object stupid Equals method (because, that like fails all over
2620         the place).  We still do not use it.
2621
2622         * class.cs (TypeContainer.SetRequiredInterface,
2623         TypeContainer.RequireMethods): Killed these two routines and moved
2624         all the functionality to RegisterRequiredImplementations.
2625
2626         (TypeContainer.RegisterRequiredImplementations): This routine now
2627         registers all the implementations required in an array for the
2628         interfaces and abstract methods.  We use an array of structures
2629         which can be computed ahead of time to reduce memory usage and we
2630         also assume that lookups are cheap as most classes will not
2631         implement too many interfaces.
2632
2633         We also avoid creating too many MethodSignatures.
2634
2635         (TypeContainer.IsInterfaceMethod): Update and optionally does not
2636         clear the "pending" bit if we find that there are problems with
2637         the declaration.
2638
2639         (TypeContainer.VerifyPendingMethods): Update to report errors of
2640         methods that look like implementations but are not.
2641
2642         (TypeContainer.Define): Add support for explicit interface method
2643         implementation. 
2644         
2645 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
2646
2647         * typemanager.cs: Keep track of the parameters here instead of
2648         being a feature of the TypeContainer.
2649
2650         * class.cs: Drop the registration of parameters here, as
2651         InterfaceMethods are also interface declarations.
2652
2653         * delegate.cs: Register methods with the TypeManager not only with
2654         the TypeContainer.  This code was buggy.
2655
2656         * interface.cs: Full registation here.
2657
2658 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
2659
2660         * expression.cs: Remove reducer for binary expressions, it can not
2661         be done this way.
2662
2663         * const.cs: Put here the code that used to go into constant.cs
2664
2665         * constant.cs: Put here the code for constants, this is a new base
2666         class for Literals.
2667
2668         * literal.cs: Make Literal derive from Constant.
2669
2670 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
2671
2672         * statement.cs (Return.Emit): Report error 157 if the user
2673         attempts to return from a finally block.
2674
2675         (Return.Emit): Instead of emitting a return, jump to the end of
2676         the function.
2677
2678         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
2679         LocalBuilder to store the result of the function.  ReturnLabel is
2680         the target where we jump.
2681         
2682
2683 2001-12-09  Radek Doulik  <rodo@ximian.com>
2684
2685         * cs-parser.jay: remember alias in current namespace
2686
2687         * ecore.cs (SimpleName::DoResolve): use aliases for types or
2688         namespaces
2689
2690         * class.cs (LookupAlias): lookup alias in my_namespace
2691
2692         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
2693         aliases hashtable
2694         (LookupAlias): lookup alias in this and if needed in parent
2695         namespaces
2696
2697 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
2698
2699         * support.cs: 
2700
2701         * rootcontext.cs: (ModuleBuilder) Made static, first step into
2702         making things static.  I need this to avoid passing the
2703         TypeContainer when calling ParameterType.
2704
2705         * support.cs (InternalParameters.ParameterType): Remove ugly hack
2706         that did string manipulation to compute the type and then call
2707         GetType.  Use Parameter.ParameterType instead.
2708
2709         * cs-tokenizer.cs: Consume the suffix for floating values.
2710
2711         * expression.cs (ParameterReference): figure out whether this is a
2712         reference parameter or not.  Kill an extra variable by computing
2713         the arg_idx during emission.
2714
2715         * parameter.cs (Parameters.GetParameterInfo): New overloaded
2716         function that returns whether a parameter is an out/ref value or not.
2717
2718         (Parameter.ParameterType): The type of the parameter (base,
2719         without ref/out applied).
2720         
2721         (Parameter.Resolve): Perform resolution here.
2722         (Parameter.ExternalType): The full type (with ref/out applied).
2723
2724         * statement.cs (Using.Emit, Using.EmitExpression): Implement
2725         support for expressions on the using statement.
2726
2727 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
2728
2729         * statement.cs (Using.EmitLocalVariableDecls): Split the
2730         localvariable handling of the using statement.
2731
2732         (Block.EmitMeta): Keep track of variable count across blocks.  We
2733         were reusing slots on separate branches of blocks.
2734
2735         (Try.Emit): Emit the general code block, we were not emitting it. 
2736
2737         Check the type of the declaration to be an IDisposable or
2738         something that can be implicity converted to it. 
2739
2740         Emit conversions if required.
2741
2742         * ecore.cs (EmptyExpression): New utility class.
2743         (Expression.ImplicitConversionExists): New utility function.
2744
2745 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
2746
2747         * statement.cs (Using): Implement.
2748
2749         * expression.cs (LocalVariableReference): Support read only variables.
2750
2751         * statement.cs: Remove the explicit emit for the Leave opcode.
2752         (VariableInfo): Add a readonly field.
2753
2754 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
2755
2756         * ecore.cs (ConvCast): new class used to encapsulate the various
2757         explicit integer conversions that works in both checked and
2758         unchecked contexts.
2759
2760         (Expression.ConvertNumericExplicit): Use new ConvCast class to
2761         properly generate the overflow opcodes.
2762
2763 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
2764
2765         * statement.cs: The correct type for the EmptyExpression is the
2766         element_type, not the variable type.  Ravi pointed this out.
2767
2768 2001-12-04  Ravi Pratap  <ravi@ximian.com>
2769
2770         * class.cs (Method::Define): Handle PInvoke methods specially
2771         by using DefinePInvokeMethod instead of the usual one.
2772
2773         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
2774         above to do the task of extracting information and defining the method.
2775         
2776 2001-12-04  Ravi Pratap  <ravi@ximian.com>
2777
2778         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
2779         of the condition for string type.
2780
2781         (Emit): Move that here. 
2782
2783         (ArrayCreation::CheckIndices): Keep string literals in their expression
2784         form.
2785
2786         (EmitDynamicInitializers): Handle strings appropriately.
2787
2788 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
2789
2790         * codegen.cs (EmitContext): Replace multiple variables with a
2791         single pointer to the current Switch statement.
2792
2793         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
2794         EmitContext.
2795
2796 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
2797
2798         * statement.cs 
2799
2800         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
2801         default'.
2802         
2803         (Foreach.Emit): Foreach on arrays was not setting
2804         up the loop variables (for break/continue).
2805
2806         (GotoCase): Semi-implented.
2807         
2808 2001-12-03  Ravi Pratap  <ravi@ximian.com>
2809
2810         * attribute.cs (CheckAttribute): Handle system attributes by using
2811         Attribute.GetAttributes to examine information we need.
2812
2813         (GetValidPlaces): Same here.
2814
2815         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
2816
2817         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
2818
2819         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
2820
2821         (Method::Define): Set appropriate flags if we have a DllImport attribute.
2822
2823         (Method::Emit): Handle the case when we are a PInvoke method.
2824
2825 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
2826
2827         * expression.cs: Use ResolveWithSimpleName on compound names.
2828
2829 2001-12-02  Ravi Pratap  <ravi@ximian.com>
2830
2831         * constant.cs (EmitConstant): Make sure we resolve the associated expression
2832         before trying to reduce it.
2833
2834         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
2835
2836         * constant.cs (LookupConstantValue): Implement.
2837
2838         (EmitConstant): Use the above in emitting the constant.
2839
2840         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
2841         that are user-defined by doing a LookupConstantValue on them.
2842
2843         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
2844         too, like above.
2845
2846 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
2847
2848         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
2849
2850         (BaseAccess.DoResolve): Implement.
2851
2852         (MemberAccess.DoResolve): Split this routine into a
2853         ResolveMemberAccess routine that can be used independently
2854
2855 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
2856
2857         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
2858         As that share bits of the implementation.  Is returns a boolean,
2859         while As returns the Type that is being probed.
2860
2861 2001-12-01  Ravi Pratap  <ravi@ximian.com>
2862
2863         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
2864         instead of a Literal - much easier.
2865
2866         (EnumInTransit): Remove - utterly useless :-)
2867
2868         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
2869
2870         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
2871
2872         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
2873         chain when we have no associated expression.
2874
2875 2001-11-30  Ravi Pratap  <ravi@ximian.com>
2876
2877         * constant.cs (Define): Use Location while reporting the errror.
2878
2879         Also emit a warning when 'new' is used and there is no inherited
2880         member to hide.
2881
2882         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
2883         populated.
2884
2885         (LookupEnumValue): Implement to lookup an enum member's value and define it
2886         if necessary.
2887
2888         (Populate): Re-write accordingly to use the above routine.
2889
2890 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
2891
2892         * expression.cs (This): Fix prototype for DoResolveLValue to
2893         override the base class DoResolveLValue.
2894
2895         * cs-parser.cs: Report errors cs574 and cs575 (destructor
2896         declarations) 
2897
2898         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
2899         (we need to load the address of the field here).  This fixes
2900         test-22. 
2901         
2902         (FieldExpr.DoResolveLValue): Call the DoResolve
2903         function to initialize the Instance expression.
2904         
2905         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
2906         correctly the GetEnumerator operation on a value type.
2907
2908         * cs-parser.jay: Add more simple parsing error catches.
2909
2910         * statement.cs (Switch): Add support for string switches.
2911         Handle null specially.
2912
2913         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
2914
2915 2001-11-28  Ravi Pratap  <ravi@ximian.com>
2916
2917         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
2918
2919         (declare_local_constant): New helper function.
2920
2921         * statement.cs (AddConstant): Keep a separate record of constants
2922
2923         (IsConstant): Implement to determine if a variable is a constant.
2924
2925         (GetConstantExpression): Implement.
2926
2927         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
2928
2929         * statement.cs (IsVariableDefined): Re-write.
2930
2931 2001-11-27  Ravi Pratap  <ravi@ximian.com>
2932
2933         * class.cs (TypeContainer::FindMembers): Look for constants
2934         in the case when we are looking for MemberTypes.Field
2935
2936         * expression.cs (MemberAccess::DoResolve): Check that in the
2937         case we are a FieldExpr and a Literal, we are not being accessed
2938         by an instance reference.
2939
2940         * cs-parser.jay (local_constant_declaration): Implement.
2941
2942         (declaration_statement): Implement for constant declarations.
2943
2944 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
2945
2946         * statement.cs (Switch): Catch double defaults.
2947
2948         (Switch): More work on the switch() statement
2949         implementation.  It works for integral values now, need to finish
2950         string support.
2951
2952
2953 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
2954
2955         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
2956         integer literals into other integer literals.  To be used by
2957         switch. 
2958
2959 2001-11-24  Ravi Pratap  <ravi@ximian.com>
2960
2961         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
2962         some memory.
2963
2964         (EmitDynamicInitializers): Cope with the above since we extract data
2965         directly from ArrayData now.
2966
2967         (ExpectInitializers): Keep track of whether initializers are mandatory
2968         or not.
2969
2970         (Bounds): Make it a hashtable to prevent the same dimension being 
2971         recorded for every element in that dimension.
2972
2973         (EmitDynamicInitializers): Fix bug which prevented the Set array method
2974         from being found.
2975
2976         Also fix bug which was causing the indices to be emitted in the reverse
2977         order.
2978
2979 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
2980
2981         * expression.cs (ArrayCreation): Implement the bits that Ravi left
2982         unfinished.  They do not work, because the underlying code is
2983         sloppy.
2984
2985 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
2986
2987         * cs-parser.jay: Remove bogus fixme.
2988
2989         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
2990         on Switch statement.
2991         
2992 2001-11-23  Ravi Pratap  <ravi@ximian.com>
2993
2994         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
2995         the same. 
2996         
2997         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
2998         parameter. Apparently, any expression is allowed. 
2999
3000         (ValidateInitializers): Update accordingly.
3001
3002         (CheckIndices): Fix some tricky bugs thanks to recursion.
3003
3004         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
3005         I was being completely brain-dead.
3006
3007         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
3008         and re-write acordingly.
3009
3010         (DelegateInvocation): Re-write accordingly.
3011
3012         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
3013
3014         (MakeByteBlob): Handle types more correctly.
3015
3016         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
3017         initialization from expressions but it is incomplete because I am a complete
3018         Dodo :-|
3019
3020 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
3021
3022         * statement.cs (If.Emit): Fix a bug that generated incorrect code
3023         on If.  Basically, we have to return `true' (ie, we do return to
3024         our caller) only if both branches of the if return.
3025
3026         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
3027         short-circuit operators, handle them as short circuit operators. 
3028
3029         (Cast.DoResolve): Resolve type.
3030         (Cast.Cast): Take an expression as the target type.
3031
3032         * cs-parser.jay (cast_expression): Remove old hack that only
3033         allowed a limited set of types to be handled.  Now we take a
3034         unary_expression and we resolve to a type during semantic
3035         analysis.
3036
3037         Use the grammar productions from Rhys to handle casts (this is
3038         not complete like Rhys syntax yet, we fail to handle that corner
3039         case that C# has regarding (-x), but we will get there.
3040         
3041 2001-11-22  Ravi Pratap  <ravi@ximian.com>
3042
3043         * class.cs (EmitFieldInitializer): Take care of the case when we have a
3044         field which is an array type.
3045
3046         * cs-parser.jay (declare_local_variables): Support array initialization too.
3047
3048         * typemanager.cs (MakeKey): Implement.
3049
3050         (everywhere): Use the above appropriately.
3051
3052         * cs-parser.jay (for_statement): Update for array initialization while
3053         declaring variables.
3054
3055         * ecore.cs : The error message was correct, it's the variable's names that
3056         were misleading ;-) Make the code more readable.
3057
3058         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
3059         the correct type etc.
3060
3061         (ConvertExplicit): Handle Enum types by examining the underlying type.
3062
3063 2001-11-21  Ravi Pratap  <ravi@ximian.com>
3064
3065         * parameter.cs (GetCallingConvention): Always return
3066         CallingConventions.Standard for now.
3067
3068 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
3069
3070         * expression.cs (Binary.ResolveOperator): Update the values of `l'
3071         and `r' after calling DoNumericPromotions.
3072
3073         * ecore.cs: Fix error message (the types were in the wrong order).
3074
3075         * statement.cs (Foreach.ProbeCollectionType): Need to pass
3076         BindingFlags.Instance as well 
3077
3078         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
3079         implicit int literal conversion in an empty cast so that we
3080         propagate the right type upstream.
3081
3082         (UnboxCast): new class used to unbox value types.
3083         (Expression.ConvertExplicit): Add explicit type conversions done
3084         by unboxing.
3085
3086         (Expression.ImplicitNumericConversion): Oops, forgot to test for
3087         the target type before applying the implicit LongLiterals to ULong
3088         literal cast.
3089
3090 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
3091
3092         * cs-parser.jay (for_statement): Reworked the way For works: now
3093         we declare manually any variables that are introduced in
3094         for_initializer to solve the problem of having out-of-band code
3095         emition (that is what got for broken).
3096
3097         (declaration_statement): Perform the actual variable declaration
3098         that used to be done in local_variable_declaration here.
3099
3100         (local_variable_declaration): Do not declare anything, just pass
3101         the information on a DictionaryEntry
3102
3103 2001-11-20  Ravi Pratap  <ravi@ximian.com>
3104
3105         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
3106         re-write of the logic to now make it recursive.
3107
3108         (UpdateIndices): Re-write accordingly.
3109
3110         Store element data in a separate ArrayData list in the above methods.
3111
3112         (MakeByteBlob): Implement to dump the array data into a byte array.
3113
3114 2001-11-19  Ravi Pratap  <ravi@ximian.com>
3115
3116         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
3117         into CheckIndices.
3118
3119         * constant.cs (Define): Implement.
3120
3121         (EmitConstant): Re-write fully.
3122
3123         Pass in location info.
3124
3125         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
3126         respectively.
3127
3128         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
3129         DictionaryEntry since we need location info too.
3130
3131         (constant_declaration): Update accordingly.
3132
3133         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
3134         code into another method : UpdateIndices.
3135
3136 2001-11-18  Ravi Pratap  <ravi@ximian.com>
3137
3138         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
3139         some type checking etc.
3140
3141 2001-11-17  Ravi Pratap  <ravi@ximian.com>
3142
3143         * expression.cs (ArrayCreation::ValidateInitializers): Implement
3144         bits to provide dimension info if the user skips doing that.
3145
3146         Update second constructor to store the rank correctly.
3147
3148 2001-11-16  Ravi Pratap  <ravi@ximian.com>
3149
3150         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
3151         and try to implement.
3152
3153         * ../errors/cs0150.cs : Add.
3154
3155         * ../errors/cs0178.cs : Add.
3156
3157 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
3158
3159         * statement.cs: Implement foreach on multi-dimensional arrays. 
3160
3161         * parameter.cs (Parameters.GetParameterByName): Also lookup the
3162         name of the params argument.
3163
3164         * expression.cs: Use EmitStoreOpcode to get the right opcode while
3165         initializing the array.
3166
3167         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
3168         we can use this elsewhere.
3169
3170         * statement.cs: Finish implementation of foreach for single
3171         dimension arrays.
3172
3173         * cs-parser.jay: Use an out-of-band stack to pass information
3174         around, I wonder why I need this.
3175
3176         foreach_block: Make the new foreach_block the current_block.
3177
3178         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
3179         function used to return a static Parameters structure.  Used for
3180         empty parameters, as those are created very frequently.
3181
3182         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
3183
3184 2001-11-15  Ravi Pratap  <ravi@ximian.com>
3185
3186         * interface.cs : Default modifier is private, not public. The
3187         make verify test passes again.
3188
3189 2001-11-15  Ravi Pratap  <ravi@ximian.com>
3190
3191         * support.cs (ReflectionParameters): Fix logic to determine
3192         whether the last parameter is a params one. Test 9 passes again.
3193
3194         * delegate.cs (Populate): Register the builders we define with
3195         RegisterParameterForBuilder. Test 19 passes again.
3196
3197         * cs-parser.jay (property_declaration): Reference $6 instead
3198         of $$ to get at the location.
3199
3200         (indexer_declaration): Similar stuff.
3201
3202         (attribute): Ditto.
3203
3204         * class.cs (Property): Register parameters for the Get and Set methods
3205         if they exist. Test 23 passes again.
3206
3207         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
3208         call to EmitArguments as we are sure there aren't any params arguments. 
3209         Test 32 passes again.
3210
3211         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
3212         IndexOutOfRangeException. 
3213
3214         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
3215         Test 33 now passes again.
3216         
3217 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
3218
3219         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
3220         broke a bunch of things.  Will have to come up with a better way
3221         of tracking locations.
3222
3223         * statement.cs: Implemented foreach for single dimension arrays.
3224
3225 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
3226
3227         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
3228         an error.  This removes the lookup from the critical path.
3229
3230         * cs-parser.jay: Removed use of temporary_loc, which is completely
3231         broken. 
3232
3233 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
3234
3235         * support.cs (ReflectionParameters.ParameterModifier): Report
3236         whether the argument is a PARAMS argument or not.
3237
3238         * class.cs: Set the attribute `ParamArrayAttribute' on the
3239         parameter argument.
3240
3241         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
3242         and cons_param_array_attribute (ConstructorInfo for
3243         ParamArrayAttribute)., 
3244
3245         * codegen.cs: Emit the return using the `Return' statement, that
3246         way we can report the error correctly for missing return values. 
3247
3248         * class.cs (Method.Emit): Clean up.
3249
3250         * expression.cs (Argument.Resolve): Take another argument: the
3251         location where this argument is used.  Notice that this is not
3252         part of the "Argument" class as to reduce the size of the
3253         structure (we know the approximate location anyways).
3254
3255         Test if the argument is a variable-reference, if not, then
3256         complain with a 206.
3257
3258         (Argument.Emit): Emit addresses of variables.
3259
3260         (Argument.FullDesc): Simplify.
3261
3262         (Invocation.DoResolve): Update for Argument.Resolve.
3263
3264         (ElementAccess.DoResolve): ditto.
3265
3266         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
3267         method should be virtual, as this method is always virtual.
3268
3269         (NewDelegate.DoResolve): Update for Argument.Resolve.
3270
3271         * class.cs (ConstructorInitializer.DoResolve): ditto.
3272         
3273         * attribute.cs (Attribute.Resolve): ditto.
3274
3275 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
3276
3277         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
3278
3279         * expression.cs (ParameterReference): Drop IStackStorage and implement
3280         IAssignMethod instead. 
3281
3282         (LocalVariableReference): ditto.
3283         
3284         * ecore.cs (FieldExpr): Drop IStackStorage and implement
3285         IAssignMethod instead. 
3286
3287 2001-11-13  Miguel de Icaza <miguel@ximian.com>
3288
3289         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
3290         enumerations that are used in heavily used structures derive from
3291         byte in a laughable and pathetic attempt to reduce memory usage.
3292         This is the kind of pre-optimzations that you should not do at
3293         home without adult supervision.
3294
3295         * expression.cs (UnaryMutator): New class, used to handle ++ and
3296         -- separatedly from the other unary operators.  Cleans up the
3297         code, and kills the ExpressionStatement dependency in Unary.
3298
3299         (Unary): Removed `method' and `Arguments' from this class, making
3300         it smaller, and moving it all to SimpleCall, so I can reuse this
3301         code in other locations and avoid creating a lot of transient data
3302         strucutres when not required.
3303
3304         * cs-parser.jay: Adjust for new changes.
3305
3306 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
3307
3308         * enum.cs (Enum.Populate): If there is a failure during
3309         definition, return
3310
3311         * cs-parser.jay (opt_enum_base): we used to catch type errors
3312         here, but this is really incorrect.  The type error should be
3313         catched during semantic analysis.
3314
3315 2001-12-11  Ravi Pratap  <ravi@ximian.com>
3316
3317         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
3318         current_local_parameters as expected since I, in my stupidity, had forgotten
3319         to do this :-)
3320
3321         * attribute.cs (GetValidPlaces): Fix stupid bug.
3322
3323         * class.cs (Method::Emit): Perform check on applicability of attributes.
3324
3325         (Constructor::Emit): Ditto.
3326
3327         (Field::Emit): Ditto.
3328
3329         (Field.Location): Store location information.
3330
3331         (Property, Event, Indexer, Operator): Ditto.
3332
3333         * cs-parser.jay (field_declaration): Pass in location for each field.
3334
3335         * ../errors/cs0592.cs : Add.
3336
3337 2001-11-12  Ravi Pratap  <ravi@ximian.com>
3338
3339         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
3340
3341         (InitCoreTypes): Update accordingly.
3342
3343         (RegisterAttrType, LookupAttr): Implement.
3344
3345         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
3346         info about the same.
3347
3348         (Resolve): Update to populate the above as necessary.
3349
3350         (Error592): Helper.
3351
3352         (GetValidPlaces): Helper to the above.
3353
3354         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
3355
3356         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
3357
3358 2001-11-12  Ravi Pratap  <ravi@ximian.com>
3359
3360         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
3361
3362         * ../errors/cs0617.cs : Add.
3363
3364 2001-11-11  Ravi Pratap  <ravi@ximian.com>
3365
3366         * enum.cs (Emit): Rename to Populate to be more consistent with what
3367         we expect it to do and when exactly it is called.
3368
3369         * class.cs, rootcontext.cs : Update accordingly.
3370
3371         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
3372         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
3373
3374         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
3375
3376         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
3377         of a fieldinfo using the above, when dealing with a FieldBuilder.
3378
3379 2001-11-10  Ravi Pratap  <ravi@ximian.com>
3380
3381         * ../errors/cs0031.cs : Add.
3382
3383         * ../errors/cs1008.cs : Add.
3384
3385         * ../errrors/cs0543.cs : Add.
3386
3387         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
3388         enum type.
3389
3390         (FindMembers): Implement.
3391
3392         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
3393         enums and delegates too.
3394
3395         (enum_types): Rename to builder_to_enum.
3396
3397         (delegate_types): Rename to builder_to_delegate.
3398
3399         * delegate.cs (FindMembers): Implement.
3400
3401 2001-11-09  Ravi Pratap  <ravi@ximian.com>
3402
3403         * typemanager.cs (IsEnumType): Implement.
3404
3405         * enum.cs (Emit): Re-write parts to account for the underlying type
3406         better and perform checking etc.
3407
3408         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
3409         of the underlying type.
3410
3411         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
3412         value
3413
3414         * enum.cs (error31): Helper to report error #31.
3415
3416         * cs-parser.jay (enum_declaration): Store location of each member too.
3417
3418         * enum.cs (member_to_location): New hashtable. 
3419
3420         (AddEnumMember): Update location hashtable.
3421
3422         (Emit): Use the location of each member while reporting errors.
3423
3424 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
3425
3426         * cs-parser.jay: A for_initializer if is a
3427         local_variable_declaration really ammount to have an implicit
3428         block with the variable declaration and no initializer for for.
3429
3430         * statement.cs (For.Emit): Cope with null initializers.
3431
3432         This fixes the infinite loop on for initializers.
3433
3434 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
3435
3436         * enum.cs: More cleanup.
3437
3438         * ecore.cs: Remove dead code.
3439
3440         * class.cs (Property.Emit): More simplification.
3441         (Event.Emit): ditto.
3442
3443         Reworked to have less levels of indentation.
3444         
3445 2001-11-08  Ravi Pratap  <ravi@ximian.com>
3446
3447         * class.cs (Property): Emit attributes.
3448
3449         (Field): Ditto.
3450         
3451         (Event): Ditto.
3452
3453         (Indexer): Ditto.
3454
3455         (Operator): Ditto.
3456
3457         * enum.cs (Emit): Ditto.
3458
3459         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
3460         Enums too.
3461
3462         * class.cs (Field, Event, etc.): Move attribute generation into the
3463         Emit method everywhere.
3464
3465         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
3466         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
3467         as we had no way of defining nested enums !
3468
3469         * rootcontext.cs : Adjust code accordingly.
3470
3471         * typemanager.cs (AddEnumType): To keep track of enum types separately.
3472
3473 2001-11-07  Ravi Pratap  <ravi@ximian.com>
3474
3475         * expression.cs (EvalConstantExpression): Move into ecore.cs
3476         
3477         * enum.cs (Enum): Rename some members and make them public and readonly
3478         according to our convention.
3479
3480         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
3481         nothing else.
3482
3483         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
3484
3485         (Enum::Emit): Write a simple version for now which doesn't try to compute
3486         expressions. I shall modify this to be more robust in just a while.
3487
3488         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
3489
3490         (TypeContainer::CloseType): Create the Enum types too.
3491
3492         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
3493
3494         * expression.cs (EvalConstantExpression): Get rid of completely.
3495
3496         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
3497         user-defined values and other cases.
3498
3499         (IsValidEnumLiteral): Helper function.
3500
3501         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
3502         out there in the case we had a literal FieldExpr.
3503
3504         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
3505
3506         (Literalize): Revamp a bit to take two arguments.
3507         
3508         (EnumLiteral): New class which derives from Literal to wrap enum literals.
3509         
3510 2001-11-06  Ravi Pratap  <ravi@ximian.com>
3511
3512         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
3513
3514         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
3515
3516         (Resolve): Use the above to ensure we have proper initializers.
3517
3518 2001-11-05  Ravi Pratap  <ravi@ximian.com>
3519
3520         * expression.cs (Expression::EvalConstantExpression): New method to 
3521         evaluate constant expressions.
3522
3523         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
3524
3525 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
3526
3527         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
3528         in an array.
3529
3530         (Binary.ResolveOperator): Handle operator != (object a, object b)
3531         and operator == (object a, object b);
3532
3533         (Binary.DoNumericPromotions): Indicate whether the numeric
3534         promotion was possible.
3535
3536         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
3537         Implement.  
3538
3539         Made the ArrayAccess implement interface IAssignMethod instead of
3540         IStackStore as the order in which arguments are passed reflects
3541         this.
3542
3543         * assign.cs: Instead of using expr.ExprClass to select the way of
3544         assinging, probe for the IStackStore/IAssignMethod interfaces.
3545
3546         * typemanager.cs: Load InitializeArray definition.
3547
3548         * rootcontext.cs (RootContext.MakeStaticData): Used to define
3549         static data that can be used to initialize arrays. 
3550
3551 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
3552
3553         * expression.cs: Handle operator== and operator!= for booleans.
3554
3555         (Conditioal.Reduce): Implement reducer for the ?: operator.
3556
3557         (Conditional.Resolve): Implement dead code elimination.
3558
3559         (Binary.Resolve): Catch string literals and return a new
3560         concatenated string.
3561
3562         (Unary.Reduce): Implement reduction of unary expressions.
3563
3564         * ecore.cs: Split out the expression core handling here.
3565
3566         (Expression.Reduce): New method used to perform constant folding
3567         and CSE.  This is needed to support constant-expressions. 
3568         
3569         * statement.cs (Statement.EmitBoolExpression): Pass true and false
3570         targets, and optimize for !x.
3571
3572 2001-11-04  Ravi Pratap  <ravi@ximian.com>
3573
3574         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
3575         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
3576         set custom atttributes.
3577
3578         * literal.cs (Literal::GetValue): New abstract method to return the actual
3579         value of the literal, cast as an object.
3580
3581         (*Literal): Implement GetValue method.
3582
3583         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
3584         expressions to the arraylist but objects of type Argument.
3585
3586         * class.cs (TypeContainer::Emit): Emit our attributes too.
3587
3588         (Method::Emit, Constructor::Emit): Ditto.
3589
3590         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
3591         to be ignoring earlier.
3592
3593 2001-11-03  Ravi Pratap  <ravi@ximian.com>
3594
3595         * attribute.cs (AttributeSection::Define): Implement to do the business
3596         of constructing a CustomAttributeBuilder.
3597
3598         (Attribute): New trivial class. Increases readability of code.  
3599
3600         * cs-parser.jay : Update accordingly.
3601
3602         (positional_argument_list, named_argument_list, named_argument): New rules
3603
3604         (attribute_arguments): Use the above so that we are more correct.
3605         
3606 2001-11-02  Ravi Pratap  <ravi@ximian.com>
3607         
3608         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
3609         to perform all checks for a method with a params parameter.
3610
3611         (Invocation::OverloadResolve): Update to use the above method and therefore
3612         cope correctly with params method invocations.
3613
3614         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
3615         params too.
3616
3617         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
3618         constructors in our parent too because we can't afford to miss out on 
3619         protected ones ;-)
3620
3621         * attribute.cs (AttributeSection): New name for the class Attribute
3622
3623         Other trivial changes to improve readability.
3624
3625         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
3626         use the new class names.
3627         
3628 2001-11-01  Ravi Pratap  <ravi@ximian.com>
3629
3630         * class.cs (Method::Define): Complete definition for params types too
3631
3632         (Indexer::Define): Ditto.
3633
3634         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
3635         Cope everywhere with a request for info about the array parameter.
3636
3637 2001-11-01  Ravi Pratap  <ravi@ximian.com>
3638
3639         * tree.cs (RecordNamespace): Fix up to check for the correct key.
3640
3641         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
3642         local_variable_type to extract the string corresponding to the type.
3643
3644         (local_variable_type): Fixup the action to use the new helper method.
3645
3646         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
3647         go.
3648
3649         * expression.cs : Clean out code which uses the above.
3650
3651 2001-10-31  Ravi Pratap  <ravi@ximian.com>
3652         
3653         * typemanager.cs (RegisterMethod): Check if we already have an existing key
3654         and bale out if necessary by returning a false.
3655
3656         (RegisterProperty): Ditto.
3657
3658         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
3659         and print out appropriate error messages.
3660
3661         * interface.cs (everywhere): Ditto.
3662
3663         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
3664         location to constructor.
3665
3666         * class.cs (Property, Event, Indexer): Update accordingly.
3667
3668         * ../errors/cs111.cs : Added.
3669
3670         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
3671         of a method, as laid down by the spec.
3672
3673         (Invocation::OverloadResolve): Use the above method.
3674
3675 2001-10-31  Ravi Pratap  <ravi@ximian.com>
3676
3677         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
3678         now take a TypeContainer and a Parameters object.
3679
3680         (ParameterData): Modify return type of ParameterModifier method to be 
3681         Parameter.Modifier and not a string.
3682
3683         (ReflectionParameters, InternalParameters): Update accordingly.
3684
3685         * expression.cs (Argument::GetParameterModifier): Same here.
3686
3687         * support.cs (InternalParameters::ParameterType): Find a better way of determining
3688         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
3689         symbol in it at all so maybe this is only for now.
3690
3691 2001-10-30  Ravi Pratap  <ravi@ximian.com>
3692
3693         * support.cs (InternalParameters): Constructor now takes an extra argument 
3694         which is the actual Parameters class.
3695
3696         (ParameterDesc): Update to provide info on ref/out modifiers.
3697
3698         * class.cs (everywhere): Update call to InternalParameters to pass in
3699         the second argument too.
3700
3701         * support.cs (ParameterData): Add ParameterModifier, which is a method 
3702         to return the modifier info [ref/out etc]
3703
3704         (InternalParameters, ReflectionParameters): Implement the above.
3705
3706         * expression.cs (Argument::ParameterModifier): Similar function to return
3707         info about the argument's modifiers.
3708
3709         (Invocation::OverloadResolve): Update to take into account matching modifiers 
3710         too.
3711
3712         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
3713         a new SetFormalParameters object which we pass to InternalParameters.
3714
3715 2001-10-30  Ravi Pratap  <ravi@ximian.com>
3716
3717         * expression.cs (NewArray): Merge into the ArrayCreation class.
3718
3719 2001-10-29  Ravi Pratap  <ravi@ximian.com>
3720
3721         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
3722         NewUserdefinedArray into one as there wasn't much of a use in having
3723         two separate ones.
3724
3725         * expression.cs (Argument): Change field's name to ArgType from Type.
3726
3727         (Type): New readonly property which returns the proper type, taking into 
3728         account ref/out modifiers.
3729
3730         (everywhere): Adjust code accordingly for the above.
3731
3732         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
3733         whether we are emitting for a ref or out parameter.
3734
3735         * expression.cs (Argument::Emit): Use the above field to set the state.
3736
3737         (LocalVariableReference::Emit): Update to honour the flag and emit the
3738         right stuff.
3739
3740         * parameter.cs (Attributes): Set the correct flags for ref parameters.
3741
3742         * expression.cs (Argument::FullDesc): New function to provide a full desc.
3743
3744         * support.cs (ParameterData): Add method ParameterDesc to the interface.
3745
3746         (ReflectionParameters, InternalParameters): Implement the above method.
3747
3748         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
3749         reporting errors.
3750
3751         (Invocation::FullMethodDesc): Ditto. 
3752
3753 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
3754
3755         * cs-parser.jay: Add extra production for the second form of array
3756         creation. 
3757
3758         * expression.cs (ArrayCreation): Update to reflect the above
3759         change. 
3760
3761         * Small changes to prepare for Array initialization.
3762
3763 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
3764
3765         * typemanager.cs (ImplementsInterface): interface might be null;
3766         Deal with this problem;
3767
3768         Also, we do store negative hits on the cache (null values), so use
3769         this instead of calling t.GetInterfaces on the type everytime.
3770
3771 2001-10-28  Ravi Pratap  <ravi@ximian.com>
3772
3773         * typemanager.cs (IsBuiltinType): New method to help determine the same.
3774
3775         * expression.cs (New::DoResolve): Get rid of array creation code and instead
3776         split functionality out into different classes.
3777
3778         (New::FormArrayType): Move into NewBuiltinArray.
3779
3780         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
3781         quite useless.
3782
3783         (NewBuiltinArray): New class to handle creation of built-in arrays.
3784
3785         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
3786         account creation of one-dimensional arrays.
3787
3788         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
3789
3790         (NewUserdefinedArray::DoResolve): Implement.
3791
3792         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
3793
3794         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
3795         we maintain inside the TypeManager. This is necessary to perform lookups on the
3796         module builder.
3797
3798         (LookupType): Update to perform GetType on the module builders too.     
3799
3800         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
3801
3802         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
3803
3804 2001-10-23  Ravi Pratap  <ravi@ximian.com>
3805
3806         * expression.cs (New::DoResolve): Implement guts of array creation.
3807
3808         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
3809         
3810 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
3811
3812         * expression.cs: Fix bug I introduced lsat night that broke
3813         Delegates. 
3814
3815         (Expression.Resolve): Report a 246 error (can not resolve name)
3816         if we find a SimpleName in the stream.
3817         
3818         (Expression.ResolveLValue): Ditto.
3819         
3820         (Expression.ResolveWithSimpleName): This function is a variant of
3821         ResolveName, this one allows SimpleNames to be returned without a
3822         warning.  The only consumer of SimpleNames is MemberAccess
3823
3824 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
3825
3826         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
3827         might arrive here.  I have my doubts that this is correct.
3828
3829         * statement.cs (Lock): Implement lock statement.
3830
3831         * cs-parser.jay: Small fixes to support `lock' and `using'
3832
3833         * cs-tokenizer.cs: Remove extra space
3834
3835         * driver.cs: New flag --checked, allows to turn on integer math
3836         checking. 
3837
3838         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
3839         Threading.Monitor.Exit 
3840         
3841 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
3842
3843         * expression.cs (IndexerAccess::DoResolveLValue): Set the
3844         Expression Class to be IndexerAccess.
3845
3846         Notice that Indexer::DoResolve sets the eclass to Value.
3847
3848 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
3849
3850         * class.cs (TypeContainer::Emit): Emit code for indexers.
3851
3852         * assign.cs (IAssignMethod): New interface implemented by Indexers
3853         and Properties for handling assignment.
3854
3855         (Assign::Emit): Simplify and reuse code. 
3856         
3857         * expression.cs (IndexerAccess, PropertyExpr): Implement
3858         IAssignMethod, clean up old code. 
3859
3860 2001-10-22  Ravi Pratap  <ravi@ximian.com>
3861
3862         * typemanager.cs (ImplementsInterface): New method to determine if a type
3863         implements a given interface. Provides a nice cache too.
3864
3865         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
3866         method.
3867
3868         (ConvertReferenceExplicit): Ditto.
3869
3870         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
3871         various methods, with correct names etc.
3872
3873         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
3874         Operator.UnaryNegation.
3875
3876         * cs-parser.jay (operator_declarator): Be a little clever in the case where
3877         we have a unary plus or minus operator.
3878
3879         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
3880         UnaryMinus.
3881
3882         * everywhere : update accordingly.
3883
3884         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
3885         respectively.
3886
3887         * class.cs (Method::Define): For the case where we are implementing a method
3888         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
3889         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
3890         
3891 2001-10-21  Ravi Pratap  <ravi@ximian.com>
3892
3893         * interface.cs (FindMembers): Implement to work around S.R.E
3894         lameness.
3895
3896         * typemanager.cs (IsInterfaceType): Implement.
3897
3898         (FindMembers): Update to handle interface types too.
3899
3900         * expression.cs (ImplicitReferenceConversion): Re-write bits which
3901         use IsAssignableFrom as that is not correct - it doesn't work.
3902
3903         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
3904         and accordingly override EmitStatement.
3905
3906         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
3907         using the correct logic :-)
3908
3909 2001-10-19  Ravi Pratap  <ravi@ximian.com>
3910
3911         * ../errors/cs-11.cs : Add to demonstrate error -11 
3912
3913 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
3914
3915         * assign.cs (Assign::Resolve): Resolve right hand side first, and
3916         then pass this as a hint to ResolveLValue.
3917         
3918         * expression.cs (FieldExpr): Add Location information
3919
3920         (FieldExpr::LValueResolve): Report assignment to readonly
3921         variable. 
3922         
3923         (Expression::ExprClassFromMemberInfo): Pass location information.
3924
3925         (Expression::ResolveLValue): Add new method that resolves an
3926         LValue. 
3927
3928         (Expression::DoResolveLValue): Default invocation calls
3929         DoResolve. 
3930
3931         (Indexers): New class used to keep track of indexers in a given
3932         Type. 
3933
3934         (IStackStore): Renamed from LValue, as it did not really describe
3935         what this did.  Also ResolveLValue is gone from this interface and
3936         now is part of Expression.
3937
3938         (ElementAccess): Depending on the element access type
3939         
3940         * typemanager.cs: Add `indexer_name_type' as a Core type
3941         (System.Runtime.CompilerServices.IndexerNameAttribute)
3942
3943         * statement.cs (Goto): Take a location.
3944         
3945 2001-10-18  Ravi Pratap  <ravi@ximian.com>
3946
3947         * delegate.cs (Delegate::VerifyDelegate): New method to verify
3948         if two delegates are compatible.
3949
3950         (NewDelegate::DoResolve): Update to take care of the case when
3951         we instantiate a delegate from another delegate.
3952
3953         * typemanager.cs (FindMembers): Don't even try to look up members
3954         of Delegate types for now.
3955
3956 2001-10-18  Ravi Pratap  <ravi@ximian.com>
3957
3958         * delegate.cs (NewDelegate): New class to take care of delegate
3959         instantiation.
3960
3961         * expression.cs (New): Split the delegate related code out into 
3962         the NewDelegate class.
3963
3964         * delegate.cs (DelegateInvocation): New class to handle delegate 
3965         invocation.
3966
3967         * expression.cs (Invocation): Split out delegate related code into
3968         the DelegateInvocation class.
3969
3970 2001-10-17  Ravi Pratap  <ravi@ximian.com>
3971
3972         * expression.cs (New::DoResolve): Implement delegate creation fully
3973         and according to the spec.
3974
3975         (New::DoEmit): Update to handle delegates differently.
3976
3977         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
3978         because of which we were printing out arguments in reverse order !
3979
3980         * delegate.cs (VerifyMethod): Implement to check if the given method
3981         matches the delegate.
3982
3983         (FullDelegateDesc): Implement.
3984
3985         (VerifyApplicability): Implement.
3986
3987         * expression.cs (Invocation::DoResolve): Update to accordingly handle
3988         delegate invocations too.
3989
3990         (Invocation::Emit): Ditto.
3991
3992         * ../errors/cs1593.cs : Added.
3993
3994         * ../errors/cs1594.cs : Added.
3995
3996         * delegate.cs (InstanceExpression, TargetMethod): New properties.
3997
3998 2001-10-16  Ravi Pratap  <ravi@ximian.com>
3999
4000         * typemanager.cs (intptr_type): Core type for System.IntPtr
4001
4002         (InitCoreTypes): Update for the same.
4003
4004         (iasyncresult_type, asynccallback_type): Ditto.
4005
4006         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
4007         correct.
4008
4009         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
4010         too.
4011
4012         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
4013         the builders for the 4 members of a delegate type :-)
4014
4015         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
4016         type.
4017
4018         * expression.cs (New::DoResolve): Implement guts for delegate creation.
4019
4020         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
4021
4022 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
4023
4024         * statement.cs (Break::Emit): Implement.   
4025         (Continue::Emit): Implement.
4026
4027         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
4028         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
4029         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
4030         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
4031         end loop
4032         
4033         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
4034         properties that track the label for the current loop (begin of the
4035         loop and end of the loop).
4036
4037 2001-10-15  Ravi Pratap  <ravi@ximian.com>
4038
4039         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
4040         use of emitting anything at all.
4041
4042         * class.cs, rootcontext.cs : Get rid of calls to the same.
4043
4044         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
4045
4046         (Populate): Define the constructor correctly and set the implementation
4047         attributes.
4048
4049         * typemanager.cs (delegate_types): New hashtable to hold delegates that
4050         have been defined.
4051
4052         (AddDelegateType): Implement.
4053
4054         (IsDelegateType): Implement helper method.
4055
4056         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
4057
4058         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
4059         and accordingly handle it.
4060
4061         * delegate.cs (Populate): Take TypeContainer argument.
4062         Implement bits to define the Invoke method. However, I still haven't figured out
4063         how to take care of the native int bit :-(
4064
4065         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
4066         Qualify the name of the delegate, not its return type !
4067
4068         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
4069         conversion.
4070
4071         (StandardConversionExists): Checking for array types turns out to be recursive.
4072
4073         (ConvertReferenceExplicit): Implement array conversion.
4074
4075         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
4076         
4077 2001-10-12  Ravi Pratap  <ravi@ximian.com>
4078
4079         * cs-parser.jay (delegate_declaration): Store the fully qualified
4080         name as it is a type declaration.
4081
4082         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
4083         readonly.
4084
4085         (DefineDelegate): Renamed from Define. Does the same thing essentially,
4086         as TypeContainer::DefineType.
4087
4088         (Populate): Method in which all the definition of the various methods (Invoke)
4089         etc is done.
4090
4091         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
4092         see.
4093         
4094         (CloseDelegate): Finally creates the delegate.
4095
4096         * class.cs (TypeContainer::DefineType): Update to define delegates.
4097         (Populate, Emit and CloseType): Do the same thing here too.
4098
4099         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
4100         delegates in all these operations.
4101
4102 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
4103
4104         * expression.cs: LocalTemporary: a new expression used to
4105         reference a temporary that has been created.
4106
4107         * assign.cs: Handle PropertyAccess back here, so that we can
4108         provide the proper semantic access to properties.
4109
4110         * expression.cs (Expression::ConvertReferenceExplicit): Implement
4111         a few more explicit conversions. 
4112
4113         * modifiers.cs: `NEW' modifier maps to HideBySig.
4114
4115         * expression.cs (PropertyExpr): Make this into an
4116         ExpressionStatement, and support the EmitStatement code path. 
4117
4118         Perform get/set error checking, clean up the interface.
4119
4120         * assign.cs: recognize PropertyExprs as targets, and if so, turn
4121         them into toplevel access objects.
4122
4123 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
4124
4125         * expression.cs: PropertyExpr::PropertyExpr: use work around the
4126         SRE.
4127
4128         * typemanager.cs: Keep track here of our PropertyBuilders again to
4129         work around lameness in SRE.
4130
4131 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
4132
4133         * expression.cs (LValue::LValueResolve): New method in the
4134         interface, used to perform a second resolution pass for LValues. 
4135         
4136         (This::DoResolve): Catch the use of this in static methods.
4137
4138         (This::LValueResolve): Implement.
4139
4140         (This::Store): Remove warning, assigning to `this' in structures
4141         is 
4142
4143         (Invocation::Emit): Deal with invocation of
4144         methods on value types.  We need to pass the address to structure
4145         methods rather than the object itself.  (The equivalent code to
4146         emit "this" for structures leaves the entire structure on the
4147         stack instead of a pointer to it). 
4148
4149         (ParameterReference::DoResolve): Compute the real index for the
4150         argument based on whether the method takes or not a `this' pointer
4151         (ie, the method is static).
4152
4153         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
4154         value types returned from functions when we need to invoke a
4155         method on the sturcture.
4156         
4157
4158 2001-10-11  Ravi Pratap  <ravi@ximian.com>
4159
4160         * class.cs (TypeContainer::DefineType): Method to actually do the business of
4161         defining the type in the Modulebuilder or Typebuilder. This is to take
4162         care of nested types which need to be defined on the TypeBuilder using
4163         DefineNestedMethod.
4164
4165         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
4166         methods in RootContext, only ported to be part of TypeContainer.
4167
4168         (TypeContainer::GetInterfaceOrClass): Ditto.
4169
4170         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
4171
4172         * interface.cs (Interface::DefineInterface): New method. Does exactly
4173         what RootContext.CreateInterface did earlier, only it takes care of nested types 
4174         too.
4175
4176         (Interface::GetInterfaces): Move from RootContext here and port.
4177
4178         (Interface::GetInterfaceByName): Same here.
4179
4180         * rootcontext.cs (ResolveTree): Re-write.
4181
4182         (PopulateTypes): Re-write.
4183
4184         * class.cs (TypeContainer::Populate): Populate nested types too.
4185         (TypeContainer::Emit): Emit nested members too.
4186
4187         * typemanager.cs (AddUserType): Do not make use of the FullName property,
4188         instead just use the name argument passed in as it is already fully
4189         qualified.
4190
4191         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
4192         to TypeContainer mapping to see if a type is user-defined.
4193
4194         * class.cs (TypeContainer::CloseType): Implement. 
4195
4196         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
4197         the default constructor.
4198         
4199         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
4200         twice.
4201
4202         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
4203
4204         * interface.cs (CloseType): Create the type here.
4205         
4206         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
4207         the hierarchy.
4208
4209         Remove all the methods which are now in TypeContainer.
4210
4211 2001-10-10  Ravi Pratap  <ravi@ximian.com>
4212
4213         * delegate.cs (Define): Re-write bits to define the delegate
4214         correctly.
4215
4216 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
4217
4218         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
4219
4220         * expression.cs (ImplicitReferenceConversion): handle null as well
4221         as a source to convert to any reference type.
4222
4223         * statement.cs (Return): Perform any implicit conversions to
4224         expected return type.  
4225
4226         Validate use of return statement.  
4227
4228         * codegen.cs (EmitContext): Pass the expected return type here.
4229
4230         * class.cs (Method, Constructor, Property): Pass expected return
4231         type to EmitContext.
4232
4233 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
4234
4235         * expression.cs: Make DoResolve take an EmitContext instead of a
4236         TypeContainer.
4237
4238         Replaced `l' and `location' for `loc', for consistency.
4239         
4240         (Error, Warning): Remove unneeded Tc argument.
4241
4242         * assign.cs, literal.cs, constant.cs: Update to new calling
4243         convention. 
4244         
4245         * codegen.cs: EmitContext now contains a flag indicating whether
4246         code is being generated in a static method or not.
4247
4248         * cs-parser.jay: DecomposeQI, new function that replaces the old
4249         QualifiedIdentifier.  Now we always decompose the assembled
4250         strings from qualified_identifier productions into a group of
4251         memberaccesses.
4252
4253 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
4254
4255         * rootcontext.cs: Deal with field-less struct types correctly now
4256         by passing the size option to Define Type.
4257
4258         * class.cs: Removed hack that created one static field. 
4259
4260 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
4261
4262         * statement.cs: Moved most of the code generation here. 
4263
4264 2001-10-09  Ravi Pratap  <ravi@ximian.com>
4265
4266         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
4267         seem very right.
4268
4269         (ElementAccess): Remove useless bits for now - keep checks as the spec
4270         says.
4271
4272 2001-10-08  Ravi Pratap  <ravi@ximian.com>
4273
4274         * expression.cs (ElementAccess::DoResolve): Remove my crap code
4275         and start performing checks according to the spec.
4276
4277 2001-10-07  Ravi Pratap  <ravi@ximian.com>
4278
4279         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
4280         rank_specifiers instead.
4281
4282         (rank_specifiers): Change the order in which the rank specifiers are stored
4283
4284         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
4285
4286         * expression.cs (ElementAccess): Implement the LValue interface too.
4287         
4288 2001-10-06  Ravi Pratap  <ravi@ximian.com>
4289         
4290         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
4291         except that user defined conversions are not included.
4292
4293         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
4294         perform the conversion of the return type, if necessary.
4295
4296         (New::DoResolve): Check whether we are creating an array or an object
4297         and accordingly do the needful.
4298
4299         (New::Emit): Same here.
4300
4301         (New::DoResolve): Implement guts of array creation.
4302
4303         (New::FormLookupType): Helper function.
4304
4305 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
4306
4307         * codegen.cs: Removed most of the code generation here, and move the
4308         corresponding code generation bits to the statement classes. 
4309
4310         Added support for try/catch/finalize and throw.
4311         
4312         * cs-parser.jay: Added support for try/catch/finalize.
4313
4314         * class.cs: Catch static methods having the flags override,
4315         virtual or abstract.
4316
4317         * expression.cs (UserCast): This user cast was not really doing
4318         what it was supposed to do.  Which is to be born in fully resolved
4319         state.  Parts of the resolution were being performed at Emit time! 
4320
4321         Fixed this code.
4322
4323 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
4324
4325         * expression.cs: Implicity convert the result from UserCast.
4326
4327 2001-10-05  Ravi Pratap  <ravi@ximian.com>
4328
4329         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
4330         prevented it from working correctly. 
4331
4332         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
4333         merely ConvertImplicit.
4334
4335 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
4336
4337         * typemanager.cs: Make the LookupTypeContainer function static,
4338         and not per-instance.  
4339
4340         * class.cs: Make static FindMembers (the one that takes a Type
4341         argument). 
4342
4343         * codegen.cs: Add EmitForeach here.
4344
4345         * cs-parser.jay: Make foreach a toplevel object instead of the
4346         inline expansion, as we need to perform semantic analysis on it. 
4347
4348 2001-10-05  Ravi Pratap  <ravi@ximian.com>
4349
4350         * expression.cs (Expression::ImplicitUserConversion): Rename to
4351         UserDefinedConversion.
4352
4353         (Expression::UserDefinedConversion): Take an extra argument specifying 
4354         whether we look for explicit user conversions too.
4355
4356         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
4357
4358         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
4359
4360         (ExplicitUserConversion): Make it a call to UserDefinedConversion
4361         with the appropriate arguments.
4362
4363         * cs-parser.jay (cast_expression): Record location too.
4364
4365         * expression.cs (Cast): Record location info.
4366
4367         (Expression::ConvertExplicit): Take location argument.
4368
4369         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
4370         to determine if we are doing explicit conversions.
4371
4372         (UserCast::Emit): Update accordingly.
4373
4374         (Expression::ConvertExplicit): Report an error if everything fails.
4375
4376         * ../errors/cs0030.cs : Add.
4377
4378 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
4379
4380         * modifiers.cs: If the ABSTRACT keyword is present, also set the
4381         virtual and newslot bits. 
4382
4383         * class.cs (TypeContainer::RegisterRequiredImplementations):
4384         Record methods we need.
4385
4386         (TypeContainer::MakeKey): Helper function to make keys for
4387         MethodBases, since the Methodbase key is useless.
4388
4389         (TypeContainer::Populate): Call RegisterRequiredImplementations
4390         before defining the methods.   
4391
4392         Create a mapping for method_builders_to_methods ahead of time
4393         instead of inside a tight loop.
4394
4395         (::RequireMethods):  Accept an object as the data to set into the
4396         hashtable so we can report interface vs abstract method mismatch.
4397
4398 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
4399
4400         * report.cs: Make all of it static.
4401
4402         * rootcontext.cs: Drop object_type and value_type computations, as
4403         we have those in the TypeManager anyways.
4404
4405         Drop report instance variable too, now it is a global.
4406
4407         * driver.cs: Use try/catch on command line handling.
4408
4409         Add --probe option to debug the error reporting system with a test
4410         suite. 
4411
4412         * report.cs: Add support for exiting program when a probe
4413         condition is reached.
4414
4415 2001-10-03  Ravi Pratap  <ravi@ximian.com>
4416
4417         * expression.cs (Binary::DoNumericPromotions): Fix the case when
4418         we do a forcible conversion regardless of type, to check if 
4419         ForceConversion returns a null.
4420
4421         (Binary::error19): Use location to report error.
4422
4423         (Unary::error23): Use location here too.
4424
4425         * ../errors/cs0019.cs : Check in.
4426
4427         * ../errors/cs0023.cs : Check in.
4428
4429         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
4430         case of a non-null MethodInfo object with a length of 0 !
4431
4432         (Binary::ResolveOperator): Flag error if overload resolution fails to find
4433         an applicable member - according to the spec :-)
4434         Also fix logic to find members in base types.
4435
4436         (Unary::ResolveOperator): Same here.
4437
4438         (Unary::report23): Change name to error23 and make first argument a TypeContainer
4439         as I was getting thoroughly confused between this and error19 :-)
4440         
4441         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
4442         (::FindMostEncompassedType): Implement.
4443         (::FindMostEncompassingType): Implement.
4444         (::StandardConversionExists): Implement.
4445
4446         (UserImplicitCast): Re-vamp. We now need info about most specific
4447         source and target types so that we can do the necessary conversions.
4448
4449         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
4450         mathematical union with no duplicates.
4451
4452 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
4453
4454         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
4455         in order from base classes to child classes, so that we can in
4456         child classes look up in our parent for method names and
4457         attributes (required for handling abstract, virtual, new, override
4458         constructs: we need to instrospect our base class, and if we dont
4459         populate the classes in order, the introspection might be
4460         incorrect.  For example, a method could query its parent before
4461         the parent has any methods and would determine that the parent has
4462         no abstract methods (while it could have had them)).
4463
4464         (RootContext::CreateType): Record the order in which we define the
4465         classes.
4466
4467 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
4468
4469         * class.cs (TypeContainer::Populate): Also method definitions can
4470         fail now, keep track of this.
4471
4472         (TypeContainer::FindMembers): Implement support for
4473         DeclaredOnly/noDeclaredOnly flag.
4474
4475         (Constructor::Emit) Return the ConstructorBuilder.
4476
4477         (Method::Emit) Return the MethodBuilder. 
4478         Check for abstract or virtual methods to be public.
4479
4480         * rootcontext.cs (RootContext::CreateType): Register all the
4481         abstract methods required for the class to be complete and the
4482         interface methods that must be implemented. 
4483
4484         * cs-parser.jay: Report error 501 (method requires body if it is
4485         not marked abstract or extern).
4486
4487         * expression.cs (TypeOf::Emit): Implement.
4488
4489         * typemanager.cs: runtime_handle_type, new global type.
4490
4491         * class.cs (Property::Emit): Generate code for properties.
4492
4493 2001-10-02  Ravi Pratap  <ravi@ximian.com>
4494
4495         * expression.cs (Unary::ResolveOperator): Find operators on base type
4496         too - we now conform exactly to the spec.
4497
4498         (Binary::ResolveOperator): Same here.
4499
4500         * class.cs (Operator::Define): Fix minor quirk in the tests.
4501
4502         * ../errors/cs0215.cs : Added.
4503
4504         * ../errors/cs0556.cs : Added.
4505
4506         * ../errors/cs0555.cs : Added.
4507
4508 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
4509
4510         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
4511         single integer which is really efficient
4512
4513 2001-10-01  Ravi Pratap  <ravi@ximian.com>
4514
4515         *  expression.cs (Expression::ImplicitUserConversion): Use location
4516         even in the case when we are examining True operators.
4517  
4518         * class.cs (Operator::Define): Perform extensive checks to conform
4519         with the rules for operator overloading in the spec.
4520
4521         * expression.cs (Expression::ImplicitReferenceConversion): Implement
4522         some of the other conversions mentioned in the spec.
4523
4524         * typemanager.cs (array_type): New static member for the System.Array built-in
4525         type.
4526
4527         (cloneable_interface): For System.ICloneable interface.
4528
4529         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
4530         we start resolving the tree and populating types.
4531
4532         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
4533  
4534 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
4535
4536         * expression.cs (Expression::ExprClassFromMemberInfo,
4537         Expression::Literalize): Create literal expressions from
4538         FieldInfos which are literals.
4539
4540         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
4541         type casts, because they were wrong.  The test suite in tests
4542         caught these ones.
4543
4544         (ImplicitNumericConversion): ushort to ulong requires a widening
4545         cast. 
4546
4547         Int32 constant to long requires widening cast as well.
4548
4549         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
4550         for integers because the type on the stack is not i4.
4551
4552 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
4553
4554         * expression.cs (report118): require location argument. 
4555
4556         * parameter.cs: Do not dereference potential null value.
4557
4558         * class.cs: Catch methods that lack the `new' keyword when
4559         overriding a name.  Report warnings when `new' is used without
4560         anything being there to override.
4561
4562         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
4563
4564         * class.cs: Only add constructor to hashtable if it is non-null
4565         (as now constructors can fail on define).
4566
4567         (TypeManager, Class, Struct): Take location arguments.
4568
4569         Catch field instance initialization in structs as errors.
4570
4571         accepting_filter: a new filter for FindMembers that is static so
4572         that we dont create an instance per invocation.
4573
4574         (Constructor::Define): Catch errors where a struct constructor is
4575         parameterless 
4576
4577         * cs-parser.jay: Pass location information for various new
4578         constructs. 
4579         
4580         * delegate.cs (Delegate): take a location argument.
4581
4582         * driver.cs: Do not call EmitCode if there were problesm in the
4583         Definition of the types, as many Builders wont be there. 
4584
4585         * decl.cs (Decl::Decl): Require a location argument.
4586
4587         * cs-tokenizer.cs: Handle properly hex constants that can not fit
4588         into integers, and find the most appropiate integer for it.
4589
4590         * literal.cs: Implement ULongLiteral.
4591
4592         * rootcontext.cs: Provide better information about the location of
4593         failure when CreateType fails.
4594         
4595 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
4596
4597         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
4598         as well.
4599
4600         * expression.cs (Binary::CheckShiftArguments): Add missing type
4601         computation.
4602         (Binary::ResolveOperator): Add type to the logical and and logical
4603         or, Bitwise And/Or and Exclusive Or code paths, it was missing
4604         before.
4605
4606         (Binary::DoNumericPromotions): In the case where either argument
4607         is ulong (and most signed types combined with ulong cause an
4608         error) perform implicit integer constant conversions as well.
4609
4610 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
4611
4612         * expression.cs (UserImplicitCast): Method should always be
4613         non-null. 
4614         (Invocation::BetterConversion): Simplified test for IntLiteral.
4615
4616         (Expression::ImplicitNumericConversion): Split this routine out.
4617         Put the code that performs implicit constant integer conversions
4618         here. 
4619
4620         (Expression::Resolve): Become a wrapper around DoResolve so we can
4621         check eclass and type being set after resolve.
4622
4623         (Invocation::Badness): Remove this dead function
4624
4625         (Binary::ResolveOperator): Do not compute the expensive argumnets
4626         unless we have a union for it.
4627
4628         (Probe::Emit): Is needs to do an isinst and then
4629         compare against null.
4630
4631         (::CanConvert): Added Location argument.  If the Location argument
4632         is null (Location.Null), then we do not report errors.  This is
4633         used by the `probe' mechanism of the Explicit conversion.  We do
4634         not want to generate an error for something that the user
4635         explicitly requested to be casted.  But the pipeline for an
4636         explicit cast first tests for potential implicit casts.
4637
4638         So for now, if the Location is null, it means `Probe only' to
4639         avoid adding another argument.   Might have to revise this
4640         strategy later.
4641
4642         (ClassCast): New class used to type cast objects into arbitrary
4643         classes (used in Explicit Reference Conversions).
4644
4645         Implement `as' as well.
4646
4647         Reverted all the patches from Ravi below: they were broken:
4648
4649                 * The use of `level' as a mechanism to stop recursive
4650                   invocations is wrong.  That was there just to catch the
4651                   bug with a strack trace but not as a way of addressing
4652                   the problem.
4653
4654                   To fix the problem we have to *understand* what is going
4655                   on and the interactions and come up with a plan, not
4656                   just get things going.
4657
4658                 * The use of the type conversion cache that I proposed
4659                   last night had an open topic: How does this work across
4660                   protection domains.  A user defined conversion might not
4661                   be public in the location where we are applying the
4662                   conversion, a different conversion might be selected
4663                   (ie, private A->B (better) but public B->A (worse),
4664                   inside A, A->B applies, but outside it, B->A will
4665                   apply).
4666
4667                 * On top of that (ie, even if the above is solved),
4668                   conversions in a cache need to be abstract.  Ie, `To
4669                   convert from an Int to a Short use an OpcodeCast', not
4670                   `To convert from an Int to a Short use the OpcodeCast on
4671                   the variable 5' (which is what this patch was doing).
4672         
4673 2001-09-28  Ravi Pratap  <ravi@ximian.com>
4674
4675         * expression.cs (Invocation::ConversionExists): Re-write to use
4676         the conversion cache
4677         
4678         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
4679         cache all conversions done, not just user-defined ones.
4680
4681         (Invocation::BetterConversion): The real culprit. Use ConversionExists
4682         to determine if a conversion exists instead of acutually trying to 
4683         perform the conversion. It's faster too.
4684
4685         (Expression::ConvertExplicit): Modify to use ConversionExists to check
4686         and only then attempt the implicit conversion.
4687
4688 2001-09-28  Ravi Pratap  <ravi@ximian.com>
4689
4690         * expression.cs (ConvertImplicit): Use a cache for conversions
4691         already found. Check level of recursion and bail out if necessary.
4692         
4693 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
4694
4695         * typemanager.cs (string_concat_string_string, string_concat_object_object):
4696         Export standard methods that we expect for string operations.
4697         
4698         * statement.cs (Block::UsageWarning): Track usage of variables and
4699         report the errors for not used variables.
4700
4701         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
4702         operator. 
4703
4704 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
4705
4706         * codegen.cs: remove unnneded code 
4707
4708         * expression.cs: Removed BuiltinTypeAccess class
4709
4710         Fix the order in which implicit conversions are
4711         done.  
4712
4713         The previous fixed dropped support for boxed conversions (adding a
4714         test to the test suite now)
4715
4716         (UserImplicitCast::CanConvert): Remove test for source being null,
4717         that code is broken.  We should not feed a null to begin with, if
4718         we do, then we should track the bug where the problem originates
4719         and not try to cover it up here.
4720
4721         Return a resolved expression of type UserImplicitCast on success
4722         rather than true/false.  Ravi: this is what I was talking about,
4723         the pattern is to use a static method as a "constructor" for
4724         objects. 
4725
4726         Also, do not create arguments until the very last minute,
4727         otherwise we always create the arguments even for lookups that
4728         will never be performed. 
4729
4730         (UserImplicitCast::Resolve): Eliminate, objects of type
4731         UserImplicitCast are born in a fully resolved state. 
4732         
4733         * typemanager.cs (InitCoreTypes): Init also value_type
4734         (System.ValueType). 
4735
4736         * expression.cs (Cast::Resolve): First resolve the child expression.
4737
4738         (LValue): Add new method AddressOf to be used by
4739         the `&' operator.  
4740
4741         Change the argument of Store to take an EmitContext instead of an
4742         ILGenerator, because things like FieldExpr need to be able to call
4743         their children expression to generate the instance code. 
4744
4745         (Expression::Error, Expression::Warning): Sugar functions for
4746         reporting errors.
4747
4748         (Expression::MemberLookup): Accept a TypeContainer instead of a
4749         Report as the first argument.
4750
4751         (Expression::ResolvePrimary): Killed.  I still want to improve
4752         this as currently the code is just not right.
4753
4754         (Expression::ResolveMemberAccess): Simplify, but it is still
4755         wrong. 
4756
4757         (Unary::Resolve): Catch errors in AddressOf operators.
4758
4759         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
4760         index to a byte for the short-version, or the compiler will choose
4761         the wrong Emit call, which generates the wrong data.
4762
4763         (ParameterReference::Emit, ::Store): same.
4764
4765         (FieldExpr::AddressOf): Implement.
4766         
4767         * typemanager.cs: TypeManager: made public variable instead of
4768         property.
4769         
4770         * driver.cs: document --fatal.
4771
4772         * report.cs (ErrorMessage, WarningMessage): new names for the old
4773         Error and Warning classes.
4774
4775         * cs-parser.jay (member_access): Turn built-in access to types
4776         into a normal simplename
4777
4778 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4779
4780         * expression.cs (Invocation::BetterConversion): Fix to cope
4781         with q being null, since this was introducing a bug.
4782
4783         * expression.cs (ConvertImplicit): Do built-in conversions first.
4784
4785 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4786
4787         * expression.cs (UserImplicitCast::Resolve): Fix bug.
4788
4789 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4790
4791         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
4792         I had introduced long ago (what's new ?).
4793
4794         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
4795         the work of all the checking. 
4796         (ConvertImplicit): Call CanConvert and only then create object if necessary.
4797         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
4798
4799         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
4800         that is the right way. 
4801
4802         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
4803         overloading resolution. Use everywhere instead of cutting and pasting code.
4804
4805         (Binary::ResolveOperator): Use MakeUnionSet.
4806
4807         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
4808         we have to convert to bool types. Not complete yet.
4809         
4810 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
4811
4812         * typemanager.cs (TypeManager::CSharpName): support ushort.
4813
4814         * expression.cs (Expression::TryImplicitIntConversion): Attempts
4815         to provide an expression that performsn an implicit constant int
4816         conversion (section 6.1.6).
4817         (Expression::ConvertImplicitRequired): Reworked to include
4818         implicit constant expression conversions.
4819
4820         (Expression::ConvertNumericExplicit): Finished.
4821
4822         (Invocation::Emit): If InstanceExpression is null, then it means
4823         that we perform a call on this.
4824         
4825 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
4826
4827         * expression.cs (Unary::Emit): Remove some dead code.
4828         (Probe): Implement Resolve and Emit for `is'.
4829         (Expression::ConvertImplicitRequired): Attempt to do constant
4830         expression conversions here.  Maybe should be moved to
4831         ConvertImplicit, but I am not sure.
4832         (Expression::ImplicitLongConstantConversionPossible,
4833         Expression::ImplicitIntConstantConversionPossible): New functions
4834         that tell whether is it possible to apply an implicit constant
4835         expression conversion.
4836
4837         (ConvertNumericExplicit): Started work on explicit numeric
4838         conversions.
4839
4840         * cs-parser.jay: Update operator constants.
4841
4842         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
4843         (Parameters::GetSignature): Hook up VerifyArgs here.
4844         (Parameters::VerifyArgs): Verifies that no two arguments have the
4845         same name. 
4846
4847         * class.cs (Operator): Update the operator names to reflect the
4848         ones that the spec expects (as we are just stringizing the
4849         operator names).
4850         
4851         * expression.cs (Unary::ResolveOperator): Fix bug: Use
4852         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
4853         previous usage did only work for our methods.
4854         (Expression::ConvertImplicit): Handle decimal implicit numeric
4855         conversions as well.
4856         (Expression::InternalTypeConstructor): Used to invoke constructors
4857         on internal types for default promotions.
4858
4859         (Unary::Emit): Implement special handling for the pre/post
4860         increment/decrement for overloaded operators, as they need to have
4861         the same semantics as the other operators.
4862
4863         (Binary::ResolveOperator): ditto.
4864         (Invocation::ConversionExists): ditto.
4865         (UserImplicitCast::Resolve): ditto.
4866         
4867 2001-09-26  Ravi Pratap  <ravi@ximian.com>
4868
4869         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
4870         operator, return after emitting body. Regression tests pass again !
4871
4872         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
4873         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
4874         (Invocation::OverloadResolve): Ditto.
4875         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
4876
4877         * everywhere : update calls to the above methods accordingly.
4878
4879 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
4880
4881         * assign.cs (Assign): Make it inherit from ExpressionStatement.
4882
4883         * expression.cs (ExpressionStatement): New base class used for
4884         expressions that can appear in statements, so that we can provide
4885         an alternate path to generate expression that do not leave a value
4886         on the stack.
4887
4888         (Expression::Emit, and all the derivatives): We no longer return
4889         whether a value is left on the stack or not.  Every expression
4890         after being emitted leaves a single value on the stack.
4891
4892         * codegen.cs (EmitContext::EmitStatementExpression): Use the
4893         facilties of ExpressionStatement if possible.
4894
4895         * cs-parser.jay: Update statement_expression.
4896
4897 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
4898
4899         * driver.cs: Change the wording of message
4900
4901 2001-09-25  Ravi Pratap  <ravi@ximian.com>
4902
4903         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
4904         the type of the expression to the return type of the method if
4905         we have an overloaded operator match ! The regression tests pass again !
4906         (Unary::ResolveOperator): Ditto.
4907
4908         * expression.cs (Invocation::ConversionExists): Correct the member lookup
4909         to find "op_Implicit", not "implicit" ;-)
4910         (UserImplicitCast): New class to take care of user-defined implicit conversions.
4911         (ConvertImplicit, ForceConversion): Take TypeContainer argument
4912
4913         * everywhere : Correct calls to the above accordingly.
4914
4915         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
4916         (ConvertImplicit): Do user-defined conversion if it exists.
4917
4918 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
4919
4920         * assign.cs: track location.
4921         (Resolve): Use implicit conversions on assignment.
4922
4923         * literal.cs: Oops.  Not good, Emit of short access values should
4924         pass (Bytes) or the wrong argument will be selected.
4925
4926         * expression.cs (Unary::Emit): Emit code for -expr.
4927         
4928         (Unary::ResolveOperator): Handle `Substract' for non-constants
4929         (substract from zero from the non-constants).
4930         Deal with Doubles as well. 
4931         
4932         (Expression::ConvertImplicitRequired): New routine that reports an
4933         error if no implicit conversion exists. 
4934
4935         (Invocation::OverloadResolve): Store the converted implicit
4936         expressions if we make them
4937         
4938 2001-09-24  Ravi Pratap  <ravi@ximian.com>
4939
4940         * class.cs (ConstructorInitializer): Take a Location argument.
4941         (ConstructorBaseInitializer): Same here.
4942         (ConstructorThisInitializer): Same here.
4943
4944         * cs-parser.jay : Update all calls accordingly.
4945
4946         * expression.cs (Unary, Binary, New): Take location argument.
4947         Update accordingly everywhere.
4948
4949         * cs-parser.jay : Update all calls to the above to take a location
4950         argument.
4951
4952         * class.cs : Ditto.
4953
4954 2001-09-24  Ravi Pratap  <ravi@ximian.com>
4955
4956         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
4957         (Invocation::BetterConversion): Same here
4958         (Invocation::ConversionExists): Ditto.
4959
4960         (Invocation::ConversionExists): Implement.
4961
4962 2001-09-22  Ravi Pratap  <ravi@ximian.com>
4963
4964         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
4965         Also take an additional TypeContainer argument.
4966
4967         * All over : Pass in TypeContainer as argument to OverloadResolve.
4968
4969         * typemanager.cs (CSharpName): Update to check for the string type and return
4970         that too.
4971
4972         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
4973         a given method.
4974         
4975 2001-09-21  Ravi Pratap  <ravi@ximian.com>
4976
4977         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
4978         (Invocation::BetterFunction): Implement.
4979         (Invocation::BetterConversion): Implement.
4980         (Invocation::ConversionExists): Skeleton, no implementation yet.
4981
4982         Okay, things work fine !
4983
4984 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
4985
4986         * typemanager.cs: declare and load enum_type, delegate_type and
4987         void_type. 
4988
4989         * expression.cs (Expression::Emit): Now emit returns a value that
4990         tells whether a value is left on the stack or not.  This strategy
4991         might be reveted tomorrow with a mechanism that would address
4992         multiple assignments.
4993         (Expression::report118): Utility routine to report mismatches on
4994         the ExprClass.
4995
4996         (Unary::Report23): Report impossible type/operator combination
4997         utility function.
4998
4999         (Unary::IsIncrementableNumber): Whether the type can be
5000         incremented or decremented with add.
5001         (Unary::ResolveOperator): Also allow enumerations to be bitwise
5002         complemented. 
5003         (Unary::ResolveOperator): Implement ++, !, ~,
5004
5005         (Invocation::Emit): Deal with new Emit convetion.
5006         
5007         * All Expression derivatives: Updated their Emit method to return
5008         whether they leave values on the stack or not.
5009         
5010         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
5011         stack for expressions that are statements. 
5012
5013 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
5014
5015         * expression.cs (LValue): New interface.  Must be implemented by
5016         LValue objects.
5017         (LocalVariableReference, ParameterReference, FieldExpr): Implement
5018         LValue interface.
5019         
5020         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
5021         interface for generating code, simplifies the code.
5022
5023 2001-09-20  Ravi Pratap  <ravi@ximian.com>
5024
5025         * expression.cs (everywhere): Comment out return statements in ::Resolve
5026         methods to avoid the warnings.
5027
5028 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
5029
5030         * driver.cs (parse): Report error 2001 if we can not open the
5031         source file.
5032
5033         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
5034         not resolve it.
5035
5036         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
5037         object. 
5038
5039         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
5040         otherwise nested blocks end up with the same index.
5041
5042         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
5043
5044         * expression.cs:  Instead of having FIXMEs in the Resolve
5045         functions, throw exceptions so it is obvious that we are facing a
5046         bug. 
5047
5048         * cs-parser.jay (invocation_expression): Pass Location information.
5049
5050         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
5051         Use a basename for those routines because .NET does not like paths
5052         on them. 
5053
5054         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
5055         already defined.
5056
5057 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
5058
5059         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
5060         are loading the correct data types (throws an exception if not).
5061         (TypeManager::InitCoreTypes): Use CoreLookupType
5062
5063         * expression.cs (Unary::ResolveOperator): return the child
5064         expression for expressions which are just +expr.
5065         (Unary::ResolveOperator): Return negative literals for -LITERAL
5066         expressions (otherwise they are Unary {Literal}).
5067         (Invocation::Badness): Take into account `Implicit constant
5068         expression conversions'.
5069
5070         * literal.cs (LongLiteral): Implement long literal class.
5071         (IntLiteral): export the `Value' of the intliteral. 
5072
5073 2001-09-19  Ravi Pratap  <ravi@ximian.com>
5074
5075         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
5076
5077         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
5078         instead of 'Operator'
5079
5080         * expression.cs (Binary::ResolveOperator): Update accordingly.
5081         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
5082         and 'Minus'
5083
5084         * cs-parser.jay (unary_expression): Update to use the new names.
5085
5086         * gen-treedump.cs (GetUnary): Same here.
5087
5088         * expression.cs (Unary::Resolve): Implement.
5089         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
5090         operators are found instead of making noise ;-)
5091         (Unary::ResolveOperator): New method to do precisely the same thing which
5092         Binary::ResolveOperator does for Binary expressions.
5093         (Unary.method, .Arguments): Add.
5094         (Unary::OperName): Implement.   
5095         (Unary::ForceConversion): Copy and Paste !
5096
5097         * class.cs (Operator::Define): Fix a small bug for the case when we have 
5098         a unary operator.
5099
5100         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
5101         for the inbuilt operators. Only overloading works for now ;-)
5102
5103 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
5104
5105         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
5106         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
5107
5108         * expression.cs (This::Emit): Implement. 
5109         (This::Resolve): Implement.
5110         (TypeOf:Resolve): Implement.
5111         (Expression::ResolveSimpleName): Add an implicit this to instance
5112         field references. 
5113         (MemberAccess::Resolve): Deal with Parameters and Fields. 
5114         Bind instance variable to Field expressions.
5115         (FieldExpr::Instance): New field used to track the expression that
5116         represents the object instance.
5117         (FieldExpr::Resolve): Track potential errors from MemberLookup not
5118         binding 
5119         (FieldExpr::Emit): Implement.
5120
5121         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
5122         the last instruction contains a return opcode to avoid generating
5123         the last `ret' instruction (this generates correct code, and it is
5124         nice to pass the peverify output).
5125
5126         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
5127         initializer for static and instance variables.
5128         (Constructor::Emit): Allow initializer to be null in the case of
5129         static constructors.  Only emit initializer for instance
5130         constructors. 
5131
5132         (TypeContainer::FindMembers): Return a null array if there are no
5133         matches.
5134
5135         Also fix the code for the MemberTypes.Method branch, as it was not
5136         scanning that for operators (or tried to access null variables before).
5137
5138         * assign.cs (Assign::Emit): Handle instance and static fields. 
5139
5140         * TODO: Updated.
5141
5142         * driver.cs: Stop compilation if there are parse errors.
5143
5144         * cs-parser.jay (constructor_declaration): Provide default base
5145         initializer for non-static constructors.
5146         (constructor_declarator): Do not provide a default base
5147         initializers if none was specified.
5148         Catch the fact that constructors should not have parameters.
5149
5150         * class.cs: Do not emit parent class initializers for static
5151         constructors, that should be flagged as an error.
5152
5153 2001-09-18  Ravi Pratap  <ravi@ximian.com>
5154
5155         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
5156         Move back code into TypeContainer::Populate.
5157
5158 2001-09-18  Ravi Pratap  <ravi@ximian.com>
5159
5160         * class.cs (TypeContainer::AddConstructor): Fix the check to
5161         compare against Name, not Basename. 
5162         (Operator::OpType): Change Plus and Minus to Add and Subtract.
5163
5164         * cs-parser.jay : Update accordingly.
5165
5166         * class.cs (TypeContainer::FindMembers): For the case where we are searching
5167         for methods, don't forget to look into the operators too.
5168         (RegisterMethodBuilder): Helper method to take care of this for
5169         methods, constructors and operators.
5170         (Operator::Define): Completely revamp.
5171         (Operator.OperatorMethod, MethodName): New fields.
5172         (TypeContainer::Populate): Move the registering of builders into
5173         RegisterMethodBuilder.
5174         (Operator::Emit): Re-write.
5175
5176         * expression.cs (Binary::Emit): Comment out code path to emit method
5177         invocation stuff for the case when we have a user defined operator. I am
5178         just not able to get it right !
5179         
5180 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
5181
5182         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
5183         argument. 
5184
5185         (Expression::MemberLookup): Provide a version that allows to
5186         specify the MemberTypes and BindingFlags. 
5187
5188         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
5189         so it was not fetching variable information from outer blocks.
5190
5191         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
5192         Beforefieldinit as it was buggy.
5193
5194         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
5195         that Ravi put here.  
5196
5197         * class.cs (Constructor::Emit): Only emit if block is not null.
5198         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
5199         deal with this by semantically definining it as if the user had
5200         done it.
5201
5202         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
5203         constructors as we now "emit" them at a higher level.
5204
5205         (TypeContainer::DefineDefaultConstructor): Used to define the
5206         default constructors if none was provided.
5207
5208         (ConstructorInitializer): Add methods Resolve and Emit. 
5209         
5210         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
5211
5212 2001-09-17  Ravi Pratap  <ravi@ximian.com>
5213
5214         * class.cs (TypeContainer::EmitDefaultConstructor): Register
5215         the default constructor builder with our hashtable for methodbuilders
5216         to methodcores.
5217
5218         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
5219         and argument_count is 0 in which case we have a match.
5220         (Binary::ResolveOperator): More null checking and miscellaneous coding
5221         style cleanup.
5222
5223 2001-09-17  Ravi Pratap  <ravi@ximian.com>
5224
5225         * rootcontext.cs (IsNameSpace): Compare against null.
5226
5227         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
5228
5229         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
5230         and Unary::Operator.
5231
5232         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
5233         accordingly.
5234
5235         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
5236         we have overloaded operators.
5237         (Binary::ResolveOperator): Implement the part which does the operator overload
5238         resolution.
5239
5240         * class.cs (Operator::Emit): Implement.
5241         (TypeContainer::Emit): Emit the operators we have too.
5242
5243         * expression.cs (Binary::Emit): Update to emit the appropriate code for
5244         the case when we have a user-defined operator.
5245         
5246 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
5247
5248         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
5249
5250 2001-09-16  Ravi Pratap  <ravi@ximian.com>
5251
5252         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
5253         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
5254         (Constructor::Emit): Implement.
5255         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
5256         if we have no work to do. 
5257         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
5258         Emit method.
5259
5260         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
5261         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
5262
5263         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
5264         of parent.parent.
5265
5266 2001-09-15  Ravi Pratap  <ravi@ximian.com>
5267
5268         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
5269         in the source.
5270         (Tree::RecordNamespace): Method to do what the name says ;-)
5271         (Tree::Namespaces): Property to get at the namespaces hashtable.
5272
5273         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
5274         keep track.
5275
5276         * rootcontext.cs (IsNamespace): Fixed it :-)
5277
5278 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
5279
5280         * class.cs (TypeContainer::FindMembers): Add support for
5281         constructors. 
5282         (MethodCore): New class that encapsulates both the shared aspects
5283         of a Constructor and a Method.  
5284         (Method, Constructor): Factored pieces into MethodCore.
5285
5286         * driver.cs: Added --fatal which makes errors throw exceptions.
5287         Load System assembly as well as part of the standard library.
5288
5289         * report.cs: Allow throwing exceptions on errors for debugging.
5290
5291         * modifiers.cs: Do not use `parent', instead use the real type
5292         container to evaluate permission settings.
5293
5294         * class.cs: Put Ravi's patch back in.  He is right, and we will
5295         have to cope with the
5296
5297 2001-09-14  Ravi Pratap  <ravi@ximian.com>
5298
5299         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
5300         FamORAssem, not FamANDAssem.
5301         
5302 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
5303
5304         * driver.cs: Added --parse option that only parses its input files
5305         and terminates.
5306
5307         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
5308         incorrect.  IsTopLevel is not used to tell whether an object is
5309         root_types or not (that can be achieved by testing this ==
5310         root_types).  But to see if this is a top-level *class* (not
5311         necessarly our "toplevel" container). 
5312
5313 2001-09-14  Ravi Pratap  <ravi@ximian.com>
5314
5315         * enum.cs (Enum::Define): Modify to call the Lookup method on the
5316         parent instead of a direct call to GetType.
5317
5318 2001-09-14  Ravi Pratap  <ravi@ximian.com>
5319
5320         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
5321         Modifiers.TypeAttr. This should just be a call to that method.
5322
5323         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
5324         object so that we can determine if we are top-level or not.
5325
5326         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
5327         TypeContainer too.
5328
5329         * enum.cs (Enum::Define): Ditto.
5330
5331         * modifiers.cs (FieldAttr): Re-write.
5332
5333         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
5334         (TypeContainer::HaveStaticConstructor): New property to provide access
5335         to precisely that info.
5336
5337         * modifiers.cs (MethodAttr): Re-write.
5338         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
5339
5340         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
5341         of top-level types as claimed.
5342         
5343 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
5344
5345         * expression.cs (MemberLookup): Fruitless attempt to lookup
5346         constructors.  Maybe I need to emit default constructors?  That
5347         might be it (currently .NET emits this for me automatically).
5348         (Invocation::OverloadResolve): Cope with Arguments == null.
5349         (Invocation::EmitArguments): new function, shared by the new
5350         constructor and us.
5351         (Invocation::Emit): Handle static and instance methods.  Emit
5352         proper call instruction for virtual or non-virtual invocations.
5353         (New::Emit): Implement.
5354         (New::Resolve): Implement.
5355         (MemberAccess:Resolve): Implement.
5356         (MethodGroupExpr::InstanceExpression): used conforming to the spec
5357         to track instances.
5358         (FieldExpr::Resolve): Set type.
5359
5360         * support.cs: Handle empty arguments.
5361                 
5362         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
5363         SimpleLookup): Auxiliary routines to help parse a qualifier
5364         identifier.  
5365
5366         Update qualifier_identifier rule.
5367
5368         * codegen.cs: Removed debugging messages.
5369
5370         * class.cs: Make this a global thing, this acts just as a "key" to
5371         objects that we might have around.
5372
5373         (Populate): Only initialize method_builders_to_methods once.
5374
5375         * expression.cs (PropertyExpr): Initialize type from the
5376         PropertyType. 
5377
5378         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
5379         Resolve pattern.  Attempt to implicitly convert value to boolean.
5380         Emit code.
5381
5382         * expression.cs: Set the type for the int32/int32 argument case.
5383         (Binary::ResolveOperator): Set the return type to boolean for
5384         comparission operators
5385
5386         * typemanager.cs: Remove debugging print code.
5387
5388         (Invocation::Resolve): resolve type.
5389
5390         * class.cs: Allocate a MemberInfo of the correct size, as the code
5391         elsewhere depends on the test to reflect the correct contents.
5392
5393         (Method::) Keep track of parameters, due to System.Reflection holes
5394
5395         (TypeContainer::Populate): Keep track of MethodBuilders to Method
5396         mapping here.
5397
5398         (TypeContainer::FindMembers): Use ArrayList and then copy an array
5399         of the exact size and return that.
5400
5401         (Class::LookupMethodByBuilder): New function that maps
5402         MethodBuilders to its methods.  Required to locate the information
5403         on methods because System.Reflection bit us again.
5404
5405         * support.cs: New file, contains an interface ParameterData and
5406         two implementations: ReflectionParameters and InternalParameters
5407         used to access Parameter information.  We will need to grow this
5408         as required.
5409
5410         * expression.cs (Invocation::GetParameterData): implement a cache
5411         and a wrapper around the ParameterData creation for methods. 
5412         (Invocation::OverloadResolve): Use new code.
5413
5414 2001-09-13  Ravi Pratap  <ravi@ximian.com>
5415
5416         * class.cs (TypeContainer::EmitField): Remove and move into 
5417         (Field::Define): here and modify accordingly.
5418         (Field.FieldBuilder): New member.
5419         (TypeContainer::Populate): Update accordingly.
5420         (TypeContainer::FindMembers): Implement.
5421
5422 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
5423
5424         * statement.cs: (VariableInfo::VariableType): New field to be
5425         initialized with the full type once it is resolved. 
5426
5427 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
5428
5429         * parameter.cs (GetParameterInfo): Use a type cache to compute
5430         things only once, and to reuse this information
5431
5432         * expression.cs (LocalVariableReference::Emit): Implement.
5433         (OpcodeCast::Emit): fix.
5434
5435         (ParameterReference::Resolve): Implement.
5436         (ParameterReference::Emit): Implement.
5437
5438         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
5439         that are expressions need to stay as Expressions.
5440
5441         * typemanager.cs (CSharpName): Returns the C# name of a type if
5442         possible. 
5443
5444         * expression.cs (Expression::ConvertImplicit): New function that
5445         implements implicit type conversions.
5446
5447         (Expression::ImplicitReferenceConversion): Implements implicit
5448         reference conversions.
5449
5450         (EmptyCast): New type for transparent casts.
5451
5452         (OpcodeCast): New type for casts of types that are performed with
5453         a sequence of bytecodes.
5454         
5455         (BoxedCast): New type used for casting value types into reference
5456         types.  Emits a box opcode.
5457
5458         (Binary::DoNumericPromotions): Implements numeric promotions of
5459         and computation of the Binary::Type.
5460
5461         (Binary::EmitBranchable): Optimization.
5462
5463         (Binary::Emit): Implement code emission for expressions.
5464         
5465         * typemanager.cs (TypeManager): Added two new core types: sbyte
5466         and byte.
5467
5468 2001-09-12  Ravi Pratap  <ravi@ximian.com>
5469
5470         * class.cs (TypeContainer::FindMembers): Method which does exactly
5471         what Type.FindMembers does, only we don't have to use reflection. No
5472         implementation yet.
5473
5474         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
5475         typecontainer objects as we need to get at them.
5476         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
5477
5478         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
5479         typecontainer object.
5480
5481         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
5482         of just a Report object.
5483
5484 2001-09-11  Ravi Pratap  <ravi@ximian.com>
5485
5486         * class.cs (Event::Define): Go back to using the prefixes "add_" and
5487         "remove_"
5488         (TypeContainer::Populate): Now define the delegates of the type too.
5489         (TypeContainer.Delegates): Property to access the list of delegates defined
5490         in the type.
5491
5492         * delegates.cs (Delegate::Define): Implement partially.
5493
5494         * modifiers.cs (TypeAttr): Handle more flags.
5495
5496 2001-09-11  Ravi Pratap  <ravi@ximian.com>
5497
5498         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
5499         and not <=
5500         (Operator::Define): Re-write logic to get types by using the LookupType method
5501         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
5502         (Indexer::Define): Ditto.
5503         (Event::Define): Ditto.
5504         (Property::Define): Ditto.
5505         
5506 2001-09-10  Ravi Pratap  <ravi@ximian.com>
5507
5508         * class.cs (TypeContainer::Populate): Now define operators too. 
5509         (TypeContainer.Operators): New property to access the list of operators
5510         in a type.
5511         (Operator.OperatorMethodBuilder): New member to hold the method builder
5512         for the operator we are defining.
5513         (Operator::Define): Implement.
5514
5515 2001-09-10  Ravi Pratap  <ravi@ximian.com>
5516
5517         * class.cs (Event::Define): Make the prefixes of the accessor methods
5518         addOn_ and removeOn_ 
5519
5520         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
5521         of the location being passed in too. Ideally, this should go later since all
5522         error reporting should be done through the Report object.
5523
5524         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
5525         (Populate): Iterate thru the indexers we have and define them too.
5526         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
5527         for the get and set accessors.
5528         (Indexer::Define): Implement.
5529         
5530 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
5531
5532         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
5533         my previous implementation, did not work.
5534
5535         * typemanager.cs: Add a couple of missing types (the longs).
5536
5537         * literal.cs: Use TypeManager.bool_type instead of getting it.
5538
5539         * expression.cs (EventExpr): New kind of expressions.
5540         (Expressio::ExprClassFromMemberInfo): finish
5541
5542 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
5543
5544         * assign.cs: Emit stores to static fields differently.
5545
5546 2001-09-08  Ravi Pratap  <ravi@ximian.com>
5547
5548         * Merge in changes and adjust code to tackle conflicts. Backed out my
5549         code in Assign::Resolve ;-) 
5550
5551 2001-09-08  Ravi Pratap  <ravi@ximian.com>
5552
5553         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
5554         instead Report.Error and also pass in the location.
5555         (CSharpParser::Lexer): New readonly property to return the reference
5556         to the Tokenizer object.
5557         (declare_local_variables): Use Report.Error with location instead of plain 
5558         old error.
5559         (CheckDef): Ditto.
5560
5561         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
5562         (Operator.CheckBinaryOperator): Ditto.
5563
5564         * cs-parser.jay (operator_declarator): Update accordingly.
5565
5566         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
5567         (CheckBinaryOperator): Same here.
5568
5569         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
5570         on the name without any prefixes of namespace names etc. This is because we
5571         already might have something already fully qualified like 
5572         'System.Console.WriteLine'
5573
5574         * assign.cs (Resolve): Begin implementation. Stuck ;-)
5575
5576 2001-09-07  Ravi Pratap  <ravi@ximian.com>
5577
5578         * cs-tokenizer.cs (location): Return a string which also contains
5579         the file name.
5580
5581         * expression.cs (ElementAccess): New class for expressions of the
5582         type 'element access.'
5583         (BaseAccess): New class for expressions of the type 'base access.'
5584         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
5585         respectively.
5586         
5587         * cs-parser.jay (element_access): Implement action.
5588         (base_access): Implement actions.
5589         (checked_expression, unchecked_expression): Implement.
5590
5591         * cs-parser.jay (local_variable_type): Correct and implement.
5592         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
5593
5594         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
5595
5596         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
5597         name and the specifiers.
5598
5599         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
5600         
5601         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
5602         making them all public ;-)
5603
5604         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
5605         class anyways.
5606         
5607 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
5608
5609         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
5610         PropertyExprs.
5611         (FieldExpr, PropertyExprs): New resolved expressions.
5612         (SimpleName::MemberStaticCheck): Perform static checks for access
5613         to non-static fields on static methods. Maybe this should be
5614         generalized for MemberAccesses. 
5615         (SimpleName::ResolveSimpleName): More work on simple name
5616         resolution. 
5617
5618         * cs-parser.jay (primary_expression/qualified_identifier): track
5619         the parameter index.
5620
5621         * codegen.cs (CodeGen::Save): Catch save exception, report error.
5622         (EmitContext::EmitBoolExpression): Chain to expression generation
5623         instead of temporary hack.
5624         (::EmitStatementExpression): Put generic expression code generation.
5625
5626         * assign.cs (Assign::Emit): Implement variable assignments to
5627         local variables, parameters and fields.
5628
5629 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
5630
5631         * statement.cs (Block::GetVariableInfo): New method, returns the
5632         VariableInfo for a variable name in a block.
5633         (Block::GetVariableType): Implement in terms of GetVariableInfo
5634
5635         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
5636         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
5637
5638 2001-09-06  Ravi Pratap  <ravi@ximian.com>
5639
5640         * cs-parser.jay (operator_declaration): Continue on my quest : update
5641         to take attributes argument.
5642         (event_declaration): Ditto.
5643         (enum_declaration): Ditto.
5644         (indexer_declaration): Ditto.
5645         
5646         * class.cs (Operator::Operator): Update constructor accordingly.
5647         (Event::Event): Ditto.
5648
5649         * delegate.cs (Delegate::Delegate): Same here.
5650
5651         * enum.cs (Enum::Enum): Same here.
5652         
5653 2001-09-05  Ravi Pratap  <ravi@ximian.com>
5654
5655         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
5656
5657         * ../tests/cs0658.cs : New file to demonstrate error 0658.
5658
5659         * attribute.cs (Attributes): New class to encapsulate all attributes which were
5660         being passed around as an arraylist.
5661         (Attributes::AddAttribute): Method to add attribute sections.
5662
5663         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
5664         (struct_declaration): Update accordingly.
5665         (constant_declaration): Update.
5666         (field_declaration): Update.
5667         (method_header): Update.
5668         (fixed_parameter): Update.
5669         (parameter_array): Ditto.
5670         (property_declaration): Ditto.
5671         (destructor_declaration): Ditto.
5672         
5673         * class.cs (Struct::Struct): Update constructors accordingly.
5674         (Class::Class): Ditto.
5675         (Field::Field): Ditto.
5676         (Method::Method): Ditto.
5677         (Property::Property): Ditto.
5678         (TypeContainer::OptAttribute): update property's return type.
5679         
5680         * interface.cs (Interface.opt_attributes): New member.
5681         (Interface::Interface): Update to take the extra Attributes argument.
5682
5683         * parameter.cs (Parameter::Parameter): Ditto.
5684
5685         * constant.cs (Constant::Constant): Ditto.
5686
5687         * interface.cs (InterfaceMemberBase): New OptAttributes field.
5688         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
5689         the attributes as a parameter.
5690         (InterfaceProperty): Update constructor call.
5691         (InterfaceEvent): Ditto.
5692         (InterfaceMethod): Ditto.
5693         (InterfaceIndexer): Ditto.
5694
5695         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
5696         pass the attributes too.
5697         (interface_event_declaration): Ditto.
5698         (interface_property_declaration): Ditto.
5699         (interface_method_declaration): Ditto.
5700         (interface_declaration): Ditto.
5701
5702 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
5703
5704         * class.cs (Method::Define): Track the "static Main" definition to
5705         create an entry point. 
5706
5707         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
5708         EntryPoint if we find it. 
5709
5710         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
5711         (EmitContext::ig): Make this variable public.
5712
5713         * driver.cs: Make the default output file be the first file name
5714         with the .exe extension.  
5715
5716         Detect empty compilations
5717
5718         Handle various kinds of output targets.  Handle --target and
5719         rename -t to --dumper.
5720
5721         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
5722         methods inherited from Expression return now an Expression.  This
5723         will is used during the tree rewriting as we resolve them during
5724         semantic analysis.
5725
5726         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
5727         the spec.  Missing entirely is the information about
5728         accessability of elements of it.
5729
5730         (Expression::ExprClassFromMemberInfo): New constructor for
5731         Expressions that creates a fully initialized Expression based on
5732         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
5733         a Type.
5734
5735         (Invocation::Resolve): Begin implementing resolution of invocations.
5736         
5737         * literal.cs (StringLiteral):  Implement Emit.
5738
5739 2001-09-05  Ravi Pratap  <ravi@ximian.com>
5740
5741         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
5742         member.
5743         
5744 2001-09-04  Ravi Pratap  <ravi@ximian.com>
5745
5746         * cs-parser.jay (attribute_arguments): Implement actions.
5747         (attribute): Fix bug in production. Implement action.
5748         (attribute_list): Implement.
5749         (attribute_target): Implement.
5750         (attribute_target_specifier, opt_target_specifier): Implement
5751         (CheckAttributeTarget): New method to check if the attribute target
5752         is valid.
5753         (attribute_section): Implement.
5754         (opt_attributes): Implement.
5755
5756         * attribute.cs : New file to handle attributes.
5757         (Attribute): Class to hold attribute info.
5758
5759         * cs-parser.jay (opt_attribute_target_specifier): Remove production
5760         (attribute_section): Modify production to use 2 different rules to 
5761         achieve the same thing. 1 s/r conflict down !
5762         Clean out commented, useless, non-reducing dimension_separator rules.
5763         
5764         * class.cs (TypeContainer.attributes): New member to hold list
5765         of attributes for a type.
5766         (Struct::Struct): Modify to take one more argument, the attribute list.
5767         (Class::Class): Ditto.
5768         (Field::Field): Ditto.
5769         (Method::Method): Ditto.
5770         (Property::Property): Ditto.
5771         
5772         * cs-parser.jay (struct_declaration): Update constructor call to
5773         pass in the attributes too.
5774         (class_declaration): Ditto.
5775         (constant_declaration): Ditto.
5776         (field_declaration): Ditto.
5777         (method_header): Ditto.
5778         (fixed_parameter): Ditto.
5779         (parameter_array): Ditto.
5780         (property_declaration): Ditto.
5781
5782         * constant.cs (Constant::Constant): Update constructor similarly.
5783         Use System.Collections.
5784
5785         * parameter.cs (Parameter::Parameter): Update as above.
5786
5787 2001-09-02  Ravi Pratap  <ravi@ximian.com>
5788
5789         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
5790         (TypeContainer.delegates): New member to hold list of delegates.
5791
5792         * cs-parser.jay (delegate_declaration): Implement the action correctly 
5793         this time as I seem to be on crack ;-)
5794
5795 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
5796
5797         * rootcontext.cs (RootContext::IsNamespace): new function, used to
5798         tell whether an identifier represents a namespace.
5799
5800         * expression.cs (NamespaceExpr): A namespace expression, used only
5801         temporarly during expression resolution.
5802         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
5803         utility functions to resolve names on expressions.
5804
5805 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
5806
5807         * codegen.cs: Add hook for StatementExpressions. 
5808
5809         * class.cs: Fix inverted test for static flag in methods.
5810
5811 2001-09-02  Ravi Pratap  <ravi@ximian.com>
5812
5813         * class.cs (Operator::CheckUnaryOperator): Correct error number used
5814         to make it coincide with MS' number.
5815         (Operator::CheckBinaryOperator): Ditto.
5816
5817         * ../errors/errors.txt : Remove error numbers added earlier.
5818
5819         * ../errors/cs1019.cs : Test case for error # 1019
5820
5821         * ../errros/cs1020.cs : Test case for error # 1020
5822
5823         * cs-parser.jay : Clean out commented cruft.
5824         (dimension_separators, dimension_separator): Comment out. Ostensibly not
5825         used anywhere - non-reducing rule.
5826         (namespace_declarations): Non-reducing rule - comment out.
5827
5828         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
5829         with TypeContainer::AddEnum.
5830
5831         * delegate.cs : New file for delegate handling classes.
5832         (Delegate): Class for declaring delegates.
5833
5834         * makefile : Update.
5835
5836         * cs-parser.jay (delegate_declaration): Implement.
5837
5838 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
5839
5840         * class.cs (Event::Define): Implement.
5841         (Event.EventBuilder): New member.
5842
5843         * class.cs (TypeContainer::Populate): Update to define all enums and events
5844         we have.
5845         (Events): New property for the events arraylist we hold. Shouldn't we move to using
5846         readonly fields for all these cases ?
5847
5848 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
5849
5850         * class.cs (Property): Revamp to use the convention of making fields readonly.
5851         Accordingly modify code elsewhere.
5852
5853         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
5854         the Define method of the Property class.
5855
5856         * class.cs : Clean up applied patch and update references to variables etc. Fix 
5857         trivial bug.
5858         (TypeContainer::Populate): Update to define all the properties we have. Also
5859         define all enumerations.
5860
5861         * enum.cs (Define): Implement.
5862         
5863 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
5864
5865         * cs-parser.jay (overloadable_operator): The semantic value is an
5866         enum of the Operator class.
5867         (operator_declarator): Implement actions.
5868         (operator_declaration): Implement.
5869
5870         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
5871         validity of definitions.
5872         (Operator::CheckBinaryOperator): Static method to check for binary operators
5873         (TypeContainer::AddOperator): New method to add an operator to a type.
5874
5875         * cs-parser.jay (indexer_declaration): Added line to actually call the
5876         AddIndexer method so it gets added ;-)
5877
5878         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
5879         already taken care of by the MS compiler ?  
5880
5881 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
5882
5883         * class.cs (Operator): New class for operator declarations.
5884         (Operator::OpType): Enum for the various operators.
5885
5886 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
5887
5888         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
5889         ostensibly handle this in semantic analysis.
5890
5891         * cs-parser.jay (general_catch_clause): Comment out
5892         (specific_catch_clauses, specific_catch_clause): Ditto.
5893         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
5894         (catch_args, opt_catch_args): New productions.
5895         (catch_clause): Rewrite to use the new productions above
5896         (catch_clauses): Modify accordingly.
5897         (opt_catch_clauses): New production to use in try_statement
5898         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
5899         and re-write the code in the actions to extract the specific and
5900         general catch clauses by being a little smart ;-)
5901
5902         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
5903         Hooray, try and catch statements parse fine !
5904         
5905 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5906
5907         * statement.cs (Block::GetVariableType): Fix logic to extract the type
5908         string from the hashtable of variables.
5909
5910         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
5911         I end up making that mistake ;-)
5912         (catch_clauses): Fixed gross error which made Key and Value of the 
5913         DictionaryEntry the same : $1 !!
5914
5915 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5916
5917         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
5918
5919         * cs-parser.jay (event_declaration): Correct to remove the semicolon
5920         when the add and remove accessors are specified. 
5921
5922 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5923
5924         * cs-parser.jay (IndexerDeclaration): New helper class to hold
5925         information about indexer_declarator.
5926         (indexer_declarator): Implement actions.
5927         (parsing_indexer): New local boolean used to keep track of whether
5928         we are parsing indexers or properties. This is necessary because 
5929         implicit_parameters come into picture even for the get accessor in the 
5930         case of an indexer.
5931         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
5932
5933         * class.cs (Indexer): New class for indexer declarations.
5934         (TypeContainer::AddIndexer): New method to add an indexer to a type.
5935         (TypeContainer::indexers): New member to hold list of indexers for the
5936         type.
5937
5938 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
5939
5940         * cs-parser.jay (add_accessor_declaration): Implement action.
5941         (remove_accessor_declaration): Implement action.
5942         (event_accessors_declaration): Implement
5943         (variable_declarators): swap statements for first rule - trivial.
5944
5945         * class.cs (Event): New class to hold information about event
5946         declarations.
5947         (TypeContainer::AddEvent): New method to add an event to a type
5948         (TypeContainer::events): New member to hold list of events.
5949
5950         * cs-parser.jay (event_declaration): Implement actions.
5951
5952 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
5953
5954         * cs-parser.jay (dim_separators): Implement. Make it a string
5955         concatenating all the commas together, just as they appear.
5956         (opt_dim_separators): Modify accordingly
5957         (rank_specifiers): Update accordingly. Basically do the same
5958         thing - instead, collect the brackets here.
5959         (opt_rank_sepcifiers): Modify accordingly.
5960         (array_type): Modify to actually return the complete type string
5961         instead of ignoring the rank_specifiers.
5962         (expression_list): Implement to collect the expressions
5963         (variable_initializer): Implement. We make it a list of expressions
5964         essentially so that we can handle the array_initializer case neatly too.
5965         (variable_initializer_list): Implement.
5966         (array_initializer): Make it a list of variable_initializers
5967         (opt_array_initializer): Modify accordingly.
5968
5969         * expression.cs (New::NType): Add enumeration to help us
5970         keep track of whether we have an object/delegate creation
5971         or an array creation.
5972         (New:NewType, New::Rank, New::Indices, New::Initializers): New
5973         members to hold data about array creation.
5974         (New:New): Modify to update NewType
5975         (New:New): New Overloaded contructor for the array creation
5976         case.
5977
5978         * cs-parser.jay (array_creation_expression): Implement to call
5979         the overloaded New constructor.
5980         
5981 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
5982
5983         * class.cs (TypeContainer::Constructors): Return member
5984         constructors instead of returning null.
5985
5986 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
5987
5988         * typemanager.cs (InitCoreTypes): Initialize the various core
5989         types after we have populated the type manager with the user
5990         defined types (this distinction will be important later while
5991         compiling corlib.dll)
5992
5993         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
5994         on Expression Classification.  Now all expressions have a method
5995         `Resolve' and a method `Emit'.
5996
5997         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
5998         generation from working.     Also add some temporary debugging
5999         code. 
6000         
6001 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
6002
6003         * codegen.cs: Lots of code generation pieces.  This is only the
6004         beginning, will continue tomorrow with more touches of polish.  We
6005         handle the fundamentals of if, while, do, for, return.  Others are
6006         trickier and I need to start working on invocations soon.
6007         
6008         * gen-treedump.cs: Bug fix, use s.Increment here instead of
6009         s.InitStatement. 
6010
6011         * codegen.cs (EmitContext): New struct, used during code
6012         emission to keep a context.   Most of the code generation will be
6013         here. 
6014
6015         * cs-parser.jay: Add embedded blocks to the list of statements of
6016         this block.  So code generation proceeds in a top down fashion.
6017
6018 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
6019
6020         * statement.cs: Add support for multiple child blocks.
6021
6022 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
6023
6024         * codegen.cs (EmitCode): New function, will emit the code for a
6025         Block of code given a TypeContainer and its ILGenerator. 
6026
6027         * statement.cs (Block): Standard public readonly optimization.
6028         (Block::Block constructors): Link children. 
6029         (Block::Child): Child Linker.
6030         (Block::EmitVariables): Emits IL variable declarations.
6031
6032         * class.cs: Drop support for MethodGroups here, delay until
6033         Semantic Analysis.
6034         (Method::): Applied the same simplification that I did before, and
6035         move from Properties to public readonly fields.
6036         (Method::ParameterTypes): Returns the parameter types for the
6037         function, and implements a cache that will be useful later when I
6038         do error checking and the semantic analysis on the methods is
6039         performed.
6040         (Constructor::GetCallingConvention): Renamed from CallingConvetion
6041         and made a method, optional argument tells whether this is a class
6042         or a structure to apply the `has-this' bit.
6043         (Method::GetCallingConvention): Implement, returns the calling
6044         convention. 
6045         (Method::Define): Defines the type, a second pass is performed
6046         later to populate the methods.
6047
6048         (Constructor::ParameterTypes): implement a cache similar to the
6049         one on Method::ParameterTypes, useful later when we do semantic
6050         analysis. 
6051
6052         (TypeContainer::EmitMethod):  New method.  Emits methods.
6053
6054         * expression.cs: Removed MethodGroup class from here.
6055         
6056         * parameter.cs (Parameters::GetCallingConvention): new method.
6057
6058 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
6059
6060         * class.cs (TypeContainer::Populate): Drop RootContext from the
6061         argument. 
6062
6063         (Constructor::CallingConvention): Returns the calling convention.
6064         (Constructor::ParameterTypes): Returns the constructor parameter
6065         types. 
6066         
6067         (TypeContainer::AddConstructor): Keep track of default constructor
6068         and the default static constructor.
6069
6070         (Constructor::) Another class that starts using `public readonly'
6071         instead of properties. 
6072
6073         (Constructor::IsDefault): Whether this is a default constructor. 
6074
6075         (Field::) use readonly public fields instead of properties also.
6076
6077         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
6078         track of static constructors;  If none is used, turn on
6079         BeforeFieldInit in the TypeAttributes. 
6080
6081         * cs-parser.jay (opt_argument_list): now the return can be null
6082         for the cases where there are no arguments. 
6083
6084         (constructor_declarator): If there is no implicit `base' or
6085         `this', then invoke the default parent constructor. 
6086         
6087         * modifiers.cs (MethodAttr): New static function maps a set of
6088         modifiers flags into a MethodAttributes enum
6089         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
6090         MethodAttr, TypeAttr to represent the various mappings where the
6091         modifiers are used.
6092         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
6093
6094 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
6095
6096         * parameter.cs (GetParameterInfo): Fix bug where there would be no
6097         method arguments.
6098
6099         * interface.cs (PopulateIndexer): Implemented the code generator
6100         for interface indexers.
6101
6102 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
6103
6104         * interface.cs (InterfaceMemberBase): Now we track the new status
6105         here.  
6106
6107         (PopulateProperty): Implement property population.  Woohoo!  Got
6108         Methods and Properties going today. 
6109
6110         Removed all the properties for interfaces, and replaced them with
6111         `public readonly' fields. 
6112
6113 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
6114
6115         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
6116         initialize their hashtables/arraylists only when they are needed
6117         instead of doing this always.
6118
6119         * parameter.cs: Handle refs and out parameters.
6120
6121         * cs-parser.jay: Use an ArrayList to construct the arguments
6122         instead of the ParameterCollection, and then cast that to a
6123         Parameter[] array.
6124
6125         * parameter.cs: Drop the use of ParameterCollection and use
6126         instead arrays of Parameters.
6127
6128         (GetParameterInfo): Use the Type, not the Name when resolving
6129         types. 
6130
6131 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
6132
6133         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
6134         and instead use public readonly fields.
6135
6136         * class.cs: Put back walking code for type containers.
6137
6138 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
6139
6140         * class.cs (MakeConstant): Code to define constants.
6141
6142         * rootcontext.cs (LookupType): New function.  Used to locate types 
6143
6144         
6145 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
6146
6147         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
6148         this System.Reflection code is.  Kudos to Microsoft
6149         
6150         * typemanager.cs: Implement a type cache and avoid loading all
6151         types at boot time.  Wrap in LookupType the internals.  This made
6152         the compiler so much faster.  Wow.  I rule!
6153         
6154         * driver.cs: Make sure we always load mscorlib first (for
6155         debugging purposes, nothing really important).
6156
6157         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
6158         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
6159
6160         * rootcontext.cs: Lookup types on their namespace;  Lookup types
6161         on namespaces that have been imported using the `using' keyword.
6162
6163         * class.cs (TypeContainer::TypeAttr): Virtualize.
6164         (Class::TypeAttr): Return attributes suitable for this bad boy.
6165         (Struct::TypeAttr): ditto.
6166         Handle nested classes.
6167         (TypeContainer::) Remove all the type visiting code, it is now
6168         replaced with the rootcontext.cs code
6169
6170         * rootcontext.cs (GetClassBases): Added support for structs. 
6171
6172 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * interface.cs, statement.cs, class.cs, parameter.cs,
6175         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
6176         Drop use of TypeRefs, and use strings instead.
6177
6178 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
6179
6180         * rootcontext.cs: 
6181
6182         * class.cs (Struct::Struct): set the SEALED flags after
6183         checking the modifiers.
6184         (TypeContainer::TypeAttr): new property, returns the
6185         TypeAttributes for a class.  
6186
6187         * cs-parser.jay (type_list): Oops, list production was creating a
6188         new list of base types.
6189
6190         * rootcontext.cs (StdLib): New property.
6191         (GetInterfaceTypeByName): returns an interface by type name, and
6192         encapsulates error handling here.
6193         (GetInterfaces): simplified.
6194         (ResolveTree): Encapsulated all the tree resolution here.
6195         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
6196         types. 
6197         
6198         * driver.cs: Add support for --nostdlib, to avoid loading the
6199         default assemblies.
6200         (Main): Do not put tree resolution here. 
6201
6202         * rootcontext.cs: Beginning of the class resolution.
6203
6204 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
6205
6206         * rootcontext.cs: Provide better error reporting. 
6207
6208         * cs-parser.jay (interface_base): set our $$ to be interfaces.
6209
6210         * rootcontext.cs (CreateInterface): Handle the case where there
6211         are no parent interfaces.
6212         
6213         (CloseTypes): Routine to flush types at the end.
6214         (CreateInterface): Track types.
6215         (GetInterfaces): Returns an array of Types from the list of
6216         defined interfaces.
6217
6218         * typemanager.c (AddUserType): Mechanism to track user types (puts
6219         the type on the global type hash, and allows us to close it at the
6220         end). 
6221         
6222 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
6223
6224         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
6225         RecordInterface instead.
6226
6227         * cs-parser.jay: Updated to reflect changes above.
6228
6229         * decl.cs (Definition): Keep track of the TypeBuilder type that
6230         represents this type here.  Not sure we will use it in the long
6231         run, but wont hurt for now.
6232
6233         * driver.cs: Smaller changes to accomodate the new code.
6234
6235         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
6236         when done. 
6237
6238         * rootcontext.cs (CreateInterface):  New method, used to create
6239         the System.TypeBuilder type for interfaces.
6240         (ResolveInterfaces): new entry point to resolve the interface
6241         hierarchy. 
6242         (CodeGen): Property, used to keep track of the code generator.
6243
6244 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
6245
6246         * cs-parser.jay: Add a second production for delegate_declaration
6247         with `VOID'.
6248
6249         (enum_body): Put an opt_comma here instead of putting it on
6250         enum_body or enum_member_declarations so we can handle trailing
6251         commas on enumeration members.  Gets rid of a shift/reduce.
6252         
6253         (type_list): Need a COMMA in the middle.
6254
6255         (indexer_declaration): Tell tokenizer to recognize get/set
6256
6257         * Remove old targets.
6258
6259         * Re-add the parser target.
6260
6261 2001-07-13  Simon Cozens <simon@simon-cozens.org>
6262
6263         * cs-parser.jay: Add precendence rules for a number of operators
6264         ot reduce the number of shift/reduce conflicts in the grammar.
6265         
6266 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
6267
6268         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
6269         and put it here.
6270
6271         Get rid of old crufty code.
6272
6273         * rootcontext.cs: Use this to keep track of the parsed
6274         representation and the defined types available to the program. 
6275
6276         * gen-treedump.cs: adjust for new convention.
6277
6278         * type.cs: Split out the type manager, and the assembly builder
6279         from here. 
6280
6281         * typemanager.cs: the type manager will live here now.
6282
6283         * cil-codegen.cs: And the code generator here. 
6284
6285 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
6286
6287         * makefile: Fixed up for easy making.
6288
6289 2001-07-13  Simon Cozens <simon@simon-cozens.org>
6290
6291         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
6292         the 
6293
6294         (unary_expression): Expand pre_increment_expression and
6295         post_decrement_expression to reduce a shift/reduce.
6296
6297 2001-07-11  Simon Cozens
6298
6299         * cs-tokenizer.cs: Hex numbers should begin with a 0.
6300
6301         Improve allow_keyword_as_indent name.
6302
6303 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
6304
6305         * Adjustments for Beta2. 
6306
6307 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
6308
6309         * decl.cs: Added `Define' abstract method.
6310         (InTransit): new property, used to catch recursive definitions. 
6311
6312         * interface.cs: Implement `Define'. 
6313
6314         * modifiers.cs: Map Modifiers.constants to
6315         System.Reflection.TypeAttribute flags.
6316
6317         * class.cs: Keep track of types and user-defined types.
6318         (BuilderInit): New method for creating an assembly
6319         (ResolveType): New function to launch the resolution process, only
6320         used by interfaces for now.
6321
6322         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
6323         that are inserted into the name space. 
6324
6325 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * ARGH.  I have screwed up my tree so many times due to the use of
6328         rsync rather than using CVS.  Going to fix this at once. 
6329
6330         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
6331         load types.
6332
6333 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * Experiment successful: Use System.Type rather that our own
6336         version of Type.  
6337
6338 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
6339
6340         * cs-parser.jay: Removed nsAliases from here.
6341
6342         Use new namespaces, handle `using XXX;' 
6343
6344         * namespace.cs: Reimplemented namespace handling, use a recursive
6345         definition of the class.  Now we can keep track of using clauses
6346         and catch invalid using clauses.
6347
6348 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
6349
6350         * gen-treedump.cs: Adapted for all the renaming.
6351
6352         * expression.cs (Expression): this class now has a Type property
6353         which returns an expression Type.
6354
6355         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
6356         `Type', as this has a different meaning now in the base
6357
6358 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
6359
6360         * interface.cs, class.cs: Removed from all the sources the
6361         references to signature computation, as we can not do method
6362         signature computation during the parsing time, as we are not
6363         trying to solve at that point distinguishing:
6364
6365         class X {
6366                 void a (Blah x) {}
6367                 void a (NS.Blah x) {}
6368         }
6369
6370         Which depending on the context might be valid or not, as we do not
6371         know if Blah is the same thing as NS.Blah at that point.
6372
6373         * Redid everything so the code uses TypeRefs now instead of
6374         Types.  TypeRefs are just temporary type placeholders, that need
6375         to be resolved.  They initially have a pointer to a string and the
6376         current scope in which they are used.  This is used later by the
6377         compiler to resolve the reference to an actual Type. 
6378
6379         * DeclSpace is no longer a CIR.Type, and neither are
6380         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
6381         are all DeclSpaces, but no Types. 
6382
6383         * type.cs (TypeRefManager): This implements the TypeRef manager,
6384         which keeps track of all the types that need to be resolved after
6385         the parsing has finished. 
6386
6387 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
6388
6389         * ARGH.  We are going to have to store `foreach' as a class rather
6390         than resolving it, as we need to verify error 1579 after name
6391         resolution.   *OR* we could keep a flag that says `This request to
6392         IEnumerator comes from a foreach statement' which we can then use
6393         to generate the error.
6394
6395 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
6396
6397         * class.cs (TypeContainer.AddMethod): we now add methods to the
6398         MethodGroup instead of the method hashtable.  
6399
6400         * expression.cs: Add MethodGroup abstraction, which gets us one
6401         step closer to the specification in the way we handle method
6402         declarations.  
6403
6404         * cs-parser.jay (primary_expression): qualified_identifier now
6405         tried to match up an identifier to a local variable reference or
6406         to a parameter reference.
6407
6408         current_local_parameters is now a parser global variable that
6409         points to the current parameters for the block, used during name
6410         lookup.
6411
6412         (property_declaration): Now creates an implicit `value' argument to
6413         the set accessor.
6414
6415 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
6416
6417         * parameter.cs: Do not use `param' arguments as part of the
6418         signature, per the spec.
6419
6420 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
6421
6422         * decl.cs: Base class for classes, structs and interfaces.  This
6423         is the "Declaration Space" 
6424
6425         * cs-parser.jay: Use CheckDef for checking declaration errors
6426         instead of having one on each function.
6427
6428         * class.cs: Factor out some code for handling error handling in
6429         accordance to the "Declarations" section in the "Basic Concepts"
6430         chapter in the ECMA C# spec.
6431
6432         * interface.cs: Make all interface member classes derive from
6433         InterfaceMemberBase.
6434
6435 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
6436
6437         * Many things: all interfaces are parsed and generated in
6438         gen-treedump.  Support for member variables, constructors,
6439         destructors, properties, constants is there.
6440
6441         Beginning of the IL backend, but very little done, just there for
6442         testing purposes. 
6443
6444 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
6445
6446         * cs-parser.jay: Fix labeled statement.
6447
6448         * cs-tokenizer.cs (escape): Escape " and ' always.
6449         ref_line, ref_name: keep track of the line/filename as instructed
6450         by #line by the compiler.
6451         Parse #line.
6452
6453 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
6454
6455         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
6456         to match the values in System.CodeDOM.
6457
6458         Divid renamed to Divide.
6459
6460         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
6461         statements. 
6462         (Statements.set): remove.
6463
6464         * System.CodeDOM/CodeCatchClause.cs: always have a valid
6465         statements. 
6466
6467         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
6468         falseStatements always have valid values. 
6469
6470         * cs-parser.jay: Use System.CodeDOM now.
6471