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