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