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