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