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