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