2004-10-31 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2
3         Fix #68850
4         * attribute.cs (GetMarshal): Add method argument for
5         caller identification.
6
7         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8         agument for GetMarshal and RuntimeMissingSupport.
9
10 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11
12         * attribute.cs (ExtractSecurityPermissionSet): Removed
13         TypeManager.code_access_permission_type.
14
15         * typemanager.cs: Removed TypeManager.code_access_permission_type.
16
17 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
18
19         * expression.cs (LocalVariableReference.DoResolveLValue): Check
20         for obsolete use of a variable here.   Fixes regression on errors
21         cs0619-25 and cs0619-26.
22
23 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
24
25         Fix #62358, implemented security attribute encoding.
26
27         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
28         Tests permitted SecurityAction for assembly or other types.
29         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
30         data from SecurityPermissionAttribute to PermisionSet class.
31
32         * class.cs (ApplyAttributeBuilder): Added special handling
33         for System.Security.Permissions.SecurityAttribute based types.
34
35         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
36         special handling for System.Security.Permissions.SecurityAttribute
37         based types.
38
39         * enum.cs (ApplyAttributeBuilder): Added special handling
40         for System.Security.Permissions.SecurityAttribute based types.
41
42         * parameter.cs (ApplyAttributeBuilder): Added special handling
43         for System.Security.Permissions.SecurityAttribute based types.
44
45         * rootcontext.cs: Next 2 core types.
46
47         * typemanager.cs (TypeManager.security_permission_attr_type):
48         Built in type for the SecurityPermission Attribute.
49         (code_access_permission_type): Build in type.
50
51 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
52
53         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
54         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
55         all of this information into
56         EmitContext.EmitCapturedVariableInstance.
57         
58         * codegen.cs (EmitCapturedVariableInstance): move here the
59         funcionality of emitting an ldarg.0 in the presence of a
60         remapping.   This centralizes the instance emit code.
61
62         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
63         then emit a load of this: it means that we have reached the
64         topmost ScopeInfo: the one that contains the pointer to the
65         instance of the class hosting the anonymous method.
66
67         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
68         captures to the topmost CaptureContext.
69
70 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
71
72         * expression.cs (LocalVariableReference): Move the knowledge about
73         the iterators into codegen's EmitCapturedVariableInstance.
74
75 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
76
77         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
78         all code paths return a value from an anonymous method (it is the
79         same as the 161 error, but for anonymous methods).
80
81 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
82
83         The introduction of anonymous methods in the compiler changed
84         various ways of doing things in the compiler.  The most
85         significant one is the hard split between the resolution phase
86         and the emission phases of the compiler.
87
88         For instance, routines that referenced local variables no
89         longer can safely create temporary variables during the
90         resolution phase: they must do so from the emission phase,
91         since the variable might have been "captured", hence access to
92         it can not be done with the local-variable operations from the runtime.
93         
94         * statement.cs 
95
96         (Block.Flags): New flag `IsTopLevel' to indicate that this block
97         is a toplevel block.
98
99         (ToplevelBlock): A new kind of Block, these are the blocks that
100         are created by the parser for all toplevel method bodies.  These
101         include methods, accessors and anonymous methods.
102
103         These contain some extra information not found in regular blocks:
104         A pointer to an optional CaptureContext (for tracking captured
105         local variables and parameters).  A pointer to the parent
106         ToplevelBlock.
107         
108         (Return.Resolve): Catch missmatches when returning a value from an
109         anonymous method (error 1662).
110         Invoke NeedReturnLabel from the Resolve phase instead of the emit
111         phase.
112
113         (Break.Resolve): ditto.
114
115         (SwitchLabel): instead of defining the labels during the
116         resolution phase, we now turned the public ILLabel and ILLabelCode
117         labels into methods called GetILLabelCode() and GetILLabel() that
118         only define the label during the Emit phase.
119
120         (GotoCase): Track the SwitchLabel instead of the computed label
121         (its contained therein).  Emit the code by using
122         SwitchLabel.GetILLabelCode ().
123
124         (LocalInfo.Flags.Captured): A new flag has been introduce to track
125         whether the Local has been captured or not.
126
127         (LocalInfo.IsCaptured): New property, used to tell whether the
128         local has been captured.
129         
130         * anonymous.cs: Vastly updated to contain the anonymous method
131         support.
132
133         The main classes here are: CaptureContext which tracks any
134         captured information for a toplevel block and ScopeInfo used to
135         track the activation frames for various local variables.   
136
137         Each toplevel block has an optional capture context associated
138         with it.  When a method contains an anonymous method both the
139         toplevel method and the anonymous method will create a capture
140         context.   When variables or parameters are captured, they are
141         recorded on the CaptureContext that owns them, for example:
142
143         void Demo () {
144              int a;
145              MyDelegate d = delegate {
146                  a = 1;
147              }
148         }
149
150         Here `a' will be recorded as captured on the toplevel
151         CapturedContext, the inner captured context will not have anything
152         (it will only have data if local variables or parameters from it
153         are captured in a nested anonymous method.
154
155         The ScopeInfo is used to track the activation frames for local
156         variables, for example:
157
158         for (int i = 0; i < 10; i++)
159                 for (int j = 0; j < 10; j++){
160                    MyDelegate d = delegate {
161                         call (i, j);
162                    }
163                 }
164
165         At runtime this captures a single captured variable `i', but it
166         captures 10 different versions of the variable `j'.  The variable
167         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
168         recorded on a child.  
169
170         The toplevel ScopeInfo will also track information like the `this'
171         pointer if instance variables were referenced (this is necessary
172         as the anonymous method lives inside a nested class in the host
173         type of the method). 
174
175         (AnonymousMethod): Expanded to track the Toplevel, implement
176         `AnonymousMethod.Compatible' to tell whether an anonymous method
177         can be converted to a target delegate type. 
178
179         The routine now also produces the anonymous method content
180
181         (AnonymousDelegate): A helper class that derives from
182         DelegateCreation, this is used to generate the code necessary to
183         produce the delegate for the anonymous method that was created. 
184
185         * assign.cs: API adjustments for new changes in
186         Convert.ImplicitStandardConversionExists.
187
188         * class.cs: Adjustments to cope with the fact that now toplevel
189         blocks are of type `ToplevelBlock'. 
190
191         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
192         insteda of standard blocks.
193
194         Flag errors if params arguments are passed to anonymous methods.
195
196         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
197         `CurrentAnonymousMethod' which points to the current Anonymous
198         Method.  The variable points to the AnonymousMethod class that
199         holds the code being compiled.  It is set in the new EmitContext
200         created for the anonymous method.
201
202         (EmitContext.Phase): Introduce a variable and an enumeration to
203         assist in enforcing some rules about when and where we are allowed
204         to invoke certain methods (EmitContext.NeedsReturnLabel is the
205         only one that enfonces this right now).
206
207         (EmitContext.HaveCaptureInfo): new helper method that returns
208         whether we have a CapturedContext initialized.
209
210         (EmitContext.CaptureVariable): New method used to register that a
211         LocalInfo must be flagged for capturing. 
212
213         (EmitContext.CapturedParameter): New method used to register that a
214         parameters must be flagged for capturing. 
215         
216         (EmitContext.CapturedField): New method used to register that a
217         field must be flagged for capturing. 
218
219         (EmitContext.HaveCapturedVariables,
220         EmitContext.HaveCapturedFields): Return whether there are captured
221         variables or fields. 
222
223         (EmitContext.EmitMethodHostInstance): This is used to emit the
224         instance for the anonymous method.  The instance might be null
225         (static methods), this (for anonymous methods that capture nothing
226         and happen to live side-by-side with the current method body) or a
227         more complicated expression if the method has a CaptureContext.
228
229         (EmitContext.EmitTopBlock): Routine that drives the emission of
230         code: it will first resolve the top block, then emit any metadata
231         and then emit the code.  The split is done so that we can extract
232         any anonymous methods and flag any captured variables/parameters.
233         
234         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
235         during this phase, the ILGenerator should not be used as labels
236         and local variables declared here might not be accessible to any
237         code that is part of an anonymous method.  
238
239         Exceptions to this include the temporary variables that are
240         created by some statements internally for holding temporary
241         variables. 
242         
243         (EmitContext.EmitMeta): New routine, in charge of emitting all the
244         metadata for a cb
245
246         (EmitContext.TemporaryReturn): This method is typically called
247         from the Emit phase, and its the only place where we allow the
248         ReturnLabel to be defined other than the EmitMeta.  The reason is
249         that otherwise we would have to duplicate a lot of logic in the
250         Resolve phases of various methods that today is on the Emit
251         phase. 
252
253         (EmitContext.NeedReturnLabel): This no longer creates the label,
254         as the ILGenerator is not valid during the resolve phase.
255
256         (EmitContext.EmitThis): Extended the knowledge in this class to
257         work in anonymous methods in addition to iterators. 
258
259         (EmitContext.EmitCapturedVariableInstance): This emits whatever
260         code is necessary on the stack to access the instance to a local
261         variable (the variable will be accessed as a field).
262
263         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
264         EmitContext.EmitAddressOfParameter): Routines to support
265         parameters (not completed at this point). 
266         
267         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
268         will also remove the parameters.
269
270         * convert.cs (Convert): Define a `ConstantEC' which points to a
271         null.  This is just to prefity some code that uses
272         ImplicitStandardConversion code and do not have an EmitContext
273         handy.
274
275         The idea is to flag explicitly that at that point in time, it is
276         known that the conversion will not trigger the delegate checking
277         code in implicit conversions (which requires a valid
278         EmitContext). 
279
280         Everywhere: pass new EmitContext parameter since
281         ImplicitStandardConversionExists now requires it to check for
282         anonymous method conversions. 
283
284         (Convert.ImplicitStandardConversionExists): If the type of an
285         expression is the anonymous_method_type, and the type is a
286         delegate, we invoke the AnonymousMethod.Compatible method to check
287         whether an implicit conversion is possible. 
288
289         (Convert.ImplicitConversionStandard): Only do implicit method
290         group conversions if the language level is not ISO_1.
291
292         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
293         MethodInfo for the Invoke method.  used by Delegate and
294         AnonymousDelegate.
295
296         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
297         method conversions if the target type is a delegate.
298
299         Removed extra debugging nops.
300
301         (LocalVariableReference): Turn the `local_info' into a public
302         field. 
303
304         Add `prepared' field, the same hack used for FieldExprs to cope
305         with composed assignments, as Local variables do not necessarily
306         operate purely on the stack as they used to: they can be captured
307         fields. 
308
309         Add `temp' for a temporary result, like fields.
310
311         Refactor DoResolve and DoResolveLValue into DoResolveBase.
312
313         It now copes with Local variables that are captured and emits the
314         proper instance variable to load it from a field in the captured
315         case. 
316
317         (ParameterReference.DoResolveBase): During the resolve phase,
318         capture parameters if we are in an anonymous method.
319
320         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
321         anonymous method, use the EmitContext helper routines to emit the
322         parameter reference.
323
324         * iterators.cs: Set RemapToProxy to true/false during the
325         EmitDispose class.
326
327         * parameters.cs (GetParameterByName): New helper method. 
328
329         * typemanager.cs (anonymous_method_type) a new type that
330         represents an anonyous method.  This is always an internal type,
331         used as a fencepost to test against the anonymous-methodness of an
332         expression. 
333         
334 2004-10-24  Marek Safar  <marek.safar@seznam.cz>
335
336         Fixed bugs #63705, #67130
337         * decl.cs (MemberCache.MemberCache): Add parameter to distinguish
338         imported and defined interfaces.
339         (CacheEntry, EntryType): Changed to protected internal.
340
341         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
342         interfaces too.
343
344         * typemanager.cs (LookupInterfaceContainer): New method.
345         Fills member container from base interfaces.
346
347 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
348
349         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
350         561 report.
351         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
352
353 2004-10-18  Martin Baulig  <martin@ximian.com>
354
355         Merged latest changes into gmcs.  Please keep this comment in
356         here, it makes it easier for me to see what changed in MCS since
357         the last time I merged.
358
359 2004-10-18  Martin Baulig  <martin@ximian.com>
360
361         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
362         `Type' directly, but call ResolveType() on it.
363         (Catch.Resolve): Likewise.
364         (Foreach.Resolve): Likewise.
365
366 2004-10-18  Martin Baulig  <martin@ximian.com>
367
368         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
369         `Type' directly, but call ResolveType() on it.
370         (Probe.DoResolve): Likewise.
371         (ArrayCreation.LookupType): Likewise.
372         (TypeOf.DoResolve): Likewise.
373         (SizeOf.DoResolve): Likewise.
374
375 2004-10-18  Martin Baulig  <martin@ximian.com>
376
377         * expression.cs (Invocation.BetterFunction): Put back
378         TypeManager.TypeToCoreType().
379
380 2004-10-18  Raja R Harinath  <rharinath@novell.com>
381
382         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
383         the ResolveType.
384
385 2004-10-18  Martin Baulig  <martin@ximian.com>
386
387         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
388         `Type' directly, but call ResolveType() on it.
389
390 2004-10-18  Martin Baulig  <martin@ximian.com>
391
392         * class.cs (FieldMember.Define): Don't access the TypeExpr's
393         `Type' directly, but call ResolveType() on it.
394         (MemberBase.DoDefine): Likewise.
395
396         * expression.cs (New.DoResolve): Don't access the TypeExpr's
397         `Type' directly, but call ResolveType() on it.
398         (ComposedCast.DoResolveAsTypeStep): Likewise.
399
400         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
401         `Type' directly, but call ResolveType() on it.
402
403 2004-10-17  John Luke  <john.luke@gmail.com>
404
405         * class.cs (Operator.GetSignatureForError): use CSharpName
406
407         * parameter.cs (Parameter.GetSignatureForError): Returns
408         correct name even if was not defined.
409
410 2004-10-13  Raja R Harinath  <rharinath@novell.com>
411
412         Fix #65816.
413         * class.cs (TypeContainer.EmitContext): New property.
414         (DefineNestedTypes): Create an emitcontext for each part.
415         (MethodCore.DoDefineParameters): Use container's emitcontext.
416         Pass type array to InternalParameters.
417         (MemberBase.DoDefine): Use container's emitcontext.
418         (FieldMember.Define): Likewise.
419         (Event.Define): Likewise.
420         (SetMethod.GetParameterInfo): Change argument to EmitContext.
421         Pass type array to InternalParameters.
422         (SetIndexerMethod.GetParameterInfo): Likewise.
423         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
424         * delegate.cs (Define): Pass emitcontext to
425         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
426         array to InternalParameters.
427         * expression.cs (ParameterReference.DoResolveBase): Pass
428         emitcontext to GetParameterInfo.
429         (ComposedCast.DoResolveAsTypeStep): Remove check on
430         ec.ResolvingTypeTree.
431         * parameter.cs (Parameter.Resolve): Change argument to
432         EmitContext.  Use ResolveAsTypeTerminal.
433         (Parameter.GetSignature): Change argument to EmitContext.
434         (Parameters.ComputeSignature): Likewise.
435         (Parameters.ComputeParameterTypes): Likewise.
436         (Parameters.GetParameterInfo): Likewise.
437         (Parameters.ComputeAndDefineParameterTypes): Likewise.
438         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
439         * support.cs (InternalParameters..ctor): Remove variant that takes
440         a DeclSpace.
441         * typemanager.cs (system_intptr_expr): New.
442         (InitExpressionTypes): Initialize it.
443
444 2004-10-12  Chris Toshok  <toshok@ximian.com>
445
446         * cs-parser.jay: fix location for try_statement and catch_clause.
447
448 2004-10-11  Martin Baulig  <martin@ximian.com>
449
450         * report.cs: Don't make --fatal abort on warnings, we have
451         -warnaserror for that.
452
453 2004-10-07  Raja R Harinath  <rharinath@novell.com>
454
455         More DeclSpace.ResolveType avoidance.
456         * decl.cs (MemberCore.InUnsafe): New property.
457         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
458         with newly created EmitContext.
459         (FieldMember.Define): Likewise.
460         * delegate.cs (Delegate.Define): Likewise.
461         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
462         only if normal name-lookup fails.
463         (TypeExpr.DoResolve): Enable error-checking.
464         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
465         (SizeOf.DoResolve): Likewise.
466         (ComposedCast.DoResolveAsTypeStep): Likewise.
467         (StackAlloc.DoResolve): Likewise.
468         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
469         (Block.Unsafe): New property.
470         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
471         (Unsafe): Set 'unsafe' flag of contained block.
472         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
473         (Fixed.Resolve): Likewise.
474         (Catch.Resolve): Likewise.
475         (Using.ResolveLocalVariableDecls): Likewise.
476         (Foreach.Resolve): Likewise.
477
478 2004-10-05  John Luke <john.luke@gmail.com>
479
480         * cs-parser.jay: add location to error CS0175
481
482 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
483
484         * ecore.cs (Expression.Constantity): Add support for turning null
485         into a constant.
486
487         * const.cs (Const.Define): Allow constants to be reference types
488         as long as the value is Null.
489
490 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
491
492         * namespace.cs (NamespaceEntry.Using): No matter which warning
493         level is set, check if this namespace name has already been added.
494
495 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
496
497         * expression.cs: reftype [!=]= null should always use br[true,false].
498         # 67410
499
500 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
501
502         Fix #67108
503         * attribute.cs: Enum conversion moved to 
504         GetAttributeArgumentExpression to be applied to the all
505         expressions.
506
507 2004-10-01  Raja R Harinath  <rharinath@novell.com>
508
509         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
510         * class.c (TypeContainer.DefineType): Flag error if
511         base types aren't accessible due to access permissions.
512         * decl.cs (DeclSpace.ResolveType): Move logic to
513         Expression.ResolveAsTypeTerminal.
514         (DeclSpace.ResolveTypeExpr): Thin layer over
515         Expression.ResolveAsTypeTerminal.
516         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
517         Refactor code into NestedAccess.  Use it.
518         (DeclSpace.NestedAccess): New.
519         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
520         argument to silence errors.  Check access permissions.
521         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
522         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
523         (Cast.DoResolve): Likewise.
524         (New.DoResolve): Likewise.
525         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
526         (TypeOf.DoResolve): Likewise.
527
528         * expression.cs (Invocation.BetterConversion): Return the Type of
529         the better conversion.  Implement section 14.4.2.3 more faithfully.
530         (Invocation.BetterFunction): Make boolean.  Make correspondence to
531         section 14.4.2.2 explicit.
532         (Invocation.OverloadResolve): Update.
533         (Invocation): Remove is_base field.
534         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
535         (Invocation.Emit): Likewise.
536
537 2004-09-27  Raja R Harinath  <rharinath@novell.com>
538
539         * README: Update to changes.
540
541 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
542
543         * cs-parser.jay: Reverted 642 warning fix.
544
545 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
546
547         Fix bug #66615
548         * decl.cs (FindMemberWithSameName): Indexer can have more than
549         1 argument.
550
551 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
552
553         * expression.cs (LocalVariableReference.DoResolveLValue):
554         Do not report warning 219 for out values.
555         (EmptyExpression.Null): New member to avoid extra allocations.
556
557 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
558
559         * cs-parser.jay: Fix wrong warning 642 report.
560
561         * cs-tokenizer.cs (CheckNextToken): New helper;
562         Inspect next character if is same as expected.
563
564 2004-09-23  Martin Baulig  <martin@ximian.com>
565
566         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
567         (Convert.ImplicitReferenceConversionExists): Likewise.
568
569 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
570
571         * class.cs (Operator.Define): Add error 448 and 559 report.
572
573 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
574
575         * class.cs (MemberBase.IsTypePermitted): New protected
576         method for checking error CS0610.
577
578 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
579
580         * class.cs (TypeContainer.HasExplicitLayout): New property
581         Returns whether container has StructLayout attribute set Explicit.
582         (FieldMember): New abstract class for consts and fields.
583         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
584         (Field): Reuse FieldMember.
585
586         * const.cs (Const): Reuse FieldMember.
587
588         * rootcontext.cs: EmitConstants call moved to class.
589
590 2004-09-22  Martin Baulig  <martin@ximian.com>
591
592         Thanks to Peter Sestoft for this bug report.
593
594         * expression.cs (Conditional): If both the `trueExpr' and the
595         `falseExpr' is a NullLiteral, return a NullLiteral.
596
597 2004-09-22  Martin Baulig  <martin@ximian.com>
598
599         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
600         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
601         for the "get_Current" call.
602
603 2004-09-22  Martin Baulig  <martin@ximian.com>
604
605         Marek and me just fixed one of our oldest bugs: #28562 :-)
606
607         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
608
609         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
610         we're an EnumConstant, just return that.
611         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
612         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
613         to get the value which'll actually be written into the attribute.
614         However, we have to use GetValue() to access the attribute's value
615         in the compiler.        
616
617 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
618
619         * constant.cs (Constant.IsNegative): New abstract property
620         IsNegative.
621
622         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
623         (StackAlloc.DoResolve): Reused IsNegative.
624
625 2004-09-21  Martin Baulig  <martin@ximian.com>
626
627         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
628         if we're used in an iterator, we may be called from different
629         methods.
630
631         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
632         we actually have an exception block.
633
634 2004-09-20  John Luke <jluke@cfl.rr.com>
635
636         * class.cs, cs-parser.jay: Improve the error report for 1520:
637         report the actual line where the error happens, not where the
638         class was declared.
639
640         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
641         Pass location information that was available elsewhere.
642
643 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
644
645         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
646         runtime to delay sign assemblies.
647
648 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
649
650         * cs-parser.jay: Do not report the stack trace, this is barely
651         used nowadays.
652
653 2004-08-22  John Luke  <john.luke@gmail.com>
654  
655         * driver.cs : check that a resource id is not already used
656         before adding it, report CS1508 if it is, bug #63637
657
658 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
659
660         * ecore.cs: Removed dead code.
661
662 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
663
664         * class.cs: Do not report warning CS0067 on the interfaces.
665
666 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
667
668         * cs-parser.jay: Add error 504 report.
669
670 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
671
672         * rootcontext.cs: WarningLevel is 4 by default now.
673
674         * statement.cs (Fixed.Resolve): Do not null
675         VariableInfo.
676
677 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
678
679         Fixed bug #55780
680         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
681         deep search when property is not virtual.
682         (PropertyExpr.ResolveAccessors): Make one call for both
683         accessors.
684
685 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
686
687         Fixed bug #65766
688         * statement.cs: Error 152 report constains also location.
689
690 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
691
692         Fixed bug #65766
693         * const.cs: Explicitly set constant as static.
694
695 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
696
697         Fixed bug #64226
698         * cs-parser.jay: Add error 1017 report.
699
700 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
701
702         Fixed bug #59980, #64224
703         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
704
705         * typemanager.cs (IsSpecialMethod): Simplified
706
707 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
708
709         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
710         condition with better params.
711
712 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
713
714         Fixed bug #65238
715         * attribute.cs (Resolve): Property has to have both
716         accessors.
717
718 2004-09-14  Martin Baulig  <martin@ximian.com>
719
720         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
721
722 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
723
724         Fixed bug #61902
725         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
726         called and is obsolete then this member suppress message
727         when call is inside next [Obsolete] method or type.
728
729         * expression.cs: Use TestObsoleteMethodUsage member.
730
731 2004-09-14  Martin Baulig  <martin@ximian.com>
732
733         * cs-parser.jay: Sync a bit with the GMCS version.
734
735 2004-09-14  Martin Baulig  <martin@ximian.com>
736
737         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
738         (CSharpParser.yacc_verbose_flag): New public field.
739
740         * genericparser.cs: Removed.
741
742 2004-09-14  Raja R Harinath  <rharinath@novell.com>
743
744         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
745
746 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
747
748         * class.cs (MethodCore.CheckBase): Fix bug #65757.
749
750 2004-09-10  Martin Baulig  <martin@ximian.com>
751
752         Backported my MemberName changes from GMCS into MCS.
753
754         - we are now using a special `MemberName' class instead of using
755         strings; in GMCS, the `MemberName' also contains the type
756         arguments.
757
758         - changed the grammar rules a bit:
759           * the old `member_name' is now a `namespace_or_type_name':
760             The rule is that we use `namespace_or_type_name' everywhere
761             where we expect either a "member name" (GetEnumerator) or a
762             "member name" with an explicit interface name
763             (IEnumerable.GetEnumerator).
764             In GMCS, the explicit interface name may include type arguments
765             (IEnumerable<T>.GetEnumerator).
766           * we use `member_name' instead of just `IDENTIFIER' for
767             "member names":
768             The rule is that we use `member_name' wherever a member may
769             have type parameters in GMCS.       
770
771         * decl.cs (MemberName): New public class.
772         (MemberCore.MemberName): New public readonly field.
773         (MemberCore.ctor): Take a `MemberName' argument, not a string.
774         (DeclSpace): Likewise.
775
776         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
777         * enum.cs (Enum.ctor): Likewise.
778
779         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
780         MemberName.     
781         (AliasEntry.ctor): Take a MemberName, not an Expression.
782         (AliasEntry.UsingAlias): Likewise.
783
784         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
785         (IMethodData.MemberName): Changed type from string to MemberName.
786         (MemberBase.ExplicitInterfaceName): Likewise.
787         (AbstractPropertyEventMethod.SetupName): Make this private.
788         (AbstractPropertyEventMethod.ctor): Added `string prefix'
789         argument; compute the member name here.
790         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
791         on the `member.MemberName' and the `prefix'.
792
793         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
794         not `type_name'.
795         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
796         thus, we get a `MemberName' instead of a `string'.  These
797         declarations may have type parameters in GMCS.
798         (interface_method_declaration, delegate_declaration): Likewise.
799         (class_declaration, interface_declaration): Likewise.
800         (method_header): Use `namespace_or_type_name' instead of
801         `member_name'.  We may be an explicit interface implementation.
802         (property_declaration, event_declaration): Likewise.
803         (member_name): This is now just an `IDENTIFIER', not a
804         `namespace_or_type_name'.
805         (type_name, interface_type): Removed.
806         (namespace_or_type_name): Return a MemberName, not an Expression.
807         (primary_expression): Use `member_name' instead of `IDENTIFIER';
808         call GetTypeExpression() on the MemberName to get an expression.
809         (IndexerDeclaration.interface_type): Changed type from string to
810         MemberName.
811         (MakeName): Operate on MemberName's instead of string's.
812
813 2004-09-13  Raja R Harinath  <rharinath@novell.com>
814
815         Fix bug #55770.
816         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
817         (NamespaceEntry.Lookup): Add new argument to flag if we want the
818         lookup to avoid symbols introduced by 'using'.
819         * rootcontext.cs (NamespaceLookup): Update.
820
821 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
822
823         * class.cs (TypeContainer.DoDefineMembers): Do not call
824         DefineDefaultConstructor for static classes.
825
826 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
827
828         * attribute.cs (Attribute.Resolve): Add error 653 report.
829
830         * class.cs (Class.ApplyAttributeBuilder): Add error 641
831         report.
832         (Method.ApplyAttributeBuilder): Add error 685 report.
833         (Operator.Define): Add error 564 report.
834
835         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
836
837         * expression.cs (Invocation.DoResolve): Add error
838         245 and 250 report.
839
840         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
841         error 674 report.
842
843 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
844
845         * class.cs (ConstructorInitializer.Resolve):
846         Wrong error number (515->516).
847
848 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
849
850         * class.cs (Indexer.Define): Add error 631 report.
851
852 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
853
854         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
855
856 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
857
858         * expression.cs (Probe.DoResolve): Add error CS0241 report.
859
860 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
861
862         * cs-parser.jay: Added error CS0241 report.
863
864 2004-09-10  Raja R Harinath  <rharinath@novell.com>
865
866         * cs-parser.jay (fixed_statement): Introduce a scope for the
867         declaration in the 'fixed' statement.
868
869 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
870
871         * cs-parser.jay: Added CS0230 error report.
872
873 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
874
875         * cs-parser.jay: Added errors CS0231 and CS0257 report.
876
877 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
878
879         * expression.cs (Argument.Resolve): Added error CS0192 and
880         CS0199 report.
881
882 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
883
884         C# 2.0 #pragma warning feature
885
886         * cs-tokenizer.cs (PreProcessPragma): New method; 
887         Handles #pragma directive.
888
889         * report.cs (WarningRegions): New class; Support
890         class for #pragma warning directive. It tests whether
891         warning is enabled for a given line.
892
893 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
894
895         * const.cs: Add more descriptive error report, tahnks to
896         Sebastien. 
897
898 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
899
900         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
901
902 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
903
904         * expression.cs: Apply patch from Ben: Remove dead code from
905         ArrayCreation, and remove the TurnintoConstant call in const.cs,
906         as that code just threw an exception anwyays.
907
908         * const.cs: Remove the call to the turnintoconstant, for details
909         see bug: #63144
910         
911         * literal.cs: The type of the null-literal is the null type;  So
912         we use a placeholder type (literal.cs:System.Null, defined here)
913         for it.
914
915         * expression.cs (Conditional.DoResolve): Remove some old code that
916         is no longer needed, conversions have been fixed.
917
918         (ArrayCreationExpression.DoResolve): Return false if we fail to
919         resolve the inner expression.
920
921 2004-09-07  Raja R Harinath  <rharinath@novell.com>
922
923         Fix test-290.cs.
924         * cs-parser.jay (delegate_declaration): Record a delegate
925         declaration as a type declaration.
926         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
927
928 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
929
930         * parameter.cs: Do not crash if the type can not be resolved. 
931
932         * expression.cs: Report errors with unsafe pointers, fixes #64896
933
934 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
935
936         * expression.cs: Pointer arith always needs to do a conv.i
937         if the operand is a long. fix 65320
938
939 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
940
941         Fixed cs0619-37.cs, cs0619-38.cs
942
943         * enum.cs (GetObsoleteAttribute): Removed.
944
945         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
946         on Enum member is double staged. The first is tested member
947         and then enum.
948
949 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
950
951         Fixed #56986, #63631, #65231
952
953         * class.cs: (TypeContainer.AddToMemberContainer): New method,
954         adds member to name container.
955         (TypeContainer.AddToTypeContainer): New method, adds type to
956         name container.
957         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
958         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
959         AddOperator): Simplified by reusing AddToMemberContainer.
960         (TypeContainer.UserDefinedStaticConstructor): Changed to property
961         instead of field.
962         (Method.CheckForDuplications): Fixed implementation to test all
963         possibilities.
964         (MemberBase): Detection whether member is explicit interface
965         implementation is now in constructor.
966         (MemberBase.UpdateMemberName): Handles IndexerName.
967         (Accessor): Changed to keep also location information.
968         (AbstractPropertyEventMethod): Is derived from MemberCore.
969         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
970         will be emited or not.
971         (PropertyBase.AreAccessorsDuplicateImplementation):
972         Tests whether accessors are not in collision with some method.
973         (Operator): Is derived from MethodCore to simplify common
974         operations.
975
976         * decl.cs (Flags.TestMethodDuplication): Test for duplication
977         must be performed.
978         (DeclSpace.AddToContainer): Adds the member to defined_names
979         table. It tests for duplications and enclosing name conflicts.
980
981         * enum.cs (EnumMember): Clean up to reuse the base structures
982
983 2004-09-03  Martin Baulig  <martin@ximian.com>
984
985         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
986         into TypeContainer, to make partial classes work again.
987
988 2004-09-03  Martin Baulig  <martin@ximian.com>
989
990         * rootcontext.cs (RootContext.V2): Removed.
991
992 2004-03-23  Martin Baulig  <martin@ximian.com>
993
994         * expression.cs (Invocation.OverloadResolve): Added `bool
995         may_fail' argument and use it instead of the Location.IsNull() hack.
996
997 2004-09-03  Martin Baulig  <martin@ximian.com>
998
999         Merged latest changes into gmcs.  Please keep this comment in
1000         here, it makes it easier for me to see what changed in MCS since
1001         the last time I merged.
1002
1003 2004-09-03  Raja R Harinath  <rharinath@novell.com>
1004
1005         Fix #61128.
1006         * expression.cs (BetterConversion): Don't allow either conversion 
1007         to be null.  Remove redundant implicit conversion test when 'q ==
1008         null' -- when this function is invoked, we already know that the
1009         implicit conversion exists.
1010         (BetterFunction): Assume that 'best' is non-null.  Remove
1011         redundant reimplementation of IsApplicable when 'best' is null.
1012         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
1013         number of arguments.
1014         (IsAncestralType): Extract from OverloadResolve.
1015         (OverloadResolve): Make robust to the MethodGroupExpr being
1016         unsorted.  Implement all the logic of Section 14.5.5.1, and
1017         support overloading of methods from multiple applicable types.
1018         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
1019
1020         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
1021         (RealError, Warning): Append type of report to related symbol.
1022
1023 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
1024
1025         * enum.cs: Fixed CLS-Compliance checks for enum members.
1026         Error tests cs3008-8.cs, cs3014-8.cs
1027
1028 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1029
1030         Fixed bug #62342, #63102
1031         * class.cs: ImplementIndexer uses member.IsExplicitImpl
1032         like ImplementMethod.
1033
1034 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1035
1036         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1037         Fixed bug #65170.
1038
1039 2004-09-02  Martin Baulig  <martin@ximian.com>
1040
1041         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
1042         TypeManager.GetArgumentTypes() rather than calling GetParameters()
1043         on the MethodBase.
1044
1045 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
1046
1047         C# 2.0 Static classes implemented
1048
1049         * class.cs (TypeContainer): instance_constructors,
1050         initialized_fields, initialized_static_fields,
1051         default_constructor, base_inteface_types are protected to be
1052         accessible from StaticClass.
1053         (TypeContainer.DefineDefaultConstructor): New virtual method
1054         for custom default constructor generating
1055         (StaticClass): New class to handle "Static classes" feature.
1056
1057         * cs-parser.jay: Handle static keyword on class like instance
1058         of StaticClass.
1059
1060         * driver.cs: Added "/langversion" command line switch with two
1061         options (iso-1, default).
1062
1063 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
1064
1065         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
1066
1067 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
1068
1069         * delegate.cs: Style.
1070
1071 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
1072
1073         * delegate.cs: Add seperate instance expr field for miguel.
1074
1075 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1076
1077         * PointerArithmetic (Resolve): make sure we are not doing
1078         pointer arith on void*. Also, make sure we are resolved
1079         by not setting eclass until resolve.
1080
1081         All callers: Make sure that PointerArithmetic gets resolved.
1082
1083 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1084
1085         * ArrayCreation (LookupType): If the type does not resolve 
1086         to an array, give an error.
1087
1088 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
1089
1090         * statement.cs (Try.Resolve): Fixed bug #64222
1091
1092 2004-08-27  Martin Baulig  <martin@ximian.com>
1093
1094         * class.cs
1095         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
1096         crash here.     
1097
1098 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1099
1100         * ecore.cs (Constantify): Get underlying type via
1101         System.Enum.GetUnderlyingType to avoid StackOverflow on the
1102         Windows in special cases.
1103
1104 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1105
1106         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
1107         for obtaining also private methods.
1108         (GetRemoveMethod): Used GetRemoveMethod (true)
1109         for obtaining also private methods.
1110
1111 2004-08-24  Martin Baulig  <martin@ximian.com>
1112
1113         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
1114         MethodAttributes.HideBySig for operators.
1115
1116 2004-08-23  Martin Baulig  <martin@ximian.com>
1117
1118         Back to the old error reporting system :-)
1119
1120         * report.cs (Message): Removed.
1121         (Report.MessageData, ErrorData, WarningData): Removed.
1122         (Report.Error, Warning): Back to the old system.
1123
1124 2004-08-23  Martin Baulig  <martin@ximian.com>
1125
1126         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
1127
1128         * class.cs (TypeContainer.ParentContainer): New public virtual
1129         method; replaces the explicit interface implementation.
1130         (ClassPart.ParentContainer): Override.
1131
1132 2004-08-23  Martin Baulig  <martin@ximian.com>
1133
1134         * statement.cs (Switch): Added support for constant switches; see
1135         #59428 or test-285.cs.
1136
1137 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1138
1139         Fixed bug #62740.
1140         * statement.cs (GetEnumeratorFilter): Removed useless
1141         logic because C# specs is strict. GetEnumerator must be
1142         public.
1143
1144 2004-08-22  Martin Baulig  <martin@ximian.com>
1145
1146         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1147         a switch and may break, reset the barrier.  Fixes #59867.
1148
1149 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1150
1151         CLS-Compliance speed up (~5% for corlib)
1152
1153         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
1154         New method. Tests container for CLS-Compliant names
1155
1156         * class.cs (TypeContainer.VerifyClsName): New method.
1157         Checks whether container name is CLS Compliant.
1158         (Constructor): Implements IMethodData.
1159
1160         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
1161         low-case table for CLS Compliance test.
1162         (MemberCache.VerifyClsParameterConflict): New method.
1163         Checks method parameters for CS3006 error.
1164
1165         * enum.cs (EnumMember): Is derived from MemberCore.
1166         (Enum.VerifyClsName): Optimized for better performance.
1167
1168 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1169
1170         * report.cs: Renamed Error_T to Error and changed all
1171         references.
1172
1173 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1174
1175         * class.cs (TypeContainer.IndexerArrayList): New inner class
1176         container for indexers.
1177         (TypeContainer.DefaultIndexerName): New constant for default
1178         indexer name. Replaced all "Item" with this constant.
1179         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
1180
1181         * typemanager.cs (TypeManager.default_member_ctor): Cache here
1182         DefaultMemberAttribute constructor.
1183
1184 2004-08-05  Martin Baulig  <martin@ximian.com>
1185
1186         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1187         Fix bug #59429.
1188
1189 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
1190
1191         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
1192         multi platforms problem.
1193
1194         * compiler.csproj: Included shared files.
1195
1196 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1197
1198         Fix bug 60333, 55971 in the more general way
1199         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1200         Added arg_type argument for constant conversion.
1201         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
1202
1203 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1204
1205         Fix bug #59760
1206         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
1207         OperatorArrayList, MethodCoreArrayList for typecontainer
1208         containers. Changed class member types to these new types.
1209         (MethodArrayList.DefineMembers): Added test for CS0659.
1210
1211 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
1212
1213         * cfold.cs: Synchronize the folding with the code in expression.cs
1214         Binary.DoNumericPromotions for uint operands.
1215
1216         * attribute.cs: Revert patch from Raja, it introduced a regression
1217         while building Blam-1.2.1 (hard to isolate a test case).
1218
1219 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1220
1221         Fix for #55382
1222         * class.cs:
1223         (TypeContainer.Define): Renamed to DefineContainerMembers because of
1224         name collision.
1225         (MethodCore.parent_method): New member. The method we're overriding
1226         if this is an override method.
1227         (MethodCore.CheckBase): Moved from Method class and made common.
1228         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
1229         private.
1230         (MethodCore.CheckForDuplications): New abstract method. For custom
1231         member duplication search in a container
1232         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
1233         method and its return type.
1234         (Event.conflict_symbol): New member. Symbol with same name in the
1235         parent class.
1236
1237         * decl.cs:
1238         (MemberCache.FindMemberWithSameName): New method. The method
1239         is looking for conflict with inherited symbols.
1240
1241 2004-08-04  Martin Baulig  <martin@ximian.com>
1242
1243         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
1244
1245         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
1246
1247 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1248
1249         * report.cs (Message): New enum for better error, warning reference in
1250         the code.
1251         (MessageData): New inner abstract class. It generally handles printing of
1252         error and warning messages.
1253         Removed unused Error, Warning, Message methods.
1254
1255 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1256
1257         Fix for cs0592-8.cs test
1258         * attribute.cs
1259         (Attributable.ValidAttributeTargets): Made public.
1260         (Attribute.ExplicitTarget): New member for explicit target value.
1261         (Attribute.CheckTargets): Now we translate explicit attribute
1262         target to Target here.
1263
1264 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
1265
1266         * ecore.cs (MethodGroupExpr): new IsBase property.
1267
1268         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
1269
1270         * delegate.cs (DelegateCreation): store a MethodGroupExpr
1271         rather than an instance expr.
1272
1273         (DelegateCreation.Emit): Use the method group rather than
1274         the instance expression. Also, if you have base.Foo as the
1275         method for a delegate, make sure to emit ldftn, not ldftnvirt.
1276
1277         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
1278
1279         (NewDelegate.DoResolve): Only check for the existance of Invoke
1280         if the method is going to be needed. Use MethodGroupExpr.
1281
1282         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
1283
1284         * expression.cs: For pointer arith., make sure to use
1285         the size of the type, not the size of the pointer to
1286         the type.
1287
1288 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1289
1290         Fix for #60722
1291         * class.cs (Class): Added error CS0502 test.
1292
1293 2004-08-03  John Luke  <jluke@cfl.rr.com>
1294             Raja R Harinath  <rharinath@novell.com>
1295
1296         Fix for #60997.
1297         * attribute.cs (Attribute.complained_before): New flag.
1298         (Attribute.ResolveType, Attribute.Resolve),
1299         (Attribute.DefinePInvokeMethod): Set it.
1300         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
1301         
1302 2004-08-03  Martin Baulig  <martin@ximian.com>
1303
1304         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
1305         use a user-defined operator; we still need to do numeric
1306         promotions in case one argument is a builtin type and the other
1307         one has an implicit conversion to that type.  Fixes #62322.
1308
1309 2004-08-02  Martin Baulig  <martin@ximian.com>
1310
1311         * statement.cs (LocalInfo.Flags): Added `IsThis'.
1312         (LocalInfo.IsThis): New public property.
1313         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
1314
1315 2004-08-01  Martin Baulig  <martin@ximian.com>
1316
1317         * class.cs (TypeContainer.GetClassBases): Don't set the default
1318         here since we may get called from GetPartialBases().
1319         (TypeContainer.DefineType): If GetClassBases() didn't return a
1320         parent, use the default one.
1321
1322 2004-07-30  Duncan Mak  <duncan@ximian.com>
1323
1324         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
1325
1326 2004-07-30  Martin Baulig  <martin@ximian.com>
1327
1328         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
1329
1330         * class.cs (SourceMethod): New public class, derive from the
1331         symbol writer's ISourceMethod.
1332         (Method): Use the new symbol writer API.
1333
1334         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
1335         as argument and use the new symbol writer.
1336
1337         * location.cs
1338         (SourceFile): Implement the symbol writer's ISourceFile.
1339         (Location.SymbolDocument): Removed.
1340         (Location.SourceFile): New public property.
1341
1342         * symbolwriter.cs: Use the new symbol writer API.
1343
1344 2004-07-30  Raja R Harinath  <rharinath@novell.com>
1345
1346         * Makefile (install-local): Remove.  Functionality moved to
1347         executable.make.
1348
1349 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
1350
1351         * Makefile: Install mcs.exe.config file together with mcs.exe.
1352         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
1353         correct runtime version.
1354         
1355 2004-07-25  Martin Baulig  <martin@ximian.com>
1356
1357         * class.cs
1358         (TypeContainer.RegisterOrder): Removed, this was unused.
1359         (TypeContainer, interface_order): Removed.
1360         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
1361         TypeContainer as argument since we can also be called with a
1362         `PartialContainer' for a partial class/struct/interface.
1363         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
1364         of checking whether we're an `Interface' - we could be a
1365         `PartialContainer'.
1366         (PartialContainer.Register): Override; call
1367         AddClass()/AddStruct()/AddInterface() on our parent.
1368
1369         * cs-parser.jay (interface_member_declaration): Add things to the
1370         `current_container', not the `current_class'.
1371
1372         * rootcontext.cs (RegisterOrder): The overloaded version which
1373         takes an `Interface' was unused, removed.
1374
1375         * typemanager.cs (TypeManager.LookupInterface): Return a
1376         `TypeContainer', not an `Interface'.
1377         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
1378         contain a `PartialContainer' for an interface, so check it's
1379         `Kind' to figure out what it is.
1380
1381 2004-07-25  Martin Baulig  <martin@ximian.com>
1382
1383         * class.cs (Class.DefaultTypeAttributes): New public constant.
1384         (Struct.DefaultTypeAttributes): Likewise.
1385         (Interface.DefaultTypeAttributes): Likewise.
1386         (PartialContainer.TypeAttr): Override this and add the
1387         DefaultTypeAttributes.
1388
1389 2004-07-25  Martin Baulig  <martin@ximian.com>
1390
1391         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
1392         we can just use the `Parent' field instead.
1393
1394 2004-07-25  Martin Baulig  <martin@ximian.com>
1395
1396         * class.cs (TypeContainer.Emit): Renamed to EmitType().
1397
1398 2004-07-25  Martin Baulig  <martin@ximian.com>
1399
1400         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
1401         our parts before defining any methods.
1402         (TypeContainer.VerifyImplements): Make this virtual.
1403         (ClassPart.VerifyImplements): Override and call VerifyImplements()
1404         on our PartialContainer.
1405
1406 2004-07-25  Martin Baulig  <martin@ximian.com>
1407
1408         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
1409
1410         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
1411         argument, we can just use the `Parent' field instead.
1412
1413         * class.cs
1414         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
1415         (MemberBase.DoDefine): Likewise.
1416
1417 2004-07-24  Martin Baulig  <martin@ximian.com>
1418
1419         * decl.cs (MemberCore.Parent): New public field.
1420         (DeclSpace.Parent): Moved to MemberCore.
1421
1422         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
1423         (MemberBase.ctor): Added TypeContainer argument, pass it to our
1424         parent's .ctor.
1425         (FieldBase, Field, Operator): Likewise.
1426         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
1427         (EventField, Event): Likewise.
1428
1429 2004-07-23  Martin Baulig  <martin@ximian.com>
1430
1431         * class.cs (PartialContainer): New public class.
1432         (ClassPart): New public class.
1433         (TypeContainer): Added support for partial classes.
1434         (TypeContainer.GetClassBases): Splitted some of the functionality
1435         out into GetNormalBases() and GetPartialBases().
1436
1437         * cs-tokenizer.cs (Token.PARTIAL): New token.
1438         (Tokenizer.consume_identifier): Added some hacks to recognize
1439         `partial', but only if it's immediately followed by `class',
1440         `struct' or `interface'.
1441
1442         * cs-parser.jay: Added support for partial clases.
1443
1444 2004-07-23  Martin Baulig  <martin@ximian.com>
1445
1446         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
1447         a `DeclSpace' and also made it readonly.
1448         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
1449         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
1450         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
1451
1452         * cs-parser.jay: Pass the `current_class', not the
1453         `current_container' (at the moment, this is still the same thing)
1454         to a new Method, Property, Event, Indexer or Constructor.
1455
1456 2004-07-23  Martin Baulig  <martin@ximian.com>
1457
1458         * cs-parser.jay (CSharpParser): Added a new `current_class' field
1459         and removed the `current_interface' one.
1460         (struct_declaration, class_declaration, interface_declaration):
1461         Set `current_class' to the newly created class/struct/interface;
1462         set their `Bases' and call Register() before parsing their body.
1463
1464 2004-07-23  Martin Baulig  <martin@ximian.com>
1465
1466         * class.cs (Kind): New public enum.
1467         (TypeContainer): Made this class abstract.
1468         (TypeContainer.Kind): New public readonly field.
1469         (TypeContainer.CheckDef): New public method; moved here from
1470         cs-parser.jay.
1471         (TypeContainer.Register): New public abstract method.
1472         (TypeContainer.GetPendingImplementations): New public abstract
1473         method.
1474         (TypeContainer.GetClassBases): Removed the `is_class' and
1475         `is_iface' parameters.
1476         (TypeContainer.DefineNestedTypes): Formerly known as
1477         DoDefineType().
1478         (ClassOrStruct): Made this class abstract.
1479
1480         * tree.cs (RootTypes): New public type. 
1481
1482 2004-07-20  Martin Baulig  <martin@ximian.com>
1483
1484         * tree.cs (Tree.RecordNamespace): Removed.
1485         (Tree.Namespaces): Removed.
1486
1487         * rootcontext.cs (RootContext.IsNamespace): Removed.
1488
1489         * cs-parser.jay (namespace_declaration): Just create a new
1490         NamespaceEntry here.
1491
1492 2004-07-20  Martin Baulig  <martin@ximian.com>
1493
1494         * statement.cs (ExceptionStatement): New abstract class.  This is
1495         now used as a base class for everyone who's using `finally'.
1496         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
1497         our local variables before using them.
1498
1499         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
1500         virtual method.  This is used by Yield.Resolve() to "steal" an
1501         outer block's `finally' clauses.
1502         (FlowBranchingException): The .ctor now takes an ExceptionStatement
1503         argument.
1504
1505         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
1506         version which takes an ExceptionStatement.  This version must be
1507         used to create exception branchings.
1508
1509         * iterator.cs
1510         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
1511         (Iterator.EmitMoveNext): Added exception support; protect the
1512         block with a `fault' clause, properly handle 'finally' clauses.
1513         (Iterator.EmitDispose): Run all the `finally' clauses here.
1514
1515 2004-07-20  Martin Baulig  <martin@ximian.com>
1516
1517         * iterator.cs: This is the first of a set of changes in the
1518         iterator code.  Match the spec more closely: if we're an
1519         IEnumerable, then GetEnumerator() must be called.  The first time
1520         GetEnumerator() is called, it returns the current instance; all
1521         subsequent invocations (if any) must create a copy.
1522
1523 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
1524
1525         * expression.cs: Resolve the constant expression before returning
1526         it. 
1527
1528 2004-07-19  Martin Baulig  <martin@ximian.com>
1529
1530         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
1531         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
1532         the return type of the new EmitContext.
1533
1534 2004-07-18  Martin Baulig  <martin@ximian.com>
1535
1536         * class.cs (Property.Define): Fix iterators.
1537
1538         * iterators.cs (Iterator.Define): Moved the
1539         `container.AddInterator (this)' call here from the .ctor; only do
1540         it if we resolved successfully.
1541
1542 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
1543
1544         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
1545         `true' for preprocessing directives that we parse.  The return
1546         value indicates whether we should return to regular tokenizing or
1547         not, not whether it was parsed successfully.
1548
1549         In the past if we were in: #if false ... #line #endif, we would
1550         resume parsing after `#line'.  See bug 61604.
1551
1552         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
1553         building: IsEnumType should return true only for enums, not for
1554         enums or System.Enum itself.  This fixes #61593.
1555
1556         Likely what happened is that corlib was wrong: mcs depended on
1557         this bug in some places.  The bug got fixed, we had to add the
1558         hack, which caused bug 61593.
1559
1560         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
1561         that was a workaround for the older conditions.
1562
1563 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
1564
1565         * assign.cs: IAssignMethod has a new interface, as documented
1566         inline. All assignment code now uses this new api.
1567
1568         * ecore.cs, expression.cs: All classes which implement
1569         IAssignMethod now use the new interface.
1570
1571         * expression.cs (Invocation): add a hack to EmitCall so that
1572         IndexerAccess can be the target of a compound assignment without
1573         evaluating its arguments twice.
1574
1575         * statement.cs: Handle changes in Invocation api.
1576
1577 2004-07-16  Martin Baulig  <martin@ximian.com>
1578
1579         * iterators.cs: Rewrote this.  We're now using one single Proxy
1580         class for both the IEnumerable and the IEnumerator interface and
1581         `Iterator' derives from Class so we can use the high-level API.
1582
1583         * class.cs (TypeContainer.AddIterator): New method.
1584         (TypeContainer.DoDefineType): New protected virtual method, which
1585         is called from DefineType().
1586         (TypeContainer.DoDefineMembers): Call DefineType() and
1587         DefineMembers() on all our iterators.
1588         (TypeContainer.Emit): Call Emit() on all our iterators.
1589         (TypeContainer.CloseType): Call CloseType() on all our iterators.
1590
1591         * codegen.cs (EmitContext.CurrentIterator): New public field.
1592
1593 2004-07-15  Martin Baulig  <martin@ximian.com>
1594
1595         * typemanager.cs
1596         (TypeManager.not_supported_exception_type): New type.   
1597
1598 2004-07-14  Martin Baulig  <martin@ximian.com>
1599
1600         * iterators.cs: Use real error numbers.
1601
1602 2004-07-14  Martin Baulig  <martin@ximian.com>
1603
1604         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
1605         requires this to be a System.Collection.IEnumerable and not a
1606         class implementing that interface.
1607         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
1608
1609 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
1610
1611         * class.cs: Fixed previous fix, it broke some error tests.
1612
1613 2004-07-12  Martin Baulig  <martin@ximian.com>
1614
1615         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
1616         Fixes #61293.
1617
1618 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
1619
1620         * assign.cs (LocalTemporary): Add new argument: is_address,If
1621         `is_address' is true, then the value that we store is the address
1622         to the real value, and not the value itself.
1623         
1624         * ecore.cs (PropertyExpr): use the new local temporary
1625         stuff to allow us to handle X.Y += z (where X is a struct)
1626
1627 2004-07-08  Martin Baulig  <martin@ximian.com>
1628
1629         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
1630         not always return, just like we're doing in Using.Resolve().
1631
1632 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
1633
1634         * cs-parser.jay (fixed_statement): flag this as Pinned.
1635
1636 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
1637
1638         * typemanager.cs (TypeManager): Removed MakePinned method, this
1639         mechanism is replaced with the .NET 2.x compatible mechanism of
1640         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1641
1642         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1643         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1644         `IsFixed' property which has a different meaning.
1645
1646 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1647
1648         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1649         visible from inside a nested class, not just the names of the
1650         immediately enclosing class.
1651         Fix for bug #60730.
1652
1653 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1654
1655         * expression.cs (BetterConversion): Remove buggy special-case
1656         handling of "implicit constant expression conversions".  At this
1657         point, we already know that the conversion is possible -- we're
1658         only checking to see which is better.
1659
1660 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1661
1662         * cs-parser.jay: Added error CS0210 test.
1663
1664 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1665
1666         * cs-parser.jay: Added error CS0134 test.
1667
1668 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1669
1670         Fix bug #52507
1671         * cs-parser.jay: Added error CS0145 test.
1672
1673 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1674
1675         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1676
1677 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1678         
1679         * expression.cs (StackAlloc.Resolve): The argument may not
1680         be a constant; deal with this case.
1681         
1682 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1683
1684         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1685         GetIndexerAttributeValue.
1686         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1687
1688         * class.cs (Indexer.Define): Added error tests for CS0415,
1689         CS0609.
1690
1691 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1692
1693         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1694         property code.
1695
1696 2004-06-23  Martin Baulig  <martin@ximian.com>
1697
1698         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1699         neither return nor throw, reset the barrier as well.  Fixes #60457.
1700
1701 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1702
1703         * class.cs : EventAttributes is now set to None by default.
1704           This fixes bug #60459.
1705
1706 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1707
1708         Fix bug #60219
1709         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1710         Don't throw exception but return null (it's sufficient now).
1711
1712 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * typemanager.cs (GetArgumentTypes): Faster implementation.
1715
1716 2004-06-18  Martin Baulig  <martin@ximian.com>
1717
1718         * attribute.cs (Attribute.Resolve): Check whether we're an
1719         EmptyCast which a Constant child.  Fixes #60333.
1720
1721 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1722
1723         * statement.cs (EmitCollectionForeach): Account for the fact that
1724         not all valuetypes are in areas which we can take the address of.
1725         For these variables, we store to a temporary variable. Also, make
1726         sure that we dont emit a `callvirt' on a valuetype method.
1727
1728 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1729
1730         * expression.cs (StackAlloc.DoReSolve): Added test for
1731         negative parameter (CS0247).
1732
1733 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1734
1735         Fix bug #59792
1736         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1737
1738 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1739
1740         Fix bug #59781
1741         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1742         ulong.
1743
1744 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1745
1746         Fix bug #58254 & cs1555.cs, cs1556.cs
1747         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1748
1749 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * cs-parser.jay: Added error CS1669 test for indexers.
1752
1753 2004-06-11  Martin Baulig  <martin@ximian.com>
1754
1755         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1756         call this twice: for params and varargs methods.
1757
1758 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1759
1760         * class.cs:
1761         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1762
1763 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1764
1765         * attribute.cs (Attribute.GetValidTargets): Made public.
1766
1767         * class.cs: 
1768         (AbstractPropertyEventMethod): New class for better code sharing.
1769         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
1770         CS1667 report.
1771         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
1772
1773 2004-06-11  Raja R Harinath  <rharinath@novell.com>
1774
1775         Fix bug #59477.
1776         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
1777         that the call to Resolve is part of a MemberAccess.
1778         (Expression.Resolve): Use it for SimpleName resolution.
1779         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
1780         Add 'intermediate' boolean argument.
1781         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
1782         error message when the SimpleName can be resolved ambiguously
1783         between an expression and a type.
1784         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
1785         public.
1786         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
1787         call on the left-side.
1788
1789 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1790
1791         * class.cs:
1792         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
1793
1794 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1795
1796         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
1797
1798 2004-06-11  Martin Baulig  <martin@ximian.com>
1799
1800         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
1801         varargs methods if applicable.
1802
1803 2004-06-11  Martin Baulig  <martin@ximian.com>
1804
1805         * expression.cs (Invocation.EmitCall): Don't use
1806         `method.CallingConvention == CallingConventions.VarArgs' since the
1807         method could also have `CallingConventions.HasThis'.
1808
1809 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1810
1811         * class.cs (Event.GetSignatureForError): Implemented.
1812         Fixed crash in error test cs3010.cs
1813
1814 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
1815
1816         * cs-tokenizer.cs: Change the way we track __arglist to be
1817         consistent with the other keywords.
1818
1819 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
1820
1821         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
1822         tomorrow.
1823
1824 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
1825
1826         * codegen.cs: Check that all referenced assemblies have a strongname
1827         before strongnaming the compiled assembly. If not report error CS1577.
1828         Fix bug #56563. Patch by Jackson Harper.
1829         * typemanager.cs: Added a method to return all referenced assemblies.
1830         Fix bug #56563. Patch by Jackson Harper.
1831
1832 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1833
1834         * class.cs:
1835         (Method.ApplyAttributeBuilder): Moved and added conditional
1836         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
1837
1838         * delegate.cs:
1839         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
1840
1841 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1842
1843         Fixed #59640
1844         * class.cs: (EventField.attribute_targets): Changed default target.
1845
1846 2004-06-08  Martin Baulig  <martin@ximian.com>
1847
1848         * expression.cs (Invocation.EmitCall): Enable varargs methods.
1849
1850 2004-06-08  Martin Baulig  <martin@ximian.com>
1851
1852         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
1853
1854 2004-06-07  Martin Baulig  <martin@ximian.com>
1855
1856         Added support for varargs methods.
1857
1858         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
1859         keyword.
1860
1861         * cs-parser.jay: Added support for `__arglist'.
1862
1863         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
1864
1865         * expression.cs (Argument.AType): Added `ArgList'.
1866         (Invocation): Added support for varargs methods.
1867         (ArglistAccess): New public class.
1868         (Arglist): New public class.
1869
1870         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
1871
1872         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
1873         a method's top-level block if the method has varargs.
1874
1875         * support.cs (ReflectionParameters, InternalParameters): Added
1876         support for varargs methods.    
1877
1878 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
1879
1880         * class.cs: Provide location in indexer error report.
1881
1882         * driver.cs: Use standard names.
1883
1884         * namespace.cs: Catch the use of using after a namespace has been
1885         declared also on using aliases.
1886
1887 2004-06-03  Raja R Harinath  <rharinath@novell.com>
1888
1889         Bug #50820.
1890         * typemanager.cs (closure_private_ok, closure_invocation_type)
1891         (closure_qualifier_type, closure_invocation_assembly)
1892         (FilterWithClosure): Move to ...
1893         (Closure): New internal nested class.
1894         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
1895         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
1896         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
1897         (MemberLookup, MemberLookupFailed): Use it.
1898         * expression.cs (New.DoResolve): Treat the lookup for the
1899         constructor as being qualified by the 'new'ed type.
1900         (Indexers.GetIndexersForTypeOrInterface): Update.
1901
1902 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
1903
1904         * attribute.cs
1905         (GetConditionalAttributeValue): New method. Returns
1906         condition of ConditionalAttribute.
1907         (SearchMulti): New method.  Returns all attributes of type 't'.
1908         Use it when attribute is AllowMultiple = true.
1909         (IsConditionalMethodExcluded): New method.
1910
1911         * class.cs
1912         (Method.IsExcluded): Implemented. Returns true if method has conditional
1913         attribute and the conditions is not defined (method is excluded).
1914         (IMethodData): Extended interface for ConditionalAttribute support.
1915         (PropertyMethod.IsExcluded): Implemented.
1916
1917         * decl.cs
1918         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
1919
1920         * expression.cs
1921         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
1922         on the method.
1923
1924 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
1925
1926         * expression.cs (ArrayCreationExpression): Make this just an
1927         `expression'. It can't be a statement, so the code here was
1928         dead.
1929
1930 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1931
1932         Fixed #59072
1933         * typemanager.cs (GetFullNameSignature): New method for
1934         MethodBase types.
1935
1936 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1937
1938         Fixed #56452
1939         * class.cs (MemberBase.GetSignatureForError): New virtual method.
1940         Use this method when MethodBuilder is null.
1941         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
1942         Added test for error CS0626 (MONO reports error for this situation).
1943         (IMethodData.GetSignatureForError): Extended interface.
1944
1945 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1946
1947         * attribute.cs
1948         (AttributeTester.GetObsoleteAttribute): Returns instance of
1949         ObsoleteAttribute when type is obsolete.
1950
1951         * class.cs
1952         (TypeContainer.VerifyObsoleteAttribute): Override.
1953         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
1954         (MethodCode.VerifyObsoleteAttribute): Override.
1955         (MemberBase.VerifyObsoleteAttribute): Override.
1956
1957         * decl.cs
1958         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
1959         and report proper error.
1960
1961         *delegate.cs
1962         Delegate.VerifyObsoleteAttribute): Override.
1963
1964         * ecore.cs
1965         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
1966         and report proper error.
1967         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
1968
1969         * enum.cs
1970         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
1971         and enum member.
1972
1973         * expression.cs
1974         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
1975         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
1976         Added test for ObsoleteAttribute.
1977
1978         * statement.cs
1979         (Catch): Derived from Statement.
1980
1981 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1982  
1983         Fixed bug #59071 & cs0160.cs
1984  
1985         * statement.cs (Try.Resolve): Check here whether order of catch
1986         clauses matches their dependencies.
1987
1988 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
1989
1990         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
1991         caused a regression: #59343.  Referencing nested classes from an
1992         assembly stopped working.
1993
1994 2004-05-31  Martin Baulig  <martin@ximian.com>
1995
1996         MCS is now frozen for beta 2.
1997
1998 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1999
2000         * convert.cs: add a trivial cache for overload operator resolution.
2001
2002 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2003
2004         * decl.cs: If possible, use lookuptypedirect here. We can only do
2005         this if there is no `.' after the namespace. Avoids using
2006         LookupType, which does lots of slow processing.
2007         (FindNestedType) New method, does what it says :-).
2008         * namespace.cs: use LookupTypeDirect.
2009         * rootcontext.cs: use membercache, if possible.
2010         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
2011
2012 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2013
2014         * expression.cs:
2015         According to the spec, 
2016
2017         In a member access of the form E.I, if E is a single identifier,
2018         and if the meaning of E as a simple-name (§7.5.2) is a constant,
2019         field, property, localvariable, or parameter with the same type as
2020         the meaning of E as a type-name (§3.8), then both possible
2021         meanings of E are permitted.
2022
2023         We did not check that E as a simple-name had the same type as E as
2024         a type name.
2025
2026         This trivial check gives us 5-7% on bootstrap time.
2027
2028 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2029
2030         * expression.cs (Invocation.OverloadResolve): Avoid the
2031         use of hashtables and boxing here by allocating on demand.
2032
2033 2004-05-30  Martin Baulig  <martin@ximian.com>
2034
2035         * rootcontext.cs (RootContext.LookupType): Don't cache things if
2036         we're doing a silent lookup.  Don't try to lookup nested types in
2037         TypeManager.object_type (thanks to Ben Maurer).
2038
2039 2004-05-30  Martin Baulig  <martin@ximian.com>
2040
2041         Committing a patch from Ben Maurer.
2042
2043         * rootcontext.cs (RootContext.LookupType): Cache negative results.
2044
2045 2004-05-29  Martin Baulig  <martin@ximian.com>
2046
2047         * class.cs (IMethodData.ShouldIgnore): New method.
2048
2049         * typemanager.cs (TypeManager.MethodFlags): Don't take a
2050         `Location' argument, we don't need it anywhere.  Use
2051         `IMethodData.ShouldIgnore ()' instead of
2052         `MethodData.GetMethodFlags ()'.
2053         (TypeManager.AddMethod): Removed.
2054         (TypeManager.AddMethod2): Renamed to AddMethod.
2055
2056 2004-05-29  Martin Baulig  <martin@ximian.com>
2057
2058         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
2059
2060         * convert.cs (Convert.ImplicitReferenceConversion): If we're
2061         converting from a class type S to an interface type and we already
2062         have an object on the stack, don't box it again.  Fixes #52578.
2063
2064 2004-05-29  Martin Baulig  <martin@ximian.com>
2065
2066         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
2067         Added support for `params' parameters.  Fixes #59267.
2068
2069 2004-05-29  Martin Baulig  <martin@ximian.com>
2070
2071         * literal.cs (NullPointer): Provide a private .ctor which sets
2072         `type' to TypeManager.object_type.  Fixes #59048.
2073
2074 2004-05-29  Martin Baulig  <martin@ximian.com>
2075
2076         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
2077         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
2078
2079         * ecore.cs (EventExpr.instance_expr): Make the field private.
2080
2081 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
2082
2083         Fixed bug #50080 & cs0214-2.cs
2084         * expression.cs (Cast.DoResolve): Check unsafe context here.
2085         
2086         * statement.cs (Resolve.DoResolve): Likewise.
2087
2088 2004-05-26  Martin Baulig  <martin@ximian.com>
2089
2090         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
2091
2092         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
2093         (RootContext.LookupType): Pass down the `silent' flag.
2094
2095 2004-05-25  Martin Baulig  <martin@ximian.com>
2096
2097         * expression.cs
2098         (MethodGroupExpr.IdenticalTypeName): New public property.
2099         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
2100         expression actually refers to a type.
2101
2102 2004-05-25  Martin Baulig  <martin@ximian.com>
2103
2104         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
2105         for #56176 and made it actually work.
2106
2107 2004-05-25  Martin Baulig  <martin@ximian.com>
2108
2109         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
2110         (FieldExpr, PropertyExpr): Override and implement
2111         CacheTemporaries.  Fixes #52279.
2112
2113 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
2114
2115         * location.cs: In the new compiler listing a file twice is a
2116         warning, not an error.
2117
2118 2004-05-24  Martin Baulig  <martin@ximian.com>
2119
2120         * enum.cs (Enum.DefineType): For the `BaseType' to be a
2121         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
2122
2123 2004-05-24  Martin Baulig  <martin@ximian.com>
2124
2125         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
2126         walking the `using' list.  Fixes #53921.
2127
2128 2004-05-24  Martin Baulig  <martin@ximian.com>
2129
2130         * const.cs (Const.LookupConstantValue): Added support for
2131         EmptyCast's; fixes #55251.
2132
2133 2004-05-24  Martin Baulig  <martin@ximian.com>
2134
2135         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
2136         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
2137         which does the CS0135 check.  The reason is that we first need to
2138         check whether the variable actually exists.
2139
2140 2004-05-24  Martin Baulig  <martin@ximian.com>
2141
2142         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
2143         than RootContext.LookupType() to find the explicit interface
2144         type.  Fixes #58584.
2145
2146 2004-05-24  Raja R Harinath  <rharinath@novell.com>
2147
2148         * Makefile: Simplify.  Use executable.make.
2149         * mcs.exe.sources: New file.  List of sources of mcs.exe.
2150
2151 2004-05-24  Anders Carlsson  <andersca@gnome.org>
2152
2153         * decl.cs:
2154         * enum.cs:
2155         Use the invariant culture when doing String.Compare for CLS case
2156         sensitivity.
2157         
2158 2004-05-23  Martin Baulig  <martin@ximian.com>
2159
2160         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
2161         don't have any dots.  Fixes #52622, added cs0246-8.cs.
2162
2163         * namespace.cs (NamespaceEntry.Lookup): Likewise.
2164         
2165 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2166
2167         * class.cs (MemberBase.Define): Reuse MemberType member for 
2168         resolved type. Other methods can use it too.
2169
2170 2004-05-23  Martin Baulig  <martin@ximian.com>
2171
2172         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
2173         the variable also exists in the current block (otherwise, we need
2174         to report a CS0103).  Fixes #58670.
2175
2176 2004-05-23  Martin Baulig  <martin@ximian.com>
2177
2178         * flowanalysis.cs (Reachability.Reachable): Compute this
2179         on-the-fly rather than storing it as a field.
2180
2181 2004-05-23  Martin Baulig  <martin@ximian.com>
2182
2183         * flowanalysis.cs (Reachability.And): Manually compute the
2184         resulting `barrier' from the reachability.      
2185        
2186 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2187
2188         Fix bug #57835
2189         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
2190         instance of ObsoleteAttribute when symbol is obsolete.
2191
2192         * class.cs
2193         (IMethodData): Extended interface for ObsoleteAttribute support.
2194
2195 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2196
2197         * attribute.cs: Fix bug #55970
2198
2199 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2200
2201         Fix bug #52705
2202         * attribute.cs
2203         (GetObsoleteAttribute): New method. Creates the instance of
2204         ObsoleteAttribute.
2205         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
2206         ObsoleteAttribute when member is obsolete.
2207         (AttributeTester.Report_ObsoleteMessage): Common method for
2208         Obsolete error/warning reporting.
2209
2210         * class.cs
2211         (TypeContainer.base_classs_type): New member for storing parent type.
2212
2213         * decl.cs
2214         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
2215         for this MemberCore.
2216
2217 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2218
2219         * attribute.cs, const.cs: Fix bug #58590
2220
2221 2004-05-21  Martin Baulig  <martin@ximian.com>
2222
2223         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
2224         out parameters if the end of the method is unreachable.  Fixes
2225         #58098. 
2226
2227 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2228
2229         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
2230         Hari was right, why extra method.
2231
2232 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2233
2234         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
2235
2236 2004-05-20  Martin Baulig  <martin@ximian.com>
2237
2238         Merged this back from gmcs to keep the differences to a minumum.
2239
2240         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
2241         instead of a Declspace.
2242         (Attribute.ResolveType): Likewise.
2243         (Attributes.Search): Likewise.
2244         (Attributes.Contains): Likewise.
2245         (Attributes.GetClsCompliantAttribute): Likewise.
2246
2247         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
2248         argument.
2249         (MethodData.ApplyAttributes): Take an EmitContext instead of a
2250         DeclSpace.
2251
2252 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
2253
2254         Fix bug #58688 (MCS does not report error when the same attribute
2255         is assigned twice)
2256
2257         * attribute.cs (Attribute.Emit): Distinction between null and default.
2258
2259 2004-05-19  Raja R Harinath  <rharinath@novell.com>
2260
2261         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
2262         of a top-level attribute without an attribute target.
2263         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
2264         Make non-static.
2265         (Attribute.Conditional_GetConditionName), 
2266         (Attribute.Obsolete_GetObsoleteMessage): Update.
2267         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
2268         part of ScanForIndexerName.
2269         (Attribute.CanIgnoreInvalidAttribute): New function.
2270         (Attribute.ScanForIndexerName): Move to ...
2271         (Attributes.ScanForIndexerName): ... here.
2272         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
2273         (Attributes.Search): New internal variant that can choose not to
2274         complain if types aren't resolved.  The original signature now
2275         complains.
2276         (Attributes.GetClsCompliantAttribute): Use internal variant, with
2277         complaints suppressed.
2278         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
2279         only if it not useful.
2280         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
2281         top-level for attributes that are shared between the assembly
2282         and a top-level class.
2283         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
2284         * class.cs: Update to reflect changes.
2285         (DefineIndexers): Fuse loops.
2286         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
2287         a couple more variants of attribute names.
2288
2289 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
2290
2291         Fix bug #52585 (Implemented explicit attribute declaration)
2292
2293         * attribute.cs:
2294         (Attributable.ValidAttributeTargets): New abstract method. It gets
2295         list of valid attribute targets for explicit target declaration.
2296         (Attribute.Target): It holds target itself.
2297         (AttributeSection): Removed.
2298         (Attribute.CheckTargets): New method. It checks whether attribute
2299         target is valid for the current element.
2300
2301         * class.cs:
2302         (EventProperty): New class. For events that are declared like
2303         property (with add and remove accessors).
2304         (EventField): New class. For events that are declared like field.
2305         class.cs
2306
2307         * cs-parser.jay: Implemented explicit attribute target declaration.
2308
2309         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
2310         Override ValidAttributeTargets.
2311
2312         * parameter.cs:
2313         (ReturnParameter): Class for applying custom attributes on 
2314         the return type.
2315         (ParameterAtribute): New class. Class for applying custom
2316         attributes on the parameter type.
2317
2318 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
2319
2320         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
2321         definitions. 
2322
2323         (Method): Allow UNSAFE here.
2324
2325         * modifiers.cs: Support unsafe reporting.
2326
2327 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
2328
2329         * decl.cs: Fix bug #58478.
2330
2331 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2332
2333         * statement.cs: When checking for unreachable code on an EmptyStatement,
2334         set the location. Fixes bug #58488.
2335
2336 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
2337
2338         * driver.cs: Add -pkg handling.
2339
2340         From Gonzalo: UseShelLExecute=false
2341
2342 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
2343
2344         * attribute.cs:
2345         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
2346         for attribute.
2347         (Attribute.IsClsCompliaceRequired): Moved to base for better
2348         accesibility.
2349         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
2350         when attribute is AttributeUsageAttribute.
2351         (Attribute.GetValidTargets): Simplified.
2352         (Attribute.GetAttributeUsage): New method returns AttributeUsage
2353         attribute for this type.
2354         (Attribute.ApplyAttributes): Method renamed to Emit and make
2355         non-static.
2356         (GlobalAttributeSection): New class for special handling of global
2357         attributes (assembly, module).
2358         (AttributeSection.Emit): New method.
2359
2360         * class.cs: Implemented Attributable abstract methods.
2361         (MethodCore.LabelParameters): Moved to Parameter class.
2362         (Accessor): Is back simple class.
2363         (PropertyMethod): Implemented Attributable abstract class.
2364         (DelegateMethod): Implemented Attributable abstract class.
2365         (Event): New constructor for disctintion between normal Event
2366         and Event with accessors.
2367
2368         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
2369
2370         * codegen.cs, const.cs, decl.cs, delegate.cs:
2371         (CommonAssemblyModulClass): Implemented Attributable abstract class
2372         and simplified.
2373
2374         * enum.cs: Implement IAttributeSupport interface.
2375         (EnumMember): New class for emum members. Implemented Attributable
2376         abstract class
2377
2378         * parameter.cs:
2379         (ParameterBase): Is abstract.
2380         (ReturnParameter): New class for easier [return:] attribute handling.
2381
2382         * typemanager.cs: Removed builder_to_attr.
2383
2384 2004-05-11  Raja R Harinath  <rharinath@novell.com>
2385
2386         Fix bug #57151.
2387         * attribute.cs (Attribute.GetPositionalValue): New function.
2388         * class.cs (TypeContainer.VerifyMembers): New function.
2389         (TypeContainer.Emit): Use it.
2390         (ClassOrStruct): New base class for Class and Struct.
2391         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
2392         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
2393         class.
2394         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
2395         then each non-static field should have a FieldOffset attribute.
2396         Otherwise, none of the fields should have a FieldOffset attribute.
2397         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
2398         and FieldOffset attributes.
2399         * typemanager.cs (TypeManager.struct_layout_attribute_type)
2400         (TypeManager.field_offset_attribute_type): New core types.
2401         (TypeManager.InitCoreTypes): Initialize them.
2402
2403 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
2404
2405         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
2406         Return correct type.
2407         From bug #58270.
2408
2409 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
2410
2411         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
2412         be implicitly converted to ulong.
2413         
2414         * expression.cs: The logic for allowing operator &, | and ^ worked
2415         was wrong, it worked before because we did not report an error in
2416         an else branch.  Fixes 57895.
2417
2418         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
2419         allow volatile fields to be reference types.
2420
2421 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
2422
2423         * driver.cs: Add support for /debug-
2424
2425 2004-05-07  Raja R Harinath  <rharinath@novell.com>
2426
2427         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
2428         Add a 'complain' parameter to silence errors.
2429         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
2430         silently overlooked type-resolutions.
2431         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
2432         to reflect changes.
2433         (Attributes.Search): New function.
2434         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
2435         (Attributes.GetAttributeFullName): Remove hack.
2436         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
2437         Update to reflect changes.
2438         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2439         Use Attributes.Search instead of nested loops.
2440
2441 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
2442
2443         * decl.cs:
2444         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
2445         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
2446         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
2447
2448         * report.cs: (Report.Warning): Renamed to Warning_T because of
2449         parameter collision.
2450
2451 2004-05-05  Raja R Harinath  <rharinath@novell.com>
2452
2453         * expression.cs (MemberAccess.ResolveMemberAccess):
2454         Exit with non-zero status after Report.Error.
2455         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
2456         Likewise.
2457         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
2458
2459 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2460
2461         * support.cs: Don't hang when the file is empty.
2462
2463 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2464
2465         * support.cs: In SeekableStreamReader, compute the preamble size of the
2466           underlying stream. Position changes should take into account that initial
2467           count of bytes.
2468
2469 2004-05-03  Todd Berman  <tberman@sevenl.net>
2470
2471         * driver.cs: remove unused GetSysVersion function.
2472
2473 2004-05-03  Todd Berman  <tberman@sevenl.net>
2474
2475         * driver.cs: Remove the hack from saturday, as well as the hack
2476         from jackson (LoadAssemblyFromGac), also adds the CWD to the
2477         link_paths to get that bit proper.
2478
2479 2004-05-01  Todd Berman  <tberman@sevenl.net>
2480
2481         * driver.cs: Try a LoadFrom before a Load, this checks the current
2482         path. This is currently a bug in mono that is be fixed, however, this
2483         provides a workaround for now. This will be removed when the bug
2484         is fixed.
2485
2486 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
2487
2488         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2489         incomplete key pairs (#57941).
2490
2491 2004-05-01  Todd Berman  <tberman@sevenl.net>
2492
2493         * driver.cs: Remove '.' from path_chars, now System.* loads properly
2494         from the GAC
2495
2496 2004-04-30  Jackson Harper  <jackson@ximian.com>
2497
2498         * codegen.cs: Open keys readonly.
2499         
2500 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2501
2502         * typemanager.cs: don't report cyclic struct layout when a struct
2503         contains 2 or more fields of the same type. Failed for Pango.AttrShape
2504         which has 2 Pango.Rectangle fields.
2505
2506 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2507
2508         * expression.cs: Handle IntPtr comparisons with IL code
2509         rather than a method call.
2510
2511 2004-04-29  Martin Baulig  <martin@ximian.com>
2512
2513         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
2514         the list of PropertyInfo's in class hierarchy and find the
2515         accessor.  Fixes #56013.
2516
2517 2004-04-29  Martin Baulig  <martin@ximian.com>
2518
2519         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2520
2521 2004-04-29  Martin Baulig  <martin@ximian.com>
2522
2523         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2524
2525         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2526
2527 2004-04-29  Martin Baulig  <martin@ximian.com>
2528
2529         * class.cs (ConstructorInitializer.Resolve): Check whether the
2530         parent .ctor is accessible.  Fixes #52146.
2531
2532 2004-04-29  Martin Baulig  <martin@ximian.com>
2533
2534         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2535
2536         * statement.cs (Using.EmitLocalVariableDecls): Use
2537         TypeManager.idisposable_type, not typeof (IDisposable).
2538         (Foreach.EmitCollectionForeach): Added support for valuetypes.
2539
2540 2004-04-29  Martin Baulig  <martin@ximian.com>
2541
2542         * class.cs (Event.Define): Don't emit the field and don't set
2543         RTSpecialName and SpecialName for events on interfaces.  Fixes
2544         #57703. 
2545
2546 2004-04-29  Raja R Harinath  <rharinath@novell.com>
2547
2548         Refactor Attribute.ApplyAttributes.
2549         * attribute.cs (Attributable): New base class for objects that can
2550         have Attributes applied on them.
2551         (Attribute): Make AttributeUsage fields public.
2552         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
2553         (Attribute.IsInternalCall): New property.
2554         (Attribute.UsageAttr): Convert to a public read-only property.
2555         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
2556         (Attribute.ResolveType, Attribute.Resolve)
2557         (Attribute.ScanForIndexerName): Update to reflect changes.
2558         (Attribute.CheckAttributeTarget): Re-format.
2559         (Attribute.ApplyAttributes): Refactor, to various
2560         Attributable.ApplyAttributeBuilder methods.
2561         * decl.cs (MemberCore): Make Attributable.
2562         * class.cs (Accessor): Make Attributable.
2563         (MethodData.ApplyAttributes): Use proper attribute types, not
2564         attribute names.
2565         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
2566         (TypeContainer.ApplyAttributeBuilder)
2567         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
2568         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
2569         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
2570         (Operator.ApplyAttributeBuilder): New factored-out methods.
2571         * const.cs (Const.ApplyAttributeBuilder): Likewise.
2572         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
2573         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
2574         * parameter.cs (ParameterBase): New Attributable base class
2575         that can also represent Return types.
2576         (Parameter): Update to the changes.
2577
2578 2004-04-29  Jackson Harper  <jackson@ximian.com>
2579
2580         * driver.cs: Prefer the corlib system version when looking for
2581         assemblies in the GAC. This is still a hack, but its a better hack
2582         now.
2583         
2584 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * decl.cs, enum.cs: Improved error 3005 reporting.
2587   
2588         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
2589         (related_symbols): New private member for list of symbols
2590         related to reported error/warning.
2591         
2592         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2593
2594 2004-04-29  Martin Baulig  <martin@ximian.com>
2595
2596         * ecore.cs (Expression.Constantify): If we're an enum and
2597         TypeManager.TypeToCoreType() doesn't give us another type, use
2598         t.UnderlyingSystemType.  Fixes #56178.  
2599
2600 2004-04-29  Martin Baulig  <martin@ximian.com>
2601
2602         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
2603         interfaces and for each interface, only add members directly
2604         declared in that interface.  Fixes #53255.
2605
2606 2004-04-28  Martin Baulig  <martin@ximian.com>
2607
2608         * expression.cs (ConditionalLogicalOperator): Use a temporary
2609         variable for `left' to avoid that we evaluate it more than once;
2610         bug #52588.
2611
2612 2004-04-28  Martin Baulig  <martin@ximian.com>
2613
2614         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
2615         `void[]' (CS1547).
2616
2617 2004-04-28  Martin Baulig  <martin@ximian.com>
2618
2619         * statement.cs (LocalInfo.Resolve): Check whether the type is not
2620         void (CS1547).
2621
2622         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
2623         whether the type is not void (CS1547).
2624
2625 2004-04-28  Martin Baulig  <martin@ximian.com>
2626
2627         * expression.cs (Unary.DoResolveLValue): Override this and report
2628         CS0131 for anything but Operator.Indirection.
2629
2630 2004-04-28  Martin Baulig  <martin@ximian.com>
2631
2632         Committing a patch from Ben Maurer; see bug #50820.
2633
2634         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2635         check for classes.
2636
2637         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2638         classes.        
2639
2640 2004-04-28  Martin Baulig  <martin@ximian.com>
2641
2642         Committing a patch from Ben Maurer; see bug #50820.
2643
2644         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2645         check for classes.
2646
2647         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2648         classes.        
2649
2650 2004-04-28  Martin Baulig  <martin@ximian.com>
2651
2652         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
2653         (Block.AddLabel): Call DoLookupLabel() to only search in the
2654         current block.
2655
2656 2004-04-28  Martin Baulig  <martin@ximian.com>
2657
2658         * cfold.cs (ConstantFold.BinaryFold): Added special support for
2659         comparing StringConstants and NullLiterals in Equality and Inequality.
2660
2661 2004-04-28  Jackson Harper  <jackson@ximian.com>
2662
2663         * driver.cs: Attempt to load referenced assemblies from the
2664         GAC. This is the quick and dirty version of this method that
2665         doesnt take into account versions and just takes the first
2666         canidate found. Will be good enough for now as we will not have more
2667         then one version installed into the GAC until I update this method.
2668
2669 2004-04-28  Martin Baulig  <martin@ximian.com>
2670
2671         * typemanager.cs (TypeManager.CheckStructCycles): New public
2672         static method to check for cycles in the struct layout.
2673
2674         * rootcontext.cs (RootContext.PopulateTypes): Call
2675         TypeManager.CheckStructCycles() for each TypeContainer.
2676         [Note: We only need to visit each type once.]
2677
2678 2004-04-28  Martin Baulig  <martin@ximian.com>
2679
2680         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
2681
2682         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
2683         success and added `out object value'.  Use a `bool resolved' field
2684         to check whether we've already been called rather than
2685         `ConstantValue != null' since this breaks for NullLiterals.
2686
2687 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2688
2689         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
2690         setting of this flag, since the 'set' method may be non-public.
2691
2692 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2693
2694         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
2695         check on current_vector.Block.
2696
2697 2004-04-27  Martin Baulig  <martin@ximian.com>
2698
2699         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
2700         a field initializer.  Fixes #56459.
2701
2702 2004-04-27  Martin Baulig  <martin@ximian.com>
2703
2704         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
2705         we're not attempting to use an indexer.  Fixes #52154.
2706
2707 2004-04-27  Martin Baulig  <martin@ximian.com>
2708
2709         * statement.cs (Return): Don't create a return label if we don't
2710         need it; reverts my change from January 20th.  Thanks to Ben
2711         Maurer for this.
2712
2713 2004-04-27  Martin Baulig  <martin@ximian.com>
2714
2715         According to the spec, `goto' can only leave a nested scope, but
2716         never enter it.
2717
2718         * statement.cs (Block.LookupLabel): Only lookup in the current
2719         block, don't recurse into parent or child blocks.
2720         (Block.AddLabel): Check in parent and child blocks, report
2721         CS0140/CS0158 if we find a duplicate.
2722         (Block): Removed this indexer for label lookups.
2723         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2724         this already does the error reporting for us.
2725
2726         * flowanalysis.cs
2727         (FlowBranching.UsageVector.Block): New public variable; may be null.
2728         (FlowBranching.CreateSibling): Added `Block' argument.
2729         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2730         label for the target of a `goto' and check whether we're not
2731         leaving a `finally'.
2732
2733 2004-04-27  Martin Baulig  <martin@ximian.com>
2734
2735         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2736         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2737         just for returns).
2738
2739 2004-04-27  Martin Baulig  <martin@ximian.com>
2740
2741         * statement.cs (Block.AddLabel): Also check for implicit blocks
2742         and added a CS0158 check.
2743
2744 2004-04-27  Martin Baulig  <martin@ximian.com>
2745
2746         * flowanalysis.cs (FlowBranchingLoop): New class.
2747         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2748         UsageVector's instead of an ArrayList.
2749         (FlowBranching.Label): Likewise.
2750         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2751         (FlowBranching.AddBreakVector): New method.
2752
2753 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2754
2755         * attribute.cs: Small regression fix: only convert the type if we
2756         the type is different, fixes System.Drawing build.
2757
2758 2004-04-27  Martin Baulig  <martin@ximian.com>
2759
2760         * attribute.cs (Attribute.Resolve): If we have a constant value
2761         for a named field or property, implicity convert it to the correct
2762         type.
2763
2764 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2765
2766         * statement.cs (Block.Block): Implicit blocks share
2767         'child_variable_names' fields with parent blocks.
2768         (Block.AddChildVariableNames): Remove.
2769         (Block.AddVariable): Mark variable as "used by a child block" in
2770         every surrounding block.
2771         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
2772         been used in a child block, complain about violation of "Invariant
2773         meaning in blocks" rule.
2774         * cs-parser.jay (declare_local_variables): Don't use
2775         AddChildVariableNames.
2776         (foreach_statement): Don't create an implicit block: 'foreach'
2777         introduces a scope.
2778
2779 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
2780
2781         * convert.cs (ImplicitNumericConversion): 0 is also positive when
2782         converting from 0L to ulong.  Fixes 57522.
2783
2784 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2785
2786         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
2787         derived class hides via 'new' keyword field from base class (test-242.cs).
2788         TODO: Handle this in the more general way.
2789         
2790         * class.cs (CheckBase): Ditto.
2791
2792 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2793
2794         * decl.cs (caching_flags): New member for storing cached values
2795         as bit flags.
2796         (MemberCore.Flags): New enum where bit flags for caching_flags
2797         are defined.
2798         (MemberCore.cls_compliance): Moved to caching_flags.
2799         (DeclSpace.Created): Moved to caching_flags.
2800
2801         * class.cs: Use caching_flags instead of DeclSpace.Created
2802         
2803 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
2804
2805         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
2806         if we are only a derived class, not a nested class.
2807
2808         * typemanager.cs: Same as above, but do this at the MemberLookup
2809         level (used by field and methods, properties are handled in
2810         PropertyExpr).   Allow for the qualified access if we are a nested
2811         method. 
2812
2813 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
2814
2815         * class.cs: Refactoring.
2816         (IMethodData): New inteface; Holds links to parent members
2817         to avoid member duplication (reduced memory allocation).
2818         (Method): Implemented IMethodData interface.
2819         (PropertyBase): New inner classes for get/set methods.
2820         (PropertyBase.PropertyMethod): Implemented IMethodData interface
2821         (Event): New inner classes for add/remove methods.
2822         (Event.DelegateMethod): Implemented IMethodData interface.
2823
2824         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
2825         EmitContext (related to class.cs refactoring).
2826
2827 2004-04-21  Raja R Harinath  <rharinath@novell.com>
2828
2829         * delegate.cs (Delegate.VerifyApplicability): If the number of
2830         arguments are the same as the number of parameters, first try to
2831         verify applicability ignoring  any 'params' modifier on the last
2832         parameter.
2833         Fixes #56442.
2834
2835 2004-04-16  Raja R Harinath  <rharinath@novell.com>
2836
2837         * class.cs (TypeContainer.AddIndexer): Use
2838         'ExplicitInterfaceName' to determine if interface name was
2839         explicitly specified.  'InterfaceType' is not initialized at this time.
2840         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
2841         Indexers array is already in the required order.  Initialize
2842         'IndexerName' only if there are normal indexers.
2843         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
2844         (TypeContainer.Emit): Emit DefaultMember attribute only if
2845         IndexerName is initialized.
2846         Fixes #56300.
2847
2848 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
2849
2850         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
2851         Fixes #57007
2852
2853 2004-04-15  Raja R Harinath  <rharinath@novell.com>
2854
2855         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
2856         attributes.
2857         Fix for #56456.
2858
2859         * attribute.cs (Attribute.Resolve): Check for duplicate named
2860         attributes.
2861         Fix for #56463.
2862
2863 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
2864
2865         * iterators.cs (MarkYield): track whether we are in an exception,
2866         and generate code accordingly.  Use a temporary value to store the
2867         result for our state.
2868
2869         I had ignored a bit the interaction of try/catch with iterators
2870         since their behavior was not entirely obvious, but now it is
2871         possible to verify that our behavior is the same as MS .NET 2.0
2872
2873         Fixes 54814
2874
2875 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
2876
2877         * iterators.cs: Avoid creating temporaries if there is no work to
2878         do. 
2879
2880         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
2881         Enumerations, use TypeManager.EnumToUnderlying and call
2882         recursively. 
2883
2884         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
2885         bug #57013
2886
2887         (This.Emit): Use EmitContext.EmitThis to emit our
2888         instance variable.
2889
2890         (This.EmitAssign): Ditto.
2891
2892         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
2893         codepaths, we will move all the functionality into
2894         Mono.CSharp.This 
2895
2896         (FieldExpr.EmitAssign): Ditto.
2897
2898         This fixes several hidden bugs that I uncovered while doing a code
2899         review of this today.
2900
2901         * codegen.cs (EmitThis): reworked so the semantics are more clear
2902         and also support value types "this" instances.
2903
2904         * iterators.cs: Changed so that for iterators in value types, we
2905         do not pass the value type as a parameter.  
2906
2907         Initialization of the enumerator helpers is now done in the caller
2908         instead of passing the parameters to the constructors and having
2909         the constructor set the fields.
2910
2911         The fields have now `assembly' visibility instead of private.
2912
2913 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
2914
2915         * expression.cs (Argument.Resolve): Check if fields passed as ref
2916         or out are contained in a MarshalByRefObject.
2917
2918         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
2919         another compiler type.
2920
2921 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2922
2923         * class.cs (Indexer.Define): use the new name checking method.
2924         Also, return false on an error.
2925         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
2926         (is_identifier_[start/part]_character): make static.
2927
2928 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
2929
2930         * expression.cs (Binary.ResolveOperator): Do no append strings
2931         twice: since we can be invoked more than once (array evaluation)
2932         on the same concatenation, take care of this here.  Based on a fix
2933         from Ben (bug #56454)
2934
2935 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
2936
2937         * codegen.cs: Fix another case where CS1548 must be reported (when 
2938         delay-sign isn't specified and no private is available #56564). Fix
2939         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
2940         error when MCS is used on the MS runtime and we need to delay-sign 
2941         (which seems unsupported by AssemblyBuilder - see #56621).
2942
2943 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
2944
2945         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
2946         (TypeManager.ComputeNamespaces): Faster implementation for
2947         Microsoft runtime.
2948
2949         * compiler.csproj: Updated AssemblyName to mcs.
2950
2951 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
2952
2953         * rootcontext.cs: Add new types to the boot resolution.
2954
2955         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
2956         MulticastDelegate is not allowed.
2957
2958         * typemanager.cs: Add new types to lookup: System.TypedReference
2959         and ArgIterator.
2960
2961         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
2962         check for TypedReference or ArgIterator, they are not allowed. 
2963
2964         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
2965         makes us properly catch 1510 in some conditions (see bug 56016 for
2966         details). 
2967
2968 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
2969
2970         * CryptoConvert.cs: update from corlib version
2971         with endian fixes.
2972
2973 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
2974
2975         * class.cs (Indexer.Define): Check indexername declaration
2976
2977 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
2978
2979         * attribute.cs (IsClsCompliant): Fixed problem with handling
2980         all three states (compliant, not-compliant, undetected).
2981
2982 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
2983
2984         * attribute.cs (Attribute): Location is now public.
2985         (Resolve): Store resolved arguments (pos_values) in attribute class.
2986         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
2987         (GetClsCompliantAttributeValue): New method that gets
2988         CLSCompliantAttribute value.
2989         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
2990         if exists else null.
2991         (AttributeTester): New class for CLS-Compliant verification routines.
2992
2993         * class.cs (Emit): Add CLS-Compliant verification.
2994         (Method.GetSignatureForError): Implemented.
2995         (Constructor.GetSignatureForError): Implemented
2996         (Constructor.HasCompliantArgs): Returns if constructor has
2997         CLS-Compliant arguments.
2998         (Constructor.Emit): Override.
2999         (Construcor.IsIdentifierClsCompliant): New method; For constructors
3000         is needed to test only parameters.
3001         (FieldBase.GetSignatureForError): Implemented.
3002         (TypeContainer): New member for storing base interfaces.
3003         (TypeContainer.FindMembers): Search in base interfaces too.
3004
3005         * codegen.cs (GetClsComplianceAttribute): New method that gets
3006         assembly or module CLSCompliantAttribute value.
3007         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
3008         for assembly.
3009         (ModuleClass.Emit): Add error 3012 test.
3010
3011         * const.cs (Emit): Override and call base for CLS-Compliant tests.
3012
3013         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
3014         state for all decl types.
3015         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
3016         if CLS-Compliant tests are required.
3017         (IsClsCompliaceRequired): New method. Analyze whether code
3018         must be CLS-Compliant.
3019         (IsExposedFromAssembly): New method. Returns true when MemberCore
3020         is exposed from assembly.
3021         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
3022         value or gets cached value.
3023         (HasClsCompliantAttribute): New method. Returns true if MemberCore
3024         is explicitly marked with CLSCompliantAttribute.
3025         (IsIdentifierClsCompliant): New abstract method. This method is
3026         used to testing error 3005.
3027         (IsIdentifierAndParamClsCompliant): New method. Common helper method
3028         for identifier and parameters CLS-Compliant testing.
3029         (VerifyClsCompliance): New method. The main virtual method for
3030         CLS-Compliant verifications.
3031         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
3032         null. I don't know why is null (too many public members !).
3033         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
3034         and get value of first CLSCompliantAttribute that found.
3035
3036         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
3037         (VerifyClsCompliance): Override and add extra tests.
3038
3039         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
3040         clscheck- disable CLS-Compliant verification event if assembly is has
3041         CLSCompliantAttribute(true).
3042
3043         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
3044         ApllyAttribute is now called in emit section as in the other cases.
3045         Possible future Emit integration.
3046         (IsIdentifierClsCompliant): New override.
3047         (VerifyClsCompliance): New override.
3048         (GetEnumeratorName): Returns full enum name.
3049
3050         * parameter.cs (GetSignatureForError): Implemented.
3051
3052         * report.cs (WarningData): New struct for Warning message information.
3053         (LocationOfPreviousError): New method.
3054         (Warning): New method. Reports warning based on the warning table.
3055         (Error_T): New method. Reports error based on the error table.
3056
3057         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
3058         verifications are done here.
3059
3060         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
3061
3062         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
3063         CLSCompliantAttribute.
3064         (all_imported_types): New member holds all imported types from other
3065         assemblies.
3066         (LoadAllImportedTypes): New method fills static table with exported types
3067         from all referenced assemblies.
3068         (Modules): New property returns all assembly modules.
3069
3070 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
3071
3072         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
3073         throwing a parser error.
3074
3075         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
3076         which removes the hardcoded get_/set_ prefixes for properties, as
3077         IL allows for the properties to be named something else.  
3078
3079         Bug #56013
3080
3081         * expression.cs: Do not override operand before we know if it is
3082         non-null.  Fix 56207
3083
3084 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3085
3086         * typemanager.cs: support for pinned variables.
3087
3088 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3089
3090         * decl.cs, typemanager.cs: Avoid using an arraylist
3091         as a buffer if there is only one result set.
3092
3093 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3094
3095         * expression.cs: Make sure you cant call a static method
3096         with an instance expression, bug #56174.
3097
3098 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
3099
3100         * class.cs (IsDuplicateImplementation): Improve error reporting to
3101         flag 663 (method only differs in parameter modifier).
3102
3103         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
3104         in preprocessor directives.
3105
3106         * location.cs (LookupFile): Allow for the empty path.
3107
3108         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
3109         better approach for some of that patch, but its failing with the
3110         CharSet enumeration.  For now try/catch will do.
3111
3112         * typemanager.cs: Do not crash if a struct does not have fields.
3113         Fixes 56150.
3114
3115 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3116
3117         * expression.cs: cs0213, cant fix a fixed expression.
3118         fixes 50231.
3119
3120 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3121
3122         * cs-parser.jay: detect invalid embeded statements gracefully.
3123         bug #51113.
3124
3125 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3126
3127         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
3128         As a regex:
3129         s/
3130         the invocation type may not be a subclass of the tye of the item/
3131         The type of the item must be a subclass of the invocation item.
3132         /g
3133
3134         Fixes bug #50820.
3135
3136 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
3137
3138         * attribute.cs: Added methods to get a string and a bool from an
3139         attribute. Required to information from AssemblyKeyFileAttribute,
3140         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
3141         * codegen.cs: Modified AssemblyName creation to include support for
3142         strongnames. Catch additional exceptions to report them as CS1548.
3143         * compiler.csproj: Updated include CryptoConvert.cs.
3144         * compiler.csproj.user: Removed file - user specific configuration.
3145         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
3146         Mono.Security assembly. The original class is maintained and tested in
3147         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
3148         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
3149         like CSC 8.0 (C# v2) supports.
3150         * Makefile: Added CryptoConvert.cs to mcs sources.
3151         * rootcontext.cs: Added new options for strongnames.
3152
3153 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
3154
3155         * driver.cs: For --expect-error, report error code `2'
3156         if the program compiled with no errors, error code `1' if
3157         it compiled with an error other than the one expected.
3158
3159 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
3160
3161         * compiler.csproj: Updated for Visual Studio .NET 2003.
3162         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
3163         * compiler.sln: Updated for Visual Studio .NET 2003.
3164
3165 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
3166
3167         * expression.cs: Fix bug #47234. We basically need to apply the
3168         rule that we prefer the conversion of null to a reference type
3169         when faced with a conversion to 'object' (csc behaviour).
3170
3171 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3172
3173         * statement.cs: Shorter form for foreach, eliminates
3174         a local variable. r=Martin.
3175
3176 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3177
3178         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
3179         checks if we can use brtrue/brfalse to test for 0.
3180         * expression.cs: use the above in the test for using brtrue/brfalse.
3181         cleanup code a bit.
3182
3183 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3184
3185         * expression.cs: Rewrite string concat stuff. Benefits:
3186
3187         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
3188         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
3189         rather than a concat chain.
3190
3191         * typemanager.cs: Add lookups for more concat overloads.
3192
3193 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3194
3195         * expression.cs: Emit shorter il code for array init.
3196
3197         newarr
3198         dup
3199         // set 1
3200
3201         // set 2
3202
3203         newarr
3204         stloc.x
3205
3206         ldloc.x
3207         // set 1
3208
3209         ldloc.x
3210         // set 2
3211
3212 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
3213
3214         * statement.cs: Before, two switch blocks would be merged if the
3215         total size of the blocks (end_item - begin_item + 1) was less than
3216         two times the combined sizes of the blocks.
3217
3218         Now, it will only merge if after the merge at least half of the
3219         slots are filled.
3220
3221         fixes 55885.
3222
3223 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
3224
3225         * class.cs : csc build fix for GetMethods(). See bug #52503.
3226
3227 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
3228
3229         * expression.cs: Make sure fp comparisons work with NaN.
3230         This fixes bug #54303. Mig approved this patch a long
3231         time ago, but we were not able to test b/c the runtime
3232         had a related bug.
3233
3234 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
3235
3236         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
3237
3238 2004-03-19  Martin Baulig  <martin@ximian.com>
3239
3240         * class.cs (MemberCore.IsDuplicateImplementation): Report the
3241         error here and not in our caller.
3242
3243 2004-03-19  Martin Baulig  <martin@ximian.com>
3244
3245         * interface.cs: Completely killed this file.
3246         (Interface): We're now a TypeContainer and live in class.cs.
3247
3248         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
3249         argument; we're now also called for interfaces.
3250         (TypeContainer.DefineMembers): Allow this method being called
3251         multiple times.
3252         (TypeContainer.GetMethods): New public method; formerly known as
3253         Interface.GetMethod().  This is used by PendingImplementation.
3254         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
3255         it's now private and non-static.
3256         (Interface): Moved this here; it's now implemented similar to
3257         Class and Struct.
3258         (Method, Property, Event, Indexer): Added `bool is_interface'
3259         argument to their .ctor's.
3260         (MemberBase.IsInterface): New public field.
3261
3262         * cs-parser.jay: Create normal Method, Property, Event, Indexer
3263         instances instead of InterfaceMethod, InterfaceProperty, etc.
3264         (opt_interface_base): Removed; we now use `opt_class_base' instead.
3265         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
3266
3267 2004-03-19  Martin Baulig  <martin@ximian.com>
3268
3269         * class.cs (MethodCore.IsDuplicateImplementation): New private
3270         method which does the CS0111 checking.
3271         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
3272         Use IsDuplicateImplementation().
3273
3274 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
3275
3276         * decl.cs (FindMemberToOverride): New method to find the correct
3277         method or property to override in the base class.
3278         * class.cs
3279             - Make Method/Property use the above method to find the
3280               version in the base class.
3281             - Remove the InheritableMemberSignatureCompare as it is now
3282               dead code.
3283
3284         This patch makes large code bases much faster to compile, as it is
3285         O(n) rather than O(n^2) to do this validation.
3286
3287         Also, it fixes bug 52458 which is that nested classes are not
3288         taken into account when finding the base class member.
3289
3290         Reviewed/Approved by Martin.
3291
3292 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
3293
3294         * interface.cs: In all interface classes removed redundant
3295         member initialization.
3296
3297 2004-03-16  Martin Baulig  <martin@ximian.com>
3298
3299         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
3300
3301 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * decl.cs (DefineTypeAndParents): New helper method to define a
3304         type's containers before the type itself is defined;  This is a
3305         bug exposed by the recent changes to Windows.Forms when an
3306         implemented interface was defined inside a class that had not been
3307         built yet.   
3308
3309         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
3310
3311         (Check): Loop correctly to report errors modifiers
3312         (UNSAFE was not in the loop, since it was the same as TOP).
3313
3314         * interface.cs: Every interface member now takes a ModFlags,
3315         instead of a "is_new" bool, which we set on the base MemberCore. 
3316
3317         Every place where we called "UnsafeOk" in the interface, now we
3318         call the proper member (InterfaceMethod.UnsafeOK) instead to get
3319         the unsafe settings from the member declaration instead of the
3320         container interface. 
3321
3322         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
3323
3324         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
3325         `set_indexer_name' to the pending bits (one per type).
3326
3327         We fixed a bug today that was picking the wrong method to
3328         override, since for properties the existing InterfaceMethod code
3329         basically ignored the method name.  Now we make sure that the
3330         method name is one of the valid indexer names.
3331
3332 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
3333  
3334         * support.cs (SeekableStreamReader): Keep track of stream byte
3335         positions and don't mix them with character offsets to the buffer.
3336
3337         Patch from Gustavo Giráldez
3338
3339 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
3340
3341         * interface.cs (InterfaceSetGetBase): Removed double member
3342         initialization, base class does it as well.
3343
3344 2004-03-13  Martin Baulig  <martin@ximian.com>
3345
3346         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
3347         when compiling corlib.
3348
3349 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
3350
3351         * convert.cs (ExplicitConversion): We were reporting an error on
3352         certain conversions (object_type source to a value type, when the
3353         expression was `null') before we had a chance to pass it through
3354         the user defined conversions.
3355
3356         * driver.cs: Replace / and \ in resource specifications to dots.
3357         Fixes 50752
3358
3359         * class.cs: Add check for duplicate operators.  Fixes 52477
3360
3361 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
3362
3363         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
3364         that are in the middle of the statements, not only at the end.
3365         Fixes #54987
3366
3367         * class.cs (TypeContainer.AddField): No longer set the
3368         `HaveStaticConstructor' flag, now we call it
3369         `UserDefineStaticConstructor' to diferentiate the slightly
3370         semantic difference.
3371
3372         The situation is that we were not adding BeforeFieldInit (from
3373         Modifiers.TypeAttr) to classes that could have it.
3374         BeforeFieldInit should be set to classes that have no static
3375         constructor. 
3376
3377         See:
3378
3379         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
3380
3381         And most importantly Zoltan's comment:
3382
3383         http://bugzilla.ximian.com/show_bug.cgi?id=44229
3384
3385         "I think beforefieldinit means 'it's ok to initialize the type sometime 
3386          before its static fields are used', i.e. initialization does not need
3387          to be triggered by the first access to the type. Setting this flag
3388          helps the JIT to compile better code, since it can run the static
3389          constructor at JIT time, and does not need to generate code to call it
3390          (possibly lots of times) at runtime. Unfortunately, mcs does not set
3391          this flag for lots of classes like String. 
3392          
3393          csc sets this flag if the type does not have an explicit static 
3394          constructor. The reasoning seems to be that if there are only static
3395          initalizers for a type, and no static constructor, then the programmer
3396          does not care when this initialization happens, so beforefieldinit
3397          can be used.
3398          
3399          This bug prevents the AOT compiler from being usable, since it 
3400          generates so many calls to mono_runtime_class_init that the AOT code
3401          is much slower than the JITted code. The JITted code is faster, 
3402          because it does not generate these calls if the vtable is type is
3403          already initialized, which is true in the majority of cases. But the
3404          AOT compiler can't do this."
3405
3406 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
3407
3408         * class.cs (MethodData.Emit): Refactor the code so symbolic
3409         information is generated for destructors;  For some reasons we
3410         were taking a code path that did not generate symbolic information
3411         before. 
3412
3413 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3414
3415         * class.cs: Create a Constructor.CheckBase method that
3416         takes care of all validation type code. The method
3417         contains some code that was moved from Define.
3418
3419         It also includes new code that checks for duplicate ctors.
3420         This fixes bug #55148.
3421
3422 2004-03-09  Joshua Tauberer <tauberer@for.net>
3423
3424         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
3425         a { ... }-style array creation invokes EmitStaticInitializers
3426         which is not good for reference-type arrays.  String, decimal
3427         and now null constants (NullCast) are not counted toward
3428         static initializers.
3429
3430 2004-03-05  Martin Baulig  <martin@ximian.com>
3431
3432         * location.cs (SourceFile.HasLineDirective): New public field;
3433         specifies whether the file contains or is referenced by a "#line"
3434         directive.
3435         (Location.DefineSymbolDocuments): Ignore source files which
3436         either contain or are referenced by a "#line" directive.        
3437
3438 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
3439
3440         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
3441         direct access to our parent, so check the method inline there.
3442
3443 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3444
3445         * expression.cs (Invocation.EmitCall): Miguel's last commit
3446         caused a regression. If you had:
3447
3448             T t = null;
3449             t.Foo ();
3450
3451         In Foo the implict this would be null.
3452
3453 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
3454
3455         * expression.cs (Invocation.EmitCall): If the method is not
3456         virtual, do not emit a CallVirt to it, use Call.
3457
3458         * typemanager.cs (GetFullNameSignature): Improve the method to
3459         cope with ".ctor" and replace it with the type name.
3460
3461         * class.cs (ConstructorInitializer.Resolve): Now the method takes
3462         as an argument the ConstructorBuilder where it is being defined,
3463         to catch the recursive constructor invocations.
3464
3465 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
3466
3467         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
3468         routines to check if a type is an enumerable/enumerator allow
3469         classes that implement the IEnumerable or IEnumerator interfaces.
3470
3471         * class.cs (Property, Operator): Implement IIteratorContainer, and
3472         implement SetYields.
3473
3474         (Property.Define): Do the block swapping for get_methods in the
3475         context of iterators.   We need to check if Properties also
3476         include indexers or not.
3477
3478         (Operator): Assign the Block before invoking the
3479         OperatorMethod.Define, so we can trigger the Iterator code
3480         replacement. 
3481
3482         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3483         Property and Operator classes are not created when we parse the
3484         declarator but until we have the block completed, so we use a
3485         singleton SimpleIteratorContainer.Simple to flag whether the
3486         SetYields has been invoked.
3487
3488         We propagate this setting then to the Property or the Operator to
3489         allow the `yield' to function.
3490
3491 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3492
3493         * codegen.cs: Implemented attribute support for modules.
3494         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3495         Assembly/Module functionality.
3496
3497         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3498         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3499         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3500
3501 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3502
3503         * interface.cs (FindMembers): The operation is performed on all base
3504         interfaces and not only on the first. It is required for future CLS Compliance patch.
3505
3506 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3507
3508         * statement.cs, codegen.cs:
3509         This patch deals with patterns such as:
3510
3511         public class List : IEnumerable {
3512
3513                 public MyEnumerator GetEnumerator () {
3514                         return new MyEnumerator(this);
3515                 }
3516
3517                 IEnumerator IEnumerable.GetEnumerator () {
3518                         ...
3519                 }
3520                 
3521                 public struct MyEnumerator : IEnumerator {
3522                         ...
3523                 }
3524         }
3525
3526         Before, there were a few things we did wrong:
3527         1) we would emit callvirt on a struct, which is illegal
3528         2) we emited ldarg when we needed to emit ldarga
3529         3) we would mistakenly call the interface methods on an enumerator
3530         type that derived from IEnumerator and was in another assembly. For example:
3531
3532         public class MyEnumerator : IEnumerator
3533
3534         Would have the interface methods called, even if there were public impls of the
3535         method. In a struct, this lead to invalid IL code.
3536
3537 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3538
3539         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3540           renamed to Emit.
3541
3542         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3543
3544 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3545
3546         * cs-parser.jay: Fix small regression: we were not testing V2
3547         compiler features correctly.
3548
3549         * interface.cs: If the emit context is null, then create one
3550
3551 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3552
3553         * decl.cs (GetSignatureForError): New virtual method to get full name
3554           for error messages.
3555
3556         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3557           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3558
3559         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3560           Duplicated members and code in these classes has been removed.
3561           Better encapsulation in these classes.
3562
3563 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3564
3565         * assign.cs (Assign.DoResolve): When dealing with compound
3566         assignments, there is a new rule in ECMA C# 2.4 (might have been
3567         there before, but it is documented here) that states that in:
3568
3569         a op= b;
3570
3571         If b is of type int, and the `op' is a shift-operator, then the
3572         above is evaluated as:
3573
3574         a = (int) a op b 
3575
3576         * expression.cs (Binary.ResolveOperator): Instead of testing for
3577         int/uint/long/ulong, try to implicitly convert to any of those
3578         types and use that in pointer arithmetic.
3579
3580         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3581         method to print information for from the type, not from the
3582         null-method we were given.
3583
3584 2004-02-01  Duncan Mak  <duncan@ximian.com>
3585
3586         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3587         parsing for cmd, fixes bug #53694.
3588
3589 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3590
3591         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3592         in the member name duplication tests. Property and operator name duplication
3593         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3594
3595 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3596
3597         * interface.cs (PopulateMethod): Fixed crash when interface method
3598         returns not existing type (error test cs0246-3.cs).
3599
3600 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3601
3602         * cs-parser.jay (interface_accessors): Re-write actions to also
3603         store attributes attached to get and set methods. Fix spelling
3604         while at it.
3605
3606         (inteface_property_declaration): Modify accordingly.
3607
3608         (InterfaceAccessorInfo): New helper class to store information to pass
3609         around between rules that use interface_accessors.
3610
3611         * interface.cs (Emit): Apply attributes on the get and set
3612         accessors of properties and indexers too.
3613
3614         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3615         right MethodBuilder when applying attributes to the get and set accessors.
3616
3617 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3618
3619         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3620
3621 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3622
3623         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3624
3625 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3626
3627         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3628         changes that treat `yield' specially when present before `break'
3629         or `return' tokens.
3630
3631         * cs-tokenizer.cs: yield is no longer a keyword.
3632
3633 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3634
3635         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3636         setting for default constructors.
3637         For default constructors are almost every time set wrong Modifier. The
3638         generated IL code has been alright. But inside mcs this values was
3639         wrong and this was reason why several of my CLS Compliance tests
3640         failed.
3641
3642 2004-01-22  Martin Baulig  <martin@ximian.com>
3643
3644         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3645         not a QualifiedIdentifier.  This is what `type_name_expression'
3646         was previously doing.
3647         (type_name_expression): Removed; the code is now in
3648         `namespace_or_type_name'.
3649         (qualified_identifier): Removed, use `namespace_or_type_name'
3650         instead.
3651         (QualifiedIdentifier): Removed this class.      
3652
3653 2004-01-22  Martin Baulig  <martin@ximian.com>
3654
3655         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3656         not a string as alias name.
3657
3658 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3659
3660         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3661         #52730 bug, and instead compute correctly the need to use a
3662         temporary variable when requesting an address based on the
3663         static/instace modified of the field and the constructor.
3664  
3665 2004-01-21  Martin Baulig  <martin@ximian.com>
3666
3667         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3668         class and namespace before looking up aliases.  Fixes #52517.
3669
3670 2004-01-21  Martin Baulig  <martin@ximian.com>
3671
3672         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3673         assinged in a 'try'; fixes exception4.cs.
3674
3675 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3676         * class.cs : Implemented parameter-less constructor for TypeContainer
3677
3678         * decl.cs: Attributes are now stored here. New property OptAttributes
3679
3680         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3681
3682         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3683
3684 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3685
3686         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3687           (CSharpSignature): New method for indexer and property signature.
3688
3689 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3690
3691         * pending.cs (IsVirtualFilter): Faster implementation.
3692
3693 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3694
3695         * typemanager.cs: Avoid inclusion of same assembly more than once.
3696
3697 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3698
3699         * cs-parser.jay: Fixed problem where the last assembly attribute
3700           has been applied also to following declaration (class, struct, etc.)
3701           
3702 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3703
3704         * class.cs: Added error CS0538, CS0539 reporting.
3705         Fixed crash on Microsoft runtime when field type is void.
3706
3707         * cs-parser.jay: Added error CS0537 reporting.
3708
3709         * pending.cs: Added error CS0535 reporting.
3710         Improved error report for errors CS0536, CS0534.
3711
3712 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3713
3714         Merge a few bits from the Anonymous Method MCS tree.
3715
3716         * statement.cs (ToplevelBlock): New class for toplevel methods,
3717         will hold anonymous methods, lifted variables.
3718
3719         * cs-parser.jay: Create toplevel blocks for delegates and for
3720         regular blocks of code. 
3721
3722 2004-01-20  Martin Baulig  <martin@ximian.com>
3723
3724         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3725         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3726         and `NeedExplicitReturn'; added `IsLastStatement'.
3727         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3728         have a `ReturnLabel' or we're not unreachable.
3729
3730         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3731         child's reachability; don't just override ours with it.  Fixes
3732         #58058 (lluis's example).
3733         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3734         InFinally(), InLoop(), InSwitch() and
3735         BreakCrossesTryCatchBoundary() methods.
3736
3737         * statement.cs (Return): Do all error checking in Resolve().
3738         Unless we are the last statement in a top-level block, always
3739         create a return label and jump to it.
3740         (Break, Continue): Do all error checking in Resolve(); also make
3741         sure we aren't leaving a `finally'.
3742         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3743         statement in a top-level block.
3744         (Block.Flags): Added `IsDestructor'.
3745         (Block.IsDestructor): New public property.
3746
3747 2004-01-20  Martin Baulig  <martin@ximian.com>
3748
3749         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3750
3751 2004-01-20  Martin Baulig  <martin@ximian.com>
3752
3753         * statement.cs (Statement.ResolveUnreachable): New public method.
3754         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3755         (Block.Resolve): Resolve unreachable statements.
3756
3757 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3758
3759         * expression.cs: We need to fix the case where we do
3760         not have a temp variable here.
3761
3762         * assign.cs: Only expression compound assignments need
3763         temporary variables.
3764
3765 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3766
3767         * flowanalysis.cs: Reduce memory allocation in a few ways:
3768           - A block with no variables should not allocate a bit
3769             vector for itself.
3770           - A method with no out parameters does not need any tracking
3771             for assignment of the parameters, so we need not allocate
3772             any data for it.
3773           - The arrays:
3774                 public readonly Type[] VariableTypes;
3775                 public readonly string[] VariableNames;
3776             Are redundant. The data is already stored in the variable
3777             map, so we need not allocate another array for it.
3778           - We need to add alot of checks for if (params | locals) == null
3779             due to the first two changes.
3780
3781 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
3782
3783         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
3784         implement IMemoryLocation, we store a copy on a local variable and
3785         take the address of it.  Patch from Benjamin Jemlich
3786
3787         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
3788         to use a special "type_name_expression" rule which reduces the
3789         number of "QualifiedIdentifier" classes created, and instead
3790         directly creates MemberAccess expressions.
3791
3792 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
3793
3794         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
3795         that fixes #52853.  Null literal assignment to ValueType
3796
3797         * class.cs (MethodData.Emit): Instead of checking the name of the
3798         method to determine if its a destructor, create a new derived
3799         class from Method called Destructor, and test for that.  
3800
3801         * cs-parser.jay: Create a Destructor object instead of a Method.  
3802
3803         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
3804
3805         Fixes: 52933
3806
3807 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
3808
3809         * expression.cs (Binary.ResolveOperator): Perform an implicit
3810         conversion from MethodGroups to their delegate types on the
3811         Addition operation.
3812
3813         * delegate.cs: Introduce a new class DelegateCreation that is the
3814         base class for `NewDelegate' and `ImplicitDelegateCreation',
3815         factor some code in here.
3816
3817         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
3818         conversion from MethodGroups to compatible delegate types. 
3819
3820         * ecore.cs (Expression.Resolve): Do not flag error 654
3821         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
3822         we allow conversions from MethodGroups to delegate types now.
3823
3824         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
3825         assignments in v2 either.
3826
3827 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
3828
3829         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
3830         static read-only fields in ctors.
3831
3832         Applied patch from Benjamin Jemlich 
3833
3834         * expression.cs (UnaryMutator): Avoid leaking local variables. 
3835
3836 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
3837
3838         * cs-tokenizer.cs (IsCastToken): Allow the various native types
3839         here to return true, as they can be used like this:
3840
3841                 (XXX) int.MEMBER ()
3842
3843         Fixed 49836 and all the other dups
3844
3845 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
3846
3847         * driver.cs: Implement /win32res and /win32icon.
3848
3849 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
3850
3851         * cs-parser.jay: Add a rule to improve error handling for the
3852         common mistake of placing modifiers after the type.
3853
3854 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
3855
3856         * cs-parser.jay (interface_event_declaration): Catch
3857         initialization of events on interfaces, and report cs0068
3858
3859         * cs-parser.jay (interface_event_declaration): Catch
3860         initialization of events. 
3861
3862         * ecore.cs: Better report missing constructors.
3863
3864         * expression.cs (Binary.ResolveOperator): My previous bug fix had
3865         the error reporting done in the wrong place.  Fix.
3866
3867         * expression.cs (Binary.ResolveOperator): Catch the 
3868         operator + (E x, E y) error earlier, and later allow for implicit
3869         conversions in operator +/- (E e, U x) from U to the underlying
3870         type of E.
3871
3872         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
3873         52596, if the container class is abstract, the default constructor
3874         is protected otherwise its public (before, we were always public).
3875
3876         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
3877         fixed statement.
3878
3879         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
3880         Jemlich that fixes bug #52597, MCS was generating invalid code for
3881         idisposable structs.   Thanks to Ben for following up with this
3882         bug as well.
3883
3884 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
3885
3886         * driver.cs: Allow assemblies without code to be generated, fixes
3887         52230.
3888
3889 2004-01-07  Nick Drochak <ndrochak@gol.com>
3890
3891         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
3892
3893 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
3894
3895         * cs-parser.jay: Add rules to improve error reporting if fields or
3896         methods are declared at the namespace level (error 116)
3897
3898         * Add rules to catch event add/remove
3899
3900 2004-01-04  David Sheldon <dave-mono@earth.li>
3901
3902   * expression.cs: Added matching ")" to error message for 
3903   CS0077
3904
3905 2004-01-03 Todd Berman <tberman@gentoo.org>
3906
3907         * ecore.cs, attribute.cs:
3908         Applying fix from #52429.
3909
3910 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3911
3912         * ecore.cs, expression.cs, statement.cs:
3913         Total rewrite of how we handle branching. We
3914         now handle complex boolean expressions with fewer
3915         jumps. As well if (x == 0) no longer emits a ceq.
3916
3917         if (x is Foo) is much faster now, because we generate
3918         better code.
3919
3920         Overall, we get a pretty big improvement on our benchmark
3921         tests. The code we generate is smaller and more readable.
3922
3923         I did a full two-stage bootstrap. The patch was reviewed
3924         by Martin and Miguel.
3925
3926 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3927
3928         * cs-parser.jay: Make primary_expression not take a QI.
3929         we dont need this because the member_access rule covers
3930         us here. So we replace the rule with just IDENTIFIER.
3931
3932         This has two good effects. First, we remove a s/r conflict.
3933         Second, we allocate many fewer QualifiedIdentifier objects.
3934
3935 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3936
3937         * attribute.cs: Handle MarshalAs attributes as pseudo, and
3938         set the correct information via SRE. This prevents
3939         hanging on the MS runtime. Fixes #29374.
3940
3941 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3942
3943         * convert.cs: correctly handle conversions to value types
3944         from Enum and ValueType as unboxing conversions.
3945
3946         Fixes bug #52569. Patch by Benjamin Jemlich.
3947
3948 2004-01-02  Ravi Pratap  <ravi@ximian.com>
3949
3950         * expression.cs (BetterConversion): Prefer int -> uint
3951         over int -> ulong (csc's behaviour). This fixed bug #52046.
3952
3953 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3954
3955         * decl.cs (MemberCache.FindMembers): now returns a
3956         MemberInfo [].
3957
3958         * typemanager.cs: In general, go with with ^^.
3959         (CopyNewMethods): take an IList.
3960         (RealMemberLookup): Only allocate an arraylist
3961         if we copy from two sets of methods.
3962
3963         This change basically does two things:
3964         1) Fewer array lists allocated due to CopyNewMethods.
3965         2) the explicit cast in MemberList costed ALOT.
3966
3967 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
3968
3969         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
3970         a hashtable to avoid needless string allocations when an identifier is
3971         used more than once (the common case).
3972
3973 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3974
3975         * pending.cs: MS's TypeBuilder.GetInterfaces ()
3976         is broken, it will not return anything. So, we
3977         have to use the information we have in mcs to
3978         do the task.
3979
3980         * typemanager.cs: Add a cache for GetInterfaces,
3981         since this will now be used more often (due to ^^)
3982
3983         (GetExplicitInterfaces) New method that gets the
3984         declared, not effective, interfaces on a type
3985         builder (eg, if you have interface IFoo, interface
3986         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
3987         { IBar }.
3988
3989         This patch makes MCS able to bootstrap itself on
3990         Windows again.
3991
3992 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3993
3994         * expression.cs: Remove the Nop's that Miguel put
3995         in by mistake.
3996
3997 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3998
3999         * report.cs, codegen.cs: Give the real stack trace to
4000         the error when an exception is thrown.
4001
4002 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4003
4004         * decl.cs: only allocate hashtables for ifaces if 
4005         it is an iface!
4006
4007 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4008
4009         * expression.cs: fix the error from cs0121-2.cs
4010         (a parent interface has two child interfaces that
4011         have a function with the same name and 0 params
4012         and the function is called through the parent).
4013
4014 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4015
4016         * class.cs, rootcontext.cs, typmanager.cs: do not
4017         leak pointers.
4018
4019 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4020
4021         * codegen.cs: remove stack for the ec flow branching.
4022         It is already a linked list, so no need.
4023
4024 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
4025
4026         * Makefile: Allow custom profiler here.
4027
4028 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4029
4030         * typemanager.cs (LookupType):
4031           - Use a static char [], because split takes
4032             a param array for args, so it was allocating
4033             every time.
4034           - Do not store true in a hashtable, it boxes.
4035
4036 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4037
4038         * flowanalysis.cs: bytify common enums.
4039
4040 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4041
4042         * modifiers.cs: Add a new set of flags for the
4043         flags allowed on explicit interface impls.
4044         * cs-parser.jay: catch the use of modifiers in
4045         interfaces correctly.
4046         * class.cs: catch private void IFoo.Blah ().
4047
4048         All related to bug #50572.
4049
4050 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4051
4052         * decl.cs: Rewrite the consistant accessability checking.
4053         Accessability is not linear, it must be implemented in
4054         a tableish way. Fixes #49704.
4055
4056 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4057
4058         * expression.cs: Handle negation in a checked context.
4059         We must use subtraction from zero. Fixes #38674.
4060
4061 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4062
4063         * class.cs: Ignore static void main in DLLs.
4064         * rootcontext.cs: Handle the target type here,
4065         since we are have to access it from class.cs
4066         * driver.cs: account for the above.
4067
4068 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4069
4070         * report.cs: Give line numbers and files if available.
4071
4072 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
4073
4074         * driver.cs: Implement /addmodule.
4075
4076         * typemanager.cs:  Change 'modules' field so it now contains Modules not
4077         ModuleBuilders.
4078
4079 2003-12-20  Martin Baulig  <martin@ximian.com>
4080
4081         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
4082         (FieldBase.IsAssigned): Removed this field.
4083         (FieldBase.SetAssigned): New public method.
4084         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
4085
4086 2003-12-20  Martin Baulig  <martin@ximian.com>
4087
4088         * expression.cs (LocalVariableReference.DoResolve): Don't set
4089         `vi.Used' if we're called from DoResolveLValue().
4090
4091         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
4092         returns the usage vector it just merged into the current one -
4093         pass this one to UsageWarning().
4094         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
4095         of the `EmitContext', don't call this recursively on our children.
4096
4097 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
4098
4099         * driver.cs: Implement /target:module.
4100
4101 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
4102
4103         * support.cs (CharArrayHashtable): New helper class.
4104
4105         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
4106         char arrays, not strings, so we can avoid creating a string in
4107         consume_identifier if the identifier is a keyword.
4108
4109 2003-12-16  Martin Baulig  <martin@ximian.com>
4110
4111         * statement.cs (LocalInfo.Assigned): Removed this property.
4112         (LocalInfo.Flags): Removed `Assigned'.
4113         (LocalInfo.IsAssigned): New public method; takes the EmitContext
4114         and uses flow analysis.
4115         (Block.UsageWarning): Made this method private.
4116         (Block.Resolve): Call UsageWarning() if appropriate.
4117
4118         * expression.cs (LocalVariableReference.DoResolve): Always set
4119         LocalInfo.Used here.
4120
4121 2003-12-13  Martin Baulig  <martin@ximian.com>
4122
4123         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
4124         any value here; we're now using flow analysis to figure out
4125         whether a statement/block returns a value.
4126
4127 2003-12-13  Martin Baulig  <martin@ximian.com>
4128
4129         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
4130         working again.
4131         (FlowBranching.MergeFinally): Don't call
4132         `branching.CheckOutParameters()' here, this is called in
4133         MergeTopBlock().
4134         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
4135         when adding the `finally' vector.       
4136
4137 2003-12-13  Martin Baulig  <martin@ximian.com>
4138
4139         * flowanalysis.cs
4140         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
4141         actually work and also fix #48962.
4142
4143 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
4144
4145         * decl.cs: Do not check System.Object for nested types,
4146         since we know it does not have any. Big bang for buck:
4147
4148         BEFORE:
4149            Run 1:   8.35 seconds
4150            Run 2:   8.32 seconds
4151            corlib:  17.99 seconds
4152         AFTER:
4153            Run 1:   8.17 seconds
4154            Run 2:   8.17 seconds
4155            corlib:  17.39 seconds
4156
4157 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
4158
4159         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
4160         time we are returning 0 members, so we save alot here.
4161
4162 2003-12-11  Martin Baulig  <martin@ximian.com>
4163
4164         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
4165         `MergeChild()', also just take the `FlowBranching' as argument;
4166         call Merge() on it and return the result.
4167         (FlowBranching.Merge): We don't need to do anything if we just
4168         have one sibling.
4169
4170 2003-12-11  Martin Baulig  <martin@ximian.com>
4171
4172         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
4173         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
4174         Maurer for this idea.
4175
4176 2003-12-11  Martin Baulig  <martin@ximian.com>
4177
4178         * flowanalysis.cs (MergeResult): This class is now gone; we now
4179         use the `UsageVector' for this.  The reason for this is that if a
4180         branching just has one sibling, we don't need to "merge" them at
4181         all - that's the next step to do.
4182         (FlowBranching.Merge): We now return a `UsageVector' instead of a
4183         `MergeResult'.
4184
4185 2003-12-11  Martin Baulig  <martin@ximian.com>
4186
4187         Reworked flow analyis and made it more precise and bug-free.  The
4188         most important change is that we're now using a special `Reachability'
4189         class instead of having "magic" meanings of `FlowReturns'.  I'll
4190         do some more cleanups and optimizations and also add some more
4191         documentation this week.
4192
4193         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
4194         largely reworked this class.
4195         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
4196         the new `Reachability' class instead of having "magic" values here.
4197         (FlowBranching): We're now using an instance of `Reachability'
4198         instead of having separate `Returns', `Breaks' etc. fields.
4199
4200         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
4201         based on flow analysis; ignore the return value of block.Emit ().
4202
4203 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
4204
4205         * driver.cs typemanager.cs: Find the mono extensions to corlib even
4206         if they are private.
4207
4208 2003-12-09  Martin Baulig  <martin@ximian.com>
4209
4210         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
4211         call them directly on the UsageVector.
4212
4213 2003-12-09  Martin Baulig  <martin@ximian.com>
4214
4215         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
4216         Changed return type from `FlowReturns' to `Reachability'.
4217
4218 2003-12-09  Martin Baulig  <martin@ximian.com>
4219
4220         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
4221         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
4222         `Reachable' fields with a single `Reachability' one.
4223
4224 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4225
4226         * class.cs (FindMembers): Remove foreach's.
4227
4228         Bootstrap times:
4229
4230         BEFORE
4231                 Run 1:   8.74 seconds
4232                 Run 2:   8.71 seconds
4233
4234         AFTER
4235                 Run 1:   8.64 seconds
4236                 Run 2:   8.58 seconds
4237
4238
4239 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4240
4241         * cs-parser.jay:
4242         * gen-treedump.cs:
4243         * statement.cs:
4244         This patch does a few things:
4245                 1. EmptyStatement is now a singleton, so it is never reallocated.
4246                 2. All blah is EmptyStatement constructs have been changed to
4247                    blah == EmptyStatement.Value, which is much faster and valid
4248                    now that EmptyStatement is a singleton.
4249                 3. When resolving a block, rather than allocating a new array for
4250                    the non-empty statements, empty statements are replaced with
4251                    EmptyStatement.Value
4252                 4. Some recursive functions have been made non-recursive.
4253         Mainly the performance impact is from (3), however (1) and (2) are needed for
4254         this to work. (4) does not make a big difference in normal situations, however
4255         it makes the profile look saner.
4256
4257         Bootstrap times:
4258
4259         BEFORE
4260         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4261         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4262         Total memory allocated: 56397 KB
4263
4264         AFTER
4265         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
4266         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
4267         Total memory allocated: 55666 KB
4268
4269 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4270
4271         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
4272         than the hashtable in a hashtable version
4273
4274         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
4275         we always end up concating a string. This results in a huge perf
4276         loss, because many strings have to be tracked by the GC. In this
4277         patch, we first use a hashtable that works with two keys, so that
4278         the strings do not need to be concat'ed.
4279
4280         Bootstrap times:
4281         BEFORE
4282                 Run 1:   8.74 seconds
4283                 Run 2:   8.71 seconds
4284
4285         AFTER
4286                 Run 1:   8.65 seconds
4287                 Run 2:   8.56 seconds
4288
4289 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4290
4291         * Makefile: Add a new target `do-time' that does a quick and simple
4292         profile, leaving easy to parse output.
4293
4294 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
4295
4296         * codegen.cs (Init): Create the dynamic assembly with 
4297         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
4298
4299 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4300
4301         * support.cs: Make the PtrHashtable use only one
4302         instance of its comparer.
4303
4304 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
4305
4306         * typemanager.cs: Fix lookup of GetNamespaces.
4307
4308 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
4309
4310         * expression.cs: Removed redundant line.
4311
4312         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
4313         ArrayLists, use for loops with bounds.  
4314
4315         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
4316         arraylist.
4317
4318         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
4319         arraylists, use for loop with bounds.
4320
4321         The above three changes give us a 0.071 second performance
4322         improvement out of 3.294 seconds down to 3.223.  On my machine
4323         the above changes reduced the memory usage by 1,387 KB during
4324         compiler bootstrap.
4325
4326         * cs-parser.jay (QualifiedIdentifier): New class used to represent
4327         QualifiedIdentifiers.  Before we created a new string through
4328         concatenation, and mostly later on, the result would be
4329         manipulated by DecomposeQI through string manipulation.
4330
4331         This reduced the compiler memory usage for bootstrapping from
4332         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
4333         compile times in 0.05 seconds.
4334
4335 2003-11-28  Dick Porter  <dick@ximian.com>
4336
4337         * support.cs: Do string compares with the Invariant culture.
4338
4339         * rootcontext.cs: 
4340         * gen-treedump.cs: 
4341         * expression.cs: 
4342         * driver.cs: 
4343         * decl.cs: 
4344         * codegen.cs: 
4345         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
4346         the comparison is done with the Invariant culture.
4347
4348 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
4349
4350         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
4351         GetEnumerator method.
4352
4353         (ProbeCollectionType): Iterate starting at the most specific type
4354         upwards looking for a GetEnumerator
4355
4356         * expression.cs: Shift count can be up to 31 for int/uint and 63
4357         for long/ulong.
4358
4359 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
4360
4361         * statement.cs (Block.LookupLabel): Also look for the label on the
4362         children blocks.  Use a hash table to keep track of visited
4363         nodes. 
4364
4365         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
4366         we actually did transform the other operand, otherwise fall back
4367         to the common codepath that casts to long.
4368
4369         * cs-tokenizer.cs: Use the same code pattern as the int case.
4370         Maybe I should do the parsing myself, and avoid depending on the
4371         Parse routines to get this done.
4372
4373 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
4374
4375         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4376         which fixes bug 51347.  This time test it.
4377
4378         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
4379         attributes for example can not tell the difference between these.
4380         The difference was only a syntax feature of the language. 
4381
4382         * attribute.cs: Apply attributes to delegates.
4383
4384         * delegate.cs: Call the apply attributes method.
4385
4386 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
4387
4388         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
4389         comparing 0 vs Byte.MinValue, not the value
4390
4391         (ImplicitConversionRequired): When reporting a conversion error,
4392         use error 31 to print out the constant error instead of the
4393         simpler 29.
4394
4395         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4396         which fixes bug 51347.
4397
4398 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
4399
4400         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
4401         which fixes the -warnaserror command line option.
4402
4403 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
4404
4405         * cfold.cs (DoNumericPromotions): During constant folding of
4406         additions on UIntConstant, special case intconstants with
4407         IntConstants like we do on the expression binary operator. 
4408
4409 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
4410
4411         * convert.cs (ImplicitReferenceConversion): We were missing a case
4412         (System.Enum are not value types or class types, so we need to
4413         classify them separatedly).
4414
4415         * driver.cs: We do not support error 2007.
4416
4417 2003-11-12 Jackson Harper <jackson@ximian.com>
4418
4419         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
4420         system directory. Also use the full file name so users can
4421         libraries names mscorlib-o-tron.dll in a non system dir.
4422
4423 2003-11-10  Martin Baulig  <martin@ximian.com>
4424
4425         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
4426         (TypeManager.InitCoreTypes): Initialize them here, but instead of
4427         calling `ResolveType()' on them, directly assign their `Type'.
4428
4429 2003-11-08  Martin Baulig  <martin@ximian.com>
4430
4431         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
4432         return value and the `out parent' parameter.
4433         (TypeContainer.DefineType): Moved the CS0644 check into
4434         GetClassBases().  Don't pass the interface types to the
4435         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
4436         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
4437
4438         * ecore.cs (TypeExpr.IsAttribute): New property.
4439         (TypeExpr.GetInterfaces): New method.
4440
4441         * interface.cs (Interface.GetInterfaceTypeByName): Return a
4442         TypeExpr instead of a Type.
4443         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
4444         (Interface.DefineType): Don't pass the interface types to the
4445         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
4446         them later and then call `TypeBulider.AddInterfaceImplementation()'.
4447
4448         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
4449         instead of a `Type[]'.
4450         (TypeManager.RegisterBuilder): Likewise.
4451         (TypeManager.AddUserInterface): Likewise.
4452         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
4453         `Type[]' and also return a `TypeExpr[]'.
4454         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
4455
4456 2003-11-08  Martin Baulig  <martin@ximian.com>
4457
4458         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
4459         Expression.     
4460
4461 2003-11-08  Martin Baulig  <martin@ximian.com>
4462
4463         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
4464         TypeManager.ResolveExpressionTypes().
4465
4466         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
4467         instead of an Expression.
4468         (TypeExpr): This is now an abstract base class for `TypeExpression'.
4469         (TypeExpression): New public class; formerly known as `TypeExpr'.
4470
4471         * expression.cs (ComposedCast): Derive from TypeExpr.
4472
4473         * typemanager.cs (TypeManager.system_*_expr): These are now
4474         TypExpr's instead of Expression's.
4475         (TypeManager.ResolveExpressionTypes): New public static function;
4476         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
4477         of them.        
4478
4479 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
4480
4481         * expression.cs (New.DoResolve): Do not dereference value that
4482         might be a null return.
4483
4484         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4485         sure that the constant value has the right type.  Fixes an
4486         unreported bug, similar to 50425.
4487
4488         * const.cs (Const.LookupConstantValue): Call
4489         ImplicitStandardConversionExists before doing a conversion to
4490         avoid havng the TypeManager.ChangeType do conversions.
4491
4492         Reduced the number of casts used
4493
4494         (Const.ChangeType): New routine to enable reuse of the constant
4495         type changing code from statement.
4496
4497         * typemanager.cs (ChangeType): Move common initialization to
4498         static global variables.
4499
4500         Fixes #50425.
4501
4502         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4503         every value type to go through, even if it was void.  Fix that. 
4504
4505         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4506         character of the define, and the is_identifier_part_character for
4507         the rest of the string.
4508
4509 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4510
4511         * expression.cs (UnaryMutator.EmitCode): When I updated
4512         LocalVariableReference.DoResolve, I overdid it, and dropped an
4513         optimization done on local variable references.
4514
4515 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4516
4517         * ecore.cs: Convert the return from Ldlen into an int.
4518
4519 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4520
4521         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4522         the accessibility, this is a special case for toplevel non-public
4523         classes (internal for instance).
4524
4525 2003-10-20  Nick Drochak <ndrochak@gol.com>
4526
4527         * ecore.cs: Fix typo and build.  Needed another right paren.
4528
4529 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4530
4531         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4532         `internal' case regular and protected, but not allowing protected
4533         to be evaluated later.  Bug 49840
4534
4535 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4536
4537         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4538         to kb.Nlast, and not the kb.nFirst to isolate the switch
4539         statement.
4540
4541         Extract the underlying type, so enumerations of long/ulong are
4542         treated like long/ulong.
4543
4544 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4545
4546         * expression.cs (New): Overload the meaning of RequestedType to
4547         track the possible creation of the NewDelegate type, since
4548         DoResolve is invoked more than once for new constructors on field
4549         initialization.
4550
4551         See bugs: #48800 and #37014
4552
4553         * cs-parser.jay (declare_local_constants): Take an arraylist
4554         instead of a single constant.
4555
4556         (local_constant_declaration): It should take a
4557         constant_declarators, not a constant_declarator.  Fixes 49487
4558
4559         * convert.cs: Fix error report.
4560
4561 2003-10-13 Jackson Harper <jackson@ximian.com>
4562
4563         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4564         bug #49611
4565
4566 2003-10-09  Martin Baulig  <martin@ximian.com>
4567
4568         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4569         to the .ctor.
4570         (MethodCore.DoDefineParameters): Removed the TypeContainer
4571         argument; use the DeclSpace which was passed to the .ctor instead.
4572         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4573         TypeContainer; we only need a DeclSpace here.
4574
4575 2003-10-09  Martin Baulig  <martin@ximian.com>
4576
4577         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4578         to the .ctor.
4579         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4580         EmitContext's .ctor.    
4581
4582 2003-10-09  Martin Baulig  <martin@ximian.com>
4583
4584         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4585         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4586         AsAccessible(), moved them as well.
4587
4588         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4589
4590 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4591
4592         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4593
4594 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4595
4596         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4597         generation for >=, as spotted by Paolo, bug 48679.  
4598         Patch from David Waite.
4599
4600         * cs-tokenizer.cs: Add handling for #pragma.
4601
4602         * cs-parser.jay: Allow for both yield and yield return in the
4603         syntax.  The anti-cobolization of C# fight will go on!
4604
4605         * class.cs (TypeBuilder.DefineType): Catch error condition here
4606         (Parent.DefineType erroring out and returning null).
4607
4608         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4609         coping with enumerations variables, we were mistakenly processing
4610         them as a regular value type instead of built-in types.  Fixes the
4611         bug #48063
4612
4613         * typemanager.cs (IsBuiltinOrEnum): New method.
4614
4615 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4616
4617         * cs-parser.jay: Upgrade: yield now needs the return clause.
4618
4619 2003-09-19  Martin Baulig  <martin@ximian.com>
4620
4621         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4622         `MemberCache parent' argument.  Normally, an interface doesn't
4623         have a parent type except System.Object, but we use this in gmcs
4624         for generic type parameters.
4625
4626 2003-09-18  Martin Baulig  <martin@ximian.com>
4627
4628         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4629         on `type.IsInterface'; don't check whether the type has a parent
4630         to determine whether it's an interface.
4631
4632 2003-09-15  Martin Baulig  <martin@ximian.com>
4633
4634         * class.cs (TypeContainer.DefineType): Added an error flag to
4635         avoid reporting duplicate CS0146's ("class definition is
4636         circular.").
4637
4638         * driver.cs (Driver.MainDriver): Abort if
4639         RootContext.ResolveTree() reported any errors.
4640
4641 2003-09-07  Martin Baulig  <martin@ximian.com>
4642
4643         * report.cs (Error, Warning): Added overloaded versions which take
4644         a `params object[] args' and call String.Format().
4645
4646 2003-09-07  Martin Baulig  <martin@ximian.com>
4647
4648         * decl.cs (DeclSpace..ctor): Don't call
4649         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4650         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4651         (DeclSpace.RecordDecl): New method.
4652
4653         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4654
4655 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4656
4657         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4658         value attributes to be applied to ParameterBuilders.
4659
4660         * class.cs (MethodCore.LabelParameters): Make static and more
4661         generic so that it can be used from other places - like interface
4662         methods, for instance.
4663
4664         * interface.cs (Interface.Emit): Call LabelParameters before
4665         emitting attributes on the InterfaceMethod.
4666
4667 2003-08-26  Martin Baulig  <martin@ximian.com>
4668
4669         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4670         resolving aliases; fixes #47927.
4671
4672 2003-08-26  Martin Baulig  <martin@ximian.com>
4673
4674         * statement.cs (Using.DoResolve): This is internally emitting a
4675         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4676         do not always return.  Fixes #47681.
4677
4678 2003-08-26  Martin Baulig  <martin@ximian.com>
4679
4680         * decl.cs (MemberCore): Moved WarningNotHiding(),
4681         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4682         into MemberBase.
4683         (AdditionResult): Make this nested in DeclSpace.
4684         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4685         argument; call NamespaceEntry.Define() unless we're nested in a
4686         class or struct.
4687
4688         * namespace.cs (Namespace.DefineName): New public function.  This
4689         is called from DeclSpace's .ctor to add 
4690         (Namespace.Lookup): Include DeclSpaces in the lookup.
4691
4692         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4693
4694         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4695
4696 2003-08-25  Martin Baulig  <martin@ximian.com>
4697
4698         * convert.cs (Convert.ExplicitReferenceConversion): When
4699         converting from an interface type to a class, unbox if the target
4700         type is a struct type.  Fixes #47822.
4701
4702 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4703
4704         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
4705         #47854.
4706
4707 2003-08-22  Martin Baulig  <martin@ximian.com>
4708
4709         * class.cs (TypeManager.DefineType): When defining a nested type,
4710         call DefineType() on our parent; fixes #47801.
4711
4712 2003-08-22  Martin Baulig  <martin@ximian.com>
4713
4714         * class.cs (MethodData.Define): While checking if a method is an
4715         interface implementation, improve the test a bit more to fix #47654.
4716
4717 2003-08-22  Martin Baulig  <martin@ximian.com>
4718
4719         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
4720         correctly; fixes #47722.
4721
4722 2003-08-22  Martin Baulig  <martin@ximian.com>
4723
4724         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
4725         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
4726
4727         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
4728
4729 2003-08-22  Martin Baulig  <martin@ximian.com>
4730
4731         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
4732         can only be assigned in static constructors.  Fixes #47161.
4733
4734 2003-08-22  Martin Baulig  <martin@ximian.com>
4735
4736         Rewrote and improved the flow analysis code.
4737
4738         * flowbranching.cs (FlowBranching): Make this class abstract.
4739         (FlowBranching.CreateBranching): New static function to create a
4740         new flow branching.
4741         (FlowBranchingBlock, FlowBranchingException): New classes.
4742         (FlowBranching.UsageVector.Type): New public readonly field.
4743         (FlowBranching.UsageVector.Breaks): Removed the setter.
4744         (FlowBranching.UsageVector.Returns): Removed the setter.
4745         (FlowBranching.UsageVector): Added Break(), Return(),
4746         NeverReachable() and Throw() methods to modify the reachability.
4747         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
4748         done by FlowBranching.Merge().
4749         (FlowBranching.UsageVector.MergeChild): New method; merges the
4750         merge result into the current vector.
4751         (FlowBranching.Merge): New abstract method to merge a branching.
4752
4753 2003-08-12  Martin Baulig  <martin@ximian.com>
4754
4755         * expression.cs (Indirection.CacheTemporaries): Create the
4756         LocalTemporary with the pointer type, not its element type.
4757
4758 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
4759
4760         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
4761         token was a keyword or not.
4762
4763         Add `error' options where an IDENTIFIER was expected;  Provide
4764         CheckToken and CheckIdentifierToken convenience error reporting
4765         functions. 
4766
4767         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
4768
4769         * decl.cs: Rename `NamespaceEntry Namespace' public field into
4770         NameSpaceEntry NameSpaceEntry.
4771
4772         (LookupInterfaceOrClass): Avoid creating a full qualified name
4773         from namespace and name: avoid doing lookups when we know the
4774         namespace is non-existant.   Use new Tree.LookupByNamespace which
4775         looks up DeclSpaces based on their namespace, name pair.
4776
4777         * driver.cs: Provide a new `parser verbose' to display the
4778         exception thrown during parsing.  This is turned off by default
4779         now, so the output of a failure from mcs is more graceful.
4780
4781         * namespace.cs: Track all the namespaces defined in a hashtable
4782         for quick lookup.
4783
4784         (IsNamespace): New method
4785
4786 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
4787
4788         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
4789         we know that we need to concatenate (full typename can never be
4790         null). 
4791
4792         * class.cs: ditto.
4793
4794         * statement.cs: Use a bitfield;  Do not initialize to null things
4795         which are done by the constructor by default.
4796
4797         * cs-parser.jay: bug fix, parameter was 4, not 3.
4798
4799         * expression.cs: Just use the property;
4800
4801         * statement.cs: No need for GetVariableInfo method.
4802
4803 2003-08-08  Martin Baulig  <martin@ximian.com>
4804
4805         * flowanalysis.cs (FlowReturns): This is now nested in the
4806         `FlowBranching' class.
4807         (MyBitVector): Moved this here from statement.cs.
4808         (FlowBranching.SiblingType): New enum type.
4809         (FlowBranching.CreateSibling): Added `SiblingType' argument.
4810
4811 2003-08-07  Martin Baulig  <martin@ximian.com>
4812
4813         * flowanalysis.cs (FlowBranchingType): This is now nested in the
4814         `FlowBranching' class and called `BranchingType'.
4815
4816 2003-08-07  Martin Baulig  <martin@ximian.com>
4817
4818         * flowanalysis.cs: Moved all the control flow analysis code into
4819         its own file.
4820
4821 2003-08-07  Martin Baulig  <martin@ximian.com>
4822
4823         * assign.cs (Assign.DoResolve): `target' must either be an
4824         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
4825         #37319.
4826
4827 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
4828
4829         * expression.cs (BinaryMethod): This kind of expression is created by the
4830         Binary class if it determines that the operator has to be handled
4831         by a method.
4832
4833         (BinaryDelegate): This kind of expression is created if we are
4834         dealing with a + or - operator on delegates.
4835
4836         (Binary): remove method, argumetns, and DelegateOperator: when
4837         dealing with methods, 
4838
4839         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
4840
4841         * statement.cs (Block): use bitfields for the three extra booleans
4842         we had in use.   Remove unused topblock parameter.
4843
4844         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
4845
4846         * assign.cs: Drop extra unneeded tests.
4847
4848 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
4849
4850         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
4851
4852         * statement.cs (Foreach): Use VariableStorage instead of
4853         LocalBuilders.   
4854
4855         * codegen.cs (VariableStorage): New class used by clients that
4856         require a variable stored: locals or fields for variables that
4857         need to live across yield.
4858
4859         Maybe provide a convenience api for EmitThis+EmitLoad?
4860
4861         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
4862         these bad boys.
4863
4864 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
4865
4866         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
4867         RemapParameterLValue): New methods that are used to turn a
4868         precomputed FieldInfo into an expression like this:
4869
4870                 instance.FieldInfo
4871
4872         The idea is to use this instead of making LocalVariableReference
4873         have more than one meaning.
4874
4875         * cs-parser.jay: Add error production to BASE.
4876
4877         * ecore.cs: Deal with TypeManager.GetField returning null, which
4878         is now a valid return value.
4879
4880         (FieldExprNoAddress): New expression for Fields whose address can
4881         not be taken.
4882
4883         * expression.cs (LocalVariableReference): During the resolve
4884         phases, create new expressions if we are in a remapping context.
4885         Remove code that dealt with remapping here.
4886
4887         (ParameterReference): same.
4888
4889         (ProxyInstance): New expression, like the `This' expression, but
4890         it is born fully resolved.  We know what we are doing, so remove
4891         the errors that are targeted to user-provided uses of `this'.
4892
4893         * statement.cs (Foreach): our variable is now stored as an
4894         Expression;  During resolution, follow the protocol, dont just
4895         assume it will return this.
4896
4897 2003-08-06  Martin Baulig  <martin@ximian.com>
4898
4899         * support.cs (SeekableStreamReader.cs): New public class.
4900
4901         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
4902         SeekableStreamReader instead of the normal StreamReader.
4903
4904 2003-08-04  Martin Baulig  <martin@ximian.com>
4905
4906         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
4907         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
4908         deambiguate casts and delegate invocations.
4909         (parenthesized_expression): Use the new tokens to ensure this is
4910         not a cast of method invocation.
4911
4912         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
4913         when reading a `)' and Deambiguate_CloseParens () was previously
4914         called.
4915
4916         * expression.cs (ParenthesizedExpression): New class.  This is
4917         just used for the CS0075 test.
4918         (Binary.DoResolve): Check for CS0075.   
4919
4920 2003-07-29  Ravi Pratap  <ravi@ximian.com>
4921
4922         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
4923         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
4924         reference comparison.
4925
4926         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
4927         examine the ReturnType for equality - this is necessary in the
4928         cases of implicit and explicit operators whose signature also
4929         includes the return type.
4930
4931 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
4932
4933         * namespace.cs: Cache the result of the namespace computation,
4934         instead of computing it every time.
4935
4936 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
4937
4938         * decl.cs: Use a global arraylist that we reuse over invocations
4939         to avoid excesive memory consumption.  Reduces memory usage on an
4940         mcs compile by one meg (45 average).
4941
4942         * typemanager.cs (LookupTypeReflection): In .NET pointers are
4943         private, work around that.
4944
4945 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
4946
4947         * literal.cs (IntLiteral): Define Zero and One static literals. 
4948
4949         * cs-parser.jay (integer_literal): use static literals to reduce
4950         memory usage for the most used literals (0, 1 and -1).  211kb
4951         reduced in memory usage.
4952
4953         Replace all calls to `new ArrayList' with `new
4954         ArrayList(4)' which is a good average number for most allocations,
4955         and also requires only 16 bytes of memory for its buffer by
4956         default. 
4957
4958         This reduced MCS memory usage in seven megabytes for the RSS after
4959         bootstrapping.
4960
4961 2003-07-28  Ravi Pratap  <ravi@ximian.com>
4962
4963         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
4964         handle params methods the correct way by forming only one
4965         applicable set with params and normal methods in them. Earlier we
4966         were looking at params methods only if we found no normal methods
4967         which was not the correct thing to do.
4968
4969         (Invocation.BetterFunction): Take separate arguments indicating
4970         when candidate and the best method are params methods in their
4971         expanded form.
4972
4973         This fixes bugs #43367 and #46199.
4974
4975         * attribute.cs: Documentation updates.
4976
4977         (CheckAttribute): Rename to CheckAttributeTarget.
4978         (GetValidPlaces): Rename to GetValidTargets.
4979
4980         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
4981         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
4982
4983         Fixes bug #44468.
4984
4985 2003-07-28  Martin Baulig  <martin@ximian.com>
4986
4987         * class.cs (TypeContainer.DefineMembers): Use the base type's full
4988         name when looking up the base class of a nested class.  Fixes #46977.
4989
4990 2003-07-26  Martin Baulig  <martin@ximian.com>
4991
4992         * expression.cs (Indexers.Indexer): New nested struct; contains
4993         getter, setter and the indexer's type.
4994         (Indexers.Properties): This is now an ArrayList of
4995         Indexers.Indexer's.
4996         (IndexerAccess.DoResolveLValue): Correctly set the type if the
4997         indexer doesn't have any getters.
4998
4999         * assign.cs (Assign.DoResolve): Also do the implicit conversions
5000         for embedded property and indexer assignments.
5001
5002 2003-07-26  Martin Baulig  <martin@ximian.com>
5003
5004         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
5005         preprocessor directive is not the first non-whitespace character
5006         on a line.
5007
5008 2003-07-26  Martin Baulig  <martin@ximian.com>
5009
5010         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
5011         namespace parsing, follow the spec more closely.
5012
5013         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
5014         NamespaceEntry.Lookup().
5015
5016 2003-07-25  Martin Baulig  <martin@ximian.com>
5017
5018         * MethodCore.cs (OverridesSomething): New public field; it's set
5019         from TypeContainer.DefineMembers if this method overrides
5020         something (which doesn't need to be a method).  Fix #39462.
5021
5022 2003-07-25  Ravi Pratap  <ravi@ximian.com>
5023
5024         * typemanager.cs (GetMembers): Ensure that the list of members is
5025         reversed. This keeps things in sync.
5026
5027         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
5028         find an AttributeUsage attribute.
5029
5030         * expression.cs (Invocation.OverloadResolve): Perform the check
5031         which disallows Invoke to be directly called on a Delegate.
5032
5033         (Error_InvokeOnDelegate): Report error cs1533.
5034
5035 2003-07-25  Martin Baulig  <martin@ximian.com>
5036
5037         * expression.cs (Indexers.GetIndexersForType): Only look in the
5038         interface hierarchy if the requested type is already an
5039         interface.  Fixes #46788 while keeping #46502 fixed.
5040
5041 2003-07-25  Martin Baulig  <martin@ximian.com>
5042
5043         * class.cs (TypeContainer.DefineMembers): Check whether all
5044         readonly fields have been assigned and report warning CS0649 if
5045         not.
5046
5047         * statement.cs (LocalInfo.IsFixed): Always return true if this is
5048         a valuetype.
5049
5050 2003-07-24  Ravi Pratap  <ravi@ximian.com>
5051
5052         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
5053         returned from GetMethods to make things consistent with the
5054         assumptions MCS makes about ordering of methods.
5055
5056         This should comprehensively fix bug #45127 and it does :-)
5057
5058         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
5059         ordering is actually reverse.
5060
5061         * Clean up some debug messages I left lying around.
5062
5063         * interface.cs (Populate*): Get rid of code which emits attributes
5064         since the stage in which we emit attributes is the 'Emit' stage,
5065         not the define stage.
5066
5067         (Emit): Move attribute emission for interface members here.
5068
5069 2003-07-22  Ravi Pratap  <ravi@ximian.com>
5070
5071         * expression.cs (Invocation.OverloadResolve): Follow the spec more
5072         closely: we eliminate methods in base types when we have an
5073         applicable method in a top-level type.
5074
5075         Please see section 14.5.5.1 for an exact description of what goes
5076         on. 
5077
5078         This fixes bug #45127 and a host of other related to corlib compilation.
5079
5080         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
5081         array is the method corresponding to the top-level type (this is
5082         because of the changes made to icall.c) so we change this
5083         accordingly.
5084
5085         (MethodGroupExpr.Name): This too.
5086
5087         * typemanager.cs (GetElementType): New method which does the right
5088         thing when compiling corlib. 
5089
5090         * everywhere: Make use of the above in the relevant places.
5091
5092 2003-07-22  Martin Baulig  <martin@ximian.com>
5093
5094         * cs-parser.jay (invocation_expression): Moved
5095         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
5096         `cast_expression', but create a InvocationOrCast which later
5097         resolves to either an Invocation or a Cast.
5098
5099         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
5100         method; call this before EmitStatement() to make sure that this
5101         expression can be used as a statement.
5102
5103         * expression.cs (InvocationOrCast): New class; resolves to either
5104         an Invocation or a Cast.
5105
5106         * statement.cs (StatementExpression): Call ResolveStatement() on
5107         the ExpressionStatement before emitting it.
5108
5109 2003-07-21  Martin Baulig  <martin@ximian.com>
5110
5111         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
5112         `ref' and `out' attributes match; fixes #46220.
5113         (MemberAccess.ResolveMemberAccess): You can't reference a type
5114         through an expression; fixes #33180.
5115         (Indexers.GetIndexersForType): Don't return the indexers from
5116         interfaces the class implements; fixes #46502.
5117
5118 2003-07-21  Martin Baulig  <martin@ximian.com>
5119
5120         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
5121         CS0661 checks; fixes bug #30442.
5122
5123 2003-07-21  Martin Baulig  <martin@ximian.com>
5124
5125         * decl.cs (AdditionResult): Added `Error'.
5126
5127         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
5128
5129         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
5130         makes cs0031.cs actually work.
5131
5132 2003-07-20  Martin Baulig  <martin@ximian.com>
5133
5134         * namespace.cs: Fixed that bug which caused a crash when compiling
5135         the debugger's GUI.
5136
5137 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
5138
5139         * typemanager.cs (LookupTypeReflection): Never expose types which
5140         are NotPublic, NestedPrivate, NestedAssembly, or
5141         NestedFamANDAssem.  We used to return these, and later do a check
5142         that would report a meaningful error, but the problem is that we
5143         would not get the real match, if there was a name override.
5144
5145 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
5146
5147         * namespace.cs (Namespace, Name): Do not compute the namespace
5148         name dynamically, compute it in the constructor.  This reduced
5149         memory usage by 1697 KB.
5150
5151         * driver.cs: Use --pause to pause at the end.
5152
5153 2003-07-17  Peter Williams  <peter@newton.cx>
5154
5155         * Makefile: Change the name of the test target so that it doesn't
5156         conflict with the recursive test target.
5157
5158 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
5159
5160         * expression.cs (LocalVariableReference.Emit, EmitAssign,
5161         AddressOf): Do not use EmitThis, that was wrong, use the actual
5162         this pointer.
5163
5164 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
5165
5166         * class.cs (MethodData.Define): While checking if a method is an
5167         interface implementation, improve the test: If we are not public
5168         (use new test here: use the computed MethodAttributes directly,
5169         instead of the parsed modifier flags) check if the `implementing'
5170         method comes from an interface or not.
5171
5172         * pending.cs (VerifyPendingMethods): Slightly better error
5173         message.
5174
5175         * makefile: add test target that does the mcs bootstrap.
5176
5177 2003-07-16  Ravi Pratap  <ravi@ximian.com>
5178
5179         * interface.cs (Define): Do nothing here since there are no
5180         members to populate etc. Move the attribute emission out of here
5181         since this was just totally the wrong place to put it. Attribute
5182         application happens during the 'Emit' phase, not in the 'Define'
5183         phase.
5184
5185         (Emit): Add this method and move the attribute emission here
5186
5187         * rootcontext.cs (EmitCode): Call the Emit method on interface
5188         types too.
5189
5190 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5191
5192         * expression.cs (OverloadResolve): Report error only if Location
5193         is not 'Null' which means that there was a probe going on.
5194
5195 2003-07-14  Martin Baulig  <martin@ximian.com>
5196
5197         * expression.cs (ConditionalLogicalOperator): New public class to
5198         implement user defined conditional logical operators.
5199         This is section 14.11.2 in the spec and bug #40505.
5200
5201 2003-07-14  Martin Baulig  <martin@ximian.com>
5202
5203         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
5204
5205 2003-07-14  Martin Baulig  <martin@ximian.com>
5206
5207         * codegen.cs (EmitContext.InFixedInitializer): New public field.
5208
5209         * ecore.cs (IVariable.VerifyFixed): New interface method.
5210
5211         * expression.cs (Unary.ResolveOperator): When resolving the `&'
5212         operator, check whether the variable is actually fixed.  Fixes bug
5213         #36055.  Set a variable definitely assigned when taking its
5214         address as required by the spec.
5215
5216         * statement.cs (LocalInfo.IsFixed): New field.
5217         (LocalInfo.MakePinned): Set `IsFixed' to true.
5218
5219 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5220
5221         * attribute.cs (Attribute.Resolve): While doing a Member lookup
5222         for .ctors, ensure that we only ask for members declared in the
5223         attribute type (BindingFlags.DeclaredOnly).
5224
5225         Fixes bug #43632.
5226
5227         * expression.cs (Error_WrongNumArguments): Report error 1501
5228         correctly the way CSC does.
5229
5230 2003-07-13  Martin Baulig  <martin@ximian.com>
5231
5232         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
5233         lookup on the fully qualified name, to make things like "X.X" work
5234         where "X.X" is a fully qualified type name, but we also have a
5235         namespace "X" in the using list.  Fixes #41975.
5236
5237 2003-07-13  Martin Baulig  <martin@ximian.com>
5238
5239         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
5240         function. If we're a CompoundAssign, we need to create an embedded
5241         CompoundAssign, not an embedded Assign.
5242         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
5243         Fixes #45854.
5244
5245 2003-07-13  Martin Baulig  <martin@ximian.com>
5246
5247         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
5248         work to fix bug #46088.
5249
5250 2003-07-13  Ravi Pratap <ravi@ximian.com>
5251
5252         * class.cs (Operator.Emit): Do not emit attributes here - it is
5253         taken care of by the Method class that we delegate too. This takes
5254         care of bug #45876.
5255
5256 2003-07-10  Martin Baulig  <martin@ximian.com>
5257
5258         * expression.cs (TypeOfVoid): New class.
5259         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
5260
5261 2003-07-10  Martin Baulig  <martin@ximian.com>
5262
5263         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
5264         bug #35957.
5265
5266 2003-07-10  Martin Baulig  <martin@ximian.com>
5267
5268         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
5269         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
5270
5271         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
5272
5273         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
5274
5275 2003-07-10  Martin Baulig  <martin@ximian.com>
5276
5277         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
5278         of decimal.  Fixes #42850.
5279
5280         NOTE: I also fixed the created byte blob, but this doesn't work on
5281         the MS runtime and csc never produces any byte blobs for decimal
5282         arrays.
5283
5284 2003-07-10  Martin Baulig  <martin@ximian.com>
5285
5286         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
5287         structs; fixes #32068.
5288         (Block.AddChildVariableNames): Fixed #44302.
5289
5290 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5291
5292         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
5293
5294 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5295
5296         * attribute.cs: And this test is onger needed.
5297
5298 2003-07-08  Martin Baulig  <martin@ximian.com>
5299
5300         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
5301         inaccessible types.  Fixes #36313.
5302
5303         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
5304
5305         * namespace.cs (NamespaceEntry): Create implicit entries for all
5306         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
5307         implicit entries for N1.N2 and N1.
5308
5309 2003-07-08  Martin Baulig  <martin@ximian.com>
5310
5311         Rewrote the handling of namespaces to fix a lot of the issues
5312         wrt. `using' aliases etc.
5313
5314         * namespace.cs (Namespace): Splitted this class into a
5315         per-assembly `Namespace' and a per-file `NamespaceEntry'.
5316
5317         * typemanager.cs (TypeManager.IsNamespace): Removed.
5318         (TypeManager.ComputeNamespaces): Only compute namespaces from
5319         loaded assemblies here, not the namespaces from the assembly we're
5320         currently compiling.
5321
5322 2003-07-08  Martin Baulig  <martin@ximian.com>
5323
5324         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
5325
5326 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5327
5328         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
5329         already fixed it.  
5330
5331         I thought about the memory savings here, but LookupTypeReflection
5332         is used under already very constrained scenarios.  Compiling
5333         corlib or mcs only exposes one hit, so it would not really reduce
5334         any memory consumption.
5335
5336 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5337
5338         * typemanager.cs: fixes bug #45889 by only adding public types from
5339         other assemblies to the list of known types.
5340
5341 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5342
5343         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
5344         on the type we resolved.
5345
5346 2003-07-05  Martin Baulig  <martin@ximian.com>
5347
5348         * pending.cs (PendingImplementation.ParentImplements): Don't
5349         create the proxy if the parent is abstract.
5350
5351         * class.cs (TypeContainer.DefineIndexers): Process explicit
5352         interface implementations first.  Fixes #37714.
5353
5354 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
5355
5356         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
5357         defined recursively;  but since we modify the input parameters
5358         (left is set to `this' temporarily), we reset this value if the
5359         left_is_explicit is false, which gives the original semantics to
5360         the code.  
5361
5362         * literal.cs (NullPointer): new class used to represent a null
5363         literal in a pointer context.
5364
5365         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
5366         type is a pointer, use a NullPointer object instead of a
5367         NullLiteral.   Closes 43687
5368
5369         (ExplicitConversion): Convert pointer values using
5370         the conv opcode to the proper type.
5371
5372         * ecore.cs (New): change ValueTypeVariable property into a method,
5373         that returns whether the valuetype is suitable for being used.
5374
5375         * expression.cs (Binary.DoNumericPromotions): Only return if we
5376         the int constant was a valid uint, and we can return both left and
5377         right as uints.  If not, we continue processing, to trigger the
5378         type conversion.  This fixes 39018.
5379
5380         * statement.cs (Block.EmitMeta): During constant resolution, set
5381         the CurrentBlock property on the emitcontext, so that we resolve
5382         constants propertly.
5383
5384 2003-07-02  Martin Baulig  <martin@ximian.com>
5385
5386         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
5387         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
5388
5389         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
5390         than emitting it here.
5391
5392         * statement.cs: Fixed some more flow analysis bugs.
5393
5394 2003-07-02  Martin Baulig  <martin@ximian.com>
5395
5396         * class.cs (MethodData.Define): When implementing interface
5397         methods, set Final unless we're Virtual.
5398
5399         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
5400         check work for interface methods.
5401
5402 2003-07-01  Martin Baulig  <martin@ximian.com>
5403
5404         * ecore.cs (EmitContext.This): Replaced this property with a
5405         GetThis() method which takes a Location argument.  This ensures
5406         that we get the correct error location for a CS0188.
5407
5408 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
5409
5410         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
5411         ImplicitStandardConversion.
5412
5413         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
5414
5415 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
5416
5417         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
5418         optimization.
5419
5420 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
5421
5422         * class.cs (Constructor.Define): Turn off initlocals for unsafe
5423         constructors.
5424
5425         (MethodData.Define): Turn off initlocals for unsafe methods.
5426
5427 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
5428
5429         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
5430         complete;  Fixes #37521.
5431
5432         * delegate.cs: Use Modifiers.TypeAttr to compute the
5433         TypeAttributes, instead of rolling our own.  This makes the flags
5434         correct for the delegates.
5435
5436 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
5437
5438         * class.cs (Constructor.Define): Set the private flag for static
5439         constructors as well.
5440
5441         * cs-parser.jay (statement_expression): Set the return value to
5442         null, to avoid a crash when we catch an error.
5443
5444 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
5445
5446         * cs-parser.jay: Applied patch from Jackson that adds support for
5447         extern and unsafe modifiers to destructor declarations.
5448
5449         * expression.cs: Report error 21 if the user is trying to index a
5450         System.Array.
5451
5452         * driver.cs: Add an error message, suggested by the bug report.
5453
5454         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
5455         if we do not have a ": this ()" constructor initializer.  Fixes 45149
5456
5457 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
5458
5459         * namespace.cs: Add some information to reduce FAQs.
5460
5461 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
5462
5463         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
5464         underlying enumeration types.  Fixes #43915.
5465
5466         * expression.cs: Treat ushort/short as legal values to be used in
5467         bitwise operations.
5468
5469 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
5470
5471         * delegate.cs: transfer custom attributes for paramenters from
5472         the delegate declaration to Invoke and BeginInvoke.
5473
5474 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
5475
5476         * attribute.cs: handle custom marshalers and emit marshal info
5477         for fields, too.
5478
5479 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
5480
5481         * makefile.gnu: Added anonymous.cs to the compiler sources.
5482
5483 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5484
5485         * iterators.cs: Change the name of the proxy class to include two
5486         underscores.
5487
5488         * cs-parser.jay: Update grammar to include anonymous methods.
5489
5490         * anonymous.cs: new file.
5491
5492 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5493
5494         * class.cs (Field.Define): Add missing test for pointers and
5495         safety. 
5496
5497 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5498
5499         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5500         we use the stobj opcode.
5501
5502         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5503         since it wasn't the correct fix. 
5504
5505         It still is puzzling that we are required to use stobj for IntPtr
5506         which seems to be a ValueType.
5507
5508 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5509
5510         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5511         during regular simple name resolution.   Now, the trick is that
5512         instead of returning for processing the simplename, we do a
5513         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5514         contextual lookup type).   If a match is found, return that, if
5515         not, return for further composition.
5516
5517         This fixes long-standing 30485.
5518
5519         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5520         using the address to initialize an object, do an Stobj instead of
5521         using the regular Stelem.
5522
5523         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5524         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5525         Because if we are a BaseIndexerAccess that value will be true.
5526         Fixes 43643.
5527
5528         * statement.cs (GotoCase.Resolve): Return after reporting an
5529         error, do not attempt to continue. 
5530
5531         * expression.cs (PointerArithmetic.Emit): If our operand is a
5532         long, convert our constants to match the operand before
5533         multiplying.  Convert to I type before adding.   Fixes 43670.
5534
5535 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5536
5537         * enum.cs (ImplicitConversionExists) : Rename to
5538         ImplicitEnumConversionExists to remove ambiguity. 
5539
5540         * ecore.cs (NullCast): New type of cast expression class which
5541         basically is very similar to EmptyCast with the difference being
5542         it still is a constant since it is used only to cast a null to
5543         something else
5544         (eg. (string) null)
5545
5546         * convert.cs (ImplicitReferenceConversion): When casting a null
5547         literal, we return a NullCast.
5548
5549         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5550         should be around anymore.
5551
5552         The renaming (reported was slightly wrong). Corrections:
5553
5554         ConvertImplicitStandard -> ImplicitConversionStandard
5555         ConvertExplicitStandard -> ExplicitConversionStandard
5556
5557         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5558         before passing them in !
5559
5560         * convert.cs (ImplicitConversionStandard): When comparing for
5561         equal expr and target types, ensure that expr is not a
5562         NullLiteral.
5563
5564         In general, we must not be checking (expr_type ==
5565         target_type) in the top level conversion methods
5566         (ImplicitConversion, ExplicitConversion etc). This checking is
5567         done in the methods that they delegate to.
5568
5569 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5570
5571         * convert.cs: Move Error_CannotConvertType,
5572         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5573         ImplicitNumericConversion, ImplicitConversionExists,
5574         ImplicitUserConversionExists, StandardConversionExists,
5575         FindMostEncompassedType, FindMostSpecificSource,
5576         FindMostSpecificTarget, ImplicitUserConversion,
5577         ExplicitUserConversion, GetConversionOperators,
5578         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5579         TryImplicitIntConversion, Error_CannotConvertImplicit,
5580         ConvertImplicitRequired, ConvertNumericExplicit,
5581         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5582         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5583         its own file.
5584
5585         Perform the following renames:
5586
5587         StandardConversionExists -> ImplicitStandardConversionExists
5588         ConvertImplicit -> ImplicitConversion
5589         ConvertImplicitStandard -> ImplicitStandardConversion
5590         TryImplicitIntConversion -> ImplicitIntConversion
5591         ConvertImplicitRequired -> ImplicitConversionRequired
5592         ConvertNumericExplicit -> ExplicitNumericConversion
5593         ConvertReferenceExplicit -> ExplicitReferenceConversion
5594         ConvertExplicit -> ExplicitConversion
5595         ConvertExplicitStandard -> ExplicitStandardConversion
5596
5597 2003-05-19  Martin Baulig  <martin@ximian.com>
5598
5599         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5600         (TypeInfo): Added support for structs having structs as fields.
5601
5602         * ecore.cs (FieldExpr): Implement IVariable.
5603         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5604         VariableInfo for the field.
5605
5606 2003-05-18  Martin Baulig  <martin@ximian.com>
5607
5608         * expression.cs (This.DoResolve): Report a CS0027 if we're
5609         emitting a field initializer.
5610
5611 2003-05-18  Martin Baulig  <martin@ximian.com>
5612
5613         * expression.cs (This.ResolveBase): New public function.
5614         (This.DoResolve): Check for CS0188.
5615
5616         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5617         This.Resolve().
5618
5619         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5620         `instance_expression' to null if we don't have any non-static
5621         methods.
5622
5623 2003-05-18  Martin Baulig  <martin@ximian.com>
5624
5625         Reworked the way how local variables and parameters are handled by
5626         the flow analysis code.
5627
5628         * statement.cs (TypeInfo, VariableMap): New public classes.
5629         (VariableInfo): New public class.  This is now responsible for
5630         checking whether a variable has been assigned.  It is used for
5631         parameters and local variables.
5632         (Block.EmitMeta): Take the InternalParameters as argument; compute
5633         the layout of the flow vectors here.
5634         (Block.LocalMap, Block.ParameterMap): New public properties.
5635         (FlowBranching): The .ctor doesn't get the InternalParameters
5636         anymore since Block.EmitMeta() now computes the layout of the flow
5637         vector.
5638         (MyStructInfo): This class is now known as `StructInfo' and nested
5639         in `TypeInfo'; we don't access this directly anymore.
5640
5641         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5642         property and removed IsAssigned(), IsFieldAssigned(),
5643         SetAssigned() and SetFieldAssigned(); we now call them on the
5644         VariableInfo so we don't need to duplicate this code everywhere.
5645
5646         * expression.cs (ParameterReference): Added `Block block' argument
5647         to the .ctor.
5648         (LocalVariableReference, ParameterReference, This): The new
5649         VariableInfo class is now responsible for all the definite
5650         assignment stuff.
5651
5652         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5653         IsParameterAssigned, SetParameterAssigned): Removed.
5654
5655 2003-05-18  Martin Baulig  <martin@ximian.com>
5656
5657         * typemanager.cs (InitCoreTypes): Try calling
5658         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5659         the 3-args-version.  Corlib now also needs our `void_type'.
5660         (GetMethod): Added overloaded version which takes an optional
5661         `bool report_errors' to allow lookups of optional methods.
5662
5663 2003-05-12  Martin Baulig  <martin@ximian.com>
5664
5665         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5666         only used for locals and not for parameters.
5667
5668 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5669
5670         * support.cs (InternalParameters.ParameterType): Return the
5671         ExternalType of the parameter.
5672
5673         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5674         they were unused.
5675
5676 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * class.cs (MethodData.Define): Do not set the `newslot' on
5679         interface members, if they are also flagged as "override".
5680
5681         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5682         better code for ++i and i++.  This only works for static fields
5683         and local variables.
5684
5685         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5686         want to pull the DeclSpace out of the builder_to_declspace instead
5687         of the TypeBuilder (like in TypeContainer.FindMembers).
5688
5689         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
5690         instead of LookupTypeContainer.  Fixes the crash on .NET for
5691         looking up interface members.
5692
5693         * const.cs: Create our own emit context during the Definition
5694         stage, so that constants are evaluated in the proper context, when
5695         a recursive definition happens.
5696
5697 2003-05-11  Martin Baulig  <martin@ximian.com>
5698
5699         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
5700         new block for a switch section.
5701         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
5702         the adding/lookup in the switch block.  Fixes #39828.
5703
5704 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
5705
5706         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
5707         functionality: I needed to convert the data after I had performed
5708         the add/sub operation into the operands type size.
5709
5710         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
5711         pass the type for the box operation, otherwise the resulting
5712         object would have been of type object.
5713
5714         (BoxedCast): Add constructor to specify the type to box as.
5715
5716 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
5717
5718         * iterators.cs: I was reusing the `count' variable inadvertently,
5719         take steps to not allow this to happen.
5720
5721 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
5722
5723         * attribute.cs (Attribute.Resolve): Params attributes are encoded
5724         by creating an array at the point where the params starts and
5725         putting all those arguments there, then adjusting the size of the
5726         array.
5727
5728 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
5729
5730         * expression.cs (New.AddressOf): Implement interface
5731         IMemoryLocation.  This is used when the `new' operator is used in
5732         the context of an invocation to a method on a value type.
5733
5734         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
5735         example. 
5736
5737         * namespace.cs: Also check the using aliases here.
5738
5739         * driver.cs: Move the test for using validity after the types have
5740         been entered, so we do a single pass that also includes the using
5741         aliases. 
5742
5743         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
5744         in the regular case.   CreateSiblingForFinally is doing extra
5745         error checking.
5746
5747         * attribute.cs (GetAttributeArgumentExpression): Store the result
5748         on an out value, and use the return value to indicate failure
5749         instead of using null (which is a valid return for Constant.GetValue).
5750
5751         * statement.cs: Perform the analysis flow for the increment
5752         portion after the statement, because this will be the real flow of
5753         execution.  Fixes #42385
5754
5755         * codegen.cs (EmitContext.EmitArgument,
5756         EmitContext.EmitStoreArgument): New helper functions when the
5757         RemapToProxy flag is set.
5758
5759         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
5760         function.
5761
5762         Add support for remapping parameters. 
5763
5764         * iterators.cs: Propagate parameter values;  Store parameter
5765         values in the proxy classes.
5766
5767 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
5768
5769         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
5770         need a proxy reference;  I do not know what I was thinking
5771
5772         * cs-parser.jay (constructor_initializer): catch another error,
5773         and display nice message.
5774
5775         (field_declaration): catch void field declaration
5776         to flag a better error. 
5777
5778         * class.cs (MemberBase.CheckBase): Report an error instead of a
5779         warning if a new protected member is declared in a struct. 
5780         (Field.Define): catch the error of readonly/volatile.
5781
5782         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
5783
5784         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
5785         volatile variable is taken
5786
5787 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
5788
5789         * statement.cs (Fixed.Resolve): Report an error if we are not in
5790         an unsafe context.
5791
5792 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
5793
5794         * typemanager.cs: reuse the code that handles type clashes for
5795         delegates and enumerations.
5796
5797         * class.cs (Report28): Always report.
5798
5799         * expression.cs (EncodeAsAttribute): Allow nulls here.
5800
5801 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
5802
5803         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
5804         the functionality for testing whether an expression is valid for
5805         an attribute here.  Also handle the case of arrays of elements
5806         being stored. 
5807
5808         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
5809         encoding a linear array into an array of objects that are suitable
5810         to be passed to an CustomAttributeBuilder.
5811
5812         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
5813
5814         * ecore.cs: (FieldExpr): Handle field remapping here.
5815
5816         * iteratators.cs: Pass the instance variable (if the method is an
5817         instance method) to the constructors, so we can access the field
5818         variables on the class.
5819
5820         TODO: Test this with structs.  I think the THIS variable on
5821         structs might have to be a pointer, and not a refenrece
5822
5823 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
5824
5825         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
5826         local variables to fields in a proxy class.
5827
5828         * iterators.cs (PopulateProxy): Rename our internal fields to
5829         <XXX>.  
5830         Create a <THIS> field if we are an instance method, so we can
5831         reference our parent container variables.
5832         (MapVariable): Called back from the EmitContext code to enter a
5833         new variable to field mapping into the proxy class (we just create
5834         a FieldBuilder).
5835
5836         * expression.cs
5837         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
5838         for using the remapped locals to fields.
5839
5840         I placed the code here, because that gives the same semantics to
5841         local variables, and only changes the Emit code.
5842
5843         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
5844         statements inside iterators.
5845         (VariableInfo): Add a FieldBuilder for the cases when we are
5846         remapping local variables to fields in a proxy class
5847
5848         * ecore.cs (SimpleNameResolve): Avoid testing two times for
5849         current_block != null.
5850
5851         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
5852         not cope with strings, as it has been moved to the
5853         TableSwitchEmit.  Fixed bug in switch generation.
5854
5855         * expression.cs (New.DoResolve): Provide more context for the user
5856         when reporting an error.
5857
5858         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
5859         pointers. 
5860
5861         * expression.cs (MemberAccess.DoResolve): When we get a type back,
5862         check the permissions for it.  Note than in a type-resolution
5863         context the check was already present in DeclSpace.ResolveType,
5864         but was missing from the MemberAccess.
5865
5866         (ArrayCreation.CheckIndices): warn if the user has
5867         more nested levels of expressions, but there are no more
5868         dimensions specified.  Avoids crash on bug 41906.
5869
5870 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
5871
5872         * statement.cs (Block): replace Implicit bool, for a generic
5873         flags.   
5874         New flag: `Unchecked'.  This is used during the EmitMeta phase
5875         (which is out-of-line with the regular Resolve/Emit process for a
5876         statement, as this is done ahead of time, but still gets a chance
5877         to call constant resolve).
5878
5879         (Block.Flags): new enum for adding a new flag.
5880
5881         (Block.EmitMeta): track the state of unchecked.
5882
5883         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
5884         to enable constant resolution to work there as well.
5885
5886 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
5887
5888         * typemanager.cs (ienumerable_type): Also look up
5889         System.Collections.IEnumerable. 
5890
5891 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
5892
5893         TODO: Test more than one conditional per method.
5894
5895         * class.cs (Indexer.Define): Report the location where the user is
5896         referencing the unsupported feature.
5897
5898         (MethodData): Overload the use of `conditionals' to
5899         minimize the creation of needless ArrayLists.   This saves roughly
5900         212kb on my machine.
5901
5902         (Method): Implement the new IIteratorContainer interface.
5903         (Method.SetYields): Implement the method by setting the ModFlags
5904         to contain METHOD_YIELDS.
5905
5906         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
5907         which just got set to null.
5908
5909         * iterators.cs: New file.
5910
5911         (Yield, YieldBreak): New statements.
5912
5913         * statement.cs (Return.Resolve): Flag an error if we are used in
5914         an iterator method.
5915
5916         * codegen.cs (InIterator): New flag set if the code is being
5917         compiled in an iterator method.
5918
5919         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
5920         internal modifier, and we just use it to avoid adding extra
5921         fields, as this is seldom used.  
5922
5923         * cs-parser.jay: Add yield_statement (yield and yield break).
5924
5925         * driver.cs: New flag -v2 to turn on version 2 features. 
5926
5927         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
5928         hashtable when v2 is enabled.
5929
5930 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
5931
5932         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
5933         there is already a namespace defined with this name.
5934
5935         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
5936         people upgraded their corlibs.
5937
5938         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
5939         always use fully qualified types, no need to use the compiler
5940         front end.
5941
5942         (TypeManager.IsNamespace): Use binarysearch.
5943
5944         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
5945         AddDelegate): I did not quite use the new IsValid API properly: I
5946         have to pass the short-name and the fullname.  I was passing only
5947         the basename instead of the fullname sometimes. 
5948
5949         (TypeContainer.DefineType): call NamespaceClash.
5950
5951         * interface.cs (Interface.DefineType): use NamespaceClash before
5952         defining the type.
5953
5954         * delegate.cs (Delegate.DefineType): use NamespaceClash before
5955         defining the type.
5956
5957         * enum.cs: (Enum.DefineType): use NamespaceClash before
5958         defining the type.
5959
5960         * typemanager.cs (: 3-line patch that gives us some tasty 11%
5961         speed increase.  First, use the negative_hits cache when we get a
5962         negative.  Second, add the type with its full original name
5963         instead of the new . and + encoded name (reflection uses + to
5964         separate type from a nested type).  Use LookupTypeReflection
5965         directly which bypasses the type->name hashtable (that we already
5966         know does not contain the type.
5967
5968         * decl.cs (DeclSpace.ResolveTypeExpr): track the
5969         location/container type. 
5970
5971         * driver.cs: When passing utf8, use directly the UTF8Encoding.
5972
5973 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
5974
5975         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
5976
5977         * delegate.cs (NewDelegate.Resolve): Test whether an instance
5978         method is being referenced in the method group from a static
5979         context, and report error 120 if so.
5980
5981         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
5982         Error118. 
5983
5984         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
5985         is created, we create the A namespace).
5986
5987         * cs-parser.jay: A namespace also introduces a DeclarationFound.
5988         Fixes #41591
5989
5990 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
5991
5992         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
5993         invocation to ModuleBuilder.GetType with the same values will
5994         return a new type instance, so we need to cache its return
5995         values. 
5996
5997         * expression.cs (Binary.ResolveOperator): Only allow the compare
5998         operators on enums if they are of the same type.
5999
6000         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
6001         types of ValueType on their own case.  Before we were giving them
6002         the same treatment as objects.
6003
6004         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
6005         fullname.  Short name is used to compare against container name.
6006         Fullname is used to check against defined namespace names.
6007
6008         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
6009         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
6010
6011         (Method.CheckBase): Call parent.
6012         (MemberBase.CheckBase): Check for protected members on sealed
6013         classes.
6014         (PropertyBase.CheckBase): Call parent.
6015         (Field.Define): Call parent.
6016
6017         * report.cs: Negative error codes are now mapped to 8000 - code,
6018         so that the display is render more nicely.
6019
6020         * typemanager.cs: Do not use try/catch, instead report a regular
6021         error. 
6022
6023         (GetPointerType, GetReferenceType): These methods provide
6024         mechanisms to obtain the T* and T& from a T.  We had the code
6025         previously scattered around the code base, and it also used
6026         TypeManager.LookupType that would go through plenty of caches.
6027         This one goes directly to the type source.
6028
6029         In some places we did the Type.GetType followed by
6030         ModuleBuilder.GetType, but not in others, so this unifies the
6031         processing as well.
6032
6033         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
6034         statements now that we have namespace information.
6035
6036         * typemanager.cs (IsNamespace): New method, returns whether the
6037         string presented is a namespace or not.
6038
6039         (ComputeNamespaces): New public entry point, computes the list of
6040         available namespaces, using the GetNamespaces API call in Mono, or
6041         the slower version in MS.NET.   
6042
6043         Now before we start the semantic analysis phase, we have a
6044         complete list of namespaces including everything that the user has
6045         provided.
6046
6047         Deleted old code to cache namespaces in .nsc files.
6048
6049 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
6050
6051         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
6052         class/struct location definition Location for the implicit
6053         constructor location.
6054
6055         (Operator.Define): Use the location of the operator for the
6056         implicit Method definition.
6057
6058         (Constructor.Emit): use the constructor location for the implicit
6059         base initializer constructor.
6060
6061         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
6062         and the Expression class now contains two new methods:
6063
6064         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
6065         isolate type lookup from the rest of the resolution process.
6066
6067         Since we use Expressions to hold type definitions due to the way
6068         we parse the input we have historically overloaded Resolve to
6069         perform the Type lookups if a special flag is passed.  Now this is
6070         eliminated and two methods take their place. 
6071
6072         The differences in the two methods between xStep and xTerminal is
6073         that xStep is involved in our current lookup system that uses
6074         SimpleNames to compose a name, while xTerminal is used just to
6075         catch the case where the simplename lookup failed.
6076
6077 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
6078
6079         * expression.cs (ResolveMemberAccess): Remove redundant code.
6080         TypeExpr expressions are always born fully resolved.
6081
6082         * interface.cs (PopulateMethod): Do not lookup the types twice.
6083         We were doing it once during SemanticAnalysis and once during
6084         PopulateMethod.
6085
6086         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
6087         in local variable type definitions, were being returned as a
6088         SimpleName (we decomposed everything into a string), that is
6089         because primary_expression was being used instead of a type in the
6090         grammar (reduce/reduce conflicts).
6091
6092         The part that was wrong is that we converted the expression into a
6093         string (an oversimplification in one hand, compounded with primary
6094         expressions doing string concatenation).
6095
6096         So things like:
6097
6098         A.B.C [] x;
6099
6100         Would return "A.B.C[]" as a SimpleName.  This stopped things like
6101         using clauses from working on this particular context.  And a type
6102         was being matched directly against "A.B.C[]".
6103
6104         We now use the correct approach, and allow for ComposedCast to be
6105         part of the unary expression.  So the "A.B.C []" become a composed
6106         cast of "A.B.C" (as a nested group of MemberAccess with a
6107         SimpleName at the end) plus the rank composition "[]". 
6108
6109         Also fixes 35567
6110
6111 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
6112
6113         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
6114         for the access level checking.
6115
6116         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
6117         `TypeContainer container', because I kept getting confused when I
6118         was debugging this code.
6119
6120         * expression.cs (Indexers): Instead of tracking getters/setters,
6121         we now track them in parallel.  We create one arraylist less, but
6122         most importantly it is possible now for the LValue code to find a
6123         matching get for a set.
6124
6125         (IndexerAccess.DoResolveLValue): Update the code.
6126         GetIndexersForType has been modified already to extract all the
6127         indexers from a type.  The code assumed it did not.
6128
6129         Also make the code set the correct return type for the indexer.
6130         This was fixed a long time ago for properties, but was missing for
6131         indexers.  It used to be void_type.
6132
6133         (Binary.Emit): Test first for doubles instead of
6134         floats, as they are more common.
6135
6136         (Binary.EmitBranchable): Use the .un version of the branch opcodes
6137         when dealing with floats and the <=, >= operators.  This fixes bug
6138         #39314 
6139
6140         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
6141         to load the array value by emitting a load on the foreach variable
6142         type.  This was incorrect.  
6143
6144         We now emit the code to load an element using the the array
6145         variable type, and then we emit the conversion operator.
6146
6147         Fixed #40176
6148
6149 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
6150
6151         * attribute.cs: Avoid allocation of ArrayLists in the common case.
6152
6153 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
6154
6155         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
6156         test for protection before we test for signatures. 
6157
6158         (MethodSignature.ToString): implement.
6159
6160         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
6161         to the case where we reduced into a LongConstant.
6162
6163         * decl.cs (CheckAccessLevel): If the type is an array, we can not
6164         depend on whether the information is acurrate, because the
6165         Microsoft runtime will always claim that the array type is public,
6166         regardless of the real state.
6167
6168         If the type is a pointer, another problem happens: the type is
6169         reported as non-public in Microsoft.  
6170
6171         In both cases we have to call CheckAccessLevel recursively with
6172         the underlying type as the argument to be tested.
6173
6174 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
6175
6176         * assign.cs (Assign.Emit): If we are dealing with a compound
6177         assignment expression, we should use the code path that stores the
6178         intermediate result in a temporary value.  This fixes #40903.
6179
6180         *expression.cs (Indirection.ToString): Provide ToString method for
6181         debugging. 
6182
6183 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
6184
6185         * class.cs: Null out fields holding references to Block objects so
6186         they can be garbage collected.
6187
6188         * expression.cs (OverloadResolve): Remove unused local.
6189
6190 2003-04-07  Martin Baulig  <martin@ximian.com>
6191
6192         * codegen.cs (EmitContext.CurrentFile): New public field.
6193         (EmitContext.Mark): Use the CurrentFile to check whether the
6194         location is in the correct file.
6195         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
6196
6197 2003-04-07  Martin Baulig  <martin@ximian.com>
6198
6199         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
6200
6201         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
6202         location.  [FIXME: The location argument which gets passed to this
6203         method is sometimes wrong!]
6204
6205 2003-04-07  Nick Drochak <ndrochak@gol.com>
6206
6207         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
6208
6209 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
6210
6211         * expression.cs (Indirection.EmitAssign): We were using the
6212         temporary, but returning immediately instead of continuing the
6213         EmitAssing flow.
6214
6215 2003-04-06  Martin Baulig  <martin@ximian.com>
6216
6217         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
6218         if it's a nested child, but also deriving from the outer class.
6219         See test 190.cs.
6220
6221         * typemanager.cs (IsNestedChildOf): Make this work if it's a
6222         nested child, but also deriving from the outer class.  See
6223         test-190.cs.
6224         (FilterWithClosure): We may access private members of the outer
6225         class if we're a nested child and deriving from the outer class.
6226         (RealMemberLookup): Only set `closure_private_ok' if the
6227         `original_bf' contained BindingFlags.NonPublic.
6228
6229 2003-04-05  Martin Baulig  <martin@ximian.com>
6230
6231         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
6232
6233 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
6234
6235         * class.cs (Event.Define): Do not allow abstract events to have
6236         initializers. 
6237
6238 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
6239
6240         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
6241         block in event declarations.
6242
6243         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
6244         value type, get its address.
6245
6246         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
6247         leaving a class on the stack instead of a boolean value (int
6248         0/1).  Change the code so we compare against null, and then the
6249         result against zero.
6250
6251         * class.cs (TypeContainer.GetClassBases): We were checking for the
6252         parent class being sealed too late.
6253
6254         * expression.cs (Binary.Emit): For <= and >= when dealing with
6255         floating point values, use cgt.un and clt.un instead of cgt and
6256         clt alone.
6257
6258 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
6259
6260         * statement.cs: Apply the same optimization as MS: skip the 
6261         GetEnumerator returning an IEnumerator, and use the one returning a 
6262         CharEnumerator instead. This allows us to avoid the try-finally block 
6263         and the boxing.
6264
6265 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
6266
6267         * cs-parser.jay: Attributes cannot be applied to
6268                          namespaces. Fixes #40473
6269
6270 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6271
6272         * class.cs:
6273         (Add*): check if the name is valid using the full name for constants,
6274         fields, properties and events.
6275
6276 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
6277
6278         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
6279         char constants to be part of the enumeration.
6280
6281         * expression.cs (Conditional.DoResolve): Add support for operator
6282         true. Implements the missing functionality from 14.12
6283
6284         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
6285         operator true/false as required by the spec.
6286
6287         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
6288         implicit conversion to boolean.
6289
6290         * statement.cs (Statement.ResolveBoolean): A boolean expression is
6291         also one where the type implements `operator true'. 
6292
6293         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
6294         get an expression that will invoke operator true based on an
6295         expression.  
6296
6297         (GetConversionOperators): Removed the hack that called op_True
6298         here.  
6299
6300         (Expression.ResolveBoolean): Move this from Statement.
6301
6302 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
6303
6304         * ecore.cs (FieldExpr): do not allow initialization of initonly
6305         fields on derived classes
6306
6307 2003-03-13  Martin Baulig  <martin@ximian.com>
6308
6309         * statement.cs (Block.Emit): Call ig.BeginScope() and
6310         ig.EndScope() when compiling with debugging info; call
6311         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
6312
6313 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
6314
6315         * expression.cs (Indexers): Do not construct immediately, allow
6316         for new members to be appended as we go.  Fixes 38143
6317
6318 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6319
6320         * expression.cs: save/restore context when resolving an unchecked
6321         expression.
6322
6323 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * cfold.cs: Catch division by zero in modulus operator during
6326         constant folding.
6327
6328 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
6329
6330         * interface.cs (Interface.DefineMembers): Avoid defining members
6331         twice. 
6332
6333 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * driver.cs: handle the +/- options for -noconfig
6336
6337         * statement.cs (Unckeched.Resolve): Also track the state of
6338         unchecked in the Resolve phase.
6339
6340 2003-02-27  Martin Baulig  <martin@ximian.com>
6341
6342         * ecore.cs (Expression.MemberLookup): Don't create a
6343         MethodGroupExpr for something which is not a method.  Fixes #38291.
6344
6345 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
6346
6347         * class.cs (MemberBase.CheckParameters): Also check that the type
6348         is unmanaged if it is a pointer.
6349
6350         * expression.cs (SizeOf.Resolve): Add location information.
6351
6352         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
6353         a managed type is declared.
6354
6355         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
6356         parameter modifiers as well.  Fixes bug 38606
6357
6358         * class.cs: Very sad.  Am backing out the speed up changes
6359         introduced by the ArrayList -> Array in the TypeContainer, as they
6360         were not actually that much faster, and introduced a bug (no error
6361         reports on duplicated methods).
6362
6363         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
6364         source first, this will guarantee that we have a valid expression
6365         before calling in lower levels functions that will require a
6366         resolved object.  Then use this original_source in the
6367         target.ResolveLValue instead of the original source that was
6368         passed to us.
6369
6370         Another change.  Use target.Resolve instead of LValueResolve.
6371         Although we are resolving for LValues, we will let the Assign code
6372         take care of that (it will be called again from Resolve).  This
6373         basically allows code like this:
6374
6375         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
6376         class Y { void A (X x) { x [0] += o; }
6377
6378         The problem was that the indexer was trying to resolve for
6379         set_Item (idx, object o) and never finding one.  The real set_Item
6380         was set_Item (idx, X).  By delaying the process we get the right
6381         semantics. 
6382
6383         Fixes bug 36505
6384
6385 2003-02-23  Martin Baulig  <martin@ximian.com>
6386
6387         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
6388         while calling DoEmit ().
6389
6390         * codegen.cs (EmitContext.Mark): Don't mark locations in other
6391         source files; if you use the #line directive inside a method, the
6392         compiler stops emitting line numbers for the debugger until it
6393         reaches the end of the method or another #line directive which
6394         restores the original file.
6395
6396 2003-02-23  Martin Baulig  <martin@ximian.com>
6397
6398         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
6399
6400 2003-02-23  Martin Baulig  <martin@ximian.com>
6401
6402         * statement.cs (Block.AddChildVariableNames): We need to call this
6403         recursively, not just for our immediate children.
6404
6405 2003-02-23  Martin Baulig  <martin@ximian.com>
6406
6407         * class.cs (Event.Define): Always make the field private, like csc does.
6408
6409         * typemanager.cs (TypeManager.RealMemberLookup): Make events
6410         actually work, fixes bug #37521.
6411
6412 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
6413
6414         * delegate.cs: When creating the various temporary "Parameters"
6415         classes, make sure that we call the ComputeAndDefineParameterTypes
6416         on those new parameters (just like we do with the formal ones), to
6417         allow them to be resolved in the context of the DeclSpace.
6418
6419         This fixes the bug that Dick observed in Bugzilla #38530.
6420
6421 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
6422
6423         * expression.cs (ResolveMemberAccess): When resolving a constant,
6424         do not attempt to pull a constant if the value was not able to
6425         generate a valid constant.
6426
6427         * const.cs (LookupConstantValue): Do not report more errors than required.
6428
6429 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6430
6431         * expression.cs: fixes bug #38328.
6432
6433 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6434
6435         * class.cs: Changed all the various members that can be part of a
6436         class from being an ArrayList to be an Array of the right type.
6437         During the DefineType type_list, interface_list, delegate_list and
6438         enum_list are turned into types, interfaces, delegates and enums
6439         arrays.  
6440
6441         And during the member population, indexer_list, event_list,
6442         constant_list, field_list, instance_constructor_list, method_list,
6443         operator_list and property_list are turned into their real arrays.
6444
6445         Although we could probably perform this operation earlier, for
6446         good error reporting we need to keep the lists and remove the
6447         lists for longer than required.
6448
6449         This optimization was triggered by Paolo profiling the compiler
6450         speed on the output of `gen-sample-program.pl' perl script. 
6451
6452         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
6453         not crash in methods like MemberLookupFailed that use this field.  
6454
6455         This problem arises when the compiler fails to resolve a type
6456         during interface type definition for example.
6457
6458 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6459
6460         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
6461         inherit from System.Object, so we have to stop at null, not only
6462         when reaching System.Object.
6463
6464 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
6465
6466         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
6467         DeclaredOnly because the parent indexer might have had a different
6468         name, but did not loop until the top of the hierarchy was reached.
6469
6470         The problem this one fixes is 35492: when a class implemented an
6471         indexer from an interface, we were getting the interface method
6472         (which was abstract) and we were flagging an error (can not invoke
6473         abstract method).
6474
6475         This also keeps bug 33089 functioning, and test-148 functioning.
6476
6477         * typemanager.cs (IsSpecialMethod): The correct way of figuring
6478         out if a method is special is to see if it is declared in a
6479         property or event, or whether it is one of the predefined operator
6480         names.   This should fix correctly #36804.
6481
6482 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6483
6484         The goal here is to remove the dependency on EmptyCast.Peel ().
6485         Killing it completely.
6486
6487         The problem is that currently in a number of places where
6488         constants are expected, we have to "probe" for an EmptyCast, and
6489         Peel, which is not the correct thing to do, as this will be
6490         repetitive and will likely lead to errors. 
6491
6492         The idea is to remove any EmptyCasts that are used in casts that
6493         can be reduced to constants, so we only have to cope with
6494         constants. 
6495
6496         This bug hunt was triggered by Bug 37363 and the desire to remove
6497         the duplicate pattern where we were "peeling" emptycasts to check
6498         whether they were constants.  Now constants will always be
6499         constants.
6500
6501         * ecore.cs: Use an enumconstant here instead of wrapping with
6502         EmptyCast.  
6503
6504         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6505         throwing me off.  By handling this we can get rid of a few hacks.
6506
6507         * statement.cs (Switch): Removed Peel() code.
6508
6509 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6510
6511         * class.cs: Location information for error 508
6512
6513         * expression.cs (New.DoResolve): Add a guard against double
6514         resolution of an expression.  
6515
6516         The New DoResolve might be called twice when initializing field
6517         expressions (see EmitFieldInitializers, the call to
6518         GetInitializerExpression will perform a resolve on the expression,
6519         and later the assign will trigger another resolution
6520
6521         This leads to bugs (#37014)
6522
6523         * delegate.cs: The signature for EndInvoke should contain any ref
6524         or out parameters as well.  We were not doing this in the past. 
6525
6526         * class.cs (Field.Define): Do not overwrite the type definition
6527         inside the `volatile' group.  Turns out that volatile enumerations
6528         were changing the type here to perform a validity test, which
6529         broke conversions. 
6530
6531 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6532
6533         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6534         and structs, we do not want to load the instance variable
6535
6536         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6537         enum_type has to be handled like an object reference (implicit
6538         conversions exists from this to object), but the regular IsClass
6539         and IsValueType tests will never return true for this one.
6540
6541         Also we use TypeManager.IsValueType instead of type.IsValueType,
6542         just for consistency with the rest of the code (this is only
6543         needed if we ever use the construct exposed by test-180.cs inside
6544         corlib, which we dont today).
6545
6546 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6547
6548         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6549         just InternalCall.
6550
6551 2003-02-09  Martin Baulig  <martin@ximian.com>
6552
6553         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6554         (Namespace.DefineNamespaces): New static public method; this is
6555         called when we're compiling with debugging to add all namespaces
6556         to the symbol file.
6557
6558         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6559         pass it to the Namespace's .ctor.
6560
6561         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6562         and MethodBase arguments; pass the namespace ID to the symwriter;
6563         pass the MethodBase instead of the token to the symwriter.
6564         (SymbolWriter.DefineNamespace): New method to add a namespace to
6565         the symbol file.
6566
6567 2003-02-09  Martin Baulig  <martin@ximian.com>
6568
6569         * symbolwriter.cs: New file.  This is a wrapper around
6570         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6571         methods here in near future.
6572
6573 2003-02-09  Martin Baulig  <martin@ximian.com>
6574
6575         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6576         ILGenerator.MarkSequencePoint() which are actually used by the
6577         symbol writer.
6578
6579 2003-02-09  Martin Baulig  <martin@ximian.com>
6580
6581         * location.cs (SourceFile): New public sealed class.  This
6582         contains the name and an index which is used in the location's token.
6583         (Location): Reserve an appropriate number of bits in the token for
6584         the source file instead of walking over that list, this gives us a
6585         really huge performance improvement when compiling with debugging.
6586
6587         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6588         `SourceFile' argument instead of a string.
6589         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6590         but don't parse/tokenize here, we need to generate the list of all
6591         source files before we do that.
6592         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6593         the files.
6594
6595         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6596         instead of a string.
6597
6598         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6599         of a string.
6600
6601 2003-02-09  Martin Baulig  <martin@ximian.com>
6602
6603         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6604         filename on `#line default'.
6605
6606 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6607
6608         * statement.cs: don't clear the pinned var when the fixed statement
6609         returns from the method (fixes bug#37752).
6610
6611 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6612
6613         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6614         to IsValueType.
6615
6616 2003-02-07  Martin Baulig  <martin@ximian.com>
6617
6618         * driver.cs: Removed the `--debug-args' command line argument.
6619
6620         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6621         automatically by the AsssemblyBuilder.
6622         (CodeGen.InitializeSymbolWriter): We don't need to call any
6623         initialization function on the symbol writer anymore.  This method
6624         doesn't take any arguments.
6625
6626 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6627
6628         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6629         from referenced assemblies as well.
6630
6631 2003-02-02  Martin Baulig  <martin@ximian.com>
6632
6633         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6634
6635 2003-02-02  Martin Baulig  <martin@ximian.com>
6636
6637         * class.cs (Constructor.Emit): Open the symbol writer before
6638         emitting the constructor initializer.
6639         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6640         single-stepping through constructor initializers.
6641
6642 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6643
6644         * class.cs: Handle error 549: do not allow virtual methods in
6645         sealed classes. 
6646
6647 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6648
6649         * decl.cs: Check access levels when resolving types
6650
6651 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6652
6653         * statement.cs: Add parameters and locals set in catch blocks that might 
6654         return to set vector
6655
6656 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6657
6658         * class.cs (Operator): Set the SpecialName flags for operators.
6659
6660         * expression.cs (Invocation.DoResolve): Only block calls to
6661         accessors and operators on SpecialName methods.
6662
6663         (Cast.TryReduce): Handle conversions from char constants.
6664
6665
6666 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
6667
6668         * statement.cs: small memory and time optimization in FlowBranching.
6669
6670 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
6671
6672         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
6673         problem that the last fix but in the other sid (Set).
6674
6675         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
6676         access when there is no indexer in the hierarchy.
6677
6678 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
6679
6680         * class.cs: Combine some if statements.
6681
6682 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6683
6684         * driver.cs: fixed bug #37187.
6685
6686 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
6687
6688         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
6689         any indexer, it's needed to build a list with all the indexers in the
6690         hierarchy (AllGetters), else we have problems. Fixes #35653.
6691
6692 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
6693
6694         * class.cs (MethodData.Define): It is wrong for an interface
6695         implementation to be static in both cases: explicit and implicit.
6696         We were only handling this in one case.
6697
6698         Improve the if situation there to not have negations.
6699
6700         * class.cs (Field.Define): Turns out that we do not need to check
6701         the unsafe bit on field definition, only on usage.  Remove the test.
6702
6703 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6704
6705         * driver.cs: use assembly.Location instead of Codebase (the latest
6706         patch made mcs fail when using MS assemblies).
6707
6708 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
6709
6710         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
6711         get the path to *corlib.dll.
6712
6713 2003-01-21  Nick Drochak <ndrochak@gol.com>
6714
6715         * cs-tokenizer.cs:
6716         * pending.cs:
6717         * typemanager.cs: Remove compiler warnings
6718
6719 2003-01-20  Duncan Mak  <duncan@ximian.com>
6720
6721         * AssemblyInfo.cs: Bump the version number to 0.19.
6722
6723 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6724
6725         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
6726
6727 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
6728
6729         * class.cs (Constructor::Emit): Emit debugging info for constructors.
6730
6731 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
6732
6733         * cs-parser.jay: Small fix: we were not comparing the constructor
6734         name correctly.   Thanks to Zoltan for the initial pointer.
6735
6736 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
6737
6738         * cs-tokenizer.cs: Set file name when specified with #line
6739
6740 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
6741
6742         * cs-parser.jay: Only perform the constructor checks here if we
6743         are named like the class;  This will help provider a better
6744         error.  The constructor path is taken when a type definition is
6745         not found, but most likely the user forgot to add the type, so
6746         report that rather than the constructor error.
6747
6748 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
6749
6750         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
6751         allocations.
6752
6753 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6754
6755         * cs-parser.jay: Add cleanup call.
6756
6757 2003-01-13  Duncan Mak  <duncan@ximian.com>
6758
6759         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
6760         consistent with other methods.
6761
6762 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6763
6764         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
6765
6766 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
6767
6768         * attribute.cs: only set GuidAttr to true when we have a
6769         GuidAttribute.
6770
6771 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6772
6773         * ecore.cs:
6774         * expression.cs:
6775         * typemanager.cs: fixes to allow mcs compile corlib with the new
6776         Type.IsSubclassOf fix.
6777
6778 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
6779
6780         * expression.cs (LocalVariableReference.DoResolve): Classify a
6781         constant as a value, not as a variable.   Also, set the type for
6782         the variable.
6783
6784         * cs-parser.jay (fixed_statement): take a type instead of a
6785         pointer_type, so we can produce a better error message later.
6786
6787         * statement.cs (Fixed.Resolve): Flag types that are not pointers
6788         as an error.  
6789
6790         (For.DoEmit): Make inifinite loops have a
6791         non-conditional branch back.
6792
6793         (Fixed.DoEmit): First populate the pinned variables, then emit the
6794         statement, then clear the variables.  Before I was emitting the
6795         code once for each fixed piece.
6796
6797
6798 2003-01-08  Martin Baulig  <martin@ximian.com>
6799
6800         * statement.cs (FlowBranching.MergeChild): A break in a
6801         SWITCH_SECTION does not leave a loop.  Fixes #36155.
6802
6803 2003-01-08  Martin Baulig  <martin@ximian.com>
6804
6805         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
6806         lives in the same number space than `param_map'.  Fixes #36154.
6807
6808 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
6809
6810         * cs-parser.jay (constructor_declaration): Set the
6811         Constructor.ModFlags before probing for it.  This makes the
6812         compiler report 514, 515 and 132 (the code was there, but got
6813         broken). 
6814
6815         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
6816         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
6817         (GotoCase.Resolve): Set `Returns' to ALWAYS.
6818
6819 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
6820
6821         * enum.cs: create the enum static fields using the enum type.
6822
6823 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
6824
6825         * class.cs: don't try to create the ParamBuilder for the return
6826         type if it's not needed (and handle it breaking for the ms runtime
6827         anyway).
6828
6829 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
6830
6831         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
6832
6833 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
6834
6835         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
6836         the command.   This showed up while compiling the JANET source
6837         code, which used \r as its only newline separator.
6838
6839 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
6840
6841         * class.cs (Method.Define): If we are an operator (because it
6842         reuses our code), then set the SpecialName and HideBySig.  #36128
6843
6844 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
6847         exception, report error 120 `object reference required'.
6848
6849         * driver.cs: Add --pause option, used during to measure the size
6850         of the process as it goes with --timestamp.
6851
6852         * expression.cs (Invocation.DoResolve): Do not allow methods with
6853         SpecialName to be invoked.
6854
6855 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
6856
6857         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
6858         number before adding it.
6859
6860 2002-12-21  Ravi Pratap  <ravi@ximian.com>
6861
6862         * ecore.cs (StandardImplicitConversion): When in an unsafe
6863         context, we allow conversion between void * to any other pointer
6864         type. This fixes bug #35973.
6865
6866 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
6867
6868         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
6869         is not thrown when extensionless outputs are used 
6870
6871 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6872
6873         * rootcontext.cs: fixed compilation of corlib.
6874
6875 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
6876
6877         * attribute.cs (Attributes.Contains): Add new method.
6878
6879         * class.cs (MethodCore.LabelParameters): if the parameter is an
6880         `out' parameter, check that no attribute `[In]' has been passed.
6881
6882         * enum.cs: Handle the `value__' name in an enumeration.
6883
6884 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
6885
6886         * decl.cs: Added special case to allow overrides on "protected
6887         internal" methods
6888
6889 2002-12-18  Ravi Pratap  <ravi@ximian.com>
6890
6891         * attribute.cs (Attributes.AddAttributeSection): Rename to this
6892         since it makes much more sense.
6893
6894         (Attributes.ctor): Don't require a Location parameter.
6895
6896         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
6897
6898         * attribute.cs (ApplyAttributes): Remove extra Location parameters
6899         since we already have that information per attribute.
6900
6901         * everywhere : make appropriate changes.
6902
6903         * class.cs (LabelParameters): Write the code which actually
6904         applies attributes to the return type. We can't do this on the MS
6905         .NET runtime so we flag a warning in the case an exception is
6906         thrown.
6907
6908 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
6909
6910         * const.cs: Handle implicit null conversions here too.
6911
6912 2002-12-17  Ravi Pratap  <ravi@ximian.com>
6913
6914         * class.cs (MethodCore.LabelParameters): Remove the extra
6915         Type [] parameter since it is completely unnecessary. Instead
6916         pass in the method's attributes so that we can extract
6917         the "return" attribute.
6918
6919 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
6920
6921         * cs-parser.jay (parse): Use Report.Error to flag errors instead
6922         of ignoring it and letting the compile continue.
6923
6924         * typemanager.cs (ChangeType): use an extra argument to return an
6925         error condition instead of throwing an exception.
6926
6927 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
6928
6929         * expression.cs (Unary.TryReduce): mimic the code for the regular
6930         code path.  Perform an implicit cast in the cases where we can
6931         implicitly convert to one of the integral types, and then reduce
6932         based on that constant.   This fixes bug #35483.
6933
6934 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6935
6936         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
6937
6938 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6939
6940         * namespace.cs: fixed bug #35489.
6941
6942 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
6943
6944         * class.cs: Remove some dead code.
6945
6946         * cs-parser.jay: Estimate the number of methods needed
6947         (RootContext.MethodCount);
6948
6949         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
6950         numbers instead of StringBuilders.
6951
6952         * support.cs (PtrHashtable): Add constructor with initial size;
6953         We can now reduce reallocations of the method table.
6954
6955 2002-12-10  Ravi Pratap  <ravi@ximian.com>
6956
6957         * attribute.cs (ApplyAttributes): Keep track of the emitted
6958         attributes on a per-target basis. This fixes bug #35413.
6959
6960 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
6961
6962         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
6963         default to the Windows 1252 encoding.
6964
6965         (UnixParseOption): Support version, thanks to Alp for the missing
6966         pointer. 
6967
6968         * AssemblyInfo.cs: Add nice assembly information.
6969
6970         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
6971         (bug 35169).
6972
6973         * cs-parser.jay: Allow a trailing comma before the close bracked
6974         in the attribute_section production.
6975
6976         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
6977         address of the instance was being taken, I will take this out,
6978         because we take the address of the object immediately here.
6979
6980 2002-12-09  Ravi Pratap  <ravi@ximian.com>
6981
6982         * typemanager.cs (AreMultipleAllowed): Take care of the most
6983         obvious case where attribute type is not in the current assembly -
6984         stupid me ;-)
6985
6986 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
6987
6988         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
6989         definitions, instead of doing that afterwards.  
6990
6991         Also we use a nice little hack, depending on the constructor, we
6992         know if we are a "composed" name or a simple name.  Hence, we
6993         avoid the IndexOf test, and we avoid 
6994
6995         * codegen.cs: Add code to assist in a bug reporter to track down
6996         the source of a compiler crash. 
6997
6998 2002-12-07  Ravi Pratap  <ravi@ximian.com>
6999
7000         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
7001         types have been emitted for a given element and flag an error
7002         if something which does not have AllowMultiple set is used more
7003         than once.
7004
7005         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
7006         attribute types and their corresponding AllowMultiple properties
7007
7008         (AreMultipleAllowed): Check the property for a given type.
7009
7010         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
7011         property in the case we have a TypeContainer.
7012
7013         (Attributes.AddAttribute): Detect duplicates and just skip on
7014         adding them. This trivial fix catches a pretty gross error in our
7015         attribute emission - global attributes were being emitted twice!
7016
7017         Bugzilla bug #33187 is now fixed.
7018
7019 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
7020
7021         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
7022         instead of pp_and).
7023
7024         * expression.cs (Binary.ResolveOperator): I can only use the
7025         Concat (string, string, string) and Concat (string, string,
7026         string, string) if the child is actually a concatenation of
7027         strings. 
7028
7029 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
7030
7031         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
7032         context where we need a 2-character lookahead.
7033
7034         * pending.cs (PendingImplementation): Rework so we can keep track
7035         of interface types all the time, and flag those which were
7036         implemented by parents as optional.
7037
7038 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
7039
7040         * expression.cs (Binary.ResolveOperator): Use
7041         String.Concat(string,string,string) or
7042         String.Concat(string,string,string,string) when possible. 
7043
7044         * typemanager: More helper methods.
7045
7046
7047 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
7048
7049         * pending.cs: remove the bogus return from GetMissingInterfaces()
7050         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
7051
7052 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7053
7054         * namespace.cs: avoid duplicated 'using xxx' being added to
7055         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
7056         when we get more than one 'using' statement for the same namespace.
7057         Report a CS0105 warning for it.
7058
7059 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * cs-tokenizer.cs (consume_identifier): use read directly, instead
7062         of calling getChar/putback, uses internal knowledge of it.    
7063
7064         (xtoken): Reorder tokenizer so most common patterns are checked
7065         first.  This reduces the compilation time in another 5% (from 8.11s
7066         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
7067
7068         The parsing time is 22% of the compilation in mcs, and from that
7069         64% is spent on the tokenization process.  
7070
7071         I tried using a binary search for keywords, but this is slower
7072         than the hashtable.  Another option would be to do a couple of
7073         things:
7074
7075                 * Not use a StringBuilder, instead use an array of chars,
7076                   with a set value.  Notice that this way we could catch
7077                   the 645 error without having to do it *afterwards*.
7078
7079                 * We could write a hand-parser to avoid the hashtable
7080                   compares altogether.
7081
7082         The identifier consumption process takes 37% of the tokenization
7083         time.  Another 15% is spent on is_number.  56% of the time spent
7084         on is_number is spent on Int64.Parse:
7085
7086                 * We could probably choose based on the string length to
7087                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
7088                   computations. 
7089
7090         Another 3% is spend on wrapping `xtoken' in the `token' function.
7091
7092         Handle 0xa0 as whitespace (#34752)
7093
7094 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
7095
7096         * typemanager.cs (IsCLRType): New routine to tell whether a type
7097         is one of the builtin types.  
7098
7099         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
7100         typecode in more places instead of doing pointer comparissions.
7101         We could leverage some knowledge about the way the typecodes are
7102         laid out.
7103
7104         New code to cache namespaces in assemblies, it is currently not
7105         invoked, to be used soon.
7106
7107         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
7108
7109         * expression.cs (Binary.ResolveOperator): specially handle
7110         strings, and do not perform user-defined operator overloading for
7111         built-in types.
7112
7113 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
7114
7115         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
7116         internalcall as it is a pretty simple operation;  Avoid whenever
7117         possible to call Char.IsLetter.
7118
7119         (consume_identifier): Cut by half the number of
7120         hashtable calls by merging the is_keyword and GetKeyword behavior.
7121
7122         Do not short-circuit, because if we do, we
7123         report errors (ie, #if false && true would produce an invalid
7124         directive error);
7125
7126
7127 2002-11-24  Martin Baulig  <martin@ximian.com>
7128
7129         * expression.cs (Cast.TryReduce): If we're in checked syntax,
7130         check constant ranges and report a CS0221.  Fixes #33186.
7131
7132 2002-11-24  Martin Baulig  <martin@ximian.com>
7133
7134         * cs-parser.jay: Make this work for uninitialized variable
7135         declarations in the `for' initializer.  Fixes #32416.
7136
7137 2002-11-24  Martin Baulig  <martin@ximian.com>
7138
7139         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
7140         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
7141
7142 2002-11-24  Martin Baulig  <martin@ximian.com>
7143
7144         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
7145         argument; if true, we also check for user-defined conversions.
7146         This is only needed if both arguments are of a user-defined type.
7147         Fixes #30443, added test-175.cs.
7148         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
7149
7150         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
7151
7152 2002-11-24  Martin Baulig  <martin@ximian.com>
7153
7154         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
7155         function to get the store opcode.
7156         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
7157         only emit the Ldelema if the store opcode is Stobj.  You must run
7158         both test-34 and test-167 to test this.  Fixes #34529.
7159
7160 2002-11-23  Martin Baulig  <martin@ximian.com>
7161
7162         * ecore.cs (Expression.MemberLookup): Added additional
7163         `qualifier_type' argument which is used when we're being called
7164         from MemberAccess.DoResolve() and null if we're called from a
7165         SimpleName lookup.
7166         (Expression.MemberLookupFailed): New method to report errors; this
7167         does the CS1540 check and reports the correct error message.
7168
7169         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
7170         argument for the CS1540 check and redone the way how we're dealing
7171         with private members.  See the comment in the source code for details.
7172         (FilterWithClosure): Reverted this back to revision 1.197; renamed
7173         `closure_start_type' to `closure_qualifier_type' and check whether
7174         it's not null.  It was not this filter being broken, it was just
7175         being called with the wrong arguments.
7176
7177         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
7178         and pass it the correct `qualifier_type'; this also does the error
7179         handling for us.
7180
7181 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
7182
7183         * expression.cs (Invocation.EmitParams): If the we are dealing
7184         with a non-built-in value type, load its address as well.
7185
7186         (ArrayCreation): Use a a pretty constant instead
7187         of the hardcoded value 2.   Use 6 instead of 2 for the number of
7188         static initializers.  
7189
7190         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
7191         because they are not really value types, just glorified integers. 
7192
7193         * driver.cs: Do not append .exe, the CSC compiler does not do it.
7194
7195         * ecore.cs: Remove redundant code for enumerations, make them use
7196         the same code path as everything else, fixes the casting issue
7197         with enumerations in Windows.Forms.
7198
7199         * attribute.cs: Do only cast to string if it is a string, the
7200         validation happens later.
7201
7202         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
7203         people upgrade their corlibs.
7204
7205         * ecore.cs: Oops, enumerations were not following the entire code path
7206
7207 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
7208
7209         * typemanager.cs (FilterWithClosure): Commented out the test for
7210         1540 in typemanager.cs, as it has problems when accessing
7211         protected methods from a parent class (see test-174.cs). 
7212
7213         * attribute.cs (Attribute.ValidateGuid): new method.
7214         (Attribute.Resolve): Use above.
7215
7216 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
7217
7218         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
7219
7220         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
7221         handling for enumerations, as we only needed the TypeContainer
7222         functionality to begin with (this is required for the fix below to
7223         work for enums that reference constants in a container class for
7224         example). 
7225
7226         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
7227
7228         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
7229         a valid TypeBuilder to perform lookups on.o
7230
7231         * class.cs (InheritableMemberSignatureCompare): Use true in the
7232         call to GetGetMethod and GetSetMethod, because we are comparing
7233         the signature, and we need to get the methods *even* if they are
7234         private. 
7235
7236         (PropertyBase.CheckBase): ditto.
7237
7238         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
7239         GotoCase.Resolve): Use Peel on EmpytCasts.
7240
7241         * ecore.cs (EmptyCast): drop child, add Peel method.
7242
7243 2002-11-17  Martin Baulig  <martin@ximian.com>
7244
7245         * ecore.cs (EmptyCast.Child): New public property.
7246
7247         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
7248         label resolved to an EmptyCast.  Fixes #34162.
7249         (GotoCase.Resolve): Likewise.
7250         (Block.EmitMeta): Likewise.
7251
7252 2002-11-17  Martin Baulig  <martin@ximian.com>
7253
7254         * expression.cs (Invocation.BetterConversion): Prefer int over
7255         uint; short over ushort; long over ulong for integer literals.
7256         Use ImplicitConversionExists instead of StandardConversionExists
7257         since we also need to check for user-defined implicit conversions.
7258         Fixes #34165.  Added test-173.cs.
7259
7260 2002-11-16  Martin Baulig  <martin@ximian.com>
7261
7262         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
7263         with the `true' and `false' literals.  Fixes #33151.
7264
7265 2002-11-16  Martin Baulig  <martin@ximian.com>
7266
7267         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
7268         October 22nd; don't do the cs1540 check for static members.
7269
7270         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
7271         now using our own filter here and doing the cs1540 check again.
7272
7273 2002-11-16  Martin Baulig  <martin@ximian.com>
7274
7275         * support.cs (InternalParameters): Don't crash if we don't have
7276         any fixed parameters.  Fixes #33532.
7277
7278 2002-11-16  Martin Baulig  <martin@ximian.com>
7279
7280         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
7281         when looking up static methods to make this work on Windows.
7282         Fixes #33773.
7283
7284 2002-11-16  Martin Baulig  <martin@ximian.com>
7285
7286         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
7287         a setter rather than using PropertyInfo.CanWrite.
7288
7289 2002-11-15  Nick Drochak  <ndrochak@gol.com>
7290
7291         * class.cs: Allow acces to block member by subclasses. Fixes build
7292         breaker.
7293
7294 2002-11-14  Martin Baulig  <martin@ximian.com>
7295
7296         * class.cs (Constructor.Emit): Added the extern/block check.
7297         Fixes bug #33678.
7298
7299 2002-11-14  Martin Baulig  <martin@ximian.com>
7300
7301         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
7302         iteration while looking for indexers, this is needed because the
7303         indexer may have a different name in our base classes.  Fixed the
7304         error reporting (no indexers at all, not get accessor, no
7305         overloaded match).  Fixes bug #33089.
7306         (IndexerAccess.DoResolveLValue): Likewise.
7307
7308 2002-11-14  Martin Baulig  <martin@ximian.com>
7309
7310         * class.cs (PropertyBase.CheckBase): Make this work for multiple
7311         indexers.  Fixes the first part of bug #33089.
7312         (MethodSignature.InheritableMemberSignatureCompare): Added support
7313         for properties.
7314
7315 2002-11-13  Ravi Pratap  <ravi@ximian.com>
7316
7317         * attribute.cs (Attribute.Resolve): Catch the
7318         NullReferenceException and report it since it isn't supposed to
7319         happen. 
7320
7321 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
7322
7323         * expression.cs (Binary.EmitBranchable): Also handle the cases for
7324         LogicalOr and LogicalAnd that can benefit from recursively
7325         handling EmitBranchable.  The code now should be nice for Paolo.
7326
7327 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
7328
7329         * typemanager.cs (LookupType): Added a negative-hit hashtable for
7330         the Type lookups, as we perform quite a number of lookups on
7331         non-Types.  This can be removed once we can deterministically tell
7332         whether we have a type or a namespace in advance.
7333
7334         But this might require special hacks from our corlib.
7335
7336         * TODO: updated.
7337
7338         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
7339         and double which avoids a conversion from an integer to a double.
7340
7341         * expression.cs: tiny optimization, avoid calling IsConstant,
7342         because it effectively performs the lookup twice.
7343
7344 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
7345
7346         But a bogus return here to keep the semantics of the old code
7347         until the Mono runtime is fixed.
7348
7349         * pending.cs (GetMissingInterfaces): New method used to remove all
7350         the interfaces that are already implemented by our parent
7351         classes from the list of pending methods. 
7352
7353         * interface.cs: Add checks for calls after ResolveTypeExpr.
7354
7355 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
7356
7357         * class.cs (Class.Emit): Report warning 67: event not used if the
7358         warning level is beyond 3.
7359
7360         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
7361         being a NullLiteral.
7362
7363         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
7364         specifiers. 
7365
7366         * class.cs (TypeContainer.GetClassBases): Cover a missing code
7367         path that might fail if a type can not be resolved.
7368
7369         * expression.cs (Binary.Emit): Emit unsigned versions of the
7370         operators. 
7371
7372         * driver.cs: use error 5.
7373
7374 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
7375
7376         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
7377
7378 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
7379
7380         * cs-parser.jay (switch_section): A beautiful patch from Martin
7381         Baulig that fixed 33094.
7382
7383 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
7384
7385         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
7386         Check whether the base is abstract and report an error if so.
7387
7388         * expression.cs (IndexerAccess.DoResolveLValue,
7389         IndexerAccess.DoResolve): ditto. 
7390
7391         (Invocation.DoResolve): ditto.
7392
7393         (Invocation.FullMethodDesc): Improve the report string.
7394
7395         * statement.cs (Block): Eliminate IsVariableDefined as it is
7396         basically just a wrapper for GetVariableInfo.
7397
7398         * ecore.cs (SimpleName): Use new 
7399
7400         * support.cs (ReflectionParamter.ParameterType): We unwrap the
7401         type, as we return the actual parameter ref/unref state on a
7402         different call.
7403
7404 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
7405
7406         * support.cs: Return proper flags REF/OUT fixing the previous
7407         commit.  
7408
7409         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
7410         not used to mean `ref' but `ref or out' in ParameterReference
7411
7412         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
7413         full type signature instead of calling TypeManger.CSharpName
7414         ourselves. 
7415
7416         * support.cs (InternalParameters.ParameterDesc): Do not compare
7417         directly to the modflags, because REF/OUT will actually be bitsets
7418         if set. 
7419
7420         * delegate.cs (VerifyMethod): Check also the modifiers.
7421
7422         * cs-tokenizer.cs: Fix bug where floating point values with an
7423         exponent where a sign was missing was ignored.
7424
7425         * driver.cs: Allow multiple assemblies to be specified in a single
7426         /r: argument
7427
7428 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
7429
7430         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
7431         because identifiers after a parenthesis would end up in this kind
7432         of production, and we needed to desamiguate it for having casts
7433         like:
7434
7435                 (UserDefinedType *) xxx
7436
7437 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
7438
7439         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
7440         we should set on the Bindingflags.NonPublic, but not turn on
7441         private_ok.  private_ok controls whether a Private member is
7442         returned (this is chekced on the filter routine), while the
7443         BindingFlags.NonPublic just controls whether private/protected
7444         will be allowed.   This fixes the problem part of the problem of
7445         private properties being allowed to be used in derived classes.
7446
7447         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
7448         so we can call the children DoResolveLValue method (this will
7449         properly signal errors on lvalue assignments to base properties)
7450
7451         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
7452         getter are null, and we have a property info, we know that this
7453         happened because the lookup failed, so we report an error 122 for
7454         protection level violation.
7455
7456         We also silently return if setter and getter are null in the
7457         resolve functions, this condition only happens if we have flagged
7458         the error before.  This is the other half of the problem. 
7459
7460         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
7461         not have accessibility information, that is why we were returning
7462         true in the filter function in typemanager.cs.
7463
7464         To properly report 122 (property is inaccessible because of its
7465         protection level) correctly, we report this error in ResolveAccess
7466         by failing if both the setter and the getter are lacking (ie, the
7467         lookup failed). 
7468
7469         DoResolve and DoLResolve have been modified to check for both
7470         setter/getter being null and returning silently, the reason being
7471         that I did not want to put the knowledge about this error in upper
7472         layers, like:
7473
7474         int old = Report.Errors;
7475         x = new PropertyExpr (...);
7476         if (old != Report.Errors)
7477                 return null;
7478         else
7479                 return x;
7480
7481         So the property expr is returned, but it is invalid, so the error
7482         will be flagged during the resolve process. 
7483
7484         * class.cs: Remove InheritablePropertySignatureCompare from the
7485         class, as we no longer depend on the property signature to compute
7486         whether it is possible to implement a method or not.
7487
7488         The reason is that calling PropertyInfo.GetGetMethod will return
7489         null (in .NET, in Mono it works, and we should change this), in
7490         cases where the Get Method does not exist in that particular
7491         class.
7492
7493         So this code:
7494
7495         class X { public virtual int A { get { return 1; } } }
7496         class Y : X { }
7497         class Z : Y { public override int A { get { return 2; } } }
7498
7499         Would fail in Z because the parent (Y) would not have the property
7500         defined.  So we avoid this completely now (because the alternative
7501         fix was ugly and slow), and we now depend exclusively on the
7502         method names.
7503
7504         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7505         reference method, instead of using the property.
7506
7507         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7508         routines are gone now.
7509
7510         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7511         names, they were incorrectly named.
7512
7513         * cs-tokenizer.cs: Return are more gentle token on failure. 
7514
7515         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7516         had an out-of-sync index variable, which caused it to remove from
7517         the list of pending methods the wrong method sometimes.
7518
7519 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7520
7521         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7522         CanWrite, because those refer to this particular instance of the
7523         property, and do not take into account the fact that we can
7524         override single members of a property.
7525
7526         Constructor requires an EmitContext.  The resolution process does
7527         not happen here, but we need to compute the accessors before,
7528         because the resolution does not always happen for properties.
7529
7530         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7531         subclass, before we did not update this flag, but we did update
7532         bindingflags. 
7533
7534         (GetAccessors): Drop this routine, as it did not work in the
7535         presence of partially overwritten set/get methods. 
7536
7537         Notice that this broke the cs1540 detection, but that will require
7538         more thinking. 
7539
7540 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7541
7542         * class.cs:
7543         * codegen.cs:
7544         * driver.cs: issue a warning instead of an error if we don't support
7545         debugging for the platform. Also ignore a couple of errors that may
7546         arise when trying to write the symbols. Undo my previous patch.
7547
7548 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7549
7550         * driver.cs: ignore /debug switch except for Unix platforms.
7551
7552 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7553
7554         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7555
7556 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7557
7558         * driver.cs: Do not make mcs-debug conditional, so we do not break
7559         builds that use it.
7560
7561         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7562         review this patch.  But basically after all the children variables
7563         have been merged, the value of "Breaks" was not being set to
7564         new_breaks for Switch blocks.  I think that it should be set after
7565         it has executed.  Currently I set this to the value of new_breaks,
7566         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7567         conservative, but I do not understand this code very well.
7568
7569         I did not break anything in the build, so that is good ;-)
7570
7571         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7572
7573 2002-10-20  Mark Crichton  <crichton@gimp.org>
7574
7575         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7576
7577 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7578
7579         * cfold.cs: Fixed compile blocker.
7580
7581 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7582
7583         * driver.cs: I was chekcing the key, not the file.
7584
7585 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7586
7587         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7588         message that we were generating - we just need to silently return
7589         a null.
7590
7591 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7592
7593         * class.cs (Event.Define): Change my previous commit, as this
7594         breaks the debugger.  This is a temporary hack, as it seems like
7595         the compiler is generating events incorrectly to begin with.
7596
7597         * expression.cs (Binary.ResolveOperator): Added support for 
7598         "U operator - (E x, E y)"
7599
7600         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7601         y)".
7602
7603         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7604         init-only variables, but this path did not take into account that
7605         there might be also instance readonly variables.  Correct this
7606         problem. 
7607
7608         This fixes bug 32253
7609
7610         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7611         delegates as well.
7612
7613         * driver.cs: Change the extension for modules to `netmodule'
7614
7615         * cs-parser.jay: Improved slightly the location tracking for
7616         the debugger symbols.
7617
7618         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7619         modifiers that were specified instead of the hardcoded value
7620         (FamAndAssem).  This was basically ignoring the static modifier,
7621         and others.  Fixes 32429.
7622
7623         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7624         fixed a bug in the process (32476)
7625
7626         * expression.cs (ArrayAccess.EmitAssign): Patch from
7627         hwang_rob@yahoo.ca that fixes bug 31834.3
7628
7629 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7630
7631         * driver.cs: Make the module extension .netmodule.
7632
7633 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7634
7635         * driver.cs: Report an error if the resource file is not found
7636         instead of crashing.
7637
7638         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7639         false, like Emit does.
7640
7641 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7642
7643         * typemanager.cs: Remove unused private member.  Also reported mcs
7644         bug to report this as a warning like csc.
7645
7646 2002-10-15  Martin Baulig  <martin@gnome.org>
7647
7648         * statement.cs (Statement.Emit): Made this a virtual method; emits
7649         the line number info and calls DoEmit().
7650         (Statement.DoEmit): New protected abstract method, formerly knows
7651         as Statement.Emit().
7652
7653         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7654
7655 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7656
7657         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7658         have fixed a remaining problem: not every AddXXXX was adding a
7659         fully qualified name.  
7660
7661         Now everyone registers a fully qualified name in the DeclSpace as
7662         being defined instead of the partial name.  
7663
7664         Downsides: we are slower than we need to be due to the excess
7665         copies and the names being registered this way.  
7666
7667         The reason for this is that we currently depend (on the corlib
7668         bootstrap for instance) that types are fully qualified, because
7669         we dump all the types in the namespace, and we should really have
7670         types inserted into the proper namespace, so we can only store the
7671         basenames in the defined_names array.
7672
7673 2002-10-10  Martin Baulig  <martin@gnome.org>
7674
7675         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
7676         from bug #31834, see the bug report for a testcase which is
7677         miscompiled.
7678
7679 2002-10-10  Martin Baulig  <martin@gnome.org>
7680
7681         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
7682         flow analysis code for this.
7683
7684         * statement.cs (Do, While, For): Tell the flow analysis code about
7685         infinite loops.
7686         (FlowBranching.UsageVector): Added support for infinite loops.
7687         (Block.Resolve): Moved the dead code elimination here and use flow
7688         analysis to do it.
7689
7690 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
7691
7692         * class.cs (Field.Define): Catch cycles on struct type
7693         definitions. 
7694
7695         * typemanager.cs (IsUnmanagedtype): Do not recursively check
7696         fields if the fields are static.  We only need to check instance
7697         fields. 
7698
7699         * expression.cs (As.DoResolve): Test for reference type.
7700
7701         * statement.cs (Using.ResolveExpression): Use
7702         ConvertImplicitRequired, not ConvertImplicit which reports an
7703         error on failture
7704         (Using.ResolveLocalVariableDecls): ditto.
7705
7706         * expression.cs (Binary.ResolveOperator): Report errors in a few
7707         places where we had to.
7708
7709         * typemanager.cs (IsUnmanagedtype): Finish implementation.
7710
7711 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
7712
7713         * expression.cs: Use StoreFromPtr instead of extracting the type
7714         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
7715
7716         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
7717         an enumeration value to a System.Enum, but System.Enum is not a
7718         value type, but an class type, so we need to box.
7719
7720         (Expression.ConvertExplicit): One codepath could return
7721         errors but not flag them.  Fix this.  Fixes #31853
7722
7723         * parameter.cs (Resolve): Do not allow void as a parameter type.
7724
7725 2002-10-06  Martin Baulig  <martin@gnome.org>
7726
7727         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
7728         if it's a class type and not a struct.  Fixes #31815.
7729
7730 2002-10-06  Martin Baulig  <martin@gnome.org>
7731
7732         * statement.cs: Reworked the flow analysis code a bit to make it
7733         usable for dead code elimination.
7734
7735 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7736
7737         * cs-parser.jay: allow empty source files. Fixes bug #31781.
7738
7739 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7740
7741         * expression.cs (ComposedCast.DoResolveType): A quick workaround
7742         to fix the test 165, will investigate deeper.
7743
7744 2002-10-04  Martin Baulig  <martin@gnome.org>
7745
7746         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
7747         finally blocks actually work.
7748         (Try.Resolve): We don't need to create a sibling for `finally' if
7749         there is no finally block.
7750
7751 2002-10-04  Martin Baulig  <martin@gnome.org>
7752
7753         * class.cs (Constructor.Define): The default accessibility for a
7754         non-default constructor is private, not public.
7755
7756 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7757
7758         * class.cs (Constructor): Make AllowedModifiers public, add
7759         EXTERN.
7760
7761         * cs-parser.jay: Perform the modifiers test here, as the
7762         constructor for the Constructor class usually receives a zero
7763         because of the way we create it (first we create, later we
7764         customize, and we were never checking the modifiers).
7765
7766         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
7767         is a version of LookupTypeReflection that includes the type-name
7768         cache.  This can be used as a fast path for functions that know
7769         the fully qualified name and are only calling into *.GetType() to
7770         obtain a composed type.
7771
7772         This is also used by TypeManager.LookupType during its type
7773         composition.
7774
7775         (LookupType): We now also track the real type name, as sometimes
7776         we can get a quey for the real type name from things like
7777         ComposedCast.  This fixes bug 31422.
7778
7779         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
7780         complete type fullname, it does not have to go through the type
7781         resolution system to obtain the composed version of the type (for
7782         obtaining arrays or pointers).
7783
7784         (Conditional.Emit): Use the EmitBoolExpression to
7785         generate nicer code, as requested by Paolo.
7786
7787         (ArrayCreation.CheckIndices): Use the patch from
7788         hwang_rob@yahoo.ca to validate the array initializers. 
7789
7790 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
7791
7792         * class.cs (ConstructorInitializer.Emit): simplify code by using
7793         Invocation.EmitCall, and at the same time, fix the bugs in calling
7794         parent constructors that took variable arguments. 
7795
7796         * ecore.cs (Expression.ConvertNumericExplicit,
7797         Expression.ImplicitNumericConversion): Remove the code that
7798         manually wrapped decimal (InternalTypeConstructor call is now gone
7799         as well).
7800
7801         * expression.cs (Cast.TryReduce): Also handle decimal types when
7802         trying to perform a constant fold on the type.
7803
7804         * typemanager.cs (IsUnmanagedtype): Partially implemented.
7805
7806         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
7807         that only turned off an error report, and did nothing else. 
7808
7809 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
7810
7811         * driver.cs: Handle and ignore /fullpaths
7812
7813 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
7814
7815         * expression.cs (Binary.ResolveOperator): Catch the case where
7816         DoNumericPromotions returns true, 
7817
7818         (Binary.DoNumericPromotions): Simplify the code, and the tests.
7819
7820 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
7821
7822         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
7823         report error 70.
7824
7825 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
7826
7827         * ecore.cs (ConvertNumericExplicit): It is not enough that the
7828         conversion exists, but it is also required that the conversion be
7829         performed.  This manifested in "(Type64Enum) 2".  
7830
7831         * class.cs (TypeManager.AddMethod): The fix is not to change
7832         AddEnum, because that one was using a fully qualified name (every
7833         DeclSpace derivative does), but to change the AddMethod routine
7834         that was using an un-namespaced name.  This now correctly reports
7835         the duplicated name.
7836
7837         Revert patch until I can properly fix it.  The issue
7838         is that we have a shared Type space across all namespaces
7839         currently, which is wrong.
7840
7841         Options include making the Namespace a DeclSpace, and merge
7842         current_namespace/current_container in the parser.
7843
7844 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
7845
7846         * cs-parser.jay: Improve error reporting when we get a different
7847         kind of expression in local_variable_type and
7848         local_variable_pointer_type. 
7849
7850         Propagate this to avoid missleading errors being reported.
7851
7852         * ecore.cs (ImplicitReferenceConversion): treat
7853         TypeManager.value_type as a target just like object_type.   As
7854         code like this:
7855
7856         ValueType v = 1;
7857
7858         Is valid, and needs to result in the int 1 being boxed before it
7859         is assigned to the value type v.
7860
7861         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
7862         to validate the enumeration name.
7863
7864         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
7865         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
7866         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
7867
7868         * ecore.cs (TryImplicitIntConversion): When doing an
7869         implicit-enumeration-conversion, check if the type is 64-bits and
7870         perform a conversion before passing to EnumConstant.
7871
7872 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
7873
7874         * decl.cs (Error_AmbiguousTypeReference); New routine used to
7875         report ambiguous type references.  Unlike the MS version, we
7876         report what the ambiguity is.   Innovation at work ;-)
7877
7878         (DeclSpace.FindType): Require a location argument to
7879         display when we display an ambiguous error.
7880
7881         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
7882
7883         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
7884
7885         * expression.cs (EmitDynamicInitializers): Apply patch from
7886         hwang_rob@yahoo.ca that fixes the order in which we emit our
7887         initializers. 
7888
7889 2002-09-21  Martin Baulig  <martin@gnome.org>
7890
7891         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
7892         delegate takes no arguments.
7893
7894 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
7895
7896         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
7897         from integers.
7898
7899         * expression.cs: Extract the underlying type.
7900
7901         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
7902
7903         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
7904
7905 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
7906
7907         * class.cs (TypeContainer.DefineType): We can not use the nice
7908         PackingSize with the size set to 1 DefineType method, because it
7909         will not allow us to define the interfaces that the struct
7910         implements.
7911
7912         This completes the fixing of bug 27287
7913
7914         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
7915         means also structs.  This fixes part of the problem. 
7916         (Expresion.ImplicitReferenceConversionExists): ditto.
7917
7918         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
7919         error if there were no errors reported during the type lookup
7920         process, to avoid duplicates or redundant errors.  Without this
7921         you would get an ambiguous errors plus a type not found.  We have
7922         beaten the user enough with the first error.  
7923
7924         (DeclSparce.FindType): Emit a warning if we have an ambiguous
7925         reference. 
7926
7927         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
7928         during the resolution process, stop the lookup, this avoids
7929         repeated error reports (same error twice).
7930
7931         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
7932
7933         * typemanager.cs (LookupType): Redo the type lookup code to match
7934         the needs of System.Reflection.  
7935
7936         The issue is that System.Reflection requires references to nested
7937         types to begin with a "+" sign instead of a dot.  So toplevel
7938         types look like: "NameSpace.TopLevelClass", and nested ones look
7939         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
7940         levels. 
7941
7942 2002-09-19  Martin Baulig  <martin@gnome.org>
7943
7944         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
7945         says that a method always returns or always throws an exception,
7946         don't report the CS0161.
7947
7948         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
7949         set `Returns = new_returns'.
7950
7951 2002-09-19  Martin Baulig  <martin@gnome.org>
7952
7953         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
7954         to an enum constant, check for a CS0176.
7955
7956 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
7957
7958         * class.cs (TypeContainer.CheckPairedOperators): Now we check
7959         for operators that must be in pairs and report errors.
7960
7961         * ecore.cs (SimpleName.DoResolveType): During the initial type
7962         resolution process, when we define types recursively, we must
7963         check first for types in our current scope before we perform
7964         lookups in the enclosing scopes.
7965
7966         * expression.cs (MakeByteBlob): Handle Decimal blobs.
7967
7968         (Invocation.VerifyArgumentsCompat): Call
7969         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
7970         I thought we were supposed to always call this, but there are a
7971         few places in the code where we dont do it.
7972
7973 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
7974
7975         * driver.cs: Add support in -linkres and -resource to specify the
7976         name of the identifier.
7977
7978 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
7979
7980         * ecore.cs (StandardConversionExists): Sync with the conversion
7981         code: allow anything-* to void* conversions.
7982
7983         (FindMostSpecificSource): Use an Expression argument
7984         instead of a Type, because we might be handed over a Literal which
7985         gets a few more implicit conversions that plain types do not.  So
7986         this information was being lost.
7987
7988         Also, we drop the temporary type-holder expression when not
7989         required.
7990
7991 2002-09-17  Martin Baulig  <martin@gnome.org>
7992
7993         * class.cs (PropertyBase.CheckBase): Don't check the base class if
7994         this is an explicit interface implementation.
7995
7996 2002-09-17  Martin Baulig  <martin@gnome.org>
7997
7998         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
7999         different `IndexerName' attributes.
8000
8001         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
8002         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
8003         virtual CommonResolve().
8004
8005 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8006
8007         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
8008         and convert that to the UnderlyingType.
8009
8010         * statement.cs (Foreach.Resolve): Indexers are just like variables
8011         or PropertyAccesses.
8012
8013         * cs-tokenizer.cs (consume_string): Track line numbers and columns
8014         inside quoted strings, we were not doing this before.
8015
8016 2002-09-16  Martin Baulig  <martin@gnome.org>
8017
8018         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
8019         resolve it.  This is needed for the definite assignment check of the
8020         instance expression, fixes bug #29846.
8021         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
8022
8023 2002-09-16  Nick Drochak  <ndrochak@gol.com>
8024
8025         * parameter.cs: Fix compile error.  Cannot reference static member
8026         from an instance object.  Is this an mcs bug?
8027
8028 2002-09-14  Martin Baulig  <martin@gnome.org>
8029
8030         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
8031         multiple times.  Fixes bug #30295, added test-166.cs.
8032
8033 2002-09-14  Martin Baulig  <martin@gnome.org>
8034
8035         * statement.cs (Block.Emit): Don't emit unreachable code.
8036         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
8037         `break' statements.
8038         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
8039
8040 2002-09-14  Martin Baulig  <martin@gnome.org>
8041
8042         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
8043         is set.
8044
8045 2002-09-14  Martin Baulig  <martin@gnome.org>
8046
8047         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
8048         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
8049         be false on the ms runtime.
8050
8051 2002-09-13  Martin Baulig  <martin@gnome.org>
8052
8053         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
8054         the CS0038 error message.
8055
8056 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
8057
8058         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
8059         constant inside, return it.
8060
8061 2002-09-12  Martin Baulig  <martin@gnome.org>
8062
8063         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
8064         implicit conversion can be done between enum types.
8065
8066         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
8067         check whether an implicit conversion to the current enum's UnderlyingType
8068         exists and report an error if not.
8069
8070         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
8071         without debugging support.
8072
8073         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
8074         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
8075
8076 2002-09-12  Martin Baulig  <martin@gnome.org>
8077
8078         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
8079
8080         * ecore.cs (IMemberExpr.DeclaringType): New property.
8081         (SimpleName.SimpleNameResolve): Check whether we're accessing a
8082         nonstatic member of an outer type (CS0038).
8083
8084 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
8085
8086         * driver.cs: Activate the using-error detector at warning level
8087         4 (at least for MS-compatible APIs).
8088
8089         * namespace.cs (VerifyUsing): Small buglett fix.
8090
8091         * pending.cs (PendingImplementation): pass the container pointer. 
8092
8093         * interface.cs (GetMethods): Allow for recursive definition.  Long
8094         term, I would like to move every type to support recursive
8095         definitions, not the current ordering mechanism that we have right
8096         now.
8097
8098         The situation is this: Attributes are handled before interfaces,
8099         so we can apply attributes to interfaces.  But some attributes
8100         implement interfaces, we will now handle the simple cases
8101         (recursive definitions will just get an error).  
8102
8103         * parameter.cs: Only invalidate types at the end if we fail to
8104         lookup all types.  
8105
8106 2002-09-09  Martin Baulig  <martin@gnome.org>
8107
8108         * ecore.cs (PropertyExpr.Emit): Also check for
8109         TypeManager.system_int_array_get_length so this'll also work when
8110         compiling corlib.  Fixes #30003.
8111
8112 2002-09-09  Martin Baulig  <martin@gnome.org>
8113
8114         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
8115         and throw an exception if we can't get the type's size.  Fixed #30040,
8116         added test-165.cs.
8117
8118 2002-09-09  Martin Baulig  <martin@gnome.org>
8119
8120         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
8121
8122         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
8123         context.  Fixes bug #30027.
8124
8125         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
8126         virtual functions.  Fixes bug #30043, added test-164.cs.
8127
8128 2002-09-08  Ravi Pratap  <ravi@ximian.com>
8129
8130         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
8131
8132 2002-09-08  Nick Drochak  <ndrochak@gol.com>
8133
8134         * driver.cs: Use an object to get the windows codepage since it's not a
8135         static property.
8136
8137 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
8138
8139         * statement.cs (For.Emit): for infinite loops (test == null)
8140         return whether there is a break inside, not always "true".
8141
8142         * namespace.cs (UsingEntry): New struct to hold the name of the
8143         using definition, the location where it is defined, and whether it
8144         has been used in a successful type lookup.
8145
8146         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
8147         strings.
8148
8149         * decl.cs: ditto.
8150
8151 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8152
8153         * attribute.cs : Fix incorrect code which relied on catching
8154         a NullReferenceException to detect a null being passed in
8155         where an object was expected.
8156
8157 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
8158
8159         * statement.cs (Try): flag the catch variable as assigned
8160
8161         * expression.cs (Cast): Simplified by using ResolveType instead of
8162         manually resolving.
8163
8164         * statement.cs (Catch): Fix bug by using ResolveType.
8165
8166 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8167
8168         * expression.cs (BetterConversion): Special case for when we have
8169         a NullLiteral as the argument and we have to choose between string
8170         and object types - we choose string the way csc does.
8171
8172         * attribute.cs (Attribute.Resolve): Catch the
8173         NullReferenceException and report error #182 since the Mono
8174         runtime no more has the bug and having this exception raised means
8175         we tried to select a constructor which takes an object and is
8176         passed a null.
8177
8178 2002-09-05  Ravi Pratap  <ravi@ximian.com>
8179
8180         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
8181         message (1502, 1503) when we can't locate a method after overload
8182         resolution. This is much more informative and closes the bug
8183         Miguel reported.
8184
8185         * interface.cs (PopulateMethod): Return if there are no argument
8186         types. Fixes a NullReferenceException bug.
8187
8188         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
8189         expressions too. Previously we were checking only in one place for
8190         positional arguments leaving out named arguments.
8191
8192         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
8193         type to the enum type is not allowed. Remove code corresponding to
8194         that.
8195
8196         (ConvertNumericExplicit): Allow explicit conversions from
8197         the underlying type to enum type. This precisely follows the spec
8198         and closes a bug filed by Gonzalo.
8199
8200 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8201
8202         * compiler.csproj:
8203         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
8204
8205 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
8206
8207         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
8208         it was important that we stored the right value after the
8209         reduction in `converted'.
8210
8211 2002-09-04  Martin Baulig  <martin@gnome.org>
8212
8213         * location.cs (Location.SymbolDocument): Use full pathnames for the
8214         source files.
8215
8216 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
8217
8218         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
8219         of the expression resolve mechanism, because that will catch the
8220         SimpleName error failures.
8221
8222         (Conditional): If we can not resolve the
8223         expression, return, do not crash.
8224
8225 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8226
8227         * cs-tokenizer.cs:
8228         (location): display token name instead of its number.
8229
8230 2002-08-28  Martin Baulig  <martin@gnome.org>
8231
8232         * expression.cs (Binary.ResolveOperator): Don't silently return
8233         but return an error if an operator cannot be applied between two
8234         enum types.
8235
8236 2002-08-28  Martin Baulig  <martin@gnome.org>
8237
8238         * class.cs (Constructor.Define): Set the permission attributes
8239         correctly instead of making all constructors public.
8240
8241 2002-08-28  Martin Baulig  <martin@gnome.org>
8242
8243         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
8244         for private members before reporting a CS0103; if we find anything,
8245         it's a CS0122.
8246
8247 2002-08-28  Martin Baulig  <martin@gnome.org>
8248
8249         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
8250         to check whether `closure_start_type == closure_invocation_type',
8251         we also need to check whether `m.DeclaringType == closure_invocation_type'
8252         before bypassing the permission checks.  We might be accessing
8253         protected/private members from the base class.
8254         (TypeManager.RealMemberLookup): Only set private_ok if private
8255         members were requested via BindingFlags.NonPublic.
8256
8257         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
8258
8259         * expression.cs (MemberAccess.ResolveMemberAccess): Set
8260         MethodGroupExpr.IsExplicitImpl if appropriate.
8261         (Invocation.DoResolve): Don't report the CS0120 for explicit
8262         interface implementations.
8263
8264 2002-08-27  Martin Baulig  <martin@gnome.org>
8265
8266         * expression.cs (Invocation.DoResolve): If this is a static
8267         method and we don't have an InstanceExpression, we must report
8268         a CS0120.
8269
8270 2002-08-25  Martin Baulig  <martin@gnome.org>
8271
8272         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
8273         `==' between a valuetype and an object.
8274
8275 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
8276
8277         * ecore.cs (TypeExpr): Provide a ToString method.
8278
8279 2002-08-24  Martin Baulig  <martin@gnome.org>
8280
8281         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
8282         now called proggie.dbg and it's a binary file.
8283
8284 2002-08-23  Martin Baulig  <martin@gnome.org>
8285
8286         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
8287
8288 2002-08-23  Martin Baulig  <martin@gnome.org>
8289
8290         * struct.cs (MyStructInfo.ctor): Make this work with empty
8291         structs; it's not allowed to use foreach() on null.
8292
8293 2002-08-23  Martin Baulig  <martin@gnome.org>
8294
8295         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
8296         writer the full pathname of the generated assembly.
8297
8298 2002-08-23  Martin Baulig  <martin@gnome.org>
8299
8300         * statements.cs (FlowBranching.UsageVector.MergeChildren):
8301         A `finally' block never returns or breaks; improved handling of
8302         unreachable code.
8303
8304 2002-08-23  Martin Baulig  <martin@gnome.org>
8305
8306         * statement.cs (Throw.Resolve): Allow `throw null'.
8307
8308 2002-08-23  Martin Baulig  <martin@gnome.org>
8309
8310         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
8311         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
8312         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
8313         MemberLookup would return a wrong event if this is an explicit
8314         interface implementation and the class has an event with the same
8315         name.
8316
8317 2002-08-23  Martin Baulig  <martin@gnome.org>
8318
8319         * statement.cs (Block.AddChildVariableNames): New public method.
8320         (Block.AddChildVariableName): Likewise.
8321         (Block.IsVariableNameUsedInChildBlock): Likewise.
8322         (Block.AddVariable): Check whether a variable name has already
8323         been used in a child block.
8324
8325         * cs-parser.jay (declare_local_variables): Mark all variable names
8326         from the current block as being used in a child block in the
8327         implicit block.
8328
8329 2002-08-23  Martin Baulig  <martin@gnome.org>
8330
8331         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
8332         find the symbol writer.
8333
8334         * driver.cs: csc also allows the arguments to /define being
8335         separated by commas, not only by semicolons.
8336
8337 2002-08-23  Martin Baulig  <martin@gnome.org>
8338
8339         * interface.cs (Interface.GetMembers): Added static check for events.
8340
8341 2002-08-15  Martin Baulig  <martin@gnome.org>
8342
8343         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
8344         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
8345
8346         * ecore.cs (Expression.MemberLookup): Added documentation and explained
8347         why the MethodData.EmitDestructor() change was necessary.
8348
8349 2002-08-20  Martin Baulig  <martin@gnome.org>
8350
8351         * class.cs (TypeContainer.FindMembers): Added static check for events.
8352
8353         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
8354
8355         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
8356         use Type.GetEvents(), not Type.FindMembers().
8357
8358 2002-08-20  Martin Baulig  <martin@gnome.org>
8359
8360         * decl.cs (MemberCache): Added a special method cache which will
8361         be used for method-only searched.  This ensures that a method
8362         search will return a MethodInfo with the correct ReflectedType for
8363         inherited methods.      
8364
8365 2002-08-20  Martin Baulig  <martin@gnome.org>
8366
8367         * decl.cs (DeclSpace.FindMembers): Made this public.
8368
8369 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8370
8371         * delegate.cs: fixed build on windows.
8372         [FIXME:  Filed as bug #29150: MCS must report these errors.]
8373
8374 2002-08-19  Ravi Pratap  <ravi@ximian.com>
8375
8376         * ecore.cs (StandardConversionExists): Return a false
8377         if we are trying to convert the void type to anything else
8378         since that is not allowed.
8379
8380         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
8381         we flag error 70 in the event an event is trying to be accessed
8382         directly from outside the declaring type.
8383
8384 2002-08-20  Martin Baulig  <martin@gnome.org>
8385
8386         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
8387         MemberCache from typemanager.cs to decl.cs.
8388
8389 2002-08-19  Martin Baulig  <martin@gnome.org>
8390
8391         * class.cs (TypeContainer): Implement IMemberContainer.
8392         (TypeContainer.DefineMembers): Create the MemberCache.
8393         (TypeContainer.FindMembers): Do better BindingFlags checking; only
8394         return public members if BindingFlags.Public was given, check
8395         whether members are static.
8396
8397 2002-08-16  Martin Baulig  <martin@gnome.org>
8398
8399         * decl.cs (DeclSpace.Define): Splitted this in Define and
8400         DefineMembers.  DefineMembers is called first and initializes the
8401         MemberCache.
8402
8403         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
8404         DefineMembers() on all our DeclSpaces.
8405
8406         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
8407         but call DefineMembers() on all nested interfaces.  We call their
8408         Define() in our new Define() function.
8409
8410         * interface.cs (Interface): Implement IMemberContainer.
8411         (Interface.Define): Moved all code except the attribute stuf to
8412         DefineMembers().
8413         (Interface.DefineMembers): Initialize the member cache.
8414
8415         * typemanager.cs (IMemberFinder): Removed this interface, we don't
8416         need this anymore since we can use MemberCache.FindMembers directly.
8417
8418 2002-08-19  Martin Baulig  <martin@gnome.org>
8419
8420         * typemanager.cs (MemberCache): When creating the cache for an
8421         interface type, add all inherited members.
8422         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
8423         to `out bool used_cache' and documented it.
8424         (TypeManager.MemberLookup): If we already used the cache in the first
8425         iteration, we don't need to do the interfaces check.
8426
8427 2002-08-19  Martin Baulig  <martin@gnome.org>
8428
8429         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
8430         here from IMemberFinder and don't implement this interface anymore.
8431         (DeclSpace.MemberCache): Moved here from IMemberFinder.
8432
8433         * typemanager.cs (IMemberFinder): This interface is now only used by
8434         classes which actually support the member cache.
8435         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
8436         since we only put DeclSpaces into this Hashtable.
8437         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
8438         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
8439
8440 2002-08-16  Martin Baulig  <martin@gnome.org>
8441
8442         * typemanager.cs (ICachingMemberFinder): Removed.
8443         (IMemberFinder.MemberCache): New property.
8444         (TypeManager.FindMembers): Merged this with RealFindMembers().
8445         This function will never be called from TypeManager.MemberLookup()
8446         so we can't use the cache here, just the IMemberFinder.
8447         (TypeManager.MemberLookup_FindMembers): Check whether the
8448         IMemberFinder has a MemberCache and call the cache's FindMembers
8449         function.
8450         (MemberCache): Rewrote larger parts of this yet another time and
8451         cleaned it up a bit.
8452
8453 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
8454
8455         * driver.cs (LoadArgs): Support quoting.
8456
8457         (Usage): Show the CSC-like command line arguments.
8458
8459         Improved a few error messages.
8460
8461 2002-08-15  Martin Baulig  <martin@gnome.org>
8462
8463         * typemanager.cs (IMemberContainer.Type): New property.
8464         (IMemberContainer.IsInterface): New property.
8465
8466         The following changes are conditional to BROKEN_RUNTIME, which is
8467         defined at the top of the file.
8468
8469         * typemanager.cs (MemberCache.MemberCache): Don't add the base
8470         class'es members, but add all members from TypeHandle.ObjectType
8471         if we're an interface.
8472         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
8473         is the current type.
8474         (MemberCache.CacheEntry.Container): Removed this field.
8475         (TypeHandle.GetMembers): Include inherited members.
8476
8477 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8478
8479         * typemanager.cs: fixed compilation and added a comment on a field that
8480         is never used.
8481
8482 2002-08-15  Martin Baulig  <martin@gnome.org>
8483
8484         * class.cs (ConstructorInitializer.Resolve): In the
8485         Expression.MemberLookup call, use the queried_type as
8486         invocation_type.
8487
8488         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8489         declared' attribute, it's always true.
8490         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8491         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8492         temporary wrapper for FindMembers which tells MemberLookup whether
8493         members from the base classes are included in the return value.
8494         This will go away soon.
8495         (TypeManager.MemberLookup): Use this temporary hack here; once the
8496         new MemberCache is completed, we don't need to do the DeclaredOnly
8497         looping here anymore since the MemberCache will take care of this.
8498         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8499         (MemberCache): When creating the MemberCache for a class, get
8500         members from the current class and all its base classes.
8501         (MemberCache.CacheEntry.Container): New field.  This is a
8502         temporary hack until the Mono runtime is fixed to distinguish
8503         between ReflectedType and DeclaringType.  It allows us to use MCS
8504         with both the MS runtime and the unfixed Mono runtime without
8505         problems and without accecting performance.
8506         (MemberCache.SearchMembers): The DeclaredOnly looping from
8507         TypeManager.MemberLookup is now done here.      
8508
8509 2002-08-14  Martin Baulig  <martin@gnome.org>
8510
8511         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8512         Type.GetFields on dynamic types but get the fields from the
8513         corresponding TypeContainer.
8514         (MyStructInfo.GetStructInfo): Added check for enum types.
8515
8516         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8517         (MemberList.SyncRoot): Implemented.
8518         (TypeManager.FilterWithClosure): No need to check permissions if
8519         closure_start_type == closure_invocation_type, don't crash if
8520         closure_invocation_type is null.
8521
8522 2002-08-13  Martin Baulig  <martin@gnome.org>
8523
8524         Rewrote TypeContainer.FindMembers to use a member cache.  This
8525         gives us a speed increase of about 35% for the self-hosting MCS
8526         build and of about 15-20% for the class libs (both on GNU/Linux).
8527
8528         * report.cs (Timer): New class to get enhanced profiling.  This
8529         whole class is "TIMER" conditional since it remarkably slows down
8530         compilation speed.
8531
8532         * class.cs (MemberList): New class.  This is an IList wrapper
8533         which we're now using instead of passing MemberInfo[]'s around to
8534         avoid copying this array unnecessarily.
8535         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8536         (ICachingMemberFinder, IMemberContainer): New interface.
8537         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8538         has already been checked, otherwise use it for the name comparision.
8539         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8540         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8541         if possible.  Returns a MemberList, not a MemberInfo [].
8542         (TypeHandle): New class, implements IMemberContainer.  We create
8543         one instance of this class per type, it contains a MemberCache
8544         which is used to do the member lookups.
8545         (MemberCache): New class.  Each instance of this class contains
8546         all members of a type and a name-based hash table.
8547         (MemberCache.FindMembers): This is our new member lookup
8548         function.  First, it looks up all members of the requested name in
8549         the hash table.  Then, it walks this list and sorts out all
8550         applicable members and returns them.
8551
8552 2002-08-13  Martin Baulig  <martin@gnome.org>
8553
8554         In addition to a nice code cleanup, this gives us a performance
8555         increase of about 1.4% on GNU/Linux - not much, but it's already
8556         half a second for the self-hosting MCS compilation.
8557
8558         * typemanager.cs (IMemberFinder): New interface.  It is used by
8559         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8560         Enum, Delegate or Interface.
8561         (TypeManager.finder_to_member_finder): New PtrHashtable.
8562         (TypeManager.finder_to_container): Removed.
8563         (TypeManager.finder_to_delegate): Removed.
8564         (TypeManager.finder_to_interface): Removed.
8565         (TypeManager.finder_to_enum): Removed.
8566
8567         * interface.cs (Interface): Implement IMemberFinder.
8568
8569         * delegate.cs (Delegate): Implement IMemberFinder.
8570
8571         * enum.cs (Enum): Implement IMemberFinder.
8572
8573         * class.cs (TypeContainer): Implement IMemberFinder.
8574
8575 2002-08-12  Martin Baulig  <martin@gnome.org>
8576
8577         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8578
8579 2002-08-12  Martin Baulig  <martin@gnome.org>
8580
8581         * ecore.cs (ITypeExpression): New interface for expressions which
8582         resolve to a type.
8583         (TypeExpression): Renamed to TypeLookupExpression.
8584         (Expression.DoResolve): If we're doing a types-only lookup, the
8585         expression must implement the ITypeExpression interface and we
8586         call DoResolveType() on it.
8587         (SimpleName): Implement the new ITypeExpression interface.
8588         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8589         hack, the situation that we're only looking up types can't happen
8590         anymore when this method is called.  Moved the type lookup code to
8591         DoResolveType() and call it.
8592         (SimpleName.DoResolveType): This ITypeExpression interface method
8593         is now doing the types-only lookup.
8594         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8595         (ResolveFlags): Added MaskExprClass.
8596
8597         * expression.cs (MemberAccess): Implement the ITypeExpression
8598         interface.
8599         (MemberAccess.DoResolve): Added support for a types-only lookup
8600         when we're called via ITypeExpression.DoResolveType().
8601         (ComposedCast): Implement the ITypeExpression interface.
8602
8603         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8604         Expression.Resolve() with ResolveFlags.Type instead.
8605
8606 2002-08-12  Martin Baulig  <martin@gnome.org>
8607
8608         * interface.cs (Interface.Define): Apply attributes.
8609
8610         * attribute.cs (Attribute.ApplyAttributes): Added support for
8611         interface attributes.
8612
8613 2002-08-11  Martin Baulig  <martin@gnome.org>
8614
8615         * statement.cs (Block.Emit): Only check the "this" variable if we
8616         do not always throw an exception.
8617
8618         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8619         whether the property has a set accessor.
8620
8621 2002-08-11  Martin Baulig  <martin@gnome.org>
8622
8623         Added control flow analysis support for structs.
8624
8625         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8626         with control flow analysis turned off.
8627         (IVariable): New interface.
8628         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8629         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8630         (FieldExpr.DoResolve): Resolve the instance expression with flow
8631         analysis turned off and do the definite assignment check after the
8632         resolving when we know what the expression will resolve to.
8633
8634         * expression.cs (LocalVariableReference, ParameterReference):
8635         Implement the new IVariable interface, only call the flow analysis
8636         code if ec.DoFlowAnalysis is true.
8637         (This): Added constructor which takes a Block argument.  Implement
8638         the new IVariable interface.
8639         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8640         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8641         This does the definite assignment checks for struct members.
8642
8643         * class.cs (Constructor.Emit): If this is a non-static `struct'
8644         constructor which doesn't have any initializer, call
8645         Block.AddThisVariable() to tell the flow analysis code that all
8646         struct elements must be initialized before control returns from
8647         the constructor.
8648
8649         * statement.cs (MyStructInfo): New public class.
8650         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8651         argument to this indexer.  If non-zero, check an individual struct
8652         member, not the whole struct.
8653         (FlowBranching.CheckOutParameters): Check struct members.
8654         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8655         overloaded versions of these methods which take an additional
8656         `int field_idx' argument to check struct members.
8657         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8658         overloaded versions of these methods which take an additional
8659         `string field_name' argument to check struct member.s
8660         (VariableInfo): Implement the IVariable interface.
8661         (VariableInfo.StructInfo): New public property.  Returns the
8662         MyStructInfo instance of the variable if it's a struct or null.
8663         (Block.AddThisVariable): New public method.  This is called from
8664         Constructor.Emit() for non-static `struct' constructor which do
8665         not have any initializer.  It creates a special variable for the
8666         "this" instance variable which will be checked by the flow
8667         analysis code to ensure that all of the struct's fields are
8668         initialized before control returns from the constructor.
8669         (UsageVector): Added support for struct members.  If a
8670         variable/parameter is a struct with N members, we reserve a slot
8671         in the usage vector for each member.  A struct is considered fully
8672         initialized if either the struct itself (slot 0) or all its
8673         members are initialized.
8674
8675 2002-08-08  Martin Baulig  <martin@gnome.org>
8676
8677         * driver.cs (Driver.MainDriver): Only report an error CS5001
8678         if there were no compilation errors.
8679
8680         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
8681         `UnsafeContext' property to determine whether the parent is in
8682         unsafe context rather than checking the parent's ModFlags:
8683         classes nested in an unsafe class are unsafe as well.
8684
8685 2002-08-08  Martin Baulig  <martin@gnome.org>
8686
8687         * statement.cs (UsageVector.MergeChildren): Distinguish between
8688         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
8689         we return.  Added test17() and test18() to test-154.cs.
8690
8691 2002-08-08  Martin Baulig  <martin@gnome.org>
8692
8693         * typemanager.cs (TypeManager.FilterWithClosure): If we have
8694         Family access, make sure the invoking type isn't a subclass of the
8695         queried type (that'd be a CS1540).
8696
8697         * ecore.cs (Expression.MemberLookup): Added overloaded version of
8698         this method which takes an additional `Type invocation_type'.
8699
8700         * expression.cs (BaseAccess.DoResolve): Use the base type as
8701         invocation and query type.
8702         (MemberAccess.DoResolve): If the lookup failed and we're about to
8703         report a CS0122, try a lookup with the ec.ContainerType - if this
8704         succeeds, we must report a CS1540.
8705
8706 2002-08-08  Martin Baulig  <martin@gnome.org>
8707
8708         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
8709         (MethodGroupExpr): Implement the IMemberExpr interface.
8710
8711         * expression (MemberAccess.ResolveMemberAccess): No need to have
8712         any special code for MethodGroupExprs anymore, they're now
8713         IMemberExprs.   
8714
8715 2002-08-08  Martin Baulig  <martin@gnome.org>
8716
8717         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
8718         Family, FamANDAssem and FamORAssem permissions.
8719         (TypeManager.IsSubclassOrNestedChildOf): New public method.
8720
8721 2002-08-08  Martin Baulig  <martin@gnome.org>
8722
8723         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
8724         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
8725         or loop block.
8726
8727 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
8728
8729         * driver.cs: implemented /resource option to embed managed resources.
8730
8731 2002-08-07  Martin Baulig  <martin@gnome.org>
8732
8733         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
8734         (FieldBase.HasFieldInitializer): New public property.
8735         (FieldBase.GetInitializerExpression): New public method.  Resolves and
8736         returns the field initializer and makes sure it is only resolved once.
8737         (TypeContainer.EmitFieldInitializers): Call
8738         FieldBase.GetInitializerExpression to get the initializer, this ensures
8739         that it isn't resolved multiple times.
8740
8741         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
8742         the resolving process (SimpleName/MemberLookup) that we're currently
8743         emitting a field initializer (which must not access any instance members,
8744         this is an error CS0236).
8745
8746         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
8747         argument, if the `IsFieldInitializer' flag is set, we must report and
8748         error CS0236 and not an error CS0120.   
8749
8750 2002-08-07  Martin Baulig  <martin@gnome.org>
8751
8752         * ecore.cs (IMemberExpr): New public interface.
8753         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
8754         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
8755         if the expression is an IMemberExpr.
8756
8757         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
8758         to be null, implicitly default to `this' if we're non-static in
8759         this case.  Simplified the code a lot by using the new IMemberExpr
8760         interface.  Also fixed bug #28176 here.
8761
8762 2002-08-06  Martin Baulig  <martin@gnome.org>
8763
8764         * cs-parser.jay (SimpleLookup): Removed.  We need to create
8765         ParameterReferences during semantic analysis so that we can do a
8766         type-only search when resolving Cast, TypeOf and SizeOf.
8767         (block): Pass the `current_local_parameters' to the Block's
8768         constructor.
8769
8770         * class.cs (ConstructorInitializer): Added `Parameters parameters'
8771         argument to the constructor.
8772         (ConstructorInitializer.Resolve): Create a temporary implicit
8773         block with the parameters.
8774
8775         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
8776         references here if we aren't doing a type-only search.
8777
8778         * statement.cs (Block): Added constructor which takes a
8779         `Parameters parameters' argument.
8780         (Block.Parameters): New public property.
8781
8782         * support.cs (InternalParameters.Parameters): Renamed `parameters'
8783         to `Parameters' and made it public readonly.
8784
8785 2002-08-06  Martin Baulig  <martin@gnome.org>
8786
8787         * ecore.cs (Expression.Warning): Made this public as well.
8788
8789         * report.cs (Report.Debug): Print the contents of collections.
8790
8791 2002-08-06  Martin Baulig  <martin@gnome.org>
8792
8793         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
8794         used to tell Resolve() which kinds of expressions it may return.
8795         (Expression.Resolve): Added overloaded version of this method which
8796         takes a `ResolveFlags flags' argument.  This can be used to tell
8797         Resolve() which kinds of expressions it may return.  Reports a
8798         CS0118 on error.
8799         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
8800         ResolveFlags.SimpleName.
8801         (Expression.Error118): Added overloaded version of this method which
8802         takes a `ResolveFlags flags' argument.  It uses the flags to determine
8803         which kinds of expressions are allowed.
8804
8805         * expression.cs (Argument.ResolveMethodGroup): New public method.
8806         Resolves an argument, but allows a MethodGroup to be returned.
8807         This is used when invoking a delegate.
8808
8809         * TODO: Updated a bit.
8810
8811 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8812
8813         Fixed compilation with csc.
8814
8815         * ecore.cs: Expression.Error made public. Is this correct? Should
8816         Warning be made public too?
8817
8818         * expression.cs: use ea.Location instead of ea.loc.
8819         [FIXME:  Filed as bug #28607: MCS must report these errors.]
8820
8821 2002-08-06  Martin Baulig  <martin@gnome.org>
8822
8823         * ecore.cs (Expression.loc): Moved the location here instead of
8824         duplicating it in all derived classes.
8825         (Expression.Location): New public property.
8826         (Expression.Error, Expression.Warning): Made them non-static and
8827         removed the location argument.
8828         (Expression.Warning): Added overloaded version which takes an
8829         `int level' argument.
8830         (Expression.Error118): Make this non-static and removed the
8831         expression and location arguments.
8832         (TypeExpr): Added location argument to the constructor.
8833
8834         * expression.cs (StaticCallExpr): Added location argument to
8835         the constructor.
8836         (Indirection, PointerArithmetic): Likewise.
8837         (CheckedExpr, UnCheckedExpr): Likewise.
8838         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
8839         (StringPtr): Likewise.
8840
8841
8842 2002-08-05  Martin Baulig  <martin@gnome.org>
8843
8844         * expression.cs (BaseAccess.DoResolve): Actually report errors.
8845
8846         * assign.cs (Assign.DoResolve): Check whether the source
8847         expression is a value or variable.
8848
8849         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
8850         while resolving the corresponding blocks.
8851
8852         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
8853         an error, don't silently return null.
8854
8855         * statement.cs (Block.AddVariable): Do the error reporting here
8856         and distinguish between CS0128 and CS0136.
8857         (Block.DoResolve): Report all unused labels (warning CS0164).
8858         (LabeledStatement): Pass the location to the constructor.
8859         (LabeledStatement.HasBeenReferenced): New property.
8860         (LabeledStatement.Resolve): Set it to true here.
8861
8862         * statement.cs (Return.Emit): Return success even after reporting
8863         a type mismatch error (CS0126 or CS0127), this is what csc does and
8864         it avoids confusing the users with any consecutive errors.
8865
8866 2002-08-05  Martin Baulig  <martin@gnome.org>
8867
8868         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
8869
8870         * const.cs (Const.LookupConstantValue): Catch circular definitions.
8871
8872         * expression.cs (MemberAccess.DoResolve): Silently return if an
8873         error has already been reported.
8874
8875         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
8876         error has already been reported.
8877
8878 2002-08-05  Martin Baulig  <martin@gnome.org>
8879
8880         * statement.cs (UsageVector): Only initialize the `parameters'
8881         vector if we actually have any "out" parameters.
8882
8883 2002-08-05  Martin Baulig  <martin@gnome.org>
8884
8885         * expression.cs (Binary.ResolveOperator): When combining delegates,
8886         they must have the same type.
8887
8888 2002-08-05  Martin Baulig  <martin@gnome.org>
8889
8890         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
8891         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
8892         work with the ms runtime and we also don't need it: if we're a
8893         PropertyBuilder and not in the `indexer_arguments' hash, then we
8894         are a property and not an indexer.
8895
8896         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
8897         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
8898         since the latter one doesn't work with the ms runtime.
8899
8900 2002-08-03  Martin Baulig  <martin@gnome.org>
8901
8902         Fixed bugs #27998 and #22735.
8903
8904         * class.cs (Method.IsOperator): New public field.
8905         (Method.CheckBase): Report CS0111 if there's already a method
8906         with the same parameters in the current class.  Report CS0508 when
8907         attempting to change the return type of an inherited method.
8908         (MethodData.Emit): Report CS0179 if a method doesn't have a body
8909         and it's not marked abstract or extern.
8910         (PropertyBase): New abstract base class for Property and Indexer.
8911         (PropertyBase.CheckBase): Moved here from Property and made it work
8912         for indexers.
8913         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
8914         the same so we can reuse it there.
8915         (Property, Indexer): Derive from PropertyBase.
8916         (MethodSignature.inheritable_property_signature_filter): New delegate
8917         to find properties and indexers.
8918
8919         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
8920         argument and improved error reporting.
8921
8922         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
8923         EmptyReadOnlyParameters and made it a property.
8924
8925         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
8926         version of this method which takes a `PropertyInfo indexer'.
8927         (TypeManager.RegisterIndexer): New method.
8928
8929         * class.cs: Added myself as author of this file :-)
8930
8931 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8932
8933         * class.cs: fixed compilation on windoze.
8934
8935 2002-08-03  Martin Baulig  <martin@gnome.org>
8936
8937         * interface.cs (Interface.GetInterfaceBases): Check whether all
8938         base interfaces are at least as accessible than the current one.
8939
8940         * class.cs (TypeContainer.GetClassBases): Check whether base types
8941         are at least as accessible than the current type.
8942         (TypeContainer.AsAccessible): Implemented and made non-static.
8943         (MemberBase.CheckParameters): Report errors if the accessibility
8944         checks fail.
8945
8946         * delegate.cs (Delegate.Delegate): The default visibility is
8947         internal for top-level types and private for nested types.
8948         (Delegate.Define): Report errors if the accessibility checks fail.
8949
8950         * enum.cs (Enum.Enum): The default visibility is internal for
8951         top-level types and private for nested types.
8952         (Enum.DefineType): Compute the correct visibility.
8953
8954         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
8955         function which takes a `bool is_toplevel' instead of a TypeContainer.
8956
8957         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
8958         builtin type.
8959
8960 2002-08-02  Martin Baulig  <martin@gnome.org>
8961
8962         * expression.cs (LocalVariableReferenc): Added constructor which
8963         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
8964         (LocalVariableReference.IsReadOnly): New property.
8965         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
8966         variable is readonly, use our own readonly flag to do this; you can
8967         use the new constructor to get a writable reference to a read-only
8968         variable.
8969
8970         * cs-parser.jay (foreach_statement, using_statement): Get a writable
8971         reference to the local variable.
8972
8973 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
8974
8975         * rootcontext.cs (ResolveCore): Also include System.Exception
8976
8977         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
8978         we reach an EmptyStatement.
8979
8980         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
8981         is also fine.
8982
8983         * expression.cs (Binary.ResolveOperator): Check error result in
8984         two places.
8985
8986         use brtrue/brfalse directly and avoid compares to null.
8987
8988 2002-08-02  Martin Baulig  <martin@gnome.org>
8989
8990         * class.cs (TypeContainer.Define): Define all nested interfaces here.
8991         Fixes bug #28407, added test-155.cs.
8992
8993 2002-08-01  Martin Baulig  <martin@gnome.org>
8994
8995         * class.cs (Event.EmitDefaultMethod): Make this work with static
8996         events.  Fixes #28311, added verify-3.cs.
8997
8998 2002-08-01  Martin Baulig  <martin@gnome.org>
8999
9000         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
9001         `is_disposable' fields.
9002         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
9003         `hm.is_disposable' if we're using the collection pattern.
9004         (Foreach.EmitCollectionForeach): Use the correct type for the
9005         enumerator's local variable, only emit the try/finally block if
9006         necessary (fixes #27713).
9007
9008 2002-08-01  Martin Baulig  <martin@gnome.org>
9009
9010         * ecore.cs (Expression.report118): Renamed to Error118 and made
9011         it public static.
9012
9013         * statement.cs (Throw.Resolve): Check whether the expression is of
9014         the correct type (CS0118) and whether the type derives from
9015         System.Exception (CS0155).
9016         (Catch.Resolve): New method.  Do the type lookup here and check
9017         whether it derives from System.Exception (CS0155).
9018         (Catch.CatchType, Catch.IsGeneral): New public properties.
9019
9020         * typemanager.cs (TypeManager.exception_type): Added.
9021
9022 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
9023
9024         * driver.cs: Updated About function.
9025
9026 2002-07-31  Martin Baulig  <martin@gnome.org>
9027
9028         Implemented Control Flow Analysis.
9029
9030         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
9031         (EmitContext.CurrentBranching): Added.
9032         (EmitContext.StartFlowBranching): Added.
9033         (EmitContext.EndFlowBranching): Added.
9034         (EmitContext.KillFlowBranching): Added.
9035         (EmitContext.IsVariableAssigned): Added.
9036         (EmitContext.SetVariableAssigned): Added.
9037         (EmitContext.IsParameterAssigned): Added.
9038         (EmitContext.SetParameterAssigned): Added.
9039         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
9040         Added control flow analysis stuff here.
9041
9042         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
9043         resolve the expression as lvalue.
9044         (LocalVariableReference.DoResolve): Check whether the variable has
9045         already been assigned.
9046         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
9047         the parameter as assigned here.
9048         (ParameterReference.DoResolve): Check whether the parameter has already
9049         been assigned.
9050         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
9051         expression as lvalue.
9052
9053         * statement.cs (FlowBranching): New class for the flow analysis code.
9054         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
9055         (LabeledStatement.IsDefined): New public property.
9056         (LabeledStatement.AddUsageVector): New public method to tell flow
9057         analyis that the label may be reached via a forward jump.
9058         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
9059         flow analysis.
9060         (VariableInfo.Number): New public field.  This is used by flow analysis
9061         to number all locals of a block.
9062         (Block.CountVariables): New public property.  This is the number of
9063         local variables in this block (including the locals from all parent
9064         blocks).
9065         (Block.EmitMeta): Number all the variables.
9066
9067         * statement.cs: Added flow analysis support to all classes.
9068
9069 2002-07-31  Martin Baulig  <martin@gnome.org>
9070
9071         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
9072         To get debugging messages, compile mcs with /define:MCS_DEBUG and
9073         then use this argument.
9074
9075         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
9076
9077         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
9078         use this to specify /define options.
9079
9080 2002-07-29  Martin Baulig  <martin@gnome.org>
9081
9082         * statement.cs (Fixed): Moved all code that does variable lookups
9083         and resolvings from Emit to Resolve.
9084
9085         * statement.cs (For): Moved all code that does variable lookups
9086         and resolvings from Emit to Resolve.
9087
9088         * statement.cs (Using): Moved all code that does variable lookups
9089         and resolvings from Emit to Resolve.
9090
9091 2002-07-29  Martin Baulig  <martin@gnome.org>
9092
9093         * attribute.cs (Attribute.Resolve): Explicitly catch a
9094         System.NullReferenceException when creating the
9095         CustromAttributeBuilder and report a different warning message.
9096
9097 2002-07-29  Martin Baulig  <martin@gnome.org>
9098
9099         * support.cs (ParameterData.ParameterName): Added method to
9100         get the name of a parameter.
9101
9102         * typemanager.cs (TypeManager.IsValueType): New public method.
9103
9104 2002-07-29  Martin Baulig  <martin@gnome.org>
9105
9106         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
9107         is a flag which specifies that it's either ref or out.
9108         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
9109         the out parameter to `out Parameter.Modifier mod', also set the
9110         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
9111
9112         * support.cs (InternalParameters.ParameterModifier): Distinguish
9113         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9114         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9115
9116         * expression.cs (Argument.GetParameterModifier): Distinguish
9117         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9118         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9119
9120 2002-07-29  Martin Baulig  <martin@gnome.org>
9121
9122         * expression.cs (ParameterReference.ParameterReference): Added
9123         `Location loc' argument to the constructor.
9124
9125         * cs-parser.jay: Pass location to ParameterReference.
9126
9127 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
9128
9129         * statement.cs (Try): Initialize the location.
9130
9131         * cs-parser.jay: pass location to Try.
9132
9133         * expression.cs (Unary.Reduce): Change the prototype to return
9134         whether a constant fold could be performed or not.  The result is
9135         returned in an out parameters.  In the case of Indirection and
9136         AddressOf, we want to perform the full tests.
9137
9138 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
9139
9140         * statement.cs (Statement.Emit): Flag dead code.
9141
9142 2002-07-27  Andrew Birkett  <andy@nobugs.org>
9143
9144         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
9145
9146 2002-07-27  Martin Baulig  <martin@gnome.org>
9147
9148         * class.cs (MethodData.Define): Put back call to
9149         TypeManager.AddMethod(), accidentally commented this out.
9150
9151         * report.cs (Debug): New public method to print debugging information,
9152         this is `[Conditional ("DEBUG")]'.
9153
9154 2002-07-26  Martin Baulig  <martin@gnome.org>
9155
9156         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
9157         (switch_statement): Push the current_block to the switch_stack and
9158         pop it again when we're done with the switch.
9159         (switch_section): The new block is a child of the current_block.
9160         Fixes bug #24007, added test-152.cs.
9161
9162 2002-07-27  Martin Baulig  <martin@gnome.org>
9163
9164         * expression.cs (Invocation.EmitArguments): When calling a varargs
9165         function with only its fixed arguments, we need to pass an empty
9166         array.
9167
9168 2002-07-27  Martin Baulig  <martin@gnome.org>
9169
9170         Mono 0.13 has been released.
9171
9172 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
9173
9174         * driver.cs: Rename --resource to --linkres, because that is what
9175         we do currently, we dont support --resource yet.
9176
9177         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
9178
9179 2002-07-25  Martin Baulig  <martin@gnome.org>
9180
9181         * class.cs (MethodData): New public class.  This is a `method builder'
9182         class for a method or one accessor of a Property/Indexer/Event.
9183         (MethodData.GetMethodFlags): Moved here from MemberBase.
9184         (MethodData.ApplyAttributes): Likewise.
9185         (MethodData.ApplyObsoleteAttribute): Likewise.
9186         (MethodData.ApplyConditionalAttribute): Likewise.
9187         (MethodData.ApplyDllImportAttribute): Likewise.
9188         (MethodData.CheckAbstractAndExternal): Likewise.
9189         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
9190         (MethodData.Emit): Formerly known as Method.Emit().
9191         (MemberBase): Moved everything which was specific to a single
9192         accessor/method to MethodData.
9193         (Method): Create a new MethodData and call Define() and Emit() on it.
9194         (Property, Indexer, Event): Create a new MethodData objects for each
9195         accessor and call Define() and Emit() on them.
9196
9197 2002-07-25  Martin Baulig  <martin@gnome.org>
9198
9199         Made MethodCore derive from MemberBase to reuse the code from there.
9200         MemberBase now also checks for attributes.
9201
9202         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
9203         (MemberBase.GetMethodFlags): Moved here from class Method and marked
9204         as virtual.
9205         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
9206         `CallingConventions cc' and `Attributes opt_attrs' arguments.
9207         (MemberBase.ApplyAttributes): New virtual method; applies the
9208         attributes to a method or accessor.
9209         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
9210         (MemberBase.ApplyConditionalAttribute): Likewise.
9211         (MemberBase.ApplyDllImportAttribute): Likewise.
9212         (MemberBase.CheckAbstractAndExternal): Likewise.
9213         (MethodCore.ParameterTypes): This is now a property instead of a
9214         method, it's initialized from DoDefineParameters().
9215         (MethodCore.ParameterInfo): Removed the set accessor.
9216         (MethodCore.DoDefineParameters): New protected virtual method to
9217         initialize ParameterTypes and ParameterInfo.
9218         (Method.GetReturnType): We can now simply return the MemberType.
9219         (Method.GetMethodFlags): Override the MemberBase version and add
9220         the conditional flags.
9221         (Method.CheckBase): Moved some code from Define() here, call
9222         DoDefineParameters() here.
9223         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
9224         here to avoid some larger code duplication.
9225         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
9226         ensure that abstract and external accessors don't declare a body.
9227
9228         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
9229         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
9230         lookup in the attribute's parent classes, so we need to abort as soon
9231         as we found the first match.
9232         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
9233         the attribute has no arguments.
9234
9235         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
9236         of a Method.
9237
9238 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9239
9240         * cs-parser.jay: reverted previous patch.
9241
9242 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9243
9244         * cs-parser.jay: fixed bug #22119.
9245
9246 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9247
9248         * attribute.cs: fixed compilation. The error was:
9249         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
9250         be assigned to before control leaves the current method."
9251         [FIXME:  Filed as bug #28186: MCS must report this error.]
9252
9253 2002-07-25  Martin Baulig  <martin@gnome.org>
9254
9255         * attribute.cs (Attribute.Conditional_GetConditionName): New static
9256         method to pull the condition name ouf of a Conditional attribute.
9257         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
9258         the obsolete message and error flag out of an Obsolete attribute.
9259
9260         * class.cs (Method.GetMethodFlags): New public method to get the
9261         TypeManager.MethodFlags for this method.
9262         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
9263         private methods.
9264         (Method.Define): Get and apply the Obsolete and Conditional attributes;
9265         if we're overriding a virtual function, set the new private variable
9266         `parent_method'; call the new TypeManager.AddMethod().
9267
9268         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
9269         the MethodBuilder and the Method in a PtrHashtable.
9270         (TypeManager.builder_to_method): Added for this purpose.
9271         (TypeManager.MethodFlags): Added IsObsoleteError.
9272         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
9273         Obsolete and Conditional arguments in MethodBuilders.  If we discover
9274         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
9275         the message from the attribute.
9276
9277 2002-07-24  Martin Baulig  <martin@gnome.org>
9278
9279         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
9280         preprocessor directives, ensure that the argument to #define/#undef is
9281         exactly one identifier and that it's actually an identifier.
9282
9283         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
9284         did not work ....
9285
9286 2002-07-24  Martin Baulig  <martin@gnome.org>
9287
9288         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
9289         initialize it to TypeManager.object_type in the constructor.
9290         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
9291         of the `hm.get_current' method if we're using the collection pattern.
9292         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
9293         for the explicit conversion to make it work when we're using the collection
9294         pattern and the `Current' property has a different return type than `object'.
9295         Fixes #27713.
9296
9297 2002-07-24  Martin Baulig  <martin@gnome.org>
9298
9299         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
9300         does not match, but don't report any errors.  This method is called in
9301         order for all methods in a MethodGroupExpr until a matching method is
9302         found, so we don't want to bail out if the first method doesn't match.
9303         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
9304         matches, report the 123.  Fixes #28070.
9305
9306 2002-07-24  Martin Baulig  <martin@gnome.org>
9307
9308         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
9309         TypeManager.TypeToCoreType() to the top of the method so the
9310         following equality checks will work.  Fixes #28107.
9311
9312 2002-07-24  Martin Baulig  <martin@gnome.org>
9313
9314         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
9315         operand is of type uint, and the other operand is of type sbyte,
9316         short or int, the operands are converted to type long." -
9317         Actually do what this comment already told us.  Fixes bug #28106,
9318         added test-150.cs.
9319
9320 2002-07-24  Martin Baulig  <martin@gnome.org>
9321
9322         * class.cs (MethodBase): New abstract class.  This is now a base
9323         class for Property, Indexer and Event to avoid some code duplication
9324         in their Define() and DefineMethods() methods.
9325         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
9326         generic methods for Define() and DefineMethods().
9327         (FieldBase): Derive from MemberBase, not MemberCore.
9328         (Property): Derive from MemberBase, not MemberCore.
9329         (Property.DefineMethod): Moved all the code from this method to the
9330         new MethodBase.DefineAccessor(), just call it with appropriate
9331         argumetnts.
9332         (Property.Define): Call the new Property.DoDefine(), this does some
9333         sanity checks and we don't need to duplicate the code everywhere.
9334         (Event): Derive from MemberBase, not MemberCore.
9335         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
9336         accessors, this will also make them work with interface events.
9337         (Indexer): Derive from MemberBase, not MemberCore.
9338         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
9339         (Indexer.Define): Use the new MethodBase functions.
9340
9341         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
9342         argument to the constructor.
9343         (Interface.FindMembers): Added support for interface events.
9344         (Interface.PopluateEvent): Implemented.
9345
9346         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
9347
9348 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
9349
9350         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
9351         but this is required to check for a method name being the same as
9352         the containing class.  
9353
9354         Handle this now.
9355
9356 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9357
9358         * interface.cs: initialize variable.
9359
9360 2002-07-23  Martin Baulig  <martin@gnome.org>
9361
9362         Implemented the IndexerName attribute in interfaces.
9363
9364         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
9365         name if this is an explicit interface implementation.
9366         (Indexer.InterfaceIndexerName): New public variable.  If we're
9367         implementing an interface indexer, this is the IndexerName in that
9368         interface.  Otherwise, it's the IndexerName.
9369         (Indexer.DefineMethod): If we're implementing interface indexer,
9370         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
9371         and Pending.ImplementIndexer methods.
9372         (Indexer.Define): Also define the PropertyBuilder if we're
9373         implementing an interface indexer and this is neither an explicit
9374         interface implementation nor do the IndexerName match the one in
9375         the interface.
9376
9377         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
9378         If a method is defined here, then we always need to create a proxy
9379         for it.  This is used when implementing interface indexers.
9380         (Pending.IsInterfaceIndexer): New public method.
9381         (Pending.ImplementIndexer): New public method.
9382         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
9383         This is used when implementing interface indexers to define a proxy
9384         if necessary.
9385         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
9386         define a proxy if necessary.
9387
9388         * interface.cs (Interface.IndexerName): New public variable.
9389         (Interface.PopulateIndexer): Set the IndexerName.
9390         (Interface.DefineIndexers): New private method.  Populate all the
9391         indexers and make sure their IndexerNames match.
9392
9393         * typemanager.cs (IndexerPropertyName): Added support for interface
9394         indexers.
9395
9396 2002-07-22  Martin Baulig  <martin@gnome.org>
9397
9398         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
9399         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
9400         ret if HasReturnLabel.
9401         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
9402         variables.
9403
9404         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
9405         and set the ec.LoopBeginTryCatchLevel.
9406         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
9407         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
9408         the current ec.TryCatchLevel, the branch goes out of an exception
9409         block.  In this case, we need to use Leave and not Br.
9410
9411 2002-07-22  Martin Baulig  <martin@gnome.org>
9412
9413         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
9414         block unless the block does not always return or it is contained in
9415         another try { ... } catch { ... } block.  Fixes bug #26506.
9416         Added verify-1.cs to the test suite.
9417
9418 2002-07-22  Martin Baulig  <martin@gnome.org>
9419
9420         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
9421         then we do not always return.  Fixes bug #24985.
9422
9423 2002-07-22  Martin Baulig  <martin@gnome.org>
9424
9425         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
9426         lookup on a per-class level; ie. walk up the class hierarchy until we
9427         found at least one applicable method, then choose the best among them.
9428         Fixes bug #24463 and test-29.cs.
9429
9430 2002-07-22  Martin Baulig  <martin@gnome.org>
9431
9432         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
9433         return types of the methods.  The return type is not part of the
9434         signature and we must not check it to make the `new' modifier work.
9435         Fixes bug #27999, also added test-147.cs.
9436         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
9437
9438         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
9439         on the method's return type.
9440
9441 2002-07-21  Martin Baulig  <martin@gnome.org>
9442
9443         * assign.cs: Make this work if the rightmost source is a constant and
9444         we need to do an implicit type conversion.  Also adding a few more tests
9445         to test-38.cs which should have caught this.
9446
9447         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
9448         target in the makefile for this.  The makefile.gnu is primarily intended
9449         for end-users who don't want to debug the compiler.
9450
9451 2002-07-21  Martin Baulig  <martin@gnome.org>
9452
9453         * assign.cs: Improved the Assign class so it can now handle embedded
9454         assignments (X = Y = Z = something).  As a side-effect this'll now also
9455         consume less local variables.  test-38.cs now passes with MCS, added
9456         a few new test cases to that test.
9457
9458 2002-07-20  Martin Baulig  <martin@gnome.org>
9459
9460         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
9461         instructions.  Fixes bug #27977, also added test-146.cs.
9462
9463 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9464
9465         * cs-tokenizer.cs: fixed getHex ().
9466
9467 2002-07-19  Martin Baulig  <martin@gnome.org>
9468
9469         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
9470         not Type.GetType() to lookup the array type.  This is needed when
9471         we're constructing an array of a user-defined type.
9472         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
9473         single-dimensional arrays, but also for single-dimensial arrays of
9474         type decimal.
9475
9476 2002-07-19  Martin Baulig  <martin@gnome.org>
9477
9478         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
9479         this function is called, it's not allowed to share LocalBuilders
9480         among ILGenerators.
9481
9482 2002-07-19  Martin Baulig  <martin@gnome.org>
9483
9484         * expression.cs (Argument.Resolve): Report an error 118 when trying
9485         to pass a type as argument.
9486
9487 2002-07-18  Martin Baulig  <martin@gnome.org>
9488
9489         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9490         Conv_R_Un for the signed `long' type.
9491
9492 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9493
9494         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9495         `expr' for the temporary result, as that will fail if we do
9496         multiple resolves on the same expression.
9497
9498 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9499
9500         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9501         ec.TypeContainer for looking up aliases. 
9502
9503         * class.cs (TypeContainer): Remove LookupAlias from here.
9504
9505         * decl.cs (DeclSpace); Move here.
9506
9507 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9508
9509         * class.cs (FindMembers): Only call filter if the constructor
9510         bulider is not null.
9511
9512         Also handle delegates in `NestedTypes' now.  Now we will perform
9513         type lookups using the standard resolution process.  This also
9514         fixes a bug.
9515
9516         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9517         This uses Expressions (the limited kind that can be parsed by the
9518         tree) instead of strings.
9519
9520         * expression.cs (ComposedCast.ToString): Implement, used to flag
9521         errors since now we have to render expressions.
9522
9523         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9524         FormArrayType. 
9525
9526         * ecore.cs (SimpleName.ToString): ditto.
9527
9528         * cs-parser.jay: Instead of using strings to assemble types, use
9529         Expressions to assemble the type (using SimpleName, ComposedCast,
9530         MemberAccess).  This should fix the type lookups in declarations,
9531         because we were using a different code path for this.
9532
9533         * statement.cs (Block.Resolve): Continue processing statements
9534         even when there is an error.
9535
9536 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * class.cs (Event.Define): Also remove the `remove' method from
9539         the list of pending items.
9540
9541         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9542         generate more compact code. 
9543
9544 2002-07-17  Martin Baulig  <martin@gnome.org>
9545
9546         * const.cs (Const.LookupConstantValue): Add support for constant
9547         `unchecked' and `checked' expressions.
9548         Also adding test case test-140.cs for this.
9549
9550 2002-07-17  Martin Baulig  <martin@gnome.org>
9551
9552         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9553         check whether mi.ReturnType implements the IEnumerator interface; the
9554         `==' and the IsAssignableFrom() will fail in this situation.
9555
9556 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9557
9558         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9559         here too.
9560
9561 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9562
9563         * expression.cs: fixed bug #27811.
9564
9565 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9566
9567         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9568         Molaro: when we are a ref, the value already contains a pointer
9569         value, do not take the address of it.
9570
9571 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9572         * removed mb-parser.jay and mb-tokenizer.cs
9573
9574 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9575
9576         * expression.cs: check against the building corlib void type.
9577
9578 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9579
9580         * ecore.cs: fix for valuetype static readonly fields: when 
9581         initializing them, we need their address, not the address of a copy.
9582
9583 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9584
9585         * typemanager.cs: register also enum_type in corlib.
9586
9587 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9588
9589         * class.cs: allow calling this (but not base) initializers in structs.
9590
9591 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9592
9593         * ecore.cs: make sure we compare against the building base types
9594         in GetTypeSize ().
9595
9596 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9597
9598         * typemanager.cs: fix TypeToCoreType() to handle void and object
9599         (corlib gets no more typerefs after this change).
9600
9601 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * expression.cs (ArrayCreation.EmitArrayArguments): use
9604         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9605
9606         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9607         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9608         array indexes, the runtime actually forbids them.
9609
9610         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9611         for array arguments here.
9612
9613         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9614         instead of the default for ValueTypes.
9615
9616         (New.DoEmit): Use IsValueType instead of
9617         IsSubclassOf (value_type)
9618         (New.DoResolve): ditto.
9619         (Invocation.EmitCall): ditto.
9620
9621         * assign.cs (Assign): ditto.
9622
9623         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9624         Statements *are* currently doing part of their resolution during
9625         Emit.  
9626
9627         Expressions do always resolve during resolve, but statements are
9628         only required to propagate resolution to their children.
9629
9630 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9631
9632         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9633
9634         (LoadAssembly): Do not add the dll if it is already specified
9635
9636         (MainDriver): Add the System directory to the link path at the end,
9637         after all the other -L arguments. 
9638
9639         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9640         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9641         ldelem.u1) and using the opposite for sbytes.
9642
9643         This fixes Digger, and we can finally run it.
9644
9645         * driver.cs (UnixParseOption): Move the option parsing here.  
9646         (CSCParseOption): Implement CSC-like parsing of options.
9647
9648         We now support both modes of operation, the old Unix way, and the
9649         new CSC-like way.  This should help those who wanted to make cross
9650         platform makefiles.
9651
9652         The only thing broken is that /r:, /reference: and /lib: are not
9653         implemented, because I want to make those have the same semantics
9654         as the CSC compiler has, and kill once and for all the confussion
9655         around this.   Will be doing this tomorrow.
9656
9657         * statement.cs (Unsafe.Resolve): The state is checked during
9658         resolve, not emit, so we have to set the flags for IsUnsfe here.
9659
9660 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9663         not catch the Error_ObjectRefRequired in SimpleName (as it is
9664         possible to have a class/instance variable name that later gets
9665         deambiguated), we have to check this here.      
9666
9667 2002-07-10  Ravi Pratap  <ravi@ximian.com>
9668
9669         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
9670         make static and put into Expression.
9671
9672         (Event.Define): Register the private field of the event with the 
9673         TypeManager so that GetFieldFromEvent can get at it.
9674
9675         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
9676         keep track of the private field associated with an event which
9677         has no accessors.
9678
9679         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
9680         private field.
9681
9682         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
9683
9684 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9685
9686         * expression.cs (Binary.EmitBranchable): this routine emits the
9687         Binary expression in a branchable context.  This basically means:
9688         we need to branch somewhere, not just get the value on the stack.
9689
9690         This works together with Statement.EmitBoolExpression.
9691
9692         * statement.cs (Statement.EmitBoolExpression): Use
9693         EmitBranchable. 
9694
9695 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
9696
9697         * statement.cs (For): Reduce the number of jumps in loops.
9698
9699         (For): Implement loop inversion for the For statement.
9700
9701         (Break): We can be breaking out of a Try/Catch controlled section
9702         (foreach might have an implicit try/catch clause), so we need to
9703         use Leave instead of Br.
9704
9705         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
9706         now).  If the instace expression supports IMemoryLocation, we use
9707         the AddressOf method from the IMemoryLocation to extract the
9708         address instead of emitting the instance.
9709
9710         This showed up with `This', as we were emitting the instance
9711         always (Emit) instead of the Address of This.  Particularly
9712         interesting when This is a value type, as we dont want the Emit
9713         effect (which was to load the object).
9714
9715 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
9716
9717         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
9718
9719         * statement.cs (Checked): Set the CheckedState during the resolve
9720         process too, as the ConvCast operations track the checked state on
9721         the resolve process, and not emit.
9722
9723         * cs-parser.jay (namespace_member_declaration): Flag that we have
9724         found a declaration when we do.  This is used to flag error 1529
9725
9726         * driver.cs: Report ok when we display the help only.
9727
9728 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
9729
9730         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
9731
9732 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
9733
9734         * cs-tokenizer.cs (define): We also have to track locally the
9735         defines.  AllDefines is just used for the Conditional Attribute,
9736         but we also need the local defines for the current source code. 
9737
9738 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * statement.cs (While, For, Do): These loops can exit through a
9741         Break statement, use this information to tell whether the
9742         statement is the last piece of code.
9743
9744         (Break): Flag that we break.
9745
9746         * codegen.cs (EmitContexts): New `Breaks' state variable.
9747
9748 2002-07-03  Martin Baulig  <martin@gnome.org>
9749
9750         * class.cs (TypeContainer.MethodModifiersValid): Allow override
9751         modifiers in method declarations in structs.  Otherwise, you won't
9752         be able to override things like Object.Equals().
9753
9754 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9755
9756         * class.cs (Method, Property, Indexer): Do not allow the public
9757         modifier to be used in explicit interface implementations.
9758
9759         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
9760         override modifiers in method declarations in structs
9761
9762 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
9763
9764         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
9765         integer or real overflow, report an error
9766
9767 2002-07-02  Martin Baulig  <martin@gnome.org>
9768
9769         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
9770         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
9771         to tell the runtime about our newly created System.Object and
9772         System.ValueType types.
9773
9774 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9775
9776         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
9777         struct instead of Ldarg/Starg.
9778
9779 2002-07-02  Martin Baulig  <martin@gnome.org>
9780
9781         * expression.cs (Indirection.Indirection): Call
9782         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
9783
9784 2002-07-02  Martin Baulig  <martin@gnome.org>
9785
9786         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
9787         ValueType, call TypeManager.TypeToCoreType() on it.
9788         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
9789         the OpCodes.Newarr argument.
9790
9791 2002-07-02  Martin Baulig  <martin@gnome.org>
9792
9793         * expression.cs (Invocation.EmitCall): When compiling corlib,
9794         replace all calls to the system's System.Array type to calls to
9795         the newly created one.
9796
9797         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
9798         System.Array methods.
9799         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
9800         from the system's System.Array type which must be replaced.
9801
9802 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
9803
9804         * typemanager.cs: load unverifiable_code_ctor so we can build
9805         corlib using the correct type. Avoid using GetTypeCode() with
9806         TypeBuilders.
9807         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
9808         TypeManager.object_type to allow building corlib.
9809
9810 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
9811
9812         * ecore.cs: handle System.Enum separately in LoadFromPtr().
9813
9814 2002-07-01  Martin Baulig  <martin@gnome.org>
9815
9816         * class.cs: Make the last change actually work, we need to check
9817         whether `ifaces != null' to avoid a crash.
9818
9819 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9820
9821         * class.cs: when we build structs without fields that implement
9822         interfaces, we need to add the interfaces separately, since there is
9823         no API to both set the size and add the interfaces at type creation
9824         time.
9825
9826 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9827
9828         * expression.cs: the dimension arguments to the array constructors
9829         need to be converted if they are a long.
9830
9831 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
9832
9833         * class.cs: don't emit ldarg.0 if there is no parent constructor
9834         (fixes showstopper for corlib).
9835
9836 2002-06-29  Martin Baulig  <martin@gnome.org>
9837
9838         MCS now compiles corlib on GNU/Linux :-)
9839
9840         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
9841         ie. check for MethodImplOptions.InternalCall.
9842
9843         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
9844         and TypeManager.attribute_type are null, so we must explicitly check
9845         whether parent is not null to find out whether it's an attribute type.
9846         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
9847         and SetBuilder, not only if the property is neither abstract nor external.
9848         This is necessary to set the MethodImplOptions on the accessor methods.
9849         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
9850         SetBuilder, see Property.Emit().
9851
9852         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
9853         populate "System.Object", "System.ValueType" and "System.Attribute" since
9854         they've already been populated from BootCorlib_PopulateCoreTypes().
9855
9856 2002-06-29  Martin Baulig  <martin@gnome.org>
9857
9858         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
9859         is the NullLiteral, we also need to make sure that target_type is not
9860         an enum type.   
9861
9862 2002-06-29  Martin Baulig  <martin@gnome.org>
9863
9864         * rootcontext.cs (RootContext.ResolveCore): We must initialize
9865         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
9866         before calling BootstrapCorlib_ResolveDelegate ().
9867
9868 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9869
9870         * statement.cs: fixed build-breaker. All tests passed ok.
9871
9872 2002-06-27  Martin Baulig  <martin@gnome.org>
9873
9874         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
9875         for System.Decimal when compiling corlib.
9876
9877 2002-06-27  Martin Baulig  <martin@gnome.org>
9878
9879         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
9880         switch blocks which contain nothing but a default clause.
9881
9882 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
9883
9884        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
9885
9886 2002-06-27  Martin Baulig  <martin@gnome.org>
9887
9888         * ecore.cs (PropertyExpr.PropertyExpr): Call
9889         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
9890
9891         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
9892         is already a TypeBuilder.
9893
9894 2002-06-27  Martin Baulig  <martin@gnome.org>
9895
9896         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
9897         `target_type == TypeManager.array_type', not IsAssignableFrom() in
9898         the "from an array-type to System.Array" case.  This makes it work
9899         when compiling corlib.
9900
9901 2002-06-27  Martin Baulig  <martin@gnome.org>
9902
9903         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
9904         non-static PropertyExpr, set its InstanceExpression.  This makes
9905         the `ICollection.Count' property work in System/Array.cs.
9906
9907 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
9908
9909         * driver.cs: Made error handling more consistent.  Errors now
9910         tracked by Report class, so many methods which used to return int
9911         now return void.  Main() now prints success/failure and 
9912         errors/warnings message.
9913
9914         Renamed '--probe' compiler argument to '--expect-error'.  Removed
9915         the magic number return values (123 and 124).  Now, if the
9916         expected error occurs, the compiler exits with success (exit value
9917         0).  If the compilation completes without seeing that particular
9918         error, the compiler exits with failure (exit value 1).  The
9919         makefile in mcs/errors has been changed to handle the new behaviour.
9920
9921         * report.cs: Made 'expected error' number a property and renamed
9922         it from 'Probe' to 'ExpectedError'.
9923
9924         * genericparser.cs: Removed error handling support, since it is
9925         now all done by Report class.
9926
9927         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
9928         class, so parse() no longer returns an int.
9929
9930         * namespace.cs: Use Report.Error instead of GenericParser.error
9931
9932 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
9933
9934         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
9935         TypeContainer.AddOperator): At the front of the list put the
9936         explicit implementations, so they get resolved/defined first. 
9937
9938 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
9939
9940         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
9941         interface type is implemented by this TypeContainer.  Used during
9942         explicit interface implementation.
9943
9944         (Property.Define, Indexer.Define, Method.Define): Validate that
9945         the given interface in the explicit implementation is one of the
9946         base classes for the containing type.
9947
9948         Also if we are explicitly implementing an interface, but there is
9949         no match in the pending implementation table, report an error.
9950
9951         (Property.Define): Only define the property if we are
9952         not explicitly implementing a property from an interface.  Use the
9953         correct name also for those properties (the same CSC uses,
9954         although that is really not needed).
9955
9956         (Property.Emit): Do not emit attributes for explicitly implemented
9957         properties, as there is no TypeBuilder.
9958
9959         (Indexer.Emit): ditto.
9960
9961         Hiding then means that we do not really *implement* a pending
9962         implementation, which makes code fail.
9963
9964 2002-06-22  Martin Baulig  <martin@gnome.org>
9965
9966         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
9967         the return value of Object.GetType().  [FIXME: we need to do this whenever
9968         we get a type back from the reflection library].
9969
9970 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
9971
9972         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
9973
9974 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
9975
9976         * attribute.cs: Return null if we can not look up the type.
9977
9978         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
9979         the interface types found.
9980
9981         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
9982         interface types found.
9983
9984         * typemanager.cs (GetInterfaces): Make this routine returns alll
9985         the interfaces and work around the lame differences between
9986         System.Type and System.Reflection.Emit.TypeBuilder in the results
9987         result for GetInterfaces.
9988
9989         (ExpandInterfaces): Given an array of interface types, expand and
9990         eliminate repeated ocurrences of an interface.  This expands in
9991         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
9992         be IA, IB, IC.
9993
9994 2002-06-21  Martin Baulig  <martin@gnome.org>
9995
9996         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
9997         on System.Enum.
9998
9999 2002-06-21  Martin Baulig  <martin@gnome.org>
10000
10001         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
10002         and called with one of the core types, return the corresponding typebuilder for
10003         that type.
10004
10005         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
10006         element type.
10007
10008 2002-06-21  Martin Baulig  <martin@gnome.org>
10009
10010         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
10011         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
10012         (Expression.ConvertReferenceExplicit): Likewise.
10013
10014         * expression.cs (ElementAccess.DoResolve): Likewise.
10015         (ElementAccess.DoResolveLValue): Likewise.
10016
10017 2002-06-10  Martin Baulig  <martin@gnome.org>
10018
10019         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
10020         add the "value" parameter to the parameter list.
10021
10022         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
10023         to our caller.
10024
10025 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
10026
10027         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
10028         the argument to an int, uint, long or ulong, per the spec.  Also
10029         catch negative constants in array creation.
10030
10031 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
10032
10033         * class.cs: do not allow the same interface to appear twice in
10034         the definition list.
10035
10036 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
10037
10038         * ecore.cs: don't use ldlen with System.Array.
10039
10040 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
10041
10042         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
10043
10044 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
10045
10046         * modifiers.cs: produce correct field attributes for protected
10047         internal. Easy fix so miguel can work on ther harder stuff:-)
10048
10049 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
10050
10051         * pending.cs: New file.  Move the code from class.cs here.
10052         Support clearning the pending flag for all methods (when not doing
10053         explicit interface implementation).
10054
10055 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
10056
10057         * rootcontext.cs: added a couple more types needed to bootstrap.
10058
10059 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
10062         constructor in the type, instead of any constructor in the type
10063         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
10064         a bug in the Mono runtime when applying the params attribute). 
10065
10066 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
10067         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
10068
10069 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
10070
10071         * expression.cs (Unary.ResolveOperator): Use TypeManager
10072         to resolve the type.
10073
10074 2002-06-13  Ravi Pratap  <ravi@ximian.com>
10075
10076         * cs-parser.jay (enum_member_declaration): Pass in the attributes
10077         attached.
10078
10079         * enum.cs (AddEnumMember): Add support to store the attributes associated 
10080         with each member too.
10081
10082         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
10083         field builders too - this takes care of the enum member case.
10084
10085 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
10086
10087         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
10088         address-of operator on both value types and pointers.
10089
10090 2002-06-10  Martin Baulig  <martin@gnome.org>
10091
10092         * interface.cs (Interface.PopulateIndexer): Add the indexer's
10093         PropertyBuilder to the `property_builders' list.
10094
10095         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
10096         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
10097         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
10098         find any indexers which are inherited from an interface.
10099
10100 2002-06-09  Martin Baulig  <martin@gnome.org>
10101
10102         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
10103         the same type as the constant if necessary.  There's also a test-130.cs
10104         for this.
10105
10106         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
10107
10108         * typemanager.cs (TypeManager.ChangeType): Previously known as
10109         Enum.ChangeEnumType().
10110
10111 2002-06-09  Martin Baulig  <martin@gnome.org>
10112
10113         * expression.cs (Cast.TryReduce): Added support for consts.
10114
10115 2002-06-08  Ravi Pratap  <ravi@ximian.com>
10116
10117         * class.cs (Accessor): Hold attributes information so we can pass
10118         it along.
10119
10120         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
10121         Modify to pass in attributes attached to the methods.
10122
10123         (add_accessor_declaration, remove_accessor_declaration): Ditto.
10124
10125         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
10126         to handle the Accessor kind :-)
10127
10128         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
10129
10130 2002-06-08  Martin Baulig  <martin@gnome.org>
10131
10132         * expression.cs (Unary.TryReduceNegative): Added support for
10133         ULongConstants.
10134
10135 2002-06-08  Martin Baulig  <martin@gnome.org>
10136
10137         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
10138         name can't be found in the `defined_names' - the caller will do a
10139         MemberLookup in this case and thus find methods in System.Enum
10140         such as Enum.IsDefined().
10141
10142 2002-06-08  Martin Baulig  <martin@gnome.org>
10143
10144         * enum.cs (Enum.ChangeEnumType): This is a custom version of
10145         Convert.ChangeType() which works with TypeBuilder created types.
10146         (Enum.LookupEnumValue, Enum.Define): Use it here.
10147
10148         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
10149         `TypeBuilder.BaseType != null' check.
10150         (TypeContainer.FindMembers): Only lookup parent members if we
10151         actually have a parent.
10152         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
10153         (ConstructorInitializer.Resolve): Likewise.
10154
10155         * interface.cs (Interface.FindMembers): Added
10156         `TypeBuilder.BaseType != null' check.
10157
10158         * rootcontext.cs (RootContext.ResolveCore): Added
10159         "System.Runtime.CompilerServices.IndexerNameAttribute" to
10160         classes_second_stage.
10161
10162         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
10163         debug_type and trace_type when compiling with --nostdlib.       
10164
10165 2002-06-07  Martin Baulig  <martin@gnome.org>
10166
10167         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
10168         (AddField): Set it to true when adding a non-static field.
10169         (DefineType): Use `have_nonstatic_fields' to find out whether we
10170         have non-static fields, not `Fields != null'.
10171
10172 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
10173
10174         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
10175         dereferencing a null on the static-field code path)
10176
10177 2002-05-30  Martin Baulig  <martin@gnome.org>
10178
10179         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
10180         to take command line arguments.  Use reflection to call the new
10181         custom `Initialize' function on the symbol writer and pass it the
10182         command line arguments.
10183
10184         * driver.cs (--debug-args): New command line argument to pass command
10185         line arguments to the symbol writer.
10186
10187 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
10188
10189         * assign.cs (DoResolve): Forgot to do the implicit conversion to
10190         the target type for indexers and properties.  Thanks to Joe for
10191         catching this.
10192
10193 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
10194
10195         * typemanager.cs (MethodFlags): returns the method flags
10196         (Obsolete/ShouldIgnore) that control warning emission and whether
10197         the invocation should be made, or ignored. 
10198
10199         * expression.cs (Invocation.Emit): Remove previous hack, we should
10200         not do this on matching a base type, we should do this based on an attribute
10201
10202         Only emit calls to System.Diagnostics.Debug and
10203         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
10204         on the command line.
10205
10206         * rootcontext.cs: Global settings for tracing and debugging.
10207
10208         * cs-tokenizer.cs (define): New utility function to track
10209         defines.   Set the global settings for TRACE and DEBUG if found.
10210
10211 2002-05-25  Ravi Pratap  <ravi@ximian.com>
10212
10213         * interface.cs (Populate*): Pass in the TypeContainer as well as
10214         the DeclSpace as parameters so that we can create EmitContexts and
10215         then use that to apply attributes etc.
10216
10217         (PopulateMethod, PopulateEvent, PopulateProperty)
10218         (PopulateIndexer): Apply attributes everywhere.
10219
10220         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
10221         etc.
10222
10223         (ApplyAttributes): Update accordingly.
10224
10225         We now apply interface attributes for all members too.
10226
10227 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * class.cs (Indexer.Define); Correctly check if we are explicit
10230         implementation (instead of checking the Name for a ".", we
10231         directly look up if the InterfaceType was specified).
10232
10233         Delay the creation of the PropertyBuilder.
10234
10235         Only create the PropertyBuilder if we are not an explicit
10236         interface implementation.   This means that explicit interface
10237         implementation members do not participate in regular function
10238         lookups, and hence fixes another major ambiguity problem in
10239         overload resolution (that was the visible effect).
10240
10241         (DefineMethod): Return whether we are doing an interface
10242         implementation. 
10243
10244         * typemanager.cs: Temporary hack until we get attributes in
10245         interfaces (Ravi is working on that) and we get IndexerName
10246         support in interfaces.
10247
10248         * interface.cs: Register the indexers as properties.
10249
10250         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
10251         warning, I have verified that this is a bug in the .NET runtime
10252         (JavaScript suffers of the same problem).
10253
10254         * typemanager.cs (MemberLookup): When looking up members for
10255         interfaces, the parent of an interface is the implicit
10256         System.Object (so we succeed in searches of Object methods in an
10257         interface method invocation.  Example:  IEnumerable x;  x.ToString
10258         ()) 
10259
10260 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
10261
10262         * class.cs (Event): Events should also register if they do
10263         implement the methods that an interface requires.
10264
10265         * typemanager.cs (MemberLookup); use the new GetInterfaces
10266         method. 
10267
10268         (GetInterfaces): The code used to lookup interfaces for a type is
10269         used in more than one place, factor it here. 
10270
10271         * driver.cs: Track the errors at the bottom of the file, we kept
10272         on going.
10273
10274         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
10275         instance if the method we are calling is static!
10276
10277 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * attribute.cs (ApplyAttributes): Make this function filter out
10280         the IndexerName attribute (as that attribute in reality is never
10281         applied) and return the string constant for the IndexerName
10282         attribute. 
10283
10284         * class.cs (TypeContainer.Emit): Validate that all the indexers
10285         have the same IndexerName attribute, and if so, set the
10286         DefaultName attribute on the class. 
10287
10288         * typemanager.cs: The return value might contain other stuff (not
10289         only methods).  For instance, consider a method with an "Item"
10290         property and an Item method.
10291
10292         * class.cs: If there is a problem with the parameter types,
10293         return. 
10294
10295 2002-05-24  Ravi Pratap  <ravi@ximian.com>
10296
10297         * ecore.cs (ImplicitConversionExists): Wrapper function which also
10298         looks at user defined conversion after making a call to 
10299         StandardConversionExists - we need this for overload resolution.
10300
10301         * expression.cs : Update accordingly the various method calls.
10302
10303         This fixes 2 bugs filed against implicit user defined conversions 
10304
10305 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
10306
10307         * statement.cs: Track the result of the assignment.
10308
10309 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * expression.cs (MemberAccess): Improved error reporting for
10312         inaccessible members.
10313
10314 2002-05-22  Martin Baulig  <martin@gnome.org>
10315
10316         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
10317         itself with debugging support.
10318
10319 2002-05-22  Martin Baulig  <martin@gnome.org>
10320
10321         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
10322         Removed, this isn't needed anymore.
10323
10324 2002-05-20  Martin Baulig  <martin@gnome.org>
10325
10326         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
10327         be underlying type for an enum.
10328
10329 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
10330
10331         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
10332         that splits out the loading of just the core types.
10333
10334         * rootcontext.cs (ResolveCore): Split the struct resolution in
10335         two, so we can load the enumeration underlying types before any
10336         enums are used.
10337
10338         * expression.cs (Is): Bandaid until we fix properly Switch (see
10339         bug #24985 for details).
10340
10341         * typemanager.cs (ImplementsInterface): The hashtable will contain
10342         a null if there are no interfaces implemented.
10343
10344 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
10345
10346         * cs-parser.jay (indexer_declarator): It is fine to have array
10347         parameters
10348
10349 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10350
10351         * typemanager.cs: (RegisterBuilder): New function used to register
10352         TypeBuilders that implement interfaces.  Since
10353         TypeBuilder.GetInterfaces (as usual) does not work with lame
10354         Reflection.Emit. 
10355         (AddUserType): register interfaces.
10356
10357         (ImplementsInterface): Use the builder_to_ifaces hash if we are
10358         dealing with TypeBuilder.  Also, arrays are showing up as
10359         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
10360         methods can not be invoked on them!
10361
10362         * ecore.cs (ExplicitReferenceConversionExists): Made public.
10363         (ImplicitReferenceConversionExists): Split out from
10364         StandardConversionExists. 
10365
10366         * expression.cs (As): We were only implementing one of the three
10367         cases for the as operator.  We now implement them all.
10368         (Is): Implement the various other cases for Is as well.
10369
10370         * typemanager.cs (CACHE): New define used to control if we want or
10371         not the FindMembers cache.  Seems to have a negative impact on
10372         performance currently
10373
10374         (MemberLookup): Nested types have full acess to
10375         enclosing type members
10376
10377         Remove code that coped with instance/static returns for events, we
10378         now catch this in RealFindMembers.
10379
10380         (RealFindMembers): only perform static lookup if the instance
10381         lookup did not return a type or an event.  
10382
10383 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10384
10385         * assign.cs (CompoundAssign): We pass more semantic information
10386         now to Compound Assignments than we did before: now we have all
10387         the information at hand, and now we resolve the target *before* we
10388         do the expression expansion, which allows the "CacheValue" method
10389         to have the effect we intended (before, a [x] += 1 would generate
10390         two differen ArrayAccess expressions from the ElementAccess,
10391         during the resolution process).
10392
10393         (CompoundAssign.DoResolve): Resolve target and original_source here.
10394
10395 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
10396
10397         * expression.cs (ArrayAccess): dropped debugging information. 
10398
10399         * typemanager.cs: Small bug fix: I was always returning i_members,
10400         instead of one of i_members or s_members (depending on which had
10401         the content).
10402
10403         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
10404         method is invoked before any code generation takes place, and it
10405         is a mechanism to inform that the expression will be invoked more
10406         than once, and that the method should use temporary values to
10407         avoid having side effects
10408
10409         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
10410
10411         * ecore.cs (Expression.CacheTemporaries): Provide empty default
10412         implementation.
10413
10414         * expression.cs (Indirection, ArrayAccess): Add support for
10415         CacheTemporaries in these two bad boys. 
10416
10417         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
10418         ldobj or ldind_ref.  
10419         (StoreFromPtr): Handle stobj as well.
10420
10421         * expression.cs (UnaryMutator): Share more code.
10422
10423         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
10424         down: I was not tracking the Filter function as well, which
10425         was affecting the results of the cache.
10426
10427 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * attribute.cs: Remove the hack to handle the CharSet property on
10430         StructLayouts. 
10431
10432 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * attribute.cs (DoResolve): More uglyness, we now only try to
10435         resolve the attribute partially, to extract the CharSet
10436         information (only if we are a StructLayout attribute).  Otherwise 
10437
10438         (GetExtraTypeInfo): Add some code to conditionally kill in the
10439         future this.   I am more and more convinced that the .NET
10440         framework has special code to handle the attribute setting on
10441         certain elements.
10442
10443         * expression.cs (IsParamsMethodApplicable): Revert my previous
10444         foreach change here, it was wrong.
10445
10446 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
10447
10448         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
10449         (pp_expr): do not abort on unknown input, just return.
10450         (eval): abort if there are pending chars.
10451
10452         * attribute.cs (Attribute.Resolve): Positional parameters are
10453         optional.  Deal with that case.
10454
10455         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
10456         the Ansi/Unicode/Auto information for the type.
10457
10458         (TypeContainer.DefineType): instantiate the EmitContext here, as
10459         we will be using it during the type definition (to resolve
10460         attributes) and during the emit phase.
10461
10462         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
10463         to pull type information out of the attributes
10464
10465         (Attribute.Resolve): track the constructor builder, and allow for
10466         multiple invocations (structs and classes will use this).
10467
10468         * ecore.cs (MemberLookupFinal): new version with all the
10469         parameters customizable.
10470
10471         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
10472         constructors.  Return if the result value is null (as the error
10473         would have been flagged already by MemberLookupFinal)
10474
10475         Do not allow instances of abstract classes or interfaces to be
10476         created.
10477
10478         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
10479         We have to compare the assembly property here when dealing with
10480         FamANDAssem and Assembly access modifiers, because we might be
10481         creating an assembly from *modules* (that means that we are not
10482         getting TypeBuilders for types defined in other modules that are
10483         part of this assembly).
10484
10485         (Method.Emit): If the method is marked abstract and has a body,
10486         emit an error. 
10487
10488         (TypeContainer.DefineMembers): If both the defined member and the
10489         parent name match are methods, then do not emit any warnings: let
10490         the Method.Define routine take care of flagging warnings.  But if
10491         there is a mismatch (method overrides something else, or method is
10492         overriwritten by something, then emit warning).
10493
10494         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10495         set to null, this means `do not check for the return type on the
10496         signature'. 
10497
10498         (Method.Define): set the return type for the method signature to
10499         null, so that we get methods with the same name and parameters and
10500         different return types.  This is used to flag warning 114 (you are
10501         hiding a method, and you probably want to use the new/override
10502         keywords instead).
10503
10504         * typemanager.cs (MemberLookup): Implemented proper access
10505         control, closing a long standing set of bug reports.  The problem
10506         was that the Framework only has two bits: Public and NonPublic,
10507         and NonPublic includes private and protected methods, but we need
10508         to enforce the FamANDAssem, FamOrAssem and Family. 
10509
10510 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * statement.cs (GotoCase): Return true: Ammounts to giving up
10513         knowledge on whether we return or not, and letting the other case
10514         be responsible for it.
10515
10516 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10517
10518         * driver.cs: Do not load directories for each file processed, only
10519         do it if there is a pattern.
10520
10521         * ecore.cs: Report readonly assigns here as well, as we might have
10522         been resolved only by MemberAccess.
10523
10524         (SimpleName.SimpleNameResolve): Also be useful for LValue
10525         resolution.   We need this to propagate assign to local readonly variables
10526
10527         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10528         do not want to reuse potential criteria memory.
10529
10530         * class.cs (MyEventBuilder): Set reflected_type;
10531
10532         * ecore.cs (Constantify): Added support for constifying bools.
10533
10534         (RootContext.LookupType): Added a cache for values looked up in
10535         the declaration space.
10536
10537         * typemanager.cs (FindMembers): Now is a front-end to
10538         RealFindMembers, and provides a two-level hashtable-based cache to
10539         the request.  
10540
10541         15% performance improvement: from 22.5 to 19.2 seconds.
10542
10543         * expression.cs (IsParamsMethodApplicable): use foreach.
10544         (Invocation.DoResolve): ditto.
10545         (New.DoResolve): ditto.
10546         (ArrayCreation.DoResolve): ditto.
10547
10548         * ecore.cs (FindMostEncompassingType): use foreach.
10549
10550         * delegate.cs (NewDelegate.DoResolve): Use foreach
10551
10552         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10553         (RemoveMethods): use foreach.
10554
10555         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10556         nested foreach statements instead of for, and also break out of
10557         the inner loop once a match is found.
10558
10559         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10560
10561 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10562
10563         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10564         we actually unwrap the expression to allow for extra information
10565         to be extracted. 
10566
10567         * expression.cs: Use Shr_Un on unsigned operations. 
10568
10569 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10570
10571         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10572         applicable operators was not being considered correctly. This closes
10573         the bug Miguel reported.
10574
10575 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10576
10577         * attribute.cs: check that the type derives from System.Attribute
10578         and report the correct error in that case (moved the duplicate code to
10579         its own method, too).
10580
10581 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10582
10583         * attribute.cs: lookup attribute type name as the spec says: first the
10584         bare attribute name and then name + "Attribute" (nant compiles with
10585         mcs after this fix).
10586
10587 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10588
10589         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10590         Because of the way we parse things, we should try to see if a
10591         UIntConstant can fit in an integer.
10592
10593 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10594
10595         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10596         when we are in an explicit context.
10597
10598         (ConvertReferenceExplicit): When converting from Iface type S to Class
10599         T make sure the rules are implemented as an OR.
10600
10601         * parameter.cs (ParameterType): Make it a property for now although the
10602         purpose really isn't anything immediate.
10603
10604         * expression.cs (Is*Applicable): Do better checking on the parameter type
10605         of a ref/out parameter. The ones from the system assemblies are already 
10606         marked with the correct type so we don't need to do any correction.
10607
10608         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10609         the object type is standard too so include that.
10610
10611 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * ecore.cs (StandardConversionExists): Augment with missing code:
10614         deal with IntConstant, LongConstants and Enumerations.
10615
10616         * assign.cs: Report the error, instead of failing silently
10617
10618         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10619         typecontainer that they are declared, because the
10620         typecontainer/namespace will have the list of using clauses that
10621         need to be applied.
10622
10623         Assembly Attributes were escaping the normal registration
10624         mechanism. 
10625
10626         (EmitCode): Apply attributes within an EmitContext that represents
10627         the container they were declared on.
10628
10629         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10630
10631 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10632
10633         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10634         Revamp completely - make much cleaner as we now operate only
10635         on a set of Types.
10636
10637         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10638         to implement the logic detailed in the spec more correctly.
10639
10640         (UserDefinedConversion): Update accordingly.
10641
10642 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10643
10644         * statement.cs: Return flow analysis information up.
10645
10646         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10647         and the default.
10648
10649         (token): Do not consume an extra character before calling
10650         decimal_digits.
10651
10652 2002-05-06  Piers Haken <piersh@friskit.com>
10653
10654         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10655
10656 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10659         EmitContext during the instance constructor initializer
10660         resolution, to stop access to instance variables.
10661
10662         This is mandated by the spec, last paragraph of the `constructor
10663         initializers' section. 
10664
10665 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
10666
10667         * cs-parser.jay, class.cs (Accessor): new class used to represent
10668         an accessor (get or set).  In the past we used `null' to represent
10669         a missing accessor.  But this is ambiguous because there was no
10670         way to tell in abstract indexers/properties if one of them was
10671         specified.
10672
10673         Now there is a way of addressing that.
10674
10675         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
10676         instead of FindMembers.
10677
10678         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
10679         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
10680
10681         * attribute.cs: Treat indexers and properties as the same in terms
10682         of applying attributes
10683
10684         * ecore.cs (FindMostEncompassedType): Use statically initialized
10685         EmptyExpressions()s like we do elsewhere to avoid creating useless
10686         objects (and we take this out of the tight loop).
10687
10688         (GetConversionOperators): Move the code to extract the actual
10689         operators to a separate routine to clean things up.
10690
10691 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
10692
10693         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
10694         events are always registered FieldBuilders.
10695
10696         * class.cs (FieldBase): New class shared by Fields 
10697
10698         * delegate.cs: If we are a toplevel delegate, use our full name.
10699         If we are a nested delegate, then only use our tail name.
10700
10701 2002-05-02  Ravi Pratap  <ravi@ximian.com>
10702
10703         * expression.cs (IsApplicable): Ensure that we add the "&" to
10704         ref/out types before comparing it with the type of the argument.
10705
10706         (IsParamsMethodApplicable): Ditto.
10707
10708         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
10709         silly me ;-)
10710
10711         * delegate.cs : Handle the case when we have more than one applicable
10712         method. Flag an error only when we finish checking all.
10713
10714 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
10715
10716         * expression.cs: Add support for boolean static initializers.
10717
10718 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
10719
10720         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
10721
10722         * parameter.cs (ComputeParameterTypes,
10723         ComputeAndDefineParameterTypes): Better error handling: now we
10724         clear the `types' cache if we fail during any of the type lookups.
10725         We also return the status code correctly to our caller
10726
10727         * delegate.cs: If we fail to define a delegate, abort the extra
10728         steps. 
10729
10730         * expression.cs (Binary.ResolveOperator): for
10731         operator==(object,object) and operator !=(object, object) we also
10732         have to verify that there is an implicit conversion from one to
10733         the other.
10734
10735         (ArrayAccess.DoResolve): Array Access can operate on
10736         non-variables. 
10737
10738 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * assign.cs (CompoundAssign): A new class used as a "flag" that
10741         the assignment actually is happening as part of a compound
10742         assignment operator.
10743
10744         During compound assignment, a few new rules exist to enable things
10745         like:
10746
10747         byte b |= 1 + 2
10748
10749         From the spec:
10750
10751         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
10752         to the type of x) if y is implicitly convertible to the type of x,
10753         and the operator is a builtin operator and the return type of the
10754         operator is explicitly convertible to the type of x. 
10755
10756         * rootcontext.cs: Reset warning level to 2.  4 catches various
10757         "interesting" features in mcs, we must clean this up at some
10758         point, but currently am trying to kill other bugs ;-)
10759
10760         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
10761         in container classes as well.  
10762
10763         * expression.cs (Binary.ResolveOperator): Handle string case
10764         before anything else (as operator overloading does emit an error
10765         before doing anything else).
10766
10767         This code could go away when we move to a table driven model, but
10768         i could not come up with a good plan last night.
10769
10770 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
10771
10772         * typemanager.cs (CSharpName): reimplementation using regex.
10773         * class.cs: added null check for fields in Emit
10774         * rootcontext.cs: set warninglevel to 4
10775
10776 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
10777
10778         * typemanager.cs (CSharpName): reimplemented with Lupus
10779         suggestion.
10780
10781 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * statement.cs (If): correclty implement Resolve, because we were
10784         not catching sem errors in there.  The same process is needed
10785         everywhere else. 
10786         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
10787
10788
10789         (Statement.Warning_DeadCodeFound): Factorize code.
10790         (While): Report dead code here too.
10791
10792         (Statement): Added Resolve virtual method to allow
10793         for resolution split from the emit code.
10794
10795 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * statement.cs (EmitBoolExpression): No longer try to resolve the
10798         expression here.    
10799         (MakeBoolean): New utility function that resolve, implicitly
10800         converts to boolean and tags the expression. 
10801
10802
10803         (If, Do): Implement dead code elimination.
10804         (While): Implement loop inversion
10805
10806         (Do, While, For, If): Resolve the expression prior to calling our
10807         code generation.
10808
10809 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
10810
10811         * class.cs:
10812           - added method Report28 (warning: program has more than one entry point)
10813           - added method IsEntryPoint, implements paragraph 10.1 of the spec
10814           - modified method Method.Define, the part at the end of the method
10815
10816         * rootcontext.cs: added static public Location EntryPointLocation;
10817           
10818         * ../errors/cs0028.cs : Add test case for the above warning.              
10819
10820         * typemanager.cs:
10821           - modified method CSharpName to allow arrays of primitive type to
10822             be printed nicely (e.g. instead of System.Int32[][] it now prints
10823             int[][])
10824           - added method CSharpSignature: returns the signature of a method
10825             in string format to be used in reporting errors, warnings, etc.
10826
10827         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
10828         with String.Empty.
10829
10830 2002-04-26  Ravi Pratap  <ravi@ximian.com>
10831
10832         * delegate.cs (Define): Fix extremely silly bug where I was
10833         setting the type of the 'object' parameter of the BeginInvoke
10834         method to System.IAsyncResult instead of System.Object ;-)
10835
10836 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10837
10838         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
10839         here. 
10840
10841         (Constructor.Emit): return if we fail to initialize the
10842         constructor.  Another door closed!  
10843
10844         * expression.cs (New.DoResolve): Improve error message (from -6 to
10845         1501).  Use DeclaredOnly lookup to find the exact constructor.
10846
10847         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
10848         loop.  This is useful.
10849
10850         * cs-parser.jay: Adjust the default parameters so that destructors
10851         have the proper signature.
10852
10853 2002-04-26  Martin Baulig  <martin@gnome.org>
10854
10855         * driver.cs (LoadAssembly): If `assembly' contains any characters
10856         which are only valid in path names and not in assembly names
10857         (currently slash, backslash and point), use Assembly.LoadFrom ()
10858         instead of Assembly.Load () on the `assembly' (before iteration
10859         over the link_paths).
10860
10861 2002-04-26  Martin Baulig  <martin@gnome.org>
10862
10863         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
10864
10865 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * class.cs (Property): use the new typemanager.MemberLookup
10868
10869         (TypeContainer.MemberLookup): Implement using the
10870         TypeManager.MemberLookup now. 
10871
10872         * typemanager.cs: Make MemberLookup a function of the TypeManager,
10873         and return MemberInfos, so that these can be used without an
10874         EmitContext (what we had before).
10875
10876 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
10877
10878         * expression.cs: Fix the case where the argument to params if the
10879         type of the params.  I omitted handling this before.   Fixed
10880
10881 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10882
10883         * driver.cs: Call BootCorlib_PopulateCoreType
10884
10885         * class.cs (Property.CheckBase): Check for properties only, not
10886         for all members. 
10887
10888         * interface.cs: Temporary hack: try/catch around the
10889         CustomAttributeBuilder, because I am getting an exception that I
10890         do not understand.
10891
10892         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
10893         types whose definitions are required to be there (attributes are
10894         defined before standard types).
10895
10896         Compute definitions as we boot the various types, as they are used
10897         immediately (value_type class will need object_type, but if we do
10898         not initialize object_type, we will pass a null, which will let
10899         the runtime pick the System.Object from the existing corlib, which
10900         is not what we want).
10901
10902 2002-04-22  Patrik Torstensson <totte@labs2.com>
10903
10904         * cs-tokenizer.cs: fixed a number of trim() issues.
10905
10906 2002-04-22  Ravi Pratap  <ravi@ximian.com>
10907
10908         * expression.cs (Argument.Type): Ensure that we return the correct
10909         type when we have out or ref parameters [in which case we 
10910         append a "&"].
10911
10912 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10913
10914         * class.cs (Property, Indexer): Allow extern modifier in there. 
10915
10916         * typemanager.cs (InitBaseTypes): Initializes object_type and
10917         value_type, since those will be used early on during the bootstrap
10918         process to compile corlib.
10919
10920         (InitCoreTypes): Move code from here to InitBaseTypes.
10921
10922 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
10923
10924         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
10925         single-dimension arrays as using the ldlen opcode.  
10926
10927         Daniel Lewis discovered this optimization.  
10928
10929         * typemanager.cs: Add signature for System.Array::get_Length
10930
10931 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10932
10933         * statement.cs: report the error when the foreach does not apply to an
10934         array nor a collection.
10935
10936 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
10937
10938         * expression.cs: Add implicit conversions to the operator ~.
10939
10940         * constant.cs (DecimalConstant.Emit): Emit decimal value.
10941
10942         * typemanager.cs: Locate the decimal constructor.
10943
10944 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10945
10946         * attribute.cs: use the new property of TypeOf.
10947         * expression.cs: added 'get' property around typearg.
10948
10949         These changes fix a build breaker reported by NickD. Is this the
10950         correct way to fix?  If not, please, revert my changes and make it
10951         work :-).
10952
10953 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
10954
10955         * attribute.cs: Add support for typeof in attribute invocations.
10956         I am not sure that this is right though.
10957
10958 2002-04-14  Duncan Mak  <duncan@ximian.com>
10959
10960         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
10961         Binary.Operator.Division case.
10962
10963 2002-04-13  Ravi Pratap  <ravi@ximian.com>
10964
10965         * class.cs (DefineType): Ensure that we do a proper check on
10966         attribute types and also register it with the TypeManager.
10967
10968         (TypeContainer.Targets): The default for attribute types is
10969         AttributeTargets.All.
10970
10971         * attribute.cs (ApplyAttributes): Registering the attribute type
10972         is done elsewhere, not when we discover we have a Usage attribute.
10973
10974 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10975
10976         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
10977         and get rid of is_delegate parameter.
10978
10979         * everywhere : update.
10980
10981 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10982
10983         * cs-parser.jay (compilation_unit): Revamp completely to use
10984         some new ideas that I got from Rhys' grammar to solve the problems
10985         with assembly level attributes.
10986
10987         (outer_declaration): New grammar production.
10988
10989         (attribute_sections): Add.
10990
10991         (opt_attributes): Base on attribute_sections
10992
10993         (namespace_declaration): Allow opt_attributes to tackle the case
10994         when we have assembly level attributes - we are clever in this
10995         regard now ;-)
10996
10997         * attribute.cs (ApplyAttributes): Do not worry about assembly 
10998         attributes in the non-global context.
10999
11000         * rootcontext.cs (AddGlobalAttributes): Go back to using this
11001         instead of SetGlobalAttributes.
11002
11003         * class.cs, rootcontext.cs : Ensure we define and generate 
11004         attribute types before anything else.
11005
11006         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
11007         and flag the new error -20 for the case when the attribute type
11008         does not have valid targets specified. csc does not catch this.
11009
11010         * ../errors/errors.txt : update for error # -20
11011
11012 2002-04-11  Ravi Pratap  <ravi@ximian.com>
11013
11014         * support.cs (InternalParameters.ParameterModifier): Do some null
11015         checking and return sane values.
11016
11017         * class.cs (Method.Define): If we are a PInvoke method, ensure
11018         that we are static and extern. Report error # 601
11019
11020         * ../errors/cs0601.cs : Add test case for the above error.
11021
11022 2002-04-07  Ravi Pratap  <ravi@ximian.com>
11023
11024         * rootcontext.cs (attribute_types): We need to keep type of
11025         all attribute types separately and emit code for them first.
11026
11027         (RegisterAttribute) : Implement.
11028
11029         * class.cs (DefineType): Check if the current Type is a custom
11030         attribute type and register it accordingly.
11031
11032         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
11033         adding the first attribute twice and rename to
11034
11035         (SetGlobalAttributes): this.
11036
11037         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
11038         lookups.
11039
11040         * attribute.cs (ApplyAttributes): Take an additional argument telling us
11041         if we are processing global arguments. Hmm, I am unsure of this.
11042
11043 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11044
11045         * expression.cs: added static array of strings to avoid calling
11046         Enum.ToString () for Operator in Binary. Significant recover of
11047         performance.
11048
11049 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
11050
11051         * class.cs (FindMembers): Allow the Builders of the various
11052         members to be null.  If they are skip them.  This only happens
11053         during the PInvoke declaration.
11054
11055 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
11058         failure, so we do not keep going afterwards.
11059
11060         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
11061         wanted to pass `false' as the `is_delegate' argument.  If this is
11062         the case, why not use delegate_type == null to mean `is_delegate =
11063         false' and anything else as is_delegate = true.
11064
11065 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
11066
11067         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
11068         code for the section, not the beginning of the tests.
11069
11070 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * cfold.cs: Handle operator + (Enum x, Underlying x) 
11073
11074         * expression.cs (Binary): same.  Warn about errors where we have
11075         Enum/Enum in operator + as well.
11076
11077 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
11078
11079         * statement.cs:
11080                 - added support for switch(bool)
11081                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
11082                 - add TableSwitchEmit() to handle table-based switch statements
11083
11084 2002-04-05  Ravi Pratap  <ravi@ximian.com>
11085
11086         * expression.cs (Invocation.OverloadResolve): Factor out code which
11087         does parameter compatibility checking with arguments so that we can 
11088         re-use the code even from Delegate.VerifyApplicability
11089
11090         (VerifyArgumentsCompat): Move above code here.
11091
11092         * delegate.cs (VerifyApplicability): Get rid of duplicate code
11093         and instead make a call to the above method.
11094
11095 2002-03-31  Ravi Pratap  <ravi@ximian.com>
11096
11097         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
11098         We use it to keep track of classes which are attribute types.
11099
11100 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
11101
11102         * delegate.cs (Delegate.Define): Correctly define the types in the
11103         presence of fixed and array parameters.
11104
11105         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
11106         doing FindMembers.
11107
11108         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
11109         include NonPublic after the first iteration.
11110
11111         * class.cs (Indexer.CheckBase): Only check if both parents are
11112         non-null. 
11113
11114         * cs-parser.jay (accessor_body): If empty, set to null.
11115
11116         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
11117         same code path here to resolve constants names that we did have in
11118         MemberAccess.DoResolve.  There is too much code duplicated here.
11119
11120 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
11121
11122         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
11123
11124         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
11125         to MakeUnionSet.
11126
11127         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
11128         tokens, numbers and strings.
11129
11130         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
11131         parenthesis.
11132
11133         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
11134         asyncronous parameters and the regular parameters.  
11135
11136         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
11137         specify the target directory.
11138
11139         * expression.cs: (This.DoResolve): Simplify
11140         (As.Emit): Optimize, do not generate IsInst if the expression is
11141         always of the given type.
11142
11143         (Is.DoResolve): Bug fix, we were reporting both always/never for
11144         the is expression.
11145
11146         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
11147         creating too many unnecessary arrays.
11148
11149 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
11150
11151         * class.cs (EmitFieldInitializer): Use Assign expression to assign
11152         fields instead of rolling our own initializer.   Takes care of all
11153         implicit conversions, and drops unnecessary static checks/argument.
11154
11155 2002-03-31  Dick Porter  <dick@ximian.com>
11156
11157         * driver.cs: use the GetDirectories() return values properly, and
11158         use "/" as path separator.
11159
11160 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
11161
11162         * expression.cs (Unary): Optimize - - expr into expr.
11163         (Binary): Optimize a + (-b) into a -b.
11164
11165         * codegen.cs (CodeGen): Made all methods static.
11166
11167 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
11168
11169         * rootcontext.cs: 
11170
11171         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
11172         TypeBuilder property.
11173
11174         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
11175         instead. 
11176
11177         * tree.cs: Removed the various RecordXXXX, and replaced with a
11178         single RecordDecl.  Removed all the accessor methods, and just
11179         left a single access point Type 
11180
11181         * enum.cs: Rename DefineEnum to DefineType.
11182
11183         * decl.cs: New abstract method `DefineType' used to unify the
11184         Defines for Enumerations, Interfaces, TypeContainers and
11185         Delegates.
11186
11187         (FindType): Moved LookupInterfaceOrClass here.  Moved the
11188         LookupBaseClasses method that used to live in class.cs and
11189         interface.cs here, and renamed to FindType.
11190
11191         * delegate.cs: Implement DefineType.  Take advantage of the
11192         refactored pattern for locating the parent builder without taking
11193         the parent_builder argument (which we know does not work if we are
11194         nested, and triggering a toplevel definition).
11195
11196 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11197
11198         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
11199         accessibility of a member has changed during override and report
11200         an error if so.
11201
11202         * class.cs (Method.Define, Property.Define): Only complain on
11203         overrides if the method is private, any other accessibility is
11204         fine (and since we just checked the permission is the same, we are
11205         good to go).
11206
11207         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
11208         and elif are processed always.  The other pre-processing
11209         directives are only processed if we are "taking" the path
11210
11211 2002-03-29  Martin Baulig  <martin@gnome.org>
11212
11213         * class.cs (Method.Emit): Only emit symbolic debugging info if the
11214         current location is not Null.
11215
11216         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
11217         a separate method so we can profile it.
11218
11219         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
11220         `span.Seconds' are just seconds, but no minutes or hours.
11221         (MainDriver): Profile the CodeGen.SaveSymbols calls.
11222
11223 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11224
11225         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
11226         Remove the gratuitous set of Final:
11227
11228                                 // If an interface implementation, then we can set Final.
11229                                 if (((flags & MethodAttributes.Abstract) == 0) &&
11230                                     implementing.DeclaringType.IsInterface)
11231                                         flags |= MethodAttributes.Final;
11232
11233         I do not know what I was smoking when I used that.
11234
11235
11236         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
11237         step into fixing the name resolution issues for delegates and
11238         unifying the toplevel name resolution.
11239
11240 2002-03-28  Martin Baulig  <martin@gnome.org>
11241
11242         * class.cs (Method.Emit): If we have a symbol writer, call its
11243         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
11244         tell it about the current method.
11245
11246         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
11247         writer that we're going to emit the first byte of IL code for a new
11248         statement (a new source line).
11249         (EmitContext.EmitTopBlock): If we have a symbol writer, call
11250         EmitContext.Mark() before emitting any code.
11251
11252         * location.cs (SymbolDocument): Return null when we're Null.
11253
11254         * statement.cs (Statement): Moved the `Location loc' variable here.
11255         (Statement.EmitBoolExpression): If we have a symbol writer, call
11256         ec.Mark() before emitting any code to tell it that we're at the
11257         beginning of a new statement.
11258         (StatementExpression): Added `Location' argument to the constructor.
11259         (Block): Added public readonly variable `StartLocation' and public
11260         variable `EndLocation'.  The latter is to be set using SetEndLocation().
11261         (Block): Added constructor which takes a start and end location.
11262         (Block.SetEndLocation): New method. This sets the end location.
11263         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
11264         local variables we create.
11265         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
11266         each statement and do also mark the begin and end of the block.
11267
11268         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
11269         tell it the current lexer.Location, use Location.Null for the end of the
11270         block.
11271         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
11272         current block, set its end location using SetEndLocation().
11273         (statement_expression): StatementExpression constructor now takes the
11274         lexer.Location as additional argument.
11275         (for_statement, declare_local_variables): Likewise.
11276         (declare_local_variables): When creating a new implicit block, use the
11277         new Block constructor and pass it the lexer.Location.
11278
11279 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11280
11281         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
11282         members also on the parent interfaces recursively.
11283
11284 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
11285
11286         * report.cs: Use new formats, since Gonzalo finished the missing
11287         bits. 
11288
11289         * expression.cs (Binary.ResolveOperator): added missing operator|
11290         operator& and operator^ for bool/bool.
11291
11292         * cs-parser.jay: CheckDef now takes a Location argument that is
11293         used to report errors more precisly (instead of reporting the end
11294         of a definition, we try to track something which is a lot closer
11295         to the source of the problem).
11296
11297         * cs-tokenizer.cs: Track global token use, so we can properly flag
11298         the use of #define/#undef after the first token has been seen.
11299
11300         Also, rename the reportXXXX to Error_DescriptiveName
11301
11302         * decl.cs (DeclSpace.IsTopLevel): Move property here from
11303         TypeContainer, so that Enum and Interface can use this too.
11304
11305         * class.cs (TypeContainer.LookupInterfaceOrClass,
11306         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
11307         `builder' argument.  Typically this was used to pass the parent
11308         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
11309         the definition).  
11310
11311         The problem is that a nested class could trigger the definition of
11312         a toplevel class, and the builder would be obviously wrong in that
11313         case. 
11314
11315         So we drop this argument, and we compute dynamically the
11316         TypeBuilder/ModuleBuilder (the correct information was available
11317         to us anyways from DeclSpace.Parent)
11318
11319         * interface.cs (Interface.DefineInterface): Drop builder
11320         parameter cleanup like class.cs
11321
11322         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
11323         like class.cs
11324
11325         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
11326         values. 
11327
11328         (Try.Emit): Propagate the returns value from the statement.
11329
11330         (Return.Emit): Even if we are leavning 
11331
11332         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
11333
11334         * modifiers.cs: Fix the computation of MethodAttributes flags.
11335
11336 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
11337
11338         * driver.cs: allow compilation of files that start with '/'.
11339         Add a default case when checking the argument of --target.
11340
11341 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
11342
11343         * interface.cs: Implement the same search algorithm for types in
11344         the interface code.
11345
11346         * delegate.cs: Do not allow multiple definition.
11347
11348         * Recovered ChangeLog that got accidentally amputated
11349
11350         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
11351
11352         * rootcontext.cs: Load manually enum to allow core classes to
11353         contain enumerations.
11354
11355         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
11356         Update to new static methods in TypeManager.
11357
11358         * typemanager.cs (GetMethod, GetConstructor): Use our
11359         implementation of FindMembers to find the members, since during
11360         corlib compilation, the types are TypeBuilders and GetMethod and
11361         GetConstructor do not work.
11362
11363         Make all methods in TypeManager static.
11364
11365         (InitCodeHelpers): Split the functionality from
11366         the InitCodeTypes function.
11367
11368         * driver.cs: Call InitCodeHelpers after we have populated the
11369         types. 
11370
11371         * cs-parser.jay (delegate_declaration): we did not used to compute
11372         the delegate name correctly for void delegates.
11373
11374 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
11375
11376         * rootcontext.cs (RootContext): Init the interface_resolve_order
11377         and type_container_resolve_order always.
11378
11379         (ResolveCore, BootstrapCorlib_ResolveClass,
11380         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
11381         compiler when compiling with --nostdlib
11382
11383         * class.cs (TypeContainer.DefineType): Check that our parent is
11384         not null.  This test is most important when we are bootstraping
11385         the core types.
11386
11387         * codegen.cs: Split out the symbol writing code.
11388
11389 2002-03-25  Martin Baulig  <martin@gnome.org>
11390
11391         * driver.cs (-g): Made -g an alias for --debug.
11392
11393 2002-03-24  Martin Baulig  <martin@gnome.org>
11394
11395         * codegen.cs (SymbolWriter): New public variable. Returns the
11396         current symbol writer.
11397         (CodeGen): Added `bool want_debugging_support' argument to the
11398          constructor. If true, tell the ModuleBuild that we want debugging
11399         support and ask it for the ISymbolWriter.
11400         (Save): If we have a symbol writer, call it's Close() method after
11401         saving the assembly.
11402
11403         * driver.c (--debug): New command line argument to create a
11404         debugger information file.
11405
11406         * location.cs (SymbolDocument): New public property. Returns an
11407         ISymbolDocumentWriter object for the current source file or null
11408         if we don't have a symbol writer.
11409
11410 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
11411
11412         * driver.cs (LoadAssembly): Correctly return when all the paths
11413         have been tried and not before.
11414
11415         * statement.cs (Switch.Emit): return the actual coverage for this
11416         statement (returns/not-returns)
11417
11418         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
11419         switch of the statement if we are the last switch section.  That
11420         kills two problems: try/catch problems (we used to emit an empty
11421         nop at the end) and switch statements where all branches would
11422         return. 
11423
11424 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
11425
11426         * driver.cs: Add default assemblies (the equivalent to the
11427         Microsoft CSC.RSP file)
11428
11429         * cs-tokenizer.cs: When updating `cols and setting it to zero,
11430         also update tokens_seen and set it to false.
11431
11432         * driver.cs: Implement --recurse for Mike.
11433
11434         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
11435         correctly splitting out the paths.
11436
11437 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
11438
11439         * interface.cs (Interface.PopulateProperty): Instead of using
11440         `parent' as the declaration space for the set parameters, use
11441         `this' 
11442
11443         * support.cs (InternalParameters): InternalParameters constructor
11444         takes a DeclSpace instead of a TypeContainer.
11445
11446         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
11447         types are being initialized, load the address of it before calling
11448         the function.  
11449
11450         (New): Provide a mechanism to disable the generation of local
11451         value type temporaries when the caller will be providing us with
11452         an address to store it.
11453
11454         (ArrayCreation.EmitDynamicInitializers): Use it.
11455
11456 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
11457
11458         * expression.cs (Invocation.EmitArguments): Only probe for array
11459         property if there is more than one argument.  Sorry about that.
11460
11461         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
11462         empty param arrays.
11463
11464         * class.cs (Method.LabelParameters): Fix incorrect code path that
11465         prevented the `ParamArrayAttribute' from being applied to the
11466         params attribute.
11467
11468 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
11469
11470         * support.cs (ReflectionParameters): Correctly compute whether the
11471         last argument is a params array.  Fixes the problem with
11472         string.Split ('a')
11473
11474         * typemanager.cs: Make the assemblies array always be non-null
11475         (empty, but non-null)
11476
11477         * tree.cs (RecordDecl): New function that abstracts the recording
11478         of names.  This reports error 101, and provides a pointer to the
11479         previous declaration.  Fixes a crash in the compiler.
11480
11481         * cs-parser.jay (constructor_declaration): Update to new grammar,
11482         and provide a constructor_body that can be empty.
11483
11484 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11485
11486         * driver.cs: Add support for --resources.
11487
11488         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11489         Make all types for the various array helper methods be integer.
11490
11491         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11492         CheckState to ConvCast.
11493
11494         (ConvCast): Now it takes a `checked' state argument, to avoid
11495         depending on the emit context for the conversion, and just using
11496         the resolve time setting.
11497
11498         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11499         instead of Invocation.EmitArguments.  We do not emit the original
11500         arguments, instead we emit those which have been converted to
11501         unsigned int expressions.
11502
11503         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11504
11505         * codegen.cs: ditto.
11506
11507         * expression.cs (LocalVariableReference): Drop the use of the
11508         Store function that depended on the variable index.
11509
11510         * statement.cs (VariableInfo): Drop the `Idx' property from this
11511         class, as this is not taking into account the indexes for
11512         temporaries tat we generate during the execution, getting the
11513         indexes wrong.
11514
11515         * class.cs: First emit class initializers, then call the parent
11516         constructor. 
11517
11518         * expression.cs (Binary): Fix opcode emision.
11519         (UnaryMutator.EmitCode): Support checked code generation
11520
11521         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11522         matches for events for both the Static and Instance scans,
11523         pointing to the same element.   Fix that.
11524
11525 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * rootcontext.cs (ResolveTree): Always set the
11528         interface_resolve_order, because nested interfaces will be calling
11529         into us.
11530
11531         * class.cs (GetInterfaceOrClass): Track the same resolution
11532         process used by TypeManager.LookupType.  This fixes the nested
11533         type lookups in class declarations (separate path from
11534         LookupType). 
11535
11536         (TypeContainer.DefineType): Also define nested interfaces.
11537         (TypeContainer.RegisterOrder): New public function used to
11538         register the order in which child interfaces need to be closed.
11539
11540         Nested interfaces need to be closed after their parents have been
11541         created. 
11542
11543         * interface.cs (InterfaceAttr): Put all the logic for computing
11544         the interface attribute here. 
11545
11546         (DefineInterface): Register our interface order with the
11547         RootContext or with the TypeContainer depending on the case.
11548
11549 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * cs-parser.jay: rework foreach statement to work with the new
11552         changes to the policy on SimpleNames.
11553
11554         * report.cs: support Stacktrace on warnings as well.
11555
11556         * makefile: drop --unsafe and /unsafe from the compile.
11557
11558 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11559
11560         * ecore.cs (StandardConversionExists): Modify to take an Expression
11561         as the first parameter. Ensure we do null -> reference type conversion
11562         checking.
11563
11564         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11565         temporary Expression objects.
11566
11567 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11568
11569         * interface.cs: workaround bug in method overloading resolution
11570         (there is already a bugzilla bug for it).
11571
11572 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11573
11574         We could also solve this problem by having a separate path for
11575         performing type lookups, instead of DoResolve, we could have a
11576         ResolveType entry point, and only participating pieces of the
11577         production (simplename, deref, array) would implement this. 
11578
11579         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11580         signal SimpleName to only resolve type names and not attempt to
11581         resolve anything else.
11582
11583         * expression.cs (Cast): Set the flag.
11584
11585         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11586
11587         * class.cs: Only report 108 if there is no `new' modifier.
11588
11589         * cs-parser.jay: rework foreach statement to work with the new
11590         changes to the policy on SimpleNames.
11591
11592         * report.cs: support Stacktrace on warnings as well.
11593
11594         * makefile: drop --unsafe and /unsafe from the compile.
11595
11596 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11597
11598         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11599         lookups here, instead of doing that at parse time.  This means
11600         that our grammar will not introduce `LocalVariableReferences' as
11601         expressions at this point.  That solves the problem of code like
11602         this:
11603
11604         class X {
11605            static void Main ()
11606            { int X = 1;
11607             { X x = null }}}
11608
11609         This is only half the fix.  The full fix requires parameters to
11610         also be handled in this way.
11611
11612         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11613         makes the use more obvious of the DeclSpace.  The
11614         ec.TypeContainer.TypeBuilder is now only used to pull the
11615         TypeBuilder for it.
11616
11617         My theory is that I can get rid of the TypeBuilder completely from
11618         the EmitContext, and have typecasts where it is used (from
11619         DeclSpace to where it matters).  
11620
11621         The only pending problem is that the code that implements Aliases
11622         is on TypeContainer, and probably should go in DeclSpace.
11623
11624         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11625         lookups here, instead of doing that at parse time.  This means
11626         that our grammar will not introduce `LocalVariableReferences' as
11627         expressions at this point.  That solves the problem of code like
11628         this:
11629
11630         class X {
11631            static void Main ()
11632            { int X = 1;
11633             { X x = null }}}
11634
11635         This is only half the fix.  The full fix requires parameters to
11636         also be handled in this way.
11637
11638         * class.cs (Property.DefineMethod): When implementing an interface
11639         method, set newslot, when implementing an abstract method, do not
11640         set the flag (before we tried never setting it, or always setting
11641         it, which is the difference).
11642         (Indexer.DefineMethod): same.
11643         (Method.DefineMethod): same.
11644
11645         * ecore.cs: Only set the status used flag if we get back a Field.
11646
11647         * attribute.cs: Temporary hack, so Paolo can keep working.
11648
11649 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11650
11651         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11652         the unmanaged type in the case we have a MarshalAs attribute.
11653
11654         (Resolve): Handle the case when we are parsing the special MarshalAs
11655         attribute [we need to store the unmanaged type to use later]
11656
11657         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11658         MarshalAs Attribute.
11659
11660         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11661         on parameters and accordingly set the marshalling info.
11662
11663 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * class.cs: Optimizing slightly by removing redundant code after
11666         we switched to the `NoTypes' return value.
11667         (Property.DefineMethod): use NoTypes here too.
11668
11669         This fixes the bug I introduced in my last batch of changes.
11670
11671 2002-03-05  Ravi Pratap  <ravi@ximian.com>
11672
11673         * tree.cs (RecordEnum): Add. We now keep track of enums too.
11674
11675         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
11676         Enums since those are types too. 
11677
11678         * cs-parser.jay (enum_declaration): Record enums as we parse them.
11679
11680         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
11681         thanks to a call during the lookup process.
11682
11683 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
11684
11685         * statement.cs (Foreach): Lots of work to accomodate a particular
11686         kind of foreach statement that I had not kept in mind.  It is
11687         possible to have foreachs on classes that provide a GetEnumerator
11688         method that return objects that implement the "pattern" for using
11689         a foreach, there is no need to support GetEnumerator
11690         specifically. 
11691
11692         This is needed to compile nant.
11693
11694         * decl.cs: Only report 114 if the member is not `Finalize' and if
11695         the warning level is at least 2.
11696
11697         * class.cs: Moved the compare function from Method to
11698         MethodSignature. 
11699
11700         (MethodSignature.InheritableMemberSignatureCompare): Add new
11701         filter function that is used to extract inheritable methods from a
11702         class. 
11703
11704         (Method.Define): Use the new `inheritable_method_signature_filter'
11705         delegate
11706
11707         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
11708         command. 
11709
11710 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
11713
11714         * cs-parser.jay: Add opt_semicolon to the interface declaration.
11715
11716         * expression.cs: Pass location information to
11717         ConvertImplicitStandard. 
11718
11719         * class.cs: Added debugging code to track return values from
11720         interfaces. 
11721
11722 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * expression.cs (Is.DoResolve): If either side of the `is' is an
11725         interface, do not flag the warning.
11726
11727         * ecore.cs (ImplicitReferenceConversion): We need a separate test
11728         for interfaces
11729
11730         * report.cs: Allow for --fatal to be used with --probe.
11731
11732         * typemanager.cs (NoTypes): Move the definition for the empty Type
11733         array here. 
11734
11735         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
11736         properties. 
11737         (TypeContainer.DefineProxy): New function used to proxy to parent
11738         implementations when implementing interfaces.
11739         (TypeContainer.ParentImplements): used to lookup if our parent
11740         implements a public function that is required by an interface.
11741         (TypeContainer.VerifyPendingMethods): Hook this up.
11742
11743         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
11744         `modules' and `assemblies' arraylists into arrays.  We only grow
11745         these are the very early start up of the program, so this improves
11746         the speedof LookupType (nicely measured).
11747
11748         * expression.cs (MakeByteBlob): Replaced unsafe code with
11749         BitConverter, as suggested by Paolo.
11750
11751         * cfold.cs (ConstantFold.Binary): Special case: perform constant
11752         folding of string concatenation, but if either side is a string,
11753         and the other is not, then return null, and let the runtime use
11754         the concatenation on the string plus the object (using
11755         `Object.ToString'). 
11756
11757 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
11758
11759         Constant Folding has been implemented now.
11760
11761         * expression.cs (Unary.Reduce): Do not throw an exception, catch
11762         the error instead on types that are not supported in one's
11763         complement. 
11764
11765         * constant.cs (Constant and all children): New set of functions to
11766         perform implict and explicit conversions.
11767
11768         * ecore.cs (EnumConstant): Implement the new functions to perform
11769         conversion by proxying to the child expression.
11770
11771         * codegen.cs: (ConstantCheckState): Constant evaluation has its
11772         own separate setting that can not be turned off from the command
11773         line using --unchecked or --checked and is only controlled using
11774         the checked/unchecked statements and expressions.  This setting is
11775         used by the constant folder to flag errors.
11776
11777         * expression.cs (CheckedExpr, UncheckedExpr): Set the
11778         ConstantCheckState as well.   
11779
11780         During Resolve, they also have to flag the state, because the
11781         constant folder runs completely in the Resolve phase.
11782
11783         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
11784         well.
11785
11786 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11787
11788         * cfold.cs: New file, this file contains the constant folder.
11789
11790         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
11791         argument to track whether we are using the resulting address to
11792         load or store a value and provide better error messages. 
11793
11794         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
11795         new AddressOf arguments.
11796
11797         * statement.cs (Foreach.EmitCollectionForeach): Update
11798
11799         * expression.cs (Argument.Emit): Call AddressOf with proper
11800         arguments to track usage.
11801
11802         (New.DoEmit): Call AddressOf with new arguments.
11803
11804         (Unary.Emit): Adjust AddressOf call.
11805
11806 2002-03-01  Ravi Pratap  <ravi@ximian.com>
11807
11808         * cs-parser.jay (member_access): Change the case for pre-defined types
11809         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
11810         this suggestion.
11811
11812         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
11813         a method body.
11814
11815         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
11816         essentially like methods and apply attributes like MethodImplOptions to them too.
11817
11818         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
11819         not being null.
11820
11821         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
11822         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
11823         is the DeclSpace.
11824
11825         * Update code everywhere accordingly.
11826
11827         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
11828
11829         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
11830
11831 2002-02-28  Ravi Pratap  <ravi@ximian.com>
11832
11833         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
11834         try performing lookups against those instead of jumping straight into using
11835         the 'using' clauses.
11836
11837         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
11838
11839         (LookupType): Perform lookups in implicit parents too.
11840
11841         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
11842         sequence as RootContext.LookupType. 
11843
11844         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
11845         the various cases of namespace lookups into this method.
11846
11847 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11848
11849         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
11850         in positional arguments)
11851
11852         * class.cs (Operator): Update the AllowedModifiers to contain
11853         extern. 
11854
11855         * cs-parser.jay: Update operator declaration to allow for the
11856         operator body to be empty.
11857
11858         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
11859         values. 
11860
11861 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
11862
11863         * class.cs (Method.Emit): Label parameters.
11864
11865         * driver.cs: Return 1 or 0 as the program exit code.
11866
11867 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
11868
11869         * expression.cs: Special case the `null' object when trying to
11870         auto-compute the type, as anything can be explicitly converted to
11871         that. 
11872
11873         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
11874         spotting this Paolo.
11875
11876         (Expression.ImplicitNumericConversion): Perform comparissions of
11877         the type using the underlying type in the case of an enumeration
11878         rather than using the enumeration type for the compare.
11879
11880         Cope with the underlying == type case, which is not possible to
11881         catch before. 
11882
11883         (Expression.ConvertNumericExplicit): Perform comparissions of
11884         the type using the underlying type in the case of an enumeration
11885         rather than using the enumeration type for the compare.
11886
11887         * driver.cs: If the user does not supply an extension, assume .exe
11888
11889         * cs-parser.jay (if_statement): Rewrote so that we can track the
11890         location for the if statement.
11891
11892         * expression.cs (Binary.ConstantFold): Only concat strings when
11893         the operation is "+", not everything ;-)
11894
11895         * statement.cs (Statement.EmitBoolExpression): Take a location
11896         argument. 
11897         (If, While, Do): Track location.
11898
11899         * expression.cs (Binary.ResolveOperator): In the object + string
11900         case, I was missing a call to ConvertImplicit
11901
11902 2002-02-25  Ravi Pratap  <ravi@ximian.com>
11903
11904         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
11905         Location arguments. Ensure we use RootContext.LookupType to do our work
11906         and not try to do a direct Type.GetType and ModuleBuilder.GetType
11907
11908         * interface.cs (PopulateMethod): Handle the type of the parameter being
11909         null gracefully.
11910
11911         * expression.cs (Invocation.BetterFunction): Handle the case when we 
11912         have a params method with no fixed arguments and a call is made with no
11913         arguments.
11914
11915 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
11918         the verbatim-string-literal
11919
11920         * support.cs (InternalParameters.ParameterModifier): handle null
11921         fixed parameters.
11922         (InternalParameters.ParameterType): ditto.
11923
11924         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
11925         duplicating the name of the variable parameter.
11926         (GetParameterByName): Fix bug where we were not looking up array
11927         paramters if they were the only present (thanks Paolo!).
11928         (GetParameterInfo): We only have an empty set of types if both
11929         fixed and array are set to null.
11930         (GetParameterInfo-idx): Handle FixedParameter == null
11931
11932         * cs-parser.jay: Handle the case where there is no catch
11933         statements (missing null test).
11934
11935 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
11936
11937         * driver.cs (MainDriver): Be conservative on our command line
11938         handling.
11939
11940         Catch DirectoryNotFoundException when calling GetFiles.
11941
11942         (SplitPathAndPattern): Used to split the input specification into
11943         a path and a pattern that we can feed to Directory.GetFiles.
11944
11945 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
11946
11947         * statement.cs (Fixed): Implement the last case of the Fixed
11948         statement (string handling).
11949
11950         * expression.cs (StringPtr): New class used to return a char * to
11951         a string;  Used by the Fixed statement.
11952
11953         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
11954
11955         * expression.cs (Binary.ResolveOperator): Remove redundant
11956         MemberLookup pn parent type.
11957         Optimize union call, we do not need a union if the types are the same.
11958         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
11959         type.
11960
11961         Specialize the use of MemberLookup everywhere, instead of using
11962         the default settings. 
11963
11964         (StackAlloc): Implement stackalloc keyword.
11965
11966         * cs-parser.jay: Add rule to parse stackalloc.
11967
11968         * driver.cs: Handle /h, /help, /?
11969
11970         * expression.cs (MakeByteBlob): Removed the hacks we had in place
11971         before we supported unsafe code.
11972
11973         * makefile: add --unsafe to the self compilation of mcs.
11974
11975 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
11976
11977         * expression.cs (PointerArithmetic): New class that is used to
11978         perform pointer arithmetic.
11979         (Binary.Resolve): Handle pointer arithmetic
11980         Handle pointer comparission.
11981         (ArrayPtr): Utility expression class that is used to take the
11982         address of an array.
11983
11984         (ElementAccess): Implement array access for pointers
11985
11986         * statement.cs (Fixed): Implement fixed statement for arrays, we
11987         are missing one more case before we are done.
11988
11989         * expression.cs (Indirection): Implement EmitAssign and set the
11990         ExprClass to Variable.  This allows pointer dereferences to be
11991         treated as variables, and to have values assigned to them.
11992
11993         * ecore.cs (Expression.StoreFromPtr): New utility function to
11994         store values dereferencing.
11995
11996 2002-02-20  Ravi Pratap  <ravi@ximian.com>
11997
11998         * expression.cs (Binary.ResolveOperator): Ensure that we are
11999         not trying to operate on a void type - this fixes the reported
12000         bug.
12001
12002         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
12003         the parent implementation is sealed.
12004
12005         * ../errors/cs0239.cs : Add.
12006
12007         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
12008
12009         * typemanager.cs (unverifiable_code_type): Corresponds to 
12010         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
12011         which have unsafe code in them.
12012
12013         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
12014         unsafe context.
12015
12016 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
12017
12018         * cs-tokenizer.cs: Add support for @"litreal strings"
12019
12020         Make tokenizer accept pre-processor directives
12021         on any column (remove the old C-like limitation). 
12022
12023         * rootcontext.cs (EmitCode): Emit any global attributes.
12024         (AddGlobalAttributes): Used to keep track of assembly attributes. 
12025
12026         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
12027
12028         * cs-parser.jay: Add support for global attributes.  
12029
12030 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
12031
12032         * expression.cs (Indirection): New helper class.  Unary will
12033         create Indirection classes to be able to implement the
12034         IMemoryLocation interface on it.
12035
12036 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * cs-parser.jay (fixed_statement): reference the right statement.
12039
12040         * statement.cs (Fixed.Emit): Finish implementing the fixed
12041         statement for the &x case.
12042
12043 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
12044
12045         * class.cs (Property.Define, Method.Define): Remove newslot when
12046         `implementing'.  
12047
12048         * modifiers.cs: My use of NewSlot when `Abstract' was set was
12049         wrong.  NewSlot should only be used if the `new' keyword is present.
12050
12051         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
12052         locating our system dir.  Sorry about this.
12053
12054 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12055
12056         * driver.cs (GetSystemDir): Compute correctly the location of our
12057         system assemblies.  I was using the compiler directory instead of
12058         the library directory.
12059
12060 2002-02-13  Ravi Pratap  <ravi@ximian.com>
12061
12062         * expression.cs (BetterFunction): Put back in what Miguel commented out
12063         since it is the correct fix. The problem is elsewhere ;-)
12064
12065         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
12066         parameters of the parms method are themselves compatible or not !
12067
12068         (StandardConversionExists): Fix very dangerous bug where we were forgetting
12069         to check that a class implements an interface before saying that an implicit
12070         conversion was allowed. Use ImplementsInterface to do the checking.
12071
12072 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12073
12074         * class.cs (Method.Define): Track whether we are an explicit
12075         implementation or not.  And only call DefineMethodOverride if we
12076         are an explicit implementation.
12077
12078         (Property.DefineMethod): Ditto.
12079
12080 2002-02-11  Ravi Pratap  <ravi@ximian.com>
12081
12082         * expression.cs (BetterFunction): Catch hideous bug which was
12083          preventing us from detecting ambiguous calls due to implicit casts i.e
12084         cs0121.
12085
12086 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
12087
12088         * support.cs (Pair): Remove un-needed method.  I figured why I was
12089         getting the error in cs-parser.jay, the variable in a foreach loop
12090         is readonly, and the compiler does not really treat this as a variable.
12091
12092         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
12093         instead of EQUALS in grammar.  
12094
12095         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
12096
12097         * expression.cs (Unary.DoResolve): Check whether the argument is
12098         managed or not.
12099
12100 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * support.cs: Api for Pair to set a value.  Despite the fact that
12103         the variables are public the MS C# compiler refuses to compile
12104         code that accesses the field if the variable is part of a foreach
12105         statement. 
12106
12107         * statement.cs (Fixed): Begin implementation of the fixed
12108         statement.
12109
12110         (Block.AddVariable): Return the VariableInfo on success and null
12111         on failure instead of true/false. 
12112
12113         * cs-parser.jay (foreach): Catch errors on variables already
12114         defined (we were ignoring this value before) and properly unwind
12115         the block hierarchy
12116
12117         (fixed_statement): grammar for the fixed statement.
12118
12119 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
12120
12121         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
12122         pointer types to be incretemented.
12123
12124         (SizeOf): Implement.
12125
12126         * cs-parser.jay (pointer_member_access): Implement
12127         expr->IDENTIFIER production.
12128
12129         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
12130         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
12131         on safe contexts.
12132
12133         (Unary): Implement indirection.
12134
12135         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
12136         use in non-unsafe context).
12137
12138         (SimpleName.DoResolve): Check for pointers in field access on safe
12139         contexts. 
12140
12141         (Expression.LoadFromPtr): Factor the load-indirect code in this
12142         function.  This was duplicated in UnboxCast and ParameterReference
12143
12144 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
12145
12146         * expression.cs (ComposedCast): report an error if a pointer cast
12147         is used in a safe region.
12148
12149         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
12150         pointer type casts in unsafe context.
12151
12152         * codegen.cs (EmitContext): Set up IsUnsafe.
12153
12154         * cs-parser.jay (non_expression_type): Add productions for pointer
12155         casts. 
12156
12157         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
12158         code.  We should not use force into static mode if the method is
12159         not virtual.  Fixes bug in MIS
12160
12161         * statement.cs (Do.Emit, While.Emit, For.Emit,
12162         Statement.EmitBoolExpression): Add support to Do and While to
12163         propagate infinite loop as `I do return' semantics.
12164
12165         Improve the For case to also test for boolean constants.
12166
12167         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
12168         to the list of attributes we can add.
12169
12170         Remove `EmitContext' argument.
12171
12172         * class.cs (Method.Define): Apply parameter attributes.
12173         (Constructor.Define): Apply parameter attributes.
12174         (MethodCore.LabelParameters): Move here the core of labeling
12175         parameters. 
12176
12177         * support.cs (ReflectionParameters.ParameterModifier,
12178         InternalParameters.ParameterModifier): Use IsByRef on the type and
12179         only return the OUT bit for these parameters instead of in/out/ref
12180         flags.
12181
12182         This is because I miss-understood things.  The ParameterInfo.IsIn
12183         and IsOut represent whether the parameter has the [In] and [Out]
12184         attributes set.  
12185
12186 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * ecore.cs (FieldExpr.Emit): Release temporaries.
12189
12190         * assign.cs (LocalTemporary.Release): new function.
12191
12192         * codegen.cs (EmitContext.GetTemporaryStorage,
12193         EmitContext.FreeTemporaryStorage): Rework the way we deal with
12194         temporary storage.  Now we can "put back" localbuilders when we
12195         are done with them
12196
12197 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
12200         need to make a copy of the variable to generate verifiable code.
12201
12202 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * driver.cs: Compute dynamically the system directory.
12205
12206         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
12207         Slower, but more generally useful.  Used by the abstract
12208         registering implementation. 
12209
12210         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
12211         the rules for the special rule on Type/instances.  First check if
12212         we have the same name, and if so, try that special static path
12213         rather than the instance path.
12214
12215 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
12218         for, while and if.
12219
12220         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
12221         Enum, ValueType, Delegate or Array for non-corlib compiles.
12222
12223         * cs-tokenizer.cs: Catch long identifiers (645)
12224
12225         * typemanager.cs (IndexerPropetyName): Ravi never tested this
12226         piece of code.
12227
12228         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
12229         fix, we were returning too early, so we were not registering
12230         pending methods from abstract classes.
12231
12232         Do not register pending methods if the class is abstract.
12233
12234         * expression.cs (Conditional.DoResolve): Report circular implicit
12235         conversions when we neecd to compute it for conditional
12236         expressions. 
12237
12238         (Is.DoResolve): If the expression is always of the provided type,
12239         flag warning 183.  If the expression can not ever be of the
12240         provided type flag warning 184.
12241
12242         * class.cs: Catch 169 as well.
12243
12244         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
12245         read. 
12246
12247 2002-01-18  Nick Drochak  <ndrochak@gol.com>
12248
12249         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
12250
12251 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
12252
12253         * interface.cs: (PopulateMethod): Check for pointers being defined
12254         only if the unsafe context is active.
12255         (PopulateProperty): ditto.
12256         (PopulateIndexer): ditto.
12257
12258         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
12259         specified.  If pointers are present, make sure that they are
12260         present in an unsafe context.
12261         (Constructor, Constructor.Define): ditto.
12262         (Field, Field.Define): ditto.
12263         (Property, Property.Define): ditto.
12264         (Event, Event.Define): ditto.
12265
12266         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
12267         hashtable if there are classes or structs defined.
12268
12269         * expression.cs (LocalVariableReference.DoResolve): Simplify this
12270         code, as the constant resolution moved.
12271
12272         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
12273         the metadata, so we can flag error 133. 
12274
12275         * decl.cs (MemberCore.UnsafeOK): New function to test that a
12276         pointer is being declared in an unsafe context.
12277
12278 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
12279
12280         * modifiers.cs (Modifiers.Check): Require a Location argument.
12281         Report error 227 for Unsafe use.
12282
12283         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
12284
12285         * statement.cs (For.Emit): If the test is null, then report that
12286         we do `return', as we wont reach anything afterwards.
12287
12288         (Switch.SwitchGoverningType): Track the expression that matched
12289         the conversion.
12290
12291         * driver.cs: Allow negative numbers as an error code to flag.
12292
12293         * cs-parser.jay: Handle 1551.
12294
12295         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
12296
12297 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12298
12299         * cs-parser.jay: Report 1518 (type declaration can only contain
12300         class, struct, interface, enum or delegate)
12301
12302         (switch_label): Report 1523 (keywords `case' or `default' must
12303         preced code)
12304
12305         (opt_switch_sections): Report 1522 (empty switch)
12306
12307         * driver.cs: Report 1515 (response file specified multiple times)
12308         Report 1516 (Source file specified multiple times).
12309
12310         * expression.cs (Argument.Resolve): Signal 1510
12311
12312         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
12313         access not allowed in static code)
12314
12315 2002-01-11  Ravi Pratap  <ravi@ximian.com>
12316
12317         * typemanager.cs (IsPointerType): Utility method which we are going
12318         to need a lot.
12319
12320         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
12321         the object type, so we take care of that.
12322
12323         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
12324
12325         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
12326         added to non-params parameters :-)
12327
12328         * typemanager.cs (CSharpName): Include 'void' type too. 
12329
12330         (void_ptr_type): Include in the set of core types.
12331
12332         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
12333         duplicating code.
12334
12335         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
12336         an unsafe context.
12337
12338         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
12339         completely forgotten about it.
12340
12341 2002-01-10  Ravi Pratap  <ravi@ximian.com>
12342
12343         * cs-parser.jay (pointer_type): Add. This begins our implementation
12344         of parsing rules for unsafe code.
12345
12346         (unsafe_statement): Implement.
12347
12348         (embedded_statement): Modify to include the above.
12349
12350         * statement.cs (Unsafe): Implement new class for unsafe blocks.
12351
12352         * codegen.cs (EmitContext.InUnsafe): Add. This determines
12353         if the current context is an unsafe one.
12354
12355         * cs-parser.jay (local_variable_pointer_type): Since local variable types
12356         are handled differently, we need separate rules for them.
12357
12358         (local_variable_declaration): Update to use local_variable_pointer_type
12359         to allow variable declarations of unmanaged pointer types.
12360
12361         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
12362         in unsafe contexts.
12363
12364         * ../errors/cs0214.cs : Add.
12365
12366 2002-01-16  Nick Drochak  <ndrochak@gol.com>
12367
12368         * makefile: remove 'response' file when cleaning.
12369
12370 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * cs-parser.jay: Report 1524.
12373
12374 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
12375
12376         * typemanager.cs (RegisterMethod): drop checking if we have
12377         registered this from here
12378
12379 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
12380
12381         * class.cs (Method.EmitDestructor): Implement calling our base
12382         destructor. 
12383
12384         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
12385         value of InFinally.
12386
12387         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
12388         this routine and will wrap the call in a try/catch block.  Deal
12389         with the case.
12390
12391 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
12392
12393         * ecore.cs (Expression.MemberLookup): instead of taking a
12394         parameter `same_type' that was used to tell whether we could
12395         access private members we compute our containing type from the
12396         EmitContext.
12397
12398         (FieldExpr): Added partial support for volatile fields.  This does
12399         not work for volatile fields exposed from assemblies, as I can not
12400         figure out how to extract the modreq from it.
12401
12402         Updated all the source files to use this.
12403
12404         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
12405         because it is referenced by MemberLookup very often. 
12406
12407 2002-01-09  Ravi Pratap  <ravi@ximian.com>
12408
12409         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
12410         TypeBuilder.GetCustomAttributes to retrieve what we need.
12411
12412         Get rid of redundant default_member_attr_type as this is the same as
12413         default_member_type which already exists.
12414
12415         * interface.cs, attribute.cs : Update accordingly.
12416
12417 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * typemanager.cs: Enable IndexerPropertyName again.  It does not
12420         work for TYpeBuilders though.  Ravi, can you please fix this?
12421
12422         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
12423
12424         * expression.cs (Argument.Emit): Handle the case of ref objects
12425         being passed to ref functions;  
12426
12427         (ParameterReference.EmitLoad): Loads the content of the pointer
12428         without dereferencing.
12429
12430 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12431
12432         * cs-tokenizer.cs: Implemented the pre-processing expressions.
12433
12434 2002-01-08  Ravi Pratap  <ravi@ximian.com>
12435
12436         * class.cs (Indexer.DefineMethod): Incorporate the interface
12437         type in the name of the method if we are doing explicit interface
12438         implementation.
12439
12440         * expression.cs (ConversionExists): Remove as it is completely obsolete.
12441
12442         (BetterConversion): Fix extremely trivial bug where we were referring to
12443         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
12444         again !
12445
12446         * ../errors/bug16.cs : Add although we have fixed it.
12447
12448 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12449
12450         * expression.cs (BaseIndexer): Begin implementation.
12451
12452         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
12453
12454         * cs-parser.jay (indexer_declarator): Use qualified_identifier
12455         production directly to remove a shift/reduce, and implement
12456         explicit interface implementation.
12457
12458         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
12459         after a floating point suffix.
12460
12461         * expression.cs (DoNumericPromotions): Improved the conversion for
12462         uint/uint.  If we have a constant, we avoid doing a typecast to a
12463         larger type.
12464
12465         * class.cs (Indexer): Implement explicit interface implementation
12466         for indexers.
12467
12468 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
12469
12470         * class.cs: make the default instance constructor public and hidebysig.
12471
12472 2001-01-03  Ravi Pratap  <ravi@ximian.com>
12473
12474         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
12475         so we can call it from elsewhere.
12476
12477         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
12478         we emit it internally if the class has a defined indexer; otherwise the user
12479         emits it by decorating the class definition with the DefaultMemberAttribute.
12480
12481         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
12482         attribute is not used on a type which defines an indexer.
12483
12484         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12485         character when we skip whitespace.
12486
12487         * ../errors/cs0646.cs : Add.
12488
12489 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12492         again. 
12493
12494         * makefile: Add practical target `mcs3.exe' which builds the third
12495         generation compiler. 
12496
12497         * expression.cs (New): Fix structures constructor calling.
12498
12499         * class.cs (Property, Method, Indexer): Emit Final flag on the
12500         method if we are an interface implementation and we are not
12501         abstract. 
12502
12503         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12504         whether this property is referencing a `base' method.
12505
12506         * expression.cs (Invocation.EmitCall): take an extra argument:
12507         is_base, this is used to determine whether the `call' or
12508         `callvirt' opcode should be used.
12509
12510
12511         * delegate.cs: update EmitCall.
12512
12513         * class.cs (Method.Define): Set NewSlot for the cases where we are
12514         not implementing an interface method.
12515
12516         (Property.Define): ditto.
12517
12518 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12521         'r'.  Allows mcs to parse itself fully.
12522
12523 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12524
12525         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12526         of the number of initializers that require the InitializeArray method.
12527
12528         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12529         update the above field where necessary.
12530
12531         (MakeByteBlob): Update accordingly.
12532
12533         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12534         greater than 2.
12535
12536         (EmitDynamicInitializers): Update in accordance with the new optimization.
12537
12538         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12539         same OpCode applies.
12540
12541         * cs-parser.jay : Fix some glaring errors I introduced.
12542
12543 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12544
12545         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12546         so that we can check for name clashes there too.
12547
12548         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12549         for interface indexers.
12550
12551         * interfaces.cs (Define): Emit the default member attribute.
12552
12553         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12554         variable was being referred to while setting the value ;-)
12555
12556 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12557
12558         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12559         byte-by-byte information when we know the data is zero.
12560
12561         Make the block always a multiple of 4, because
12562         DefineInitializedData has a bug.
12563
12564         * assign.cs: Fix, we should assign from the temporary, not from
12565         the source. 
12566
12567         * expression.cs (MakeByteBlob): Fix my incorrect code.
12568
12569 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * typemanager.cs (EnumToUnderlying): This function is used to get
12572         the underlying type from an enumeration, because it does not
12573         always work. 
12574
12575         * constant.cs: Use the I4_S form for values between -128 and 127.
12576
12577         * statement.cs (Block.LookupLabel): Looks up a label.
12578         (Block): Drop support for labeled blocks.
12579
12580         (LabeledStatement): New kind of statement that represents a label
12581         only.
12582
12583         (Goto): Finally implement this bad boy.
12584
12585         * cs-parser.jay: Update to reflect new mechanism to implement
12586         labels.
12587
12588 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * codegen.cs (EmitContext.This): a codegen property that keeps the
12591         a single instance of this instead of creating many different this
12592         instances. 
12593
12594         * delegate.cs (Delegate.DoResolve): Update to use the property;
12595
12596         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12597
12598         * expression.cs (BaseAccess.DoResolve): Ditto.
12599
12600 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12601
12602         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12603         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12604
12605         (InitCoreTypes): Update accordingly.
12606
12607         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12608         so we can quickly store the state.
12609
12610         (ApplyAttributes): Set the correct implementation flags
12611         for InternalCall methods.
12612
12613 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12614
12615         * expression.cs (EmitCall): if a method is not virtual, then do
12616         not use callvirt on it.
12617
12618         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12619         user defined stuff) requires the use of stobj, which takes an
12620         address on the stack instead of an array and an index.  So emit
12621         the Ldelema operation for it.
12622
12623         (EmitStoreOpcode): Use stobj for valuetypes.
12624
12625         (UnaryMutator.EmitCode): Use the right 1 value depending on
12626         whether we are dealing with int64/uint64, float or doubles.
12627
12628         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12629         constructors that I implemented last night.
12630
12631         (Constructor.IsDefault): Fix to work properly for static
12632         constructors.
12633
12634         * cs-parser.jay (CheckDef): report method signature errors.
12635         Update error number 103 to be 132.
12636
12637         * decl.cs: New AdditionResult enumeration value: MethodExists.
12638         Although we do this check for methods later on in the semantic
12639         analysis, catching repeated default constructors is so easy that
12640         we catch these here. 
12641
12642         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12643         promotions code.
12644
12645         (ParameterReference.EmitAssign, Emit): handle
12646         bools as bytes.
12647
12648         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12649         (ArrayAccess.EmitStoreOpcode): ditto.
12650
12651         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12652
12653         * expression.cs (MakeByteBlob): Complete all the missing types
12654         (uint, short, ushort, byte, sbyte)
12655
12656         * class.cs: Only init instance field initializers on instance
12657         constructors. 
12658
12659         Rename `constructors' to instance_constructors. 
12660
12661         (TypeContainer.AddConstructor): Only add constructors to the list
12662         if it is not static.
12663
12664         Make sure that we handle default_static_constructor independently
12665         everywhere where we handle instance_constructors
12666
12667 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * class.cs: Do not lookup or create a base initializer for a
12670         static constructor.
12671
12672         (ConstructorInitializer.Resolve): use the proper type to lookup
12673         for constructors.
12674
12675         * cs-parser.jay: Report error 1585 (modifiers between type and name).
12676
12677         * enum.cs, interface.cs: Remove CloseType, this is taken care by
12678         in DeclSpace. 
12679
12680         * decl.cs: CloseType is now an virtual method, the default
12681         implementation just closes this type.
12682
12683 2001-12-28  Ravi Pratap  <ravi@ximian.com>
12684
12685         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
12686         to PreserveSig by default. Also emit HideBySig on such methods.
12687
12688         Basically, set the defaults to standard values.
12689
12690         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
12691         argument, if candidate is better, it can't be worse than the best !
12692
12693         (Invocation): Re-write bits to differentiate between methods being
12694         applicable in their expanded form and their normal form - for params
12695         methods of course.
12696
12697         Get rid of use_standard everywhere as only standard conversions are allowed
12698         in overload resolution. 
12699
12700         More spec conformance.
12701
12702 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12703
12704         * driver.cs: Add --timestamp, to see where the compiler spends
12705         most of its time.
12706
12707         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
12708         `this' in static code.
12709
12710         (SimpleName.DoResolve): Implement in terms of a helper function
12711         that allows static-references to be passed upstream to
12712         MemberAccess.
12713
12714         (Expression.ResolveWithSimpleName): Resolve specially simple
12715         names when called by MemberAccess to implement the special
12716         semantics. 
12717
12718         (Expression.ImplicitReferenceConversion): Handle conversions from
12719         Null to reference types before others, as Null's type is
12720         System.Object. 
12721
12722         * expression.cs (Invocation.EmitCall): Handle the special case of
12723         calling methods declared on a reference type from a ValueType
12724         (Base classes System.Object and System.Enum)
12725
12726         (MemberAccess.Resolve): Only perform lookups on Enumerations if
12727         the left hand side is a TypeExpr, not on every enumeration. 
12728
12729         (Binary.Resolve): If types are reference types, then do a cast to
12730         object on operators != and == of both arguments.
12731
12732         * typemanager.cs (FindMembers): Extract instance and static
12733         members if requested.
12734
12735         * interface.cs (PopulateProperty): Use void_type instead of null
12736         as the return type for the setter method.
12737
12738         (PopulateIndexer): ditto.
12739
12740 2001-12-27  Ravi Pratap  <ravi@ximian.com>
12741
12742         * support.cs (ReflectionParameters): Fix minor bug where we
12743         were examining the wrong parameter for the ParamArray attribute.
12744
12745         Cope with requests for the type of the parameter at position
12746         greater than the params parameter's. We now return the element
12747         type of the params array as that makes more sense.
12748
12749         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
12750         accordingly as we no longer have to extract the element type
12751         ourselves.
12752
12753         (Invocation.OverloadResolve): Update.
12754
12755 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12756
12757         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
12758         against IEnumerator, test whether the return value is a descendant
12759         of the IEnumerator interface.
12760
12761         * class.cs (Indexer.Define): Use an auxiliary method to implement
12762         the other bits of the method definition.  Begin support for
12763         explicit interface implementation.
12764
12765         (Property.DefineMethod): Use TypeManager.void_type instead of null
12766         for an empty return value.
12767
12768 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
12769
12770         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
12771         dealing with a FieldExpr which is composed of a FieldBuilder, in
12772         the code path we did extract the constant, but we should have
12773         obtained the underlying value to be able to cast it (otherwise we
12774         end up in an infinite loop, this is what Ravi was running into).
12775
12776         (ArrayCreation.UpdateIndices): Arrays might be empty.
12777
12778         (MemberAccess.ResolveMemberAccess): Add support for section
12779         14.5.4.1 that deals with the special case of E.I when E is a type
12780         and something else, that I can be a reference to a static member.
12781
12782         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
12783         handle a particular array type to create byte blobs, it is just
12784         something we dont generate byteblobs for.
12785
12786         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
12787         arguments. 
12788
12789         * location.cs (Push): remove the key from the hashtable that we
12790         are about to add.   This happens for empty files.
12791
12792         * driver.cs: Dispose files after we have parsed them.
12793
12794         (tokenize): new function that only runs the tokenizer on its
12795         input, for speed testing.
12796
12797 2001-12-26  Ravi Pratap  <ravi@ximian.com>
12798
12799         * class.cs (Event.Define): Define the private field only if there
12800         are no accessors defined.
12801
12802         * expression.cs (ResolveMemberAccess): If there is no associated
12803         field with the event, that means we have an event defined with its
12804         own accessors and we should flag error cs0070 since transforming
12805         ourselves into a field is not valid in that case.
12806
12807         * ecore.cs (SimpleName.DoResolve): Same as above.
12808
12809         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
12810         and charset to sane values.
12811
12812 2001-12-25  Ravi Pratap  <ravi@ximian.com>
12813
12814         * assign.cs (DoResolve): Perform check on events only if they 
12815         are being accessed outside the declaring type.
12816
12817         * cs-parser.jay (event_declarations): Update rules to correctly
12818         set the type of the implicit parameter etc.
12819
12820         (add_accessor, remove_accessor): Set current local parameters.
12821
12822         * expression.cs (Binary): For delegate addition and subtraction,
12823         cast the return value from the method into the appropriate delegate
12824         type.
12825
12826 2001-12-24  Ravi Pratap  <ravi@ximian.com>
12827
12828         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
12829         of these as the workaround is unnecessary.
12830
12831         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
12832         delegate data - none of that is needed at all.
12833
12834         Re-write bits to extract the instance expression and the delegate method
12835         correctly.
12836
12837         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
12838         on delegates too.
12839
12840         * attribute.cs (ApplyAttributes): New method to take care of common tasks
12841         of attaching attributes instead of duplicating code everywhere.
12842
12843         * everywhere : Update code to do attribute emission using the above method.
12844
12845 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12846
12847         * expression.cs (IsParamsMethodApplicable): if there are not
12848         parameters, return immediately.
12849
12850         * ecore.cs: The 0 literal can be implicity converted to an enum
12851         type. 
12852
12853         (SimpleName.DoResolve): First lookup the type, then lookup the
12854         members. 
12855
12856         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
12857         want to get its address.  If the InstanceExpression is not
12858         addressable, store the result in a temporary variable, then get
12859         the address of it.
12860
12861         * codegen.cs: Only display 219 errors on warning level or above. 
12862
12863         * expression.cs (ArrayAccess): Make it implement the
12864         IMemoryLocation interface.
12865
12866         (Binary.DoResolve): handle the operator == (object a, object b)
12867         and operator != (object a, object b) without incurring into a
12868         BoxedCast (because 5 != o should never be performed).
12869
12870         Handle binary enumerator operators.
12871
12872         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
12873         value type, otherwise use Ldelem_ref.
12874
12875         Use precomputed names;
12876
12877         (AddressOf): Implement address of
12878
12879         * cs-parser.jay (labeled_statement): Fix recursive block
12880         addition by reworking the production.
12881
12882         * expression.cs (New.DoEmit): New has a special case:
12883                 
12884                  If we are dealing with a ValueType, we have a few
12885                  situations to deal with:
12886                 
12887                     * The target of New is a ValueType variable, that is
12888                       easy, we just pass this as the variable reference
12889                 
12890                     * The target of New is being passed as an argument,
12891                       to a boxing operation or a function that takes a
12892                       ValueType.
12893                 
12894                       In this case, we need to create a temporary variable
12895                       that is the argument of New.
12896
12897
12898 2001-12-23  Ravi Pratap  <ravi@ximian.com>
12899
12900         * rootcontext.cs (LookupType): Check that current_type is not null before
12901         going about looking at nested types.
12902
12903         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
12904         not implement the IAssignMethod interface any more.
12905
12906         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
12907         where we tranform them into FieldExprs if they are being resolved from within
12908         the declaring type.
12909
12910         * ecore.cs (SimpleName.DoResolve): Do the same here.
12911
12912         * assign.cs (DoResolve, Emit): Clean up code considerably. 
12913
12914         * ../errors/bug10.cs : Add.
12915
12916         * ../errors/cs0070.cs : Add.
12917
12918         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
12919
12920         * assign.cs : Get rid of EventIsLocal everywhere.
12921
12922 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12923
12924         * ecore.cs (ConvertIntLiteral): finished the implementation.
12925
12926         * statement.cs (SwitchLabel): Convert the value we are using as a
12927         key before looking up the table.
12928
12929 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
12930
12931         * codegen.cs (EmitTopBlock): Require a Location argument now.
12932
12933         * cs-parser.jay (constructor_declarator): We need to setup
12934         current_local_parameters before we parse the
12935         opt_constructor_initializer, to allow the variables to be bound
12936         to the constructor arguments.
12937
12938         * rootcontext.cs (LookupType): First lookup nested classes in our
12939         class and our parents before we go looking outside our class.
12940
12941         * expression.cs (ConstantFold): Extract/debox the values at the
12942         beginnning. 
12943
12944         * rootcontext.cs (EmitCode): Resolve the constants first before we
12945         resolve the types.  This is not really needed, but it helps debugging.
12946
12947         * statement.cs: report location.
12948
12949         * cs-parser.jay: pass location to throw statement.
12950
12951         * driver.cs: Small bug fix.
12952
12953         * report.cs: Updated format to be 4-zero filled digits.
12954
12955 2001-12-22  Ravi Pratap  <ravi@ximian.com>
12956
12957         * expression.cs (CheckIndices): Fix minor bug where the wrong
12958         variable was being referred to ;-)
12959
12960         (DoEmit): Do not call EmitStaticInitializers when the 
12961         underlying type is System.Object.
12962
12963 2001-12-21  Ravi Pratap  <ravi@ximian.com>
12964
12965         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
12966         and do the usual workaround for SRE.
12967
12968         * class.cs (MyEventBuilder.EventType): New member to get at the type
12969         of the event, quickly.
12970
12971         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
12972
12973         * assign.cs (Assign.DoResolve): Handle the case when the target
12974         is an EventExpr and perform the necessary checks.
12975
12976         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
12977         interface.
12978
12979         (SimpleName.MemberStaticCheck): Include check for EventExpr.
12980
12981         (EventExpr): Set the type in the constructor itself since we 
12982         are meant to be born fully resolved.
12983
12984         (EventExpr.Define): Revert code I wrote earlier.
12985                 
12986         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
12987         instance expression is null. The instance expression is a This in that case
12988         or a null, depending on whether it is a static method or not.
12989
12990         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
12991         refers to more than one method.
12992
12993         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
12994         and accordingly flag errors.
12995
12996 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
12999
13000 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13001
13002         * location.cs (ToString): Provide useful rutine.
13003
13004 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13005
13006         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
13007         objects, return the actual integral boxed.
13008
13009         * statement.cs (SwitchLabel): define an ILLabel for each
13010         SwitchLabel. 
13011
13012         (Switch.CheckSwitch): If the value is a Literal, extract
13013         the underlying literal.
13014
13015         Also in the unused hashtable we had, add the SwitchLabel so we can
13016         quickly look this value up.
13017
13018         * constant.cs: Implement a bunch of new constants.  Rewrite
13019         Literal based on this.  Made changes everywhere to adapt to this.
13020
13021         * expression.cs (Expression.MakeByteBlob): Optimize routine by
13022         dereferencing array only once, and also copes with enumrations.
13023
13024         bytes are two bytes wide, not one.
13025
13026         (Cast): Perform constant conversions.
13027
13028         * ecore.cs (TryImplicitIntConversion): Return literals instead of
13029         wrappers to the literals here.
13030
13031         * expression.cs (DoNumericPromotions): long literals can converted
13032         to ulong implicity (this is taken care of elsewhere, but I was
13033         missing this spot).
13034
13035         * ecore.cs (Expression.Literalize): Make the return type Literal,
13036         to improve type checking.
13037
13038         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
13039
13040 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * literal.cs: Revert code from ravi that checked the bounds.  The
13043         bounds are sane by the definition of the type itself. 
13044
13045         * typemanager.cs: Fix implementation of ImplementsInterface.  We
13046         need to actually look up in our parent hierarchy for interfaces
13047         implemented. 
13048
13049         * const.cs: Use the underlying type for enumerations
13050
13051         * delegate.cs: Compute the basename for the delegate creation,
13052         that should fix the delegate test case, and restore the correct
13053         Type Lookup semantics in rootcontext
13054
13055         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
13056         referencing a nested type with the Reflection API is using the "+"
13057         sign. 
13058
13059         * cs-parser.jay: Do not require EOF token at the end.
13060
13061 2001-12-20  Ravi Pratap  <ravi@ximian.com>
13062
13063         * rootcontext.cs (LookupType): Concatenate type names with
13064         a '.' instead of a '+' The test suite passes again.
13065
13066         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
13067         field of the enumeration.
13068
13069         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
13070         the case when the member is an EventExpr.
13071
13072         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
13073         static has an associated instance expression.
13074
13075         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
13076
13077         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
13078
13079         * class.cs (Event.Define): Register event and perform appropriate checks
13080         for error #111.
13081
13082         We define the Add and Remove methods even if the use provides none because
13083         in that case, we provide default implementations ourselves.
13084
13085         Define a private field of the type of the event. This is done by the CSC compiler
13086         and we should be doing it too ;-)
13087
13088         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
13089         More methods we use in code we generate.
13090
13091         (multicast_delegate_type, delegate_type): Two separate types since the distinction
13092         is important.
13093
13094         (InitCoreTypes): Update accordingly for the above.
13095
13096         * class.cs (Event.Emit): Generate code for default accessors that we provide
13097
13098         (EmitDefaultMethod): Do the job in the above.
13099
13100         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
13101         appropriate place.
13102
13103 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
13106         builders even if we were missing one.
13107
13108         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
13109         pass the Basename as our class name instead of the Name.  The
13110         basename will be correctly composed for us.
13111
13112         * parameter.cs (Paramters): Now takes a Location argument.
13113
13114         * decl.cs (DeclSpace.LookupType): Removed convenience function and
13115         make all the code call directly LookupType in RootContext and take
13116         this chance to pass the Location information everywhere.
13117
13118         * Everywhere: pass Location information.
13119
13120 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
13121
13122         * class.cs (Constructor.Define): Updated way of detecting the
13123         length of the parameters.
13124
13125         (TypeContainer.DefineType): Use basename as the type name for
13126         nested types.
13127
13128         (TypeContainer.Define): Do not recursively define types here, as
13129         definition is taken care in order by the RootContext.
13130
13131         * tree.cs: Keep track of namespaces in a per-file basis.
13132
13133         * parameter.cs (Parameter.ComputeSignature): Update to use
13134         DeclSpace. 
13135
13136         (Parameters.GetSignature): ditto.
13137
13138         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
13139         instead of a TypeContainer.
13140
13141         (Interface.SemanticAnalysis): Use `this' instead of our parent to
13142         resolve names.  Because we need to be resolve in our context, not
13143         our parents.
13144
13145         * driver.cs: Implement response files.
13146
13147         * class.cs (TypeContainer.DefineType): If we are defined, do not
13148         redefine ourselves.
13149
13150         (Event.Emit): Emit the code for add/remove handlers.
13151         (Event.Define): Save the MethodBuilders for add/remove.
13152
13153         * typemanager.cs: Use pair here too.
13154
13155         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
13156         DictionaryEntry requires the first argument to be non-null.  
13157
13158         (enum_declaration): Compute full name for registering the
13159         enumeration.
13160
13161         (delegate_declaration): Instead of using
13162         formal_parameter_list, use opt_formal_parameter_list as the list
13163         can be empty.
13164
13165         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
13166         (EventParsing): New property that controls whether `add' and
13167         `remove' are returned as tokens or identifiers (for events);
13168
13169 2001-12-19  Ravi Pratap  <ravi@ximian.com>
13170
13171         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
13172         use MyEventBuilder only and let it wrap the real builder for us.
13173
13174         (MyEventBuilder): Revamp constructor etc.
13175
13176         Implement all operations that we perform on EventBuilder in precisely the same
13177         way here too.
13178
13179         (FindMembers): Update to use the EventBuilder member.
13180
13181         (Event.Emit): Update accordingly.
13182
13183 2001-12-18  Ravi Pratap  <ravi@ximian.com>
13184
13185         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
13186         by calling the appropriate methods.
13187
13188         (GetCustomAttributes): Make stubs as they cannot possibly do anything
13189         useful.
13190
13191         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
13192
13193 2001-12-17  Ravi Pratap  <ravi@ximian.com>
13194
13195         * delegate.cs (Delegate.Populate): Check that the return type
13196         and various parameters types are indeed accessible.
13197
13198         * class.cs (Constructor.Define): Same here.
13199
13200         (Field.Define): Ditto.
13201
13202         (Event.Define): Ditto.
13203
13204         (Operator.Define): Check that the underlying Method defined itself
13205         correctly - so it's MethodBuilder should not be null.
13206
13207         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
13208         expression happens to be null.
13209
13210         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
13211         members but as of now we don't seem to be able to do anything really useful with it.
13212
13213         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
13214         not the EventBuilder.
13215
13216 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * cs-tokenizer.cs: Add support for defines.
13219         Add support for #if, #elif, #else, #endif
13220
13221         (eval_var): evaluates a variable.
13222         (eval): stubbed for evaluating functions.
13223
13224         * cs-parser.jay: Pass the defines information
13225
13226         * driver.cs: Add --define command line option.
13227
13228         * decl.cs: Move MemberCore here.
13229
13230         Make it the base class for DeclSpace.  This allows us to catch and
13231         report 108 and 109 for everything now.
13232
13233         * class.cs (TypeContainer.Define): Extract all the members
13234         before populating and emit the warning 108 (new keyword required
13235         to override) instead of having each member implement this.
13236
13237         (MemberCore.Define): New abstract method, we will be using this in
13238         the warning reporting engine in Populate.
13239
13240         (Operator.Define): Adjust to new MemberCore protocol. 
13241
13242         * const.cs (Const): This does not derive from Expression, it is a
13243         temporary object we use to create fields, it is a MemberCore. 
13244
13245         * class.cs (Method.Define): Allow the entry point to be in a
13246         specific class.
13247
13248         * driver.cs: Rewrite the argument handler to clean it up a bit.
13249
13250         * rootcontext.cs: Made it just an auxiliary namespace feature by
13251         making everything static.
13252
13253         * driver.cs: Adapt code to use RootContext type name instead of
13254         instance variable.
13255
13256         * delegate.cs: Remove RootContext argument.
13257
13258         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
13259         argument. 
13260
13261         * class.cs (Event.Define): The lookup can fail.
13262
13263         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
13264
13265         * expression.cs: Resolve the this instance before invoking the code.
13266
13267 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
13268
13269         * cs-parser.jay: Add a production in element_access that allows
13270         the thing to become a "type" reference.  This way we can parse
13271         things like "(string [])" as a type.
13272
13273         Note that this still does not handle the more complex rules of
13274         casts. 
13275
13276
13277         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
13278
13279         * ecore.cs: (CopyNewMethods): new utility function used to
13280         assemble the list of methods from running FindMembers.
13281
13282         (MemberLookup): Rework FindMembers so that 
13283
13284 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
13285
13286         * class.cs (TypeContainer): Remove Delegates who fail to be
13287         defined.
13288
13289         * delegate.cs (Populate): Verify that we dont get null return
13290         values.   TODO: Check for AsAccessible.
13291
13292         * cs-parser.jay: Use basename to emit error 574 (destructor should
13293         have the same name as container class), not the full name.
13294
13295         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
13296         possible representation.  
13297
13298         Also implements integer type suffixes U and L.
13299
13300 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * expression.cs (ArrayCreation.DoResolve): We need to do the
13303         argument resolution *always*.
13304
13305         * decl.cs: Make this hold the namespace.  Hold the root context as
13306         well.
13307         (LookupType): Move here.
13308
13309         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
13310
13311         * location.cs (Row, Name): Fixed the code, it was always returning
13312         references to the first file.
13313
13314         * interface.cs: Register properties defined through interfaces.
13315
13316         * driver.cs: Add support for globbing on the command line
13317
13318         * class.cs (Field): Make it derive from MemberCore as well.
13319         (Event): ditto.
13320
13321 2001-12-15  Ravi Pratap  <ravi@ximian.com>
13322
13323         * class.cs (Event::Define): Check that the type of the event is a delegate
13324         type else flag error #66.
13325
13326         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
13327         same.
13328
13329         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
13330         values of EntryPoint, CharSet etc etc.
13331
13332         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
13333
13334         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
13335         be null and we should ignore this. I am not sure if this is really clean. Apparently,
13336         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
13337         which needs this to do its work.
13338
13339         * ../errors/cs0066.cs : Add.
13340
13341 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
13342
13343         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
13344         helper functions.
13345
13346         * class.cs: (MethodSignature.MethodSignature): Removed hack that
13347         clears out the parameters field.
13348         (MemberSignatureCompare): Cleanup
13349
13350         (MemberCore): New base class used to share code between MethodCore
13351         and Property.
13352
13353         (RegisterRequiredImplementations) BindingFlags.Public requires
13354         either BindingFlags.Instace or Static.  Use instance here.
13355
13356         (Property): Refactored code to cope better with the full spec.
13357
13358         * parameter.cs (GetParameterInfo): Return an empty array instead
13359         of null on error.
13360
13361         * class.cs (Property): Abstract or extern properties have no bodies.
13362
13363         * parameter.cs (GetParameterInfo): return a zero-sized array.
13364
13365         * class.cs (TypeContainer.MethodModifiersValid): Move all the
13366         method modifier validation to the typecontainer so we can reuse
13367         this on properties.
13368
13369         (MethodCore.ParameterTypes): return an empty sized array of types.
13370
13371         (Property.Define): Test property modifier validity.
13372
13373         Add tests for sealed/override too.
13374
13375         (Method.Emit): abstract or extern methods have no bodies.
13376
13377 2001-12-14  Ravi Pratap  <ravi@ximian.com>
13378
13379         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
13380         thing.
13381
13382         (Method::Define, ::Emit): Modify accordingly.
13383
13384         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
13385
13386         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
13387
13388         * makefile: Pass in /unsafe.
13389
13390 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * class.cs (MakeKey): Kill routine.
13393
13394         * class.cs (TypeContainer.Define): Correctly define explicit
13395         method implementations (they require the full interface name plus
13396         the method name).
13397
13398         * typemanager.cs: Deply the PtrHashtable here and stop using the
13399         lame keys.  Things work so much better.
13400
13401         This of course broke everyone who depended on `RegisterMethod' to
13402         do the `test for existance' test.  This has to be done elsewhere.
13403
13404         * support.cs (PtrHashtable): A hashtable that avoid comparing with
13405         the object stupid Equals method (because, that like fails all over
13406         the place).  We still do not use it.
13407
13408         * class.cs (TypeContainer.SetRequiredInterface,
13409         TypeContainer.RequireMethods): Killed these two routines and moved
13410         all the functionality to RegisterRequiredImplementations.
13411
13412         (TypeContainer.RegisterRequiredImplementations): This routine now
13413         registers all the implementations required in an array for the
13414         interfaces and abstract methods.  We use an array of structures
13415         which can be computed ahead of time to reduce memory usage and we
13416         also assume that lookups are cheap as most classes will not
13417         implement too many interfaces.
13418
13419         We also avoid creating too many MethodSignatures.
13420
13421         (TypeContainer.IsInterfaceMethod): Update and optionally does not
13422         clear the "pending" bit if we find that there are problems with
13423         the declaration.
13424
13425         (TypeContainer.VerifyPendingMethods): Update to report errors of
13426         methods that look like implementations but are not.
13427
13428         (TypeContainer.Define): Add support for explicit interface method
13429         implementation. 
13430
13431 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * typemanager.cs: Keep track of the parameters here instead of
13434         being a feature of the TypeContainer.
13435
13436         * class.cs: Drop the registration of parameters here, as
13437         InterfaceMethods are also interface declarations.
13438
13439         * delegate.cs: Register methods with the TypeManager not only with
13440         the TypeContainer.  This code was buggy.
13441
13442         * interface.cs: Full registation here.
13443
13444 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
13445
13446         * expression.cs: Remove reducer for binary expressions, it can not
13447         be done this way.
13448
13449         * const.cs: Put here the code that used to go into constant.cs
13450
13451         * constant.cs: Put here the code for constants, this is a new base
13452         class for Literals.
13453
13454         * literal.cs: Make Literal derive from Constant.
13455
13456 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
13457
13458         * statement.cs (Return.Emit): Report error 157 if the user
13459         attempts to return from a finally block.
13460
13461         (Return.Emit): Instead of emitting a return, jump to the end of
13462         the function.
13463
13464         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
13465         LocalBuilder to store the result of the function.  ReturnLabel is
13466         the target where we jump.
13467
13468
13469 2001-12-09  Radek Doulik  <rodo@ximian.com>
13470
13471         * cs-parser.jay: remember alias in current namespace
13472
13473         * ecore.cs (SimpleName::DoResolve): use aliases for types or
13474         namespaces
13475
13476         * class.cs (LookupAlias): lookup alias in my_namespace
13477
13478         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
13479         aliases hashtable
13480         (LookupAlias): lookup alias in this and if needed in parent
13481         namespaces
13482
13483 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13484
13485         * support.cs: 
13486
13487         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13488         making things static.  I need this to avoid passing the
13489         TypeContainer when calling ParameterType.
13490
13491         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13492         that did string manipulation to compute the type and then call
13493         GetType.  Use Parameter.ParameterType instead.
13494
13495         * cs-tokenizer.cs: Consume the suffix for floating values.
13496
13497         * expression.cs (ParameterReference): figure out whether this is a
13498         reference parameter or not.  Kill an extra variable by computing
13499         the arg_idx during emission.
13500
13501         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13502         function that returns whether a parameter is an out/ref value or not.
13503
13504         (Parameter.ParameterType): The type of the parameter (base,
13505         without ref/out applied).
13506
13507         (Parameter.Resolve): Perform resolution here.
13508         (Parameter.ExternalType): The full type (with ref/out applied).
13509
13510         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13511         support for expressions on the using statement.
13512
13513 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13514
13515         * statement.cs (Using.EmitLocalVariableDecls): Split the
13516         localvariable handling of the using statement.
13517
13518         (Block.EmitMeta): Keep track of variable count across blocks.  We
13519         were reusing slots on separate branches of blocks.
13520
13521         (Try.Emit): Emit the general code block, we were not emitting it. 
13522
13523         Check the type of the declaration to be an IDisposable or
13524         something that can be implicity converted to it. 
13525
13526         Emit conversions if required.
13527
13528         * ecore.cs (EmptyExpression): New utility class.
13529         (Expression.ImplicitConversionExists): New utility function.
13530
13531 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * statement.cs (Using): Implement.
13534
13535         * expression.cs (LocalVariableReference): Support read only variables.
13536
13537         * statement.cs: Remove the explicit emit for the Leave opcode.
13538         (VariableInfo): Add a readonly field.
13539
13540 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13541
13542         * ecore.cs (ConvCast): new class used to encapsulate the various
13543         explicit integer conversions that works in both checked and
13544         unchecked contexts.
13545
13546         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13547         properly generate the overflow opcodes.
13548
13549 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * statement.cs: The correct type for the EmptyExpression is the
13552         element_type, not the variable type.  Ravi pointed this out.
13553
13554 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13555
13556         * class.cs (Method::Define): Handle PInvoke methods specially
13557         by using DefinePInvokeMethod instead of the usual one.
13558
13559         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13560         above to do the task of extracting information and defining the method.
13561
13562 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13563
13564         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13565         of the condition for string type.
13566
13567         (Emit): Move that here. 
13568
13569         (ArrayCreation::CheckIndices): Keep string literals in their expression
13570         form.
13571
13572         (EmitDynamicInitializers): Handle strings appropriately.
13573
13574 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13575
13576         * codegen.cs (EmitContext): Replace multiple variables with a
13577         single pointer to the current Switch statement.
13578
13579         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13580         EmitContext.
13581
13582 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * statement.cs 
13585
13586         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13587         default'.
13588
13589         (Foreach.Emit): Foreach on arrays was not setting
13590         up the loop variables (for break/continue).
13591
13592         (GotoCase): Semi-implented.
13593
13594 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13595
13596         * attribute.cs (CheckAttribute): Handle system attributes by using
13597         Attribute.GetAttributes to examine information we need.
13598
13599         (GetValidPlaces): Same here.
13600
13601         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13602
13603         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13604
13605         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13606
13607         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13608
13609         (Method::Emit): Handle the case when we are a PInvoke method.
13610
13611 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13612
13613         * expression.cs: Use ResolveWithSimpleName on compound names.
13614
13615 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13616
13617         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13618         before trying to reduce it.
13619
13620         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13621
13622         * constant.cs (LookupConstantValue): Implement.
13623
13624         (EmitConstant): Use the above in emitting the constant.
13625
13626         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13627         that are user-defined by doing a LookupConstantValue on them.
13628
13629         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13630         too, like above.
13631
13632 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13633
13634         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13635
13636         (BaseAccess.DoResolve): Implement.
13637
13638         (MemberAccess.DoResolve): Split this routine into a
13639         ResolveMemberAccess routine that can be used independently
13640
13641 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13642
13643         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13644         As that share bits of the implementation.  Is returns a boolean,
13645         while As returns the Type that is being probed.
13646
13647 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13648
13649         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13650         instead of a Literal - much easier.
13651
13652         (EnumInTransit): Remove - utterly useless :-)
13653
13654         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13655
13656         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13657
13658         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13659         chain when we have no associated expression.
13660
13661 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13662
13663         * constant.cs (Define): Use Location while reporting the errror.
13664
13665         Also emit a warning when 'new' is used and there is no inherited
13666         member to hide.
13667
13668         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
13669         populated.
13670
13671         (LookupEnumValue): Implement to lookup an enum member's value and define it
13672         if necessary.
13673
13674         (Populate): Re-write accordingly to use the above routine.
13675
13676 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * expression.cs (This): Fix prototype for DoResolveLValue to
13679         override the base class DoResolveLValue.
13680
13681         * cs-parser.cs: Report errors cs574 and cs575 (destructor
13682         declarations) 
13683
13684         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
13685         (we need to load the address of the field here).  This fixes
13686         test-22. 
13687
13688         (FieldExpr.DoResolveLValue): Call the DoResolve
13689         function to initialize the Instance expression.
13690
13691         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
13692         correctly the GetEnumerator operation on a value type.
13693
13694         * cs-parser.jay: Add more simple parsing error catches.
13695
13696         * statement.cs (Switch): Add support for string switches.
13697         Handle null specially.
13698
13699         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
13700
13701 2001-11-28  Ravi Pratap  <ravi@ximian.com>
13702
13703         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
13704
13705         (declare_local_constant): New helper function.
13706
13707         * statement.cs (AddConstant): Keep a separate record of constants
13708
13709         (IsConstant): Implement to determine if a variable is a constant.
13710
13711         (GetConstantExpression): Implement.
13712
13713         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
13714
13715         * statement.cs (IsVariableDefined): Re-write.
13716
13717 2001-11-27  Ravi Pratap  <ravi@ximian.com>
13718
13719         * class.cs (TypeContainer::FindMembers): Look for constants
13720         in the case when we are looking for MemberTypes.Field
13721
13722         * expression.cs (MemberAccess::DoResolve): Check that in the
13723         case we are a FieldExpr and a Literal, we are not being accessed
13724         by an instance reference.
13725
13726         * cs-parser.jay (local_constant_declaration): Implement.
13727
13728         (declaration_statement): Implement for constant declarations.
13729
13730 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
13731
13732         * statement.cs (Switch): Catch double defaults.
13733
13734         (Switch): More work on the switch() statement
13735         implementation.  It works for integral values now, need to finish
13736         string support.
13737
13738
13739 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
13742         integer literals into other integer literals.  To be used by
13743         switch. 
13744
13745 2001-11-24  Ravi Pratap  <ravi@ximian.com>
13746
13747         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
13748         some memory.
13749
13750         (EmitDynamicInitializers): Cope with the above since we extract data
13751         directly from ArrayData now.
13752
13753         (ExpectInitializers): Keep track of whether initializers are mandatory
13754         or not.
13755
13756         (Bounds): Make it a hashtable to prevent the same dimension being 
13757         recorded for every element in that dimension.
13758
13759         (EmitDynamicInitializers): Fix bug which prevented the Set array method
13760         from being found.
13761
13762         Also fix bug which was causing the indices to be emitted in the reverse
13763         order.
13764
13765 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13766
13767         * expression.cs (ArrayCreation): Implement the bits that Ravi left
13768         unfinished.  They do not work, because the underlying code is
13769         sloppy.
13770
13771 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13772
13773         * cs-parser.jay: Remove bogus fixme.
13774
13775         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
13776         on Switch statement.
13777
13778 2001-11-23  Ravi Pratap  <ravi@ximian.com>
13779
13780         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
13781         the same. 
13782
13783         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
13784         parameter. Apparently, any expression is allowed. 
13785
13786         (ValidateInitializers): Update accordingly.
13787
13788         (CheckIndices): Fix some tricky bugs thanks to recursion.
13789
13790         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
13791         I was being completely brain-dead.
13792
13793         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
13794         and re-write acordingly.
13795
13796         (DelegateInvocation): Re-write accordingly.
13797
13798         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
13799
13800         (MakeByteBlob): Handle types more correctly.
13801
13802         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
13803         initialization from expressions but it is incomplete because I am a complete
13804         Dodo :-|
13805
13806 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * statement.cs (If.Emit): Fix a bug that generated incorrect code
13809         on If.  Basically, we have to return `true' (ie, we do return to
13810         our caller) only if both branches of the if return.
13811
13812         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
13813         short-circuit operators, handle them as short circuit operators. 
13814
13815         (Cast.DoResolve): Resolve type.
13816         (Cast.Cast): Take an expression as the target type.
13817
13818         * cs-parser.jay (cast_expression): Remove old hack that only
13819         allowed a limited set of types to be handled.  Now we take a
13820         unary_expression and we resolve to a type during semantic
13821         analysis.
13822
13823         Use the grammar productions from Rhys to handle casts (this is
13824         not complete like Rhys syntax yet, we fail to handle that corner
13825         case that C# has regarding (-x), but we will get there.
13826
13827 2001-11-22  Ravi Pratap  <ravi@ximian.com>
13828
13829         * class.cs (EmitFieldInitializer): Take care of the case when we have a
13830         field which is an array type.
13831
13832         * cs-parser.jay (declare_local_variables): Support array initialization too.
13833
13834         * typemanager.cs (MakeKey): Implement.
13835
13836         (everywhere): Use the above appropriately.
13837
13838         * cs-parser.jay (for_statement): Update for array initialization while
13839         declaring variables.
13840
13841         * ecore.cs : The error message was correct, it's the variable's names that
13842         were misleading ;-) Make the code more readable.
13843
13844         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
13845         the correct type etc.
13846
13847         (ConvertExplicit): Handle Enum types by examining the underlying type.
13848
13849 2001-11-21  Ravi Pratap  <ravi@ximian.com>
13850
13851         * parameter.cs (GetCallingConvention): Always return
13852         CallingConventions.Standard for now.
13853
13854 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * expression.cs (Binary.ResolveOperator): Update the values of `l'
13857         and `r' after calling DoNumericPromotions.
13858
13859         * ecore.cs: Fix error message (the types were in the wrong order).
13860
13861         * statement.cs (Foreach.ProbeCollectionType): Need to pass
13862         BindingFlags.Instance as well 
13863
13864         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
13865         implicit int literal conversion in an empty cast so that we
13866         propagate the right type upstream.
13867
13868         (UnboxCast): new class used to unbox value types.
13869         (Expression.ConvertExplicit): Add explicit type conversions done
13870         by unboxing.
13871
13872         (Expression.ImplicitNumericConversion): Oops, forgot to test for
13873         the target type before applying the implicit LongLiterals to ULong
13874         literal cast.
13875
13876 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * cs-parser.jay (for_statement): Reworked the way For works: now
13879         we declare manually any variables that are introduced in
13880         for_initializer to solve the problem of having out-of-band code
13881         emition (that is what got for broken).
13882
13883         (declaration_statement): Perform the actual variable declaration
13884         that used to be done in local_variable_declaration here.
13885
13886         (local_variable_declaration): Do not declare anything, just pass
13887         the information on a DictionaryEntry
13888
13889 2001-11-20  Ravi Pratap  <ravi@ximian.com>
13890
13891         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
13892         re-write of the logic to now make it recursive.
13893
13894         (UpdateIndices): Re-write accordingly.
13895
13896         Store element data in a separate ArrayData list in the above methods.
13897
13898         (MakeByteBlob): Implement to dump the array data into a byte array.
13899
13900 2001-11-19  Ravi Pratap  <ravi@ximian.com>
13901
13902         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
13903         into CheckIndices.
13904
13905         * constant.cs (Define): Implement.
13906
13907         (EmitConstant): Re-write fully.
13908
13909         Pass in location info.
13910
13911         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
13912         respectively.
13913
13914         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
13915         DictionaryEntry since we need location info too.
13916
13917         (constant_declaration): Update accordingly.
13918
13919         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
13920         code into another method : UpdateIndices.
13921
13922 2001-11-18  Ravi Pratap  <ravi@ximian.com>
13923
13924         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
13925         some type checking etc.
13926
13927 2001-11-17  Ravi Pratap  <ravi@ximian.com>
13928
13929         * expression.cs (ArrayCreation::ValidateInitializers): Implement
13930         bits to provide dimension info if the user skips doing that.
13931
13932         Update second constructor to store the rank correctly.
13933
13934 2001-11-16  Ravi Pratap  <ravi@ximian.com>
13935
13936         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
13937         and try to implement.
13938
13939         * ../errors/cs0150.cs : Add.
13940
13941         * ../errors/cs0178.cs : Add.
13942
13943 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
13944
13945         * statement.cs: Implement foreach on multi-dimensional arrays. 
13946
13947         * parameter.cs (Parameters.GetParameterByName): Also lookup the
13948         name of the params argument.
13949
13950         * expression.cs: Use EmitStoreOpcode to get the right opcode while
13951         initializing the array.
13952
13953         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
13954         we can use this elsewhere.
13955
13956         * statement.cs: Finish implementation of foreach for single
13957         dimension arrays.
13958
13959         * cs-parser.jay: Use an out-of-band stack to pass information
13960         around, I wonder why I need this.
13961
13962         foreach_block: Make the new foreach_block the current_block.
13963
13964         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
13965         function used to return a static Parameters structure.  Used for
13966         empty parameters, as those are created very frequently.
13967
13968         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
13969
13970 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13971
13972         * interface.cs : Default modifier is private, not public. The
13973         make verify test passes again.
13974
13975 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13976
13977         * support.cs (ReflectionParameters): Fix logic to determine
13978         whether the last parameter is a params one. Test 9 passes again.
13979
13980         * delegate.cs (Populate): Register the builders we define with
13981         RegisterParameterForBuilder. Test 19 passes again.
13982
13983         * cs-parser.jay (property_declaration): Reference $6 instead
13984         of $$ to get at the location.
13985
13986         (indexer_declaration): Similar stuff.
13987
13988         (attribute): Ditto.
13989
13990         * class.cs (Property): Register parameters for the Get and Set methods
13991         if they exist. Test 23 passes again.
13992
13993         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
13994         call to EmitArguments as we are sure there aren't any params arguments. 
13995         Test 32 passes again.
13996
13997         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
13998         IndexOutOfRangeException. 
13999
14000         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
14001         Test 33 now passes again.
14002
14003 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
14004
14005         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
14006         broke a bunch of things.  Will have to come up with a better way
14007         of tracking locations.
14008
14009         * statement.cs: Implemented foreach for single dimension arrays.
14010
14011 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
14014         an error.  This removes the lookup from the critical path.
14015
14016         * cs-parser.jay: Removed use of temporary_loc, which is completely
14017         broken. 
14018
14019 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
14020
14021         * support.cs (ReflectionParameters.ParameterModifier): Report
14022         whether the argument is a PARAMS argument or not.
14023
14024         * class.cs: Set the attribute `ParamArrayAttribute' on the
14025         parameter argument.
14026
14027         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
14028         and cons_param_array_attribute (ConstructorInfo for
14029         ParamArrayAttribute)., 
14030
14031         * codegen.cs: Emit the return using the `Return' statement, that
14032         way we can report the error correctly for missing return values. 
14033
14034         * class.cs (Method.Emit): Clean up.
14035
14036         * expression.cs (Argument.Resolve): Take another argument: the
14037         location where this argument is used.  Notice that this is not
14038         part of the "Argument" class as to reduce the size of the
14039         structure (we know the approximate location anyways).
14040
14041         Test if the argument is a variable-reference, if not, then
14042         complain with a 206.
14043
14044         (Argument.Emit): Emit addresses of variables.
14045
14046         (Argument.FullDesc): Simplify.
14047
14048         (Invocation.DoResolve): Update for Argument.Resolve.
14049
14050         (ElementAccess.DoResolve): ditto.
14051
14052         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
14053         method should be virtual, as this method is always virtual.
14054
14055         (NewDelegate.DoResolve): Update for Argument.Resolve.
14056
14057         * class.cs (ConstructorInitializer.DoResolve): ditto.
14058
14059         * attribute.cs (Attribute.Resolve): ditto.
14060
14061 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
14064
14065         * expression.cs (ParameterReference): Drop IStackStorage and implement
14066         IAssignMethod instead. 
14067
14068         (LocalVariableReference): ditto.
14069
14070         * ecore.cs (FieldExpr): Drop IStackStorage and implement
14071         IAssignMethod instead. 
14072
14073 2001-11-13  Miguel de Icaza <miguel@ximian.com>
14074
14075         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
14076         enumerations that are used in heavily used structures derive from
14077         byte in a laughable and pathetic attempt to reduce memory usage.
14078         This is the kind of pre-optimzations that you should not do at
14079         home without adult supervision.
14080
14081         * expression.cs (UnaryMutator): New class, used to handle ++ and
14082         -- separatedly from the other unary operators.  Cleans up the
14083         code, and kills the ExpressionStatement dependency in Unary.
14084
14085         (Unary): Removed `method' and `Arguments' from this class, making
14086         it smaller, and moving it all to SimpleCall, so I can reuse this
14087         code in other locations and avoid creating a lot of transient data
14088         strucutres when not required.
14089
14090         * cs-parser.jay: Adjust for new changes.
14091
14092 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * enum.cs (Enum.Populate): If there is a failure during
14095         definition, return
14096
14097         * cs-parser.jay (opt_enum_base): we used to catch type errors
14098         here, but this is really incorrect.  The type error should be
14099         catched during semantic analysis.
14100
14101 2001-12-11  Ravi Pratap  <ravi@ximian.com>
14102
14103         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
14104         current_local_parameters as expected since I, in my stupidity, had forgotten
14105         to do this :-)
14106
14107         * attribute.cs (GetValidPlaces): Fix stupid bug.
14108
14109         * class.cs (Method::Emit): Perform check on applicability of attributes.
14110
14111         (Constructor::Emit): Ditto.
14112
14113         (Field::Emit): Ditto.
14114
14115         (Field.Location): Store location information.
14116
14117         (Property, Event, Indexer, Operator): Ditto.
14118
14119         * cs-parser.jay (field_declaration): Pass in location for each field.
14120
14121         * ../errors/cs0592.cs : Add.
14122
14123 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14124
14125         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
14126
14127         (InitCoreTypes): Update accordingly.
14128
14129         (RegisterAttrType, LookupAttr): Implement.
14130
14131         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
14132         info about the same.
14133
14134         (Resolve): Update to populate the above as necessary.
14135
14136         (Error592): Helper.
14137
14138         (GetValidPlaces): Helper to the above.
14139
14140         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
14141
14142         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
14143
14144 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14145
14146         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
14147
14148         * ../errors/cs0617.cs : Add.
14149
14150 2001-11-11  Ravi Pratap  <ravi@ximian.com>
14151
14152         * enum.cs (Emit): Rename to Populate to be more consistent with what
14153         we expect it to do and when exactly it is called.
14154
14155         * class.cs, rootcontext.cs : Update accordingly.
14156
14157         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
14158         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
14159
14160         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
14161
14162         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
14163         of a fieldinfo using the above, when dealing with a FieldBuilder.
14164
14165 2001-11-10  Ravi Pratap  <ravi@ximian.com>
14166
14167         * ../errors/cs0031.cs : Add.
14168
14169         * ../errors/cs1008.cs : Add.
14170
14171         * ../errrors/cs0543.cs : Add.
14172
14173         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
14174         enum type.
14175
14176         (FindMembers): Implement.
14177
14178         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
14179         enums and delegates too.
14180
14181         (enum_types): Rename to builder_to_enum.
14182
14183         (delegate_types): Rename to builder_to_delegate.
14184
14185         * delegate.cs (FindMembers): Implement.
14186
14187 2001-11-09  Ravi Pratap  <ravi@ximian.com>
14188
14189         * typemanager.cs (IsEnumType): Implement.
14190
14191         * enum.cs (Emit): Re-write parts to account for the underlying type
14192         better and perform checking etc.
14193
14194         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
14195         of the underlying type.
14196
14197         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
14198         value
14199
14200         * enum.cs (error31): Helper to report error #31.
14201
14202         * cs-parser.jay (enum_declaration): Store location of each member too.
14203
14204         * enum.cs (member_to_location): New hashtable. 
14205
14206         (AddEnumMember): Update location hashtable.
14207
14208         (Emit): Use the location of each member while reporting errors.
14209
14210 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * cs-parser.jay: A for_initializer if is a
14213         local_variable_declaration really ammount to have an implicit
14214         block with the variable declaration and no initializer for for.
14215
14216         * statement.cs (For.Emit): Cope with null initializers.
14217
14218         This fixes the infinite loop on for initializers.
14219
14220 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
14221
14222         * enum.cs: More cleanup.
14223
14224         * ecore.cs: Remove dead code.
14225
14226         * class.cs (Property.Emit): More simplification.
14227         (Event.Emit): ditto.
14228
14229         Reworked to have less levels of indentation.
14230
14231 2001-11-08  Ravi Pratap  <ravi@ximian.com>
14232
14233         * class.cs (Property): Emit attributes.
14234
14235         (Field): Ditto.
14236
14237         (Event): Ditto.
14238
14239         (Indexer): Ditto.
14240
14241         (Operator): Ditto.
14242
14243         * enum.cs (Emit): Ditto.
14244
14245         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
14246         Enums too.
14247
14248         * class.cs (Field, Event, etc.): Move attribute generation into the
14249         Emit method everywhere.
14250
14251         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
14252         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
14253         as we had no way of defining nested enums !
14254
14255         * rootcontext.cs : Adjust code accordingly.
14256
14257         * typemanager.cs (AddEnumType): To keep track of enum types separately.
14258
14259 2001-11-07  Ravi Pratap  <ravi@ximian.com>
14260
14261         * expression.cs (EvalConstantExpression): Move into ecore.cs
14262
14263         * enum.cs (Enum): Rename some members and make them public and readonly
14264         according to our convention.
14265
14266         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
14267         nothing else.
14268
14269         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
14270
14271         (Enum::Emit): Write a simple version for now which doesn't try to compute
14272         expressions. I shall modify this to be more robust in just a while.
14273
14274         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
14275
14276         (TypeContainer::CloseType): Create the Enum types too.
14277
14278         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
14279
14280         * expression.cs (EvalConstantExpression): Get rid of completely.
14281
14282         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
14283         user-defined values and other cases.
14284
14285         (IsValidEnumLiteral): Helper function.
14286
14287         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
14288         out there in the case we had a literal FieldExpr.
14289
14290         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
14291
14292         (Literalize): Revamp a bit to take two arguments.
14293
14294         (EnumLiteral): New class which derives from Literal to wrap enum literals.
14295
14296 2001-11-06  Ravi Pratap  <ravi@ximian.com>
14297
14298         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
14299
14300         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
14301
14302         (Resolve): Use the above to ensure we have proper initializers.
14303
14304 2001-11-05  Ravi Pratap  <ravi@ximian.com>
14305
14306         * expression.cs (Expression::EvalConstantExpression): New method to 
14307         evaluate constant expressions.
14308
14309         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
14310
14311 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
14312
14313         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
14314         in an array.
14315
14316         (Binary.ResolveOperator): Handle operator != (object a, object b)
14317         and operator == (object a, object b);
14318
14319         (Binary.DoNumericPromotions): Indicate whether the numeric
14320         promotion was possible.
14321
14322         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
14323         Implement.  
14324
14325         Made the ArrayAccess implement interface IAssignMethod instead of
14326         IStackStore as the order in which arguments are passed reflects
14327         this.
14328
14329         * assign.cs: Instead of using expr.ExprClass to select the way of
14330         assinging, probe for the IStackStore/IAssignMethod interfaces.
14331
14332         * typemanager.cs: Load InitializeArray definition.
14333
14334         * rootcontext.cs (RootContext.MakeStaticData): Used to define
14335         static data that can be used to initialize arrays. 
14336
14337 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
14338
14339         * expression.cs: Handle operator== and operator!= for booleans.
14340
14341         (Conditioal.Reduce): Implement reducer for the ?: operator.
14342
14343         (Conditional.Resolve): Implement dead code elimination.
14344
14345         (Binary.Resolve): Catch string literals and return a new
14346         concatenated string.
14347
14348         (Unary.Reduce): Implement reduction of unary expressions.
14349
14350         * ecore.cs: Split out the expression core handling here.
14351
14352         (Expression.Reduce): New method used to perform constant folding
14353         and CSE.  This is needed to support constant-expressions. 
14354
14355         * statement.cs (Statement.EmitBoolExpression): Pass true and false
14356         targets, and optimize for !x.
14357
14358 2001-11-04  Ravi Pratap  <ravi@ximian.com>
14359
14360         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
14361         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
14362         set custom atttributes.
14363
14364         * literal.cs (Literal::GetValue): New abstract method to return the actual
14365         value of the literal, cast as an object.
14366
14367         (*Literal): Implement GetValue method.
14368
14369         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
14370         expressions to the arraylist but objects of type Argument.
14371
14372         * class.cs (TypeContainer::Emit): Emit our attributes too.
14373
14374         (Method::Emit, Constructor::Emit): Ditto.
14375
14376         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
14377         to be ignoring earlier.
14378
14379 2001-11-03  Ravi Pratap  <ravi@ximian.com>
14380
14381         * attribute.cs (AttributeSection::Define): Implement to do the business
14382         of constructing a CustomAttributeBuilder.
14383
14384         (Attribute): New trivial class. Increases readability of code.  
14385
14386         * cs-parser.jay : Update accordingly.
14387
14388         (positional_argument_list, named_argument_list, named_argument): New rules
14389
14390         (attribute_arguments): Use the above so that we are more correct.
14391
14392 2001-11-02  Ravi Pratap  <ravi@ximian.com>
14393
14394         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
14395         to perform all checks for a method with a params parameter.
14396
14397         (Invocation::OverloadResolve): Update to use the above method and therefore
14398         cope correctly with params method invocations.
14399
14400         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
14401         params too.
14402
14403         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
14404         constructors in our parent too because we can't afford to miss out on 
14405         protected ones ;-)
14406
14407         * attribute.cs (AttributeSection): New name for the class Attribute
14408
14409         Other trivial changes to improve readability.
14410
14411         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
14412         use the new class names.
14413
14414 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14415
14416         * class.cs (Method::Define): Complete definition for params types too
14417
14418         (Indexer::Define): Ditto.
14419
14420         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
14421         Cope everywhere with a request for info about the array parameter.
14422
14423 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14424
14425         * tree.cs (RecordNamespace): Fix up to check for the correct key.
14426
14427         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
14428         local_variable_type to extract the string corresponding to the type.
14429
14430         (local_variable_type): Fixup the action to use the new helper method.
14431
14432         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
14433         go.
14434
14435         * expression.cs : Clean out code which uses the above.
14436
14437 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14438
14439         * typemanager.cs (RegisterMethod): Check if we already have an existing key
14440         and bale out if necessary by returning a false.
14441
14442         (RegisterProperty): Ditto.
14443
14444         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
14445         and print out appropriate error messages.
14446
14447         * interface.cs (everywhere): Ditto.
14448
14449         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
14450         location to constructor.
14451
14452         * class.cs (Property, Event, Indexer): Update accordingly.
14453
14454         * ../errors/cs111.cs : Added.
14455
14456         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
14457         of a method, as laid down by the spec.
14458
14459         (Invocation::OverloadResolve): Use the above method.
14460
14461 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14462
14463         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
14464         now take a TypeContainer and a Parameters object.
14465
14466         (ParameterData): Modify return type of ParameterModifier method to be 
14467         Parameter.Modifier and not a string.
14468
14469         (ReflectionParameters, InternalParameters): Update accordingly.
14470
14471         * expression.cs (Argument::GetParameterModifier): Same here.
14472
14473         * support.cs (InternalParameters::ParameterType): Find a better way of determining
14474         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
14475         symbol in it at all so maybe this is only for now.
14476
14477 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14478
14479         * support.cs (InternalParameters): Constructor now takes an extra argument 
14480         which is the actual Parameters class.
14481
14482         (ParameterDesc): Update to provide info on ref/out modifiers.
14483
14484         * class.cs (everywhere): Update call to InternalParameters to pass in
14485         the second argument too.
14486
14487         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14488         to return the modifier info [ref/out etc]
14489
14490         (InternalParameters, ReflectionParameters): Implement the above.
14491
14492         * expression.cs (Argument::ParameterModifier): Similar function to return
14493         info about the argument's modifiers.
14494
14495         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14496         too.
14497
14498         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14499         a new SetFormalParameters object which we pass to InternalParameters.
14500
14501 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14502
14503         * expression.cs (NewArray): Merge into the ArrayCreation class.
14504
14505 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14506
14507         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14508         NewUserdefinedArray into one as there wasn't much of a use in having
14509         two separate ones.
14510
14511         * expression.cs (Argument): Change field's name to ArgType from Type.
14512
14513         (Type): New readonly property which returns the proper type, taking into 
14514         account ref/out modifiers.
14515
14516         (everywhere): Adjust code accordingly for the above.
14517
14518         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14519         whether we are emitting for a ref or out parameter.
14520
14521         * expression.cs (Argument::Emit): Use the above field to set the state.
14522
14523         (LocalVariableReference::Emit): Update to honour the flag and emit the
14524         right stuff.
14525
14526         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14527
14528         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14529
14530         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14531
14532         (ReflectionParameters, InternalParameters): Implement the above method.
14533
14534         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14535         reporting errors.
14536
14537         (Invocation::FullMethodDesc): Ditto. 
14538
14539 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14540
14541         * cs-parser.jay: Add extra production for the second form of array
14542         creation. 
14543
14544         * expression.cs (ArrayCreation): Update to reflect the above
14545         change. 
14546
14547         * Small changes to prepare for Array initialization.
14548
14549 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * typemanager.cs (ImplementsInterface): interface might be null;
14552         Deal with this problem;
14553
14554         Also, we do store negative hits on the cache (null values), so use
14555         this instead of calling t.GetInterfaces on the type everytime.
14556
14557 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14558
14559         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14560
14561         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14562         split functionality out into different classes.
14563
14564         (New::FormArrayType): Move into NewBuiltinArray.
14565
14566         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14567         quite useless.
14568
14569         (NewBuiltinArray): New class to handle creation of built-in arrays.
14570
14571         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14572         account creation of one-dimensional arrays.
14573
14574         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14575
14576         (NewUserdefinedArray::DoResolve): Implement.
14577
14578         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14579
14580         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14581         we maintain inside the TypeManager. This is necessary to perform lookups on the
14582         module builder.
14583
14584         (LookupType): Update to perform GetType on the module builders too.     
14585
14586         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14587
14588         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14589
14590 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14591
14592         * expression.cs (New::DoResolve): Implement guts of array creation.
14593
14594         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14595
14596 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * expression.cs: Fix bug I introduced lsat night that broke
14599         Delegates. 
14600
14601         (Expression.Resolve): Report a 246 error (can not resolve name)
14602         if we find a SimpleName in the stream.
14603
14604         (Expression.ResolveLValue): Ditto.
14605
14606         (Expression.ResolveWithSimpleName): This function is a variant of
14607         ResolveName, this one allows SimpleNames to be returned without a
14608         warning.  The only consumer of SimpleNames is MemberAccess
14609
14610 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14611
14612         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14613         might arrive here.  I have my doubts that this is correct.
14614
14615         * statement.cs (Lock): Implement lock statement.
14616
14617         * cs-parser.jay: Small fixes to support `lock' and `using'
14618
14619         * cs-tokenizer.cs: Remove extra space
14620
14621         * driver.cs: New flag --checked, allows to turn on integer math
14622         checking. 
14623
14624         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14625         Threading.Monitor.Exit 
14626
14627 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14628
14629         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14630         Expression Class to be IndexerAccess.
14631
14632         Notice that Indexer::DoResolve sets the eclass to Value.
14633
14634 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * class.cs (TypeContainer::Emit): Emit code for indexers.
14637
14638         * assign.cs (IAssignMethod): New interface implemented by Indexers
14639         and Properties for handling assignment.
14640
14641         (Assign::Emit): Simplify and reuse code. 
14642
14643         * expression.cs (IndexerAccess, PropertyExpr): Implement
14644         IAssignMethod, clean up old code. 
14645
14646 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14647
14648         * typemanager.cs (ImplementsInterface): New method to determine if a type
14649         implements a given interface. Provides a nice cache too.
14650
14651         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14652         method.
14653
14654         (ConvertReferenceExplicit): Ditto.
14655
14656         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14657         various methods, with correct names etc.
14658
14659         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14660         Operator.UnaryNegation.
14661
14662         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14663         we have a unary plus or minus operator.
14664
14665         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
14666         UnaryMinus.
14667
14668         * everywhere : update accordingly.
14669
14670         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
14671         respectively.
14672
14673         * class.cs (Method::Define): For the case where we are implementing a method
14674         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
14675         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
14676
14677 2001-10-21  Ravi Pratap  <ravi@ximian.com>
14678
14679         * interface.cs (FindMembers): Implement to work around S.R.E
14680         lameness.
14681
14682         * typemanager.cs (IsInterfaceType): Implement.
14683
14684         (FindMembers): Update to handle interface types too.
14685
14686         * expression.cs (ImplicitReferenceConversion): Re-write bits which
14687         use IsAssignableFrom as that is not correct - it doesn't work.
14688
14689         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
14690         and accordingly override EmitStatement.
14691
14692         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
14693         using the correct logic :-)
14694
14695 2001-10-19  Ravi Pratap  <ravi@ximian.com>
14696
14697         * ../errors/cs-11.cs : Add to demonstrate error -11 
14698
14699 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
14700
14701         * assign.cs (Assign::Resolve): Resolve right hand side first, and
14702         then pass this as a hint to ResolveLValue.
14703
14704         * expression.cs (FieldExpr): Add Location information
14705
14706         (FieldExpr::LValueResolve): Report assignment to readonly
14707         variable. 
14708
14709         (Expression::ExprClassFromMemberInfo): Pass location information.
14710
14711         (Expression::ResolveLValue): Add new method that resolves an
14712         LValue. 
14713
14714         (Expression::DoResolveLValue): Default invocation calls
14715         DoResolve. 
14716
14717         (Indexers): New class used to keep track of indexers in a given
14718         Type. 
14719
14720         (IStackStore): Renamed from LValue, as it did not really describe
14721         what this did.  Also ResolveLValue is gone from this interface and
14722         now is part of Expression.
14723
14724         (ElementAccess): Depending on the element access type
14725
14726         * typemanager.cs: Add `indexer_name_type' as a Core type
14727         (System.Runtime.CompilerServices.IndexerNameAttribute)
14728
14729         * statement.cs (Goto): Take a location.
14730
14731 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14732
14733         * delegate.cs (Delegate::VerifyDelegate): New method to verify
14734         if two delegates are compatible.
14735
14736         (NewDelegate::DoResolve): Update to take care of the case when
14737         we instantiate a delegate from another delegate.
14738
14739         * typemanager.cs (FindMembers): Don't even try to look up members
14740         of Delegate types for now.
14741
14742 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14743
14744         * delegate.cs (NewDelegate): New class to take care of delegate
14745         instantiation.
14746
14747         * expression.cs (New): Split the delegate related code out into 
14748         the NewDelegate class.
14749
14750         * delegate.cs (DelegateInvocation): New class to handle delegate 
14751         invocation.
14752
14753         * expression.cs (Invocation): Split out delegate related code into
14754         the DelegateInvocation class.
14755
14756 2001-10-17  Ravi Pratap  <ravi@ximian.com>
14757
14758         * expression.cs (New::DoResolve): Implement delegate creation fully
14759         and according to the spec.
14760
14761         (New::DoEmit): Update to handle delegates differently.
14762
14763         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
14764         because of which we were printing out arguments in reverse order !
14765
14766         * delegate.cs (VerifyMethod): Implement to check if the given method
14767         matches the delegate.
14768
14769         (FullDelegateDesc): Implement.
14770
14771         (VerifyApplicability): Implement.
14772
14773         * expression.cs (Invocation::DoResolve): Update to accordingly handle
14774         delegate invocations too.
14775
14776         (Invocation::Emit): Ditto.
14777
14778         * ../errors/cs1593.cs : Added.
14779
14780         * ../errors/cs1594.cs : Added.
14781
14782         * delegate.cs (InstanceExpression, TargetMethod): New properties.
14783
14784 2001-10-16  Ravi Pratap  <ravi@ximian.com>
14785
14786         * typemanager.cs (intptr_type): Core type for System.IntPtr
14787
14788         (InitCoreTypes): Update for the same.
14789
14790         (iasyncresult_type, asynccallback_type): Ditto.
14791
14792         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
14793         correct.
14794
14795         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
14796         too.
14797
14798         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
14799         the builders for the 4 members of a delegate type :-)
14800
14801         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
14802         type.
14803
14804         * expression.cs (New::DoResolve): Implement guts for delegate creation.
14805
14806         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
14807
14808 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
14809
14810         * statement.cs (Break::Emit): Implement.   
14811         (Continue::Emit): Implement.
14812
14813         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14814         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14815         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14816         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
14817         end loop
14818
14819         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
14820         properties that track the label for the current loop (begin of the
14821         loop and end of the loop).
14822
14823 2001-10-15  Ravi Pratap  <ravi@ximian.com>
14824
14825         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
14826         use of emitting anything at all.
14827
14828         * class.cs, rootcontext.cs : Get rid of calls to the same.
14829
14830         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
14831
14832         (Populate): Define the constructor correctly and set the implementation
14833         attributes.
14834
14835         * typemanager.cs (delegate_types): New hashtable to hold delegates that
14836         have been defined.
14837
14838         (AddDelegateType): Implement.
14839
14840         (IsDelegateType): Implement helper method.
14841
14842         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
14843
14844         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
14845         and accordingly handle it.
14846
14847         * delegate.cs (Populate): Take TypeContainer argument.
14848         Implement bits to define the Invoke method. However, I still haven't figured out
14849         how to take care of the native int bit :-(
14850
14851         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
14852         Qualify the name of the delegate, not its return type !
14853
14854         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
14855         conversion.
14856
14857         (StandardConversionExists): Checking for array types turns out to be recursive.
14858
14859         (ConvertReferenceExplicit): Implement array conversion.
14860
14861         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
14862
14863 2001-10-12  Ravi Pratap  <ravi@ximian.com>
14864
14865         * cs-parser.jay (delegate_declaration): Store the fully qualified
14866         name as it is a type declaration.
14867
14868         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
14869         readonly.
14870
14871         (DefineDelegate): Renamed from Define. Does the same thing essentially,
14872         as TypeContainer::DefineType.
14873
14874         (Populate): Method in which all the definition of the various methods (Invoke)
14875         etc is done.
14876
14877         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
14878         see.
14879
14880         (CloseDelegate): Finally creates the delegate.
14881
14882         * class.cs (TypeContainer::DefineType): Update to define delegates.
14883         (Populate, Emit and CloseType): Do the same thing here too.
14884
14885         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
14886         delegates in all these operations.
14887
14888 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
14889
14890         * expression.cs: LocalTemporary: a new expression used to
14891         reference a temporary that has been created.
14892
14893         * assign.cs: Handle PropertyAccess back here, so that we can
14894         provide the proper semantic access to properties.
14895
14896         * expression.cs (Expression::ConvertReferenceExplicit): Implement
14897         a few more explicit conversions. 
14898
14899         * modifiers.cs: `NEW' modifier maps to HideBySig.
14900
14901         * expression.cs (PropertyExpr): Make this into an
14902         ExpressionStatement, and support the EmitStatement code path. 
14903
14904         Perform get/set error checking, clean up the interface.
14905
14906         * assign.cs: recognize PropertyExprs as targets, and if so, turn
14907         them into toplevel access objects.
14908
14909 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * expression.cs: PropertyExpr::PropertyExpr: use work around the
14912         SRE.
14913
14914         * typemanager.cs: Keep track here of our PropertyBuilders again to
14915         work around lameness in SRE.
14916
14917 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
14918
14919         * expression.cs (LValue::LValueResolve): New method in the
14920         interface, used to perform a second resolution pass for LValues. 
14921
14922         (This::DoResolve): Catch the use of this in static methods.
14923
14924         (This::LValueResolve): Implement.
14925
14926         (This::Store): Remove warning, assigning to `this' in structures
14927         is 
14928
14929         (Invocation::Emit): Deal with invocation of
14930         methods on value types.  We need to pass the address to structure
14931         methods rather than the object itself.  (The equivalent code to
14932         emit "this" for structures leaves the entire structure on the
14933         stack instead of a pointer to it). 
14934
14935         (ParameterReference::DoResolve): Compute the real index for the
14936         argument based on whether the method takes or not a `this' pointer
14937         (ie, the method is static).
14938
14939         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
14940         value types returned from functions when we need to invoke a
14941         method on the sturcture.
14942
14943
14944 2001-10-11  Ravi Pratap  <ravi@ximian.com>
14945
14946         * class.cs (TypeContainer::DefineType): Method to actually do the business of
14947         defining the type in the Modulebuilder or Typebuilder. This is to take
14948         care of nested types which need to be defined on the TypeBuilder using
14949         DefineNestedMethod.
14950
14951         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
14952         methods in RootContext, only ported to be part of TypeContainer.
14953
14954         (TypeContainer::GetInterfaceOrClass): Ditto.
14955
14956         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
14957
14958         * interface.cs (Interface::DefineInterface): New method. Does exactly
14959         what RootContext.CreateInterface did earlier, only it takes care of nested types 
14960         too.
14961
14962         (Interface::GetInterfaces): Move from RootContext here and port.
14963
14964         (Interface::GetInterfaceByName): Same here.
14965
14966         * rootcontext.cs (ResolveTree): Re-write.
14967
14968         (PopulateTypes): Re-write.
14969
14970         * class.cs (TypeContainer::Populate): Populate nested types too.
14971         (TypeContainer::Emit): Emit nested members too.
14972
14973         * typemanager.cs (AddUserType): Do not make use of the FullName property,
14974         instead just use the name argument passed in as it is already fully
14975         qualified.
14976
14977         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
14978         to TypeContainer mapping to see if a type is user-defined.
14979
14980         * class.cs (TypeContainer::CloseType): Implement. 
14981
14982         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
14983         the default constructor.
14984
14985         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
14986         twice.
14987
14988         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
14989
14990         * interface.cs (CloseType): Create the type here.
14991
14992         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
14993         the hierarchy.
14994
14995         Remove all the methods which are now in TypeContainer.
14996
14997 2001-10-10  Ravi Pratap  <ravi@ximian.com>
14998
14999         * delegate.cs (Define): Re-write bits to define the delegate
15000         correctly.
15001
15002 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
15005
15006         * expression.cs (ImplicitReferenceConversion): handle null as well
15007         as a source to convert to any reference type.
15008
15009         * statement.cs (Return): Perform any implicit conversions to
15010         expected return type.  
15011
15012         Validate use of return statement.  
15013
15014         * codegen.cs (EmitContext): Pass the expected return type here.
15015
15016         * class.cs (Method, Constructor, Property): Pass expected return
15017         type to EmitContext.
15018
15019 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
15020
15021         * expression.cs: Make DoResolve take an EmitContext instead of a
15022         TypeContainer.
15023
15024         Replaced `l' and `location' for `loc', for consistency.
15025
15026         (Error, Warning): Remove unneeded Tc argument.
15027
15028         * assign.cs, literal.cs, constant.cs: Update to new calling
15029         convention. 
15030
15031         * codegen.cs: EmitContext now contains a flag indicating whether
15032         code is being generated in a static method or not.
15033
15034         * cs-parser.jay: DecomposeQI, new function that replaces the old
15035         QualifiedIdentifier.  Now we always decompose the assembled
15036         strings from qualified_identifier productions into a group of
15037         memberaccesses.
15038
15039 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * rootcontext.cs: Deal with field-less struct types correctly now
15042         by passing the size option to Define Type.
15043
15044         * class.cs: Removed hack that created one static field. 
15045
15046 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15047
15048         * statement.cs: Moved most of the code generation here. 
15049
15050 2001-10-09  Ravi Pratap  <ravi@ximian.com>
15051
15052         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
15053         seem very right.
15054
15055         (ElementAccess): Remove useless bits for now - keep checks as the spec
15056         says.
15057
15058 2001-10-08  Ravi Pratap  <ravi@ximian.com>
15059
15060         * expression.cs (ElementAccess::DoResolve): Remove my crap code
15061         and start performing checks according to the spec.
15062
15063 2001-10-07  Ravi Pratap  <ravi@ximian.com>
15064
15065         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
15066         rank_specifiers instead.
15067
15068         (rank_specifiers): Change the order in which the rank specifiers are stored
15069
15070         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
15071
15072         * expression.cs (ElementAccess): Implement the LValue interface too.
15073
15074 2001-10-06  Ravi Pratap  <ravi@ximian.com>
15075
15076         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
15077         except that user defined conversions are not included.
15078
15079         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
15080         perform the conversion of the return type, if necessary.
15081
15082         (New::DoResolve): Check whether we are creating an array or an object
15083         and accordingly do the needful.
15084
15085         (New::Emit): Same here.
15086
15087         (New::DoResolve): Implement guts of array creation.
15088
15089         (New::FormLookupType): Helper function.
15090
15091 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15092
15093         * codegen.cs: Removed most of the code generation here, and move the
15094         corresponding code generation bits to the statement classes. 
15095
15096         Added support for try/catch/finalize and throw.
15097
15098         * cs-parser.jay: Added support for try/catch/finalize.
15099
15100         * class.cs: Catch static methods having the flags override,
15101         virtual or abstract.
15102
15103         * expression.cs (UserCast): This user cast was not really doing
15104         what it was supposed to do.  Which is to be born in fully resolved
15105         state.  Parts of the resolution were being performed at Emit time! 
15106
15107         Fixed this code.
15108
15109 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15110
15111         * expression.cs: Implicity convert the result from UserCast.
15112
15113 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15114
15115         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
15116         prevented it from working correctly. 
15117
15118         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
15119         merely ConvertImplicit.
15120
15121 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * typemanager.cs: Make the LookupTypeContainer function static,
15124         and not per-instance.  
15125
15126         * class.cs: Make static FindMembers (the one that takes a Type
15127         argument). 
15128
15129         * codegen.cs: Add EmitForeach here.
15130
15131         * cs-parser.jay: Make foreach a toplevel object instead of the
15132         inline expansion, as we need to perform semantic analysis on it. 
15133
15134 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15135
15136         * expression.cs (Expression::ImplicitUserConversion): Rename to
15137         UserDefinedConversion.
15138
15139         (Expression::UserDefinedConversion): Take an extra argument specifying 
15140         whether we look for explicit user conversions too.
15141
15142         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
15143
15144         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
15145
15146         (ExplicitUserConversion): Make it a call to UserDefinedConversion
15147         with the appropriate arguments.
15148
15149         * cs-parser.jay (cast_expression): Record location too.
15150
15151         * expression.cs (Cast): Record location info.
15152
15153         (Expression::ConvertExplicit): Take location argument.
15154
15155         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
15156         to determine if we are doing explicit conversions.
15157
15158         (UserCast::Emit): Update accordingly.
15159
15160         (Expression::ConvertExplicit): Report an error if everything fails.
15161
15162         * ../errors/cs0030.cs : Add.
15163
15164 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
15165
15166         * modifiers.cs: If the ABSTRACT keyword is present, also set the
15167         virtual and newslot bits. 
15168
15169         * class.cs (TypeContainer::RegisterRequiredImplementations):
15170         Record methods we need.
15171
15172         (TypeContainer::MakeKey): Helper function to make keys for
15173         MethodBases, since the Methodbase key is useless.
15174
15175         (TypeContainer::Populate): Call RegisterRequiredImplementations
15176         before defining the methods.   
15177
15178         Create a mapping for method_builders_to_methods ahead of time
15179         instead of inside a tight loop.
15180
15181         (::RequireMethods):  Accept an object as the data to set into the
15182         hashtable so we can report interface vs abstract method mismatch.
15183
15184 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15185
15186         * report.cs: Make all of it static.
15187
15188         * rootcontext.cs: Drop object_type and value_type computations, as
15189         we have those in the TypeManager anyways.
15190
15191         Drop report instance variable too, now it is a global.
15192
15193         * driver.cs: Use try/catch on command line handling.
15194
15195         Add --probe option to debug the error reporting system with a test
15196         suite. 
15197
15198         * report.cs: Add support for exiting program when a probe
15199         condition is reached.
15200
15201 2001-10-03  Ravi Pratap  <ravi@ximian.com>
15202
15203         * expression.cs (Binary::DoNumericPromotions): Fix the case when
15204         we do a forcible conversion regardless of type, to check if 
15205         ForceConversion returns a null.
15206
15207         (Binary::error19): Use location to report error.
15208
15209         (Unary::error23): Use location here too.
15210
15211         * ../errors/cs0019.cs : Check in.
15212
15213         * ../errors/cs0023.cs : Check in.
15214
15215         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
15216         case of a non-null MethodInfo object with a length of 0 !
15217
15218         (Binary::ResolveOperator): Flag error if overload resolution fails to find
15219         an applicable member - according to the spec :-)
15220         Also fix logic to find members in base types.
15221
15222         (Unary::ResolveOperator): Same here.
15223
15224         (Unary::report23): Change name to error23 and make first argument a TypeContainer
15225         as I was getting thoroughly confused between this and error19 :-)
15226
15227         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
15228         (::FindMostEncompassedType): Implement.
15229         (::FindMostEncompassingType): Implement.
15230         (::StandardConversionExists): Implement.
15231
15232         (UserImplicitCast): Re-vamp. We now need info about most specific
15233         source and target types so that we can do the necessary conversions.
15234
15235         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
15236         mathematical union with no duplicates.
15237
15238 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15239
15240         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
15241         in order from base classes to child classes, so that we can in
15242         child classes look up in our parent for method names and
15243         attributes (required for handling abstract, virtual, new, override
15244         constructs: we need to instrospect our base class, and if we dont
15245         populate the classes in order, the introspection might be
15246         incorrect.  For example, a method could query its parent before
15247         the parent has any methods and would determine that the parent has
15248         no abstract methods (while it could have had them)).
15249
15250         (RootContext::CreateType): Record the order in which we define the
15251         classes.
15252
15253 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
15254
15255         * class.cs (TypeContainer::Populate): Also method definitions can
15256         fail now, keep track of this.
15257
15258         (TypeContainer::FindMembers): Implement support for
15259         DeclaredOnly/noDeclaredOnly flag.
15260
15261         (Constructor::Emit) Return the ConstructorBuilder.
15262
15263         (Method::Emit) Return the MethodBuilder. 
15264         Check for abstract or virtual methods to be public.
15265
15266         * rootcontext.cs (RootContext::CreateType): Register all the
15267         abstract methods required for the class to be complete and the
15268         interface methods that must be implemented. 
15269
15270         * cs-parser.jay: Report error 501 (method requires body if it is
15271         not marked abstract or extern).
15272
15273         * expression.cs (TypeOf::Emit): Implement.
15274
15275         * typemanager.cs: runtime_handle_type, new global type.
15276
15277         * class.cs (Property::Emit): Generate code for properties.
15278
15279 2001-10-02  Ravi Pratap  <ravi@ximian.com>
15280
15281         * expression.cs (Unary::ResolveOperator): Find operators on base type
15282         too - we now conform exactly to the spec.
15283
15284         (Binary::ResolveOperator): Same here.
15285
15286         * class.cs (Operator::Define): Fix minor quirk in the tests.
15287
15288         * ../errors/cs0215.cs : Added.
15289
15290         * ../errors/cs0556.cs : Added.
15291
15292         * ../errors/cs0555.cs : Added.
15293
15294 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
15297         single integer which is really efficient
15298
15299 2001-10-01  Ravi Pratap  <ravi@ximian.com>
15300
15301         *  expression.cs (Expression::ImplicitUserConversion): Use location
15302         even in the case when we are examining True operators.
15303  
15304         * class.cs (Operator::Define): Perform extensive checks to conform
15305         with the rules for operator overloading in the spec.
15306
15307         * expression.cs (Expression::ImplicitReferenceConversion): Implement
15308         some of the other conversions mentioned in the spec.
15309
15310         * typemanager.cs (array_type): New static member for the System.Array built-in
15311         type.
15312
15313         (cloneable_interface): For System.ICloneable interface.
15314
15315         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
15316         we start resolving the tree and populating types.
15317
15318         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
15319  
15320 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * expression.cs (Expression::ExprClassFromMemberInfo,
15323         Expression::Literalize): Create literal expressions from
15324         FieldInfos which are literals.
15325
15326         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
15327         type casts, because they were wrong.  The test suite in tests
15328         caught these ones.
15329
15330         (ImplicitNumericConversion): ushort to ulong requires a widening
15331         cast. 
15332
15333         Int32 constant to long requires widening cast as well.
15334
15335         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
15336         for integers because the type on the stack is not i4.
15337
15338 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
15339
15340         * expression.cs (report118): require location argument. 
15341
15342         * parameter.cs: Do not dereference potential null value.
15343
15344         * class.cs: Catch methods that lack the `new' keyword when
15345         overriding a name.  Report warnings when `new' is used without
15346         anything being there to override.
15347
15348         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
15349
15350         * class.cs: Only add constructor to hashtable if it is non-null
15351         (as now constructors can fail on define).
15352
15353         (TypeManager, Class, Struct): Take location arguments.
15354
15355         Catch field instance initialization in structs as errors.
15356
15357         accepting_filter: a new filter for FindMembers that is static so
15358         that we dont create an instance per invocation.
15359
15360         (Constructor::Define): Catch errors where a struct constructor is
15361         parameterless 
15362
15363         * cs-parser.jay: Pass location information for various new
15364         constructs. 
15365
15366         * delegate.cs (Delegate): take a location argument.
15367
15368         * driver.cs: Do not call EmitCode if there were problesm in the
15369         Definition of the types, as many Builders wont be there. 
15370
15371         * decl.cs (Decl::Decl): Require a location argument.
15372
15373         * cs-tokenizer.cs: Handle properly hex constants that can not fit
15374         into integers, and find the most appropiate integer for it.
15375
15376         * literal.cs: Implement ULongLiteral.
15377
15378         * rootcontext.cs: Provide better information about the location of
15379         failure when CreateType fails.
15380
15381 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
15384         as well.
15385
15386         * expression.cs (Binary::CheckShiftArguments): Add missing type
15387         computation.
15388         (Binary::ResolveOperator): Add type to the logical and and logical
15389         or, Bitwise And/Or and Exclusive Or code paths, it was missing
15390         before.
15391
15392         (Binary::DoNumericPromotions): In the case where either argument
15393         is ulong (and most signed types combined with ulong cause an
15394         error) perform implicit integer constant conversions as well.
15395
15396 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * expression.cs (UserImplicitCast): Method should always be
15399         non-null. 
15400         (Invocation::BetterConversion): Simplified test for IntLiteral.
15401
15402         (Expression::ImplicitNumericConversion): Split this routine out.
15403         Put the code that performs implicit constant integer conversions
15404         here. 
15405
15406         (Expression::Resolve): Become a wrapper around DoResolve so we can
15407         check eclass and type being set after resolve.
15408
15409         (Invocation::Badness): Remove this dead function
15410
15411         (Binary::ResolveOperator): Do not compute the expensive argumnets
15412         unless we have a union for it.
15413
15414         (Probe::Emit): Is needs to do an isinst and then
15415         compare against null.
15416
15417         (::CanConvert): Added Location argument.  If the Location argument
15418         is null (Location.Null), then we do not report errors.  This is
15419         used by the `probe' mechanism of the Explicit conversion.  We do
15420         not want to generate an error for something that the user
15421         explicitly requested to be casted.  But the pipeline for an
15422         explicit cast first tests for potential implicit casts.
15423
15424         So for now, if the Location is null, it means `Probe only' to
15425         avoid adding another argument.   Might have to revise this
15426         strategy later.
15427
15428         (ClassCast): New class used to type cast objects into arbitrary
15429         classes (used in Explicit Reference Conversions).
15430
15431         Implement `as' as well.
15432
15433         Reverted all the patches from Ravi below: they were broken:
15434
15435                 * The use of `level' as a mechanism to stop recursive
15436                   invocations is wrong.  That was there just to catch the
15437                   bug with a strack trace but not as a way of addressing
15438                   the problem.
15439
15440                   To fix the problem we have to *understand* what is going
15441                   on and the interactions and come up with a plan, not
15442                   just get things going.
15443
15444                 * The use of the type conversion cache that I proposed
15445                   last night had an open topic: How does this work across
15446                   protection domains.  A user defined conversion might not
15447                   be public in the location where we are applying the
15448                   conversion, a different conversion might be selected
15449                   (ie, private A->B (better) but public B->A (worse),
15450                   inside A, A->B applies, but outside it, B->A will
15451                   apply).
15452
15453                 * On top of that (ie, even if the above is solved),
15454                   conversions in a cache need to be abstract.  Ie, `To
15455                   convert from an Int to a Short use an OpcodeCast', not
15456                   `To convert from an Int to a Short use the OpcodeCast on
15457                   the variable 5' (which is what this patch was doing).
15458
15459 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15460
15461         * expression.cs (Invocation::ConversionExists): Re-write to use
15462         the conversion cache
15463
15464         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
15465         cache all conversions done, not just user-defined ones.
15466
15467         (Invocation::BetterConversion): The real culprit. Use ConversionExists
15468         to determine if a conversion exists instead of acutually trying to 
15469         perform the conversion. It's faster too.
15470
15471         (Expression::ConvertExplicit): Modify to use ConversionExists to check
15472         and only then attempt the implicit conversion.
15473
15474 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15475
15476         * expression.cs (ConvertImplicit): Use a cache for conversions
15477         already found. Check level of recursion and bail out if necessary.
15478
15479 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * typemanager.cs (string_concat_string_string, string_concat_object_object):
15482         Export standard methods that we expect for string operations.
15483
15484         * statement.cs (Block::UsageWarning): Track usage of variables and
15485         report the errors for not used variables.
15486
15487         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15488         operator. 
15489
15490 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15491
15492         * codegen.cs: remove unnneded code 
15493
15494         * expression.cs: Removed BuiltinTypeAccess class
15495
15496         Fix the order in which implicit conversions are
15497         done.  
15498
15499         The previous fixed dropped support for boxed conversions (adding a
15500         test to the test suite now)
15501
15502         (UserImplicitCast::CanConvert): Remove test for source being null,
15503         that code is broken.  We should not feed a null to begin with, if
15504         we do, then we should track the bug where the problem originates
15505         and not try to cover it up here.
15506
15507         Return a resolved expression of type UserImplicitCast on success
15508         rather than true/false.  Ravi: this is what I was talking about,
15509         the pattern is to use a static method as a "constructor" for
15510         objects. 
15511
15512         Also, do not create arguments until the very last minute,
15513         otherwise we always create the arguments even for lookups that
15514         will never be performed. 
15515
15516         (UserImplicitCast::Resolve): Eliminate, objects of type
15517         UserImplicitCast are born in a fully resolved state. 
15518
15519         * typemanager.cs (InitCoreTypes): Init also value_type
15520         (System.ValueType). 
15521
15522         * expression.cs (Cast::Resolve): First resolve the child expression.
15523
15524         (LValue): Add new method AddressOf to be used by
15525         the `&' operator.  
15526
15527         Change the argument of Store to take an EmitContext instead of an
15528         ILGenerator, because things like FieldExpr need to be able to call
15529         their children expression to generate the instance code. 
15530
15531         (Expression::Error, Expression::Warning): Sugar functions for
15532         reporting errors.
15533
15534         (Expression::MemberLookup): Accept a TypeContainer instead of a
15535         Report as the first argument.
15536
15537         (Expression::ResolvePrimary): Killed.  I still want to improve
15538         this as currently the code is just not right.
15539
15540         (Expression::ResolveMemberAccess): Simplify, but it is still
15541         wrong. 
15542
15543         (Unary::Resolve): Catch errors in AddressOf operators.
15544
15545         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15546         index to a byte for the short-version, or the compiler will choose
15547         the wrong Emit call, which generates the wrong data.
15548
15549         (ParameterReference::Emit, ::Store): same.
15550
15551         (FieldExpr::AddressOf): Implement.
15552
15553         * typemanager.cs: TypeManager: made public variable instead of
15554         property.
15555
15556         * driver.cs: document --fatal.
15557
15558         * report.cs (ErrorMessage, WarningMessage): new names for the old
15559         Error and Warning classes.
15560
15561         * cs-parser.jay (member_access): Turn built-in access to types
15562         into a normal simplename
15563
15564 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15565
15566         * expression.cs (Invocation::BetterConversion): Fix to cope
15567         with q being null, since this was introducing a bug.
15568
15569         * expression.cs (ConvertImplicit): Do built-in conversions first.
15570
15571 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15572
15573         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15574
15575 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15576
15577         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15578         I had introduced long ago (what's new ?).
15579
15580         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15581         the work of all the checking. 
15582         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15583         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15584
15585         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15586         that is the right way. 
15587
15588         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15589         overloading resolution. Use everywhere instead of cutting and pasting code.
15590
15591         (Binary::ResolveOperator): Use MakeUnionSet.
15592
15593         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15594         we have to convert to bool types. Not complete yet.
15595
15596 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * typemanager.cs (TypeManager::CSharpName): support ushort.
15599
15600         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15601         to provide an expression that performsn an implicit constant int
15602         conversion (section 6.1.6).
15603         (Expression::ConvertImplicitRequired): Reworked to include
15604         implicit constant expression conversions.
15605
15606         (Expression::ConvertNumericExplicit): Finished.
15607
15608         (Invocation::Emit): If InstanceExpression is null, then it means
15609         that we perform a call on this.
15610
15611 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * expression.cs (Unary::Emit): Remove some dead code.
15614         (Probe): Implement Resolve and Emit for `is'.
15615         (Expression::ConvertImplicitRequired): Attempt to do constant
15616         expression conversions here.  Maybe should be moved to
15617         ConvertImplicit, but I am not sure.
15618         (Expression::ImplicitLongConstantConversionPossible,
15619         Expression::ImplicitIntConstantConversionPossible): New functions
15620         that tell whether is it possible to apply an implicit constant
15621         expression conversion.
15622
15623         (ConvertNumericExplicit): Started work on explicit numeric
15624         conversions.
15625
15626         * cs-parser.jay: Update operator constants.
15627
15628         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15629         (Parameters::GetSignature): Hook up VerifyArgs here.
15630         (Parameters::VerifyArgs): Verifies that no two arguments have the
15631         same name. 
15632
15633         * class.cs (Operator): Update the operator names to reflect the
15634         ones that the spec expects (as we are just stringizing the
15635         operator names).
15636
15637         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15638         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15639         previous usage did only work for our methods.
15640         (Expression::ConvertImplicit): Handle decimal implicit numeric
15641         conversions as well.
15642         (Expression::InternalTypeConstructor): Used to invoke constructors
15643         on internal types for default promotions.
15644
15645         (Unary::Emit): Implement special handling for the pre/post
15646         increment/decrement for overloaded operators, as they need to have
15647         the same semantics as the other operators.
15648
15649         (Binary::ResolveOperator): ditto.
15650         (Invocation::ConversionExists): ditto.
15651         (UserImplicitCast::Resolve): ditto.
15652
15653 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15654
15655         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15656         operator, return after emitting body. Regression tests pass again !
15657
15658         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15659         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15660         (Invocation::OverloadResolve): Ditto.
15661         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15662
15663         * everywhere : update calls to the above methods accordingly.
15664
15665 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15666
15667         * assign.cs (Assign): Make it inherit from ExpressionStatement.
15668
15669         * expression.cs (ExpressionStatement): New base class used for
15670         expressions that can appear in statements, so that we can provide
15671         an alternate path to generate expression that do not leave a value
15672         on the stack.
15673
15674         (Expression::Emit, and all the derivatives): We no longer return
15675         whether a value is left on the stack or not.  Every expression
15676         after being emitted leaves a single value on the stack.
15677
15678         * codegen.cs (EmitContext::EmitStatementExpression): Use the
15679         facilties of ExpressionStatement if possible.
15680
15681         * cs-parser.jay: Update statement_expression.
15682
15683 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
15684
15685         * driver.cs: Change the wording of message
15686
15687 2001-09-25  Ravi Pratap  <ravi@ximian.com>
15688
15689         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
15690         the type of the expression to the return type of the method if
15691         we have an overloaded operator match ! The regression tests pass again !
15692         (Unary::ResolveOperator): Ditto.
15693
15694         * expression.cs (Invocation::ConversionExists): Correct the member lookup
15695         to find "op_Implicit", not "implicit" ;-)
15696         (UserImplicitCast): New class to take care of user-defined implicit conversions.
15697         (ConvertImplicit, ForceConversion): Take TypeContainer argument
15698
15699         * everywhere : Correct calls to the above accordingly.
15700
15701         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
15702         (ConvertImplicit): Do user-defined conversion if it exists.
15703
15704 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
15705
15706         * assign.cs: track location.
15707         (Resolve): Use implicit conversions on assignment.
15708
15709         * literal.cs: Oops.  Not good, Emit of short access values should
15710         pass (Bytes) or the wrong argument will be selected.
15711
15712         * expression.cs (Unary::Emit): Emit code for -expr.
15713
15714         (Unary::ResolveOperator): Handle `Substract' for non-constants
15715         (substract from zero from the non-constants).
15716         Deal with Doubles as well. 
15717
15718         (Expression::ConvertImplicitRequired): New routine that reports an
15719         error if no implicit conversion exists. 
15720
15721         (Invocation::OverloadResolve): Store the converted implicit
15722         expressions if we make them
15723
15724 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15725
15726         * class.cs (ConstructorInitializer): Take a Location argument.
15727         (ConstructorBaseInitializer): Same here.
15728         (ConstructorThisInitializer): Same here.
15729
15730         * cs-parser.jay : Update all calls accordingly.
15731
15732         * expression.cs (Unary, Binary, New): Take location argument.
15733         Update accordingly everywhere.
15734
15735         * cs-parser.jay : Update all calls to the above to take a location
15736         argument.
15737
15738         * class.cs : Ditto.
15739
15740 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15741
15742         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
15743         (Invocation::BetterConversion): Same here
15744         (Invocation::ConversionExists): Ditto.
15745
15746         (Invocation::ConversionExists): Implement.
15747
15748 2001-09-22  Ravi Pratap  <ravi@ximian.com>
15749
15750         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
15751         Also take an additional TypeContainer argument.
15752
15753         * All over : Pass in TypeContainer as argument to OverloadResolve.
15754
15755         * typemanager.cs (CSharpName): Update to check for the string type and return
15756         that too.
15757
15758         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
15759         a given method.
15760
15761 2001-09-21  Ravi Pratap  <ravi@ximian.com>
15762
15763         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
15764         (Invocation::BetterFunction): Implement.
15765         (Invocation::BetterConversion): Implement.
15766         (Invocation::ConversionExists): Skeleton, no implementation yet.
15767
15768         Okay, things work fine !
15769
15770 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
15771
15772         * typemanager.cs: declare and load enum_type, delegate_type and
15773         void_type. 
15774
15775         * expression.cs (Expression::Emit): Now emit returns a value that
15776         tells whether a value is left on the stack or not.  This strategy
15777         might be reveted tomorrow with a mechanism that would address
15778         multiple assignments.
15779         (Expression::report118): Utility routine to report mismatches on
15780         the ExprClass.
15781
15782         (Unary::Report23): Report impossible type/operator combination
15783         utility function.
15784
15785         (Unary::IsIncrementableNumber): Whether the type can be
15786         incremented or decremented with add.
15787         (Unary::ResolveOperator): Also allow enumerations to be bitwise
15788         complemented. 
15789         (Unary::ResolveOperator): Implement ++, !, ~,
15790
15791         (Invocation::Emit): Deal with new Emit convetion.
15792
15793         * All Expression derivatives: Updated their Emit method to return
15794         whether they leave values on the stack or not.
15795
15796         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
15797         stack for expressions that are statements. 
15798
15799 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15800
15801         * expression.cs (LValue): New interface.  Must be implemented by
15802         LValue objects.
15803         (LocalVariableReference, ParameterReference, FieldExpr): Implement
15804         LValue interface.
15805
15806         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
15807         interface for generating code, simplifies the code.
15808
15809 2001-09-20  Ravi Pratap  <ravi@ximian.com>
15810
15811         * expression.cs (everywhere): Comment out return statements in ::Resolve
15812         methods to avoid the warnings.
15813
15814 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15815
15816         * driver.cs (parse): Report error 2001 if we can not open the
15817         source file.
15818
15819         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
15820         not resolve it.
15821
15822         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
15823         object. 
15824
15825         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
15826         otherwise nested blocks end up with the same index.
15827
15828         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
15829
15830         * expression.cs:  Instead of having FIXMEs in the Resolve
15831         functions, throw exceptions so it is obvious that we are facing a
15832         bug. 
15833
15834         * cs-parser.jay (invocation_expression): Pass Location information.
15835
15836         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
15837         Use a basename for those routines because .NET does not like paths
15838         on them. 
15839
15840         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
15841         already defined.
15842
15843 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
15844
15845         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
15846         are loading the correct data types (throws an exception if not).
15847         (TypeManager::InitCoreTypes): Use CoreLookupType
15848
15849         * expression.cs (Unary::ResolveOperator): return the child
15850         expression for expressions which are just +expr.
15851         (Unary::ResolveOperator): Return negative literals for -LITERAL
15852         expressions (otherwise they are Unary {Literal}).
15853         (Invocation::Badness): Take into account `Implicit constant
15854         expression conversions'.
15855
15856         * literal.cs (LongLiteral): Implement long literal class.
15857         (IntLiteral): export the `Value' of the intliteral. 
15858
15859 2001-09-19  Ravi Pratap  <ravi@ximian.com>
15860
15861         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
15862
15863         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
15864         instead of 'Operator'
15865
15866         * expression.cs (Binary::ResolveOperator): Update accordingly.
15867         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
15868         and 'Minus'
15869
15870         * cs-parser.jay (unary_expression): Update to use the new names.
15871
15872         * gen-treedump.cs (GetUnary): Same here.
15873
15874         * expression.cs (Unary::Resolve): Implement.
15875         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
15876         operators are found instead of making noise ;-)
15877         (Unary::ResolveOperator): New method to do precisely the same thing which
15878         Binary::ResolveOperator does for Binary expressions.
15879         (Unary.method, .Arguments): Add.
15880         (Unary::OperName): Implement.   
15881         (Unary::ForceConversion): Copy and Paste !
15882
15883         * class.cs (Operator::Define): Fix a small bug for the case when we have 
15884         a unary operator.
15885
15886         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
15887         for the inbuilt operators. Only overloading works for now ;-)
15888
15889 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
15892         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
15893
15894         * expression.cs (This::Emit): Implement. 
15895         (This::Resolve): Implement.
15896         (TypeOf:Resolve): Implement.
15897         (Expression::ResolveSimpleName): Add an implicit this to instance
15898         field references. 
15899         (MemberAccess::Resolve): Deal with Parameters and Fields. 
15900         Bind instance variable to Field expressions.
15901         (FieldExpr::Instance): New field used to track the expression that
15902         represents the object instance.
15903         (FieldExpr::Resolve): Track potential errors from MemberLookup not
15904         binding 
15905         (FieldExpr::Emit): Implement.
15906
15907         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
15908         the last instruction contains a return opcode to avoid generating
15909         the last `ret' instruction (this generates correct code, and it is
15910         nice to pass the peverify output).
15911
15912         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
15913         initializer for static and instance variables.
15914         (Constructor::Emit): Allow initializer to be null in the case of
15915         static constructors.  Only emit initializer for instance
15916         constructors. 
15917
15918         (TypeContainer::FindMembers): Return a null array if there are no
15919         matches.
15920
15921         Also fix the code for the MemberTypes.Method branch, as it was not
15922         scanning that for operators (or tried to access null variables before).
15923
15924         * assign.cs (Assign::Emit): Handle instance and static fields. 
15925
15926         * TODO: Updated.
15927
15928         * driver.cs: Stop compilation if there are parse errors.
15929
15930         * cs-parser.jay (constructor_declaration): Provide default base
15931         initializer for non-static constructors.
15932         (constructor_declarator): Do not provide a default base
15933         initializers if none was specified.
15934         Catch the fact that constructors should not have parameters.
15935
15936         * class.cs: Do not emit parent class initializers for static
15937         constructors, that should be flagged as an error.
15938
15939 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15940
15941         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
15942         Move back code into TypeContainer::Populate.
15943
15944 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15945
15946         * class.cs (TypeContainer::AddConstructor): Fix the check to
15947         compare against Name, not Basename. 
15948         (Operator::OpType): Change Plus and Minus to Add and Subtract.
15949
15950         * cs-parser.jay : Update accordingly.
15951
15952         * class.cs (TypeContainer::FindMembers): For the case where we are searching
15953         for methods, don't forget to look into the operators too.
15954         (RegisterMethodBuilder): Helper method to take care of this for
15955         methods, constructors and operators.
15956         (Operator::Define): Completely revamp.
15957         (Operator.OperatorMethod, MethodName): New fields.
15958         (TypeContainer::Populate): Move the registering of builders into
15959         RegisterMethodBuilder.
15960         (Operator::Emit): Re-write.
15961
15962         * expression.cs (Binary::Emit): Comment out code path to emit method
15963         invocation stuff for the case when we have a user defined operator. I am
15964         just not able to get it right !
15965
15966 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
15969         argument. 
15970
15971         (Expression::MemberLookup): Provide a version that allows to
15972         specify the MemberTypes and BindingFlags. 
15973
15974         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
15975         so it was not fetching variable information from outer blocks.
15976
15977         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
15978         Beforefieldinit as it was buggy.
15979
15980         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
15981         that Ravi put here.  
15982
15983         * class.cs (Constructor::Emit): Only emit if block is not null.
15984         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
15985         deal with this by semantically definining it as if the user had
15986         done it.
15987
15988         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
15989         constructors as we now "emit" them at a higher level.
15990
15991         (TypeContainer::DefineDefaultConstructor): Used to define the
15992         default constructors if none was provided.
15993
15994         (ConstructorInitializer): Add methods Resolve and Emit. 
15995
15996         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
15997
15998 2001-09-17  Ravi Pratap  <ravi@ximian.com>
15999
16000         * class.cs (TypeContainer::EmitDefaultConstructor): Register
16001         the default constructor builder with our hashtable for methodbuilders
16002         to methodcores.
16003
16004         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
16005         and argument_count is 0 in which case we have a match.
16006         (Binary::ResolveOperator): More null checking and miscellaneous coding
16007         style cleanup.
16008
16009 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16010
16011         * rootcontext.cs (IsNameSpace): Compare against null.
16012
16013         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
16014
16015         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
16016         and Unary::Operator.
16017
16018         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
16019         accordingly.
16020
16021         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
16022         we have overloaded operators.
16023         (Binary::ResolveOperator): Implement the part which does the operator overload
16024         resolution.
16025
16026         * class.cs (Operator::Emit): Implement.
16027         (TypeContainer::Emit): Emit the operators we have too.
16028
16029         * expression.cs (Binary::Emit): Update to emit the appropriate code for
16030         the case when we have a user-defined operator.
16031
16032 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
16035
16036 2001-09-16  Ravi Pratap  <ravi@ximian.com>
16037
16038         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
16039         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
16040         (Constructor::Emit): Implement.
16041         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
16042         if we have no work to do. 
16043         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
16044         Emit method.
16045
16046         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
16047         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
16048
16049         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
16050         of parent.parent.
16051
16052 2001-09-15  Ravi Pratap  <ravi@ximian.com>
16053
16054         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
16055         in the source.
16056         (Tree::RecordNamespace): Method to do what the name says ;-)
16057         (Tree::Namespaces): Property to get at the namespaces hashtable.
16058
16059         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
16060         keep track.
16061
16062         * rootcontext.cs (IsNamespace): Fixed it :-)
16063
16064 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16065
16066         * class.cs (TypeContainer::FindMembers): Add support for
16067         constructors. 
16068         (MethodCore): New class that encapsulates both the shared aspects
16069         of a Constructor and a Method.  
16070         (Method, Constructor): Factored pieces into MethodCore.
16071
16072         * driver.cs: Added --fatal which makes errors throw exceptions.
16073         Load System assembly as well as part of the standard library.
16074
16075         * report.cs: Allow throwing exceptions on errors for debugging.
16076
16077         * modifiers.cs: Do not use `parent', instead use the real type
16078         container to evaluate permission settings.
16079
16080         * class.cs: Put Ravi's patch back in.  He is right, and we will
16081         have to cope with the
16082
16083 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16084
16085         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
16086         FamORAssem, not FamANDAssem.
16087
16088 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * driver.cs: Added --parse option that only parses its input files
16091         and terminates.
16092
16093         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
16094         incorrect.  IsTopLevel is not used to tell whether an object is
16095         root_types or not (that can be achieved by testing this ==
16096         root_types).  But to see if this is a top-level *class* (not
16097         necessarly our "toplevel" container). 
16098
16099 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16100
16101         * enum.cs (Enum::Define): Modify to call the Lookup method on the
16102         parent instead of a direct call to GetType.
16103
16104 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16105
16106         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
16107         Modifiers.TypeAttr. This should just be a call to that method.
16108
16109         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
16110         object so that we can determine if we are top-level or not.
16111
16112         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
16113         TypeContainer too.
16114
16115         * enum.cs (Enum::Define): Ditto.
16116
16117         * modifiers.cs (FieldAttr): Re-write.
16118
16119         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
16120         (TypeContainer::HaveStaticConstructor): New property to provide access
16121         to precisely that info.
16122
16123         * modifiers.cs (MethodAttr): Re-write.
16124         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
16125
16126         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
16127         of top-level types as claimed.
16128
16129 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16130
16131         * expression.cs (MemberLookup): Fruitless attempt to lookup
16132         constructors.  Maybe I need to emit default constructors?  That
16133         might be it (currently .NET emits this for me automatically).
16134         (Invocation::OverloadResolve): Cope with Arguments == null.
16135         (Invocation::EmitArguments): new function, shared by the new
16136         constructor and us.
16137         (Invocation::Emit): Handle static and instance methods.  Emit
16138         proper call instruction for virtual or non-virtual invocations.
16139         (New::Emit): Implement.
16140         (New::Resolve): Implement.
16141         (MemberAccess:Resolve): Implement.
16142         (MethodGroupExpr::InstanceExpression): used conforming to the spec
16143         to track instances.
16144         (FieldExpr::Resolve): Set type.
16145
16146         * support.cs: Handle empty arguments.
16147                 
16148         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
16149         SimpleLookup): Auxiliary routines to help parse a qualifier
16150         identifier.  
16151
16152         Update qualifier_identifier rule.
16153
16154         * codegen.cs: Removed debugging messages.
16155
16156         * class.cs: Make this a global thing, this acts just as a "key" to
16157         objects that we might have around.
16158
16159         (Populate): Only initialize method_builders_to_methods once.
16160
16161         * expression.cs (PropertyExpr): Initialize type from the
16162         PropertyType. 
16163
16164         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
16165         Resolve pattern.  Attempt to implicitly convert value to boolean.
16166         Emit code.
16167
16168         * expression.cs: Set the type for the int32/int32 argument case.
16169         (Binary::ResolveOperator): Set the return type to boolean for
16170         comparission operators
16171
16172         * typemanager.cs: Remove debugging print code.
16173
16174         (Invocation::Resolve): resolve type.
16175
16176         * class.cs: Allocate a MemberInfo of the correct size, as the code
16177         elsewhere depends on the test to reflect the correct contents.
16178
16179         (Method::) Keep track of parameters, due to System.Reflection holes
16180
16181         (TypeContainer::Populate): Keep track of MethodBuilders to Method
16182         mapping here.
16183
16184         (TypeContainer::FindMembers): Use ArrayList and then copy an array
16185         of the exact size and return that.
16186
16187         (Class::LookupMethodByBuilder): New function that maps
16188         MethodBuilders to its methods.  Required to locate the information
16189         on methods because System.Reflection bit us again.
16190
16191         * support.cs: New file, contains an interface ParameterData and
16192         two implementations: ReflectionParameters and InternalParameters
16193         used to access Parameter information.  We will need to grow this
16194         as required.
16195
16196         * expression.cs (Invocation::GetParameterData): implement a cache
16197         and a wrapper around the ParameterData creation for methods. 
16198         (Invocation::OverloadResolve): Use new code.
16199
16200 2001-09-13  Ravi Pratap  <ravi@ximian.com>
16201
16202         * class.cs (TypeContainer::EmitField): Remove and move into 
16203         (Field::Define): here and modify accordingly.
16204         (Field.FieldBuilder): New member.
16205         (TypeContainer::Populate): Update accordingly.
16206         (TypeContainer::FindMembers): Implement.
16207
16208 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16209
16210         * statement.cs: (VariableInfo::VariableType): New field to be
16211         initialized with the full type once it is resolved. 
16212
16213 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * parameter.cs (GetParameterInfo): Use a type cache to compute
16216         things only once, and to reuse this information
16217
16218         * expression.cs (LocalVariableReference::Emit): Implement.
16219         (OpcodeCast::Emit): fix.
16220
16221         (ParameterReference::Resolve): Implement.
16222         (ParameterReference::Emit): Implement.
16223
16224         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
16225         that are expressions need to stay as Expressions.
16226
16227         * typemanager.cs (CSharpName): Returns the C# name of a type if
16228         possible. 
16229
16230         * expression.cs (Expression::ConvertImplicit): New function that
16231         implements implicit type conversions.
16232
16233         (Expression::ImplicitReferenceConversion): Implements implicit
16234         reference conversions.
16235
16236         (EmptyCast): New type for transparent casts.
16237
16238         (OpcodeCast): New type for casts of types that are performed with
16239         a sequence of bytecodes.
16240
16241         (BoxedCast): New type used for casting value types into reference
16242         types.  Emits a box opcode.
16243
16244         (Binary::DoNumericPromotions): Implements numeric promotions of
16245         and computation of the Binary::Type.
16246
16247         (Binary::EmitBranchable): Optimization.
16248
16249         (Binary::Emit): Implement code emission for expressions.
16250
16251         * typemanager.cs (TypeManager): Added two new core types: sbyte
16252         and byte.
16253
16254 2001-09-12  Ravi Pratap  <ravi@ximian.com>
16255
16256         * class.cs (TypeContainer::FindMembers): Method which does exactly
16257         what Type.FindMembers does, only we don't have to use reflection. No
16258         implementation yet.
16259
16260         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
16261         typecontainer objects as we need to get at them.
16262         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
16263
16264         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
16265         typecontainer object.
16266
16267         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
16268         of just a Report object.
16269
16270 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16271
16272         * class.cs (Event::Define): Go back to using the prefixes "add_" and
16273         "remove_"
16274         (TypeContainer::Populate): Now define the delegates of the type too.
16275         (TypeContainer.Delegates): Property to access the list of delegates defined
16276         in the type.
16277
16278         * delegates.cs (Delegate::Define): Implement partially.
16279
16280         * modifiers.cs (TypeAttr): Handle more flags.
16281
16282 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16283
16284         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
16285         and not <=
16286         (Operator::Define): Re-write logic to get types by using the LookupType method
16287         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
16288         (Indexer::Define): Ditto.
16289         (Event::Define): Ditto.
16290         (Property::Define): Ditto.
16291
16292 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16293
16294         * class.cs (TypeContainer::Populate): Now define operators too. 
16295         (TypeContainer.Operators): New property to access the list of operators
16296         in a type.
16297         (Operator.OperatorMethodBuilder): New member to hold the method builder
16298         for the operator we are defining.
16299         (Operator::Define): Implement.
16300
16301 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16302
16303         * class.cs (Event::Define): Make the prefixes of the accessor methods
16304         addOn_ and removeOn_ 
16305
16306         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
16307         of the location being passed in too. Ideally, this should go later since all
16308         error reporting should be done through the Report object.
16309
16310         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
16311         (Populate): Iterate thru the indexers we have and define them too.
16312         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
16313         for the get and set accessors.
16314         (Indexer::Define): Implement.
16315
16316 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
16317
16318         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
16319         my previous implementation, did not work.
16320
16321         * typemanager.cs: Add a couple of missing types (the longs).
16322
16323         * literal.cs: Use TypeManager.bool_type instead of getting it.
16324
16325         * expression.cs (EventExpr): New kind of expressions.
16326         (Expressio::ExprClassFromMemberInfo): finish
16327
16328 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
16329
16330         * assign.cs: Emit stores to static fields differently.
16331
16332 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16333
16334         * Merge in changes and adjust code to tackle conflicts. Backed out my
16335         code in Assign::Resolve ;-) 
16336
16337 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16338
16339         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
16340         instead Report.Error and also pass in the location.
16341         (CSharpParser::Lexer): New readonly property to return the reference
16342         to the Tokenizer object.
16343         (declare_local_variables): Use Report.Error with location instead of plain 
16344         old error.
16345         (CheckDef): Ditto.
16346
16347         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
16348         (Operator.CheckBinaryOperator): Ditto.
16349
16350         * cs-parser.jay (operator_declarator): Update accordingly.
16351
16352         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
16353         (CheckBinaryOperator): Same here.
16354
16355         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
16356         on the name without any prefixes of namespace names etc. This is because we
16357         already might have something already fully qualified like 
16358         'System.Console.WriteLine'
16359
16360         * assign.cs (Resolve): Begin implementation. Stuck ;-)
16361
16362 2001-09-07  Ravi Pratap  <ravi@ximian.com>
16363
16364         * cs-tokenizer.cs (location): Return a string which also contains
16365         the file name.
16366
16367         * expression.cs (ElementAccess): New class for expressions of the
16368         type 'element access.'
16369         (BaseAccess): New class for expressions of the type 'base access.'
16370         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
16371         respectively.
16372
16373         * cs-parser.jay (element_access): Implement action.
16374         (base_access): Implement actions.
16375         (checked_expression, unchecked_expression): Implement.
16376
16377         * cs-parser.jay (local_variable_type): Correct and implement.
16378         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
16379
16380         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
16381
16382         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
16383         name and the specifiers.
16384
16385         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
16386
16387         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
16388         making them all public ;-)
16389
16390         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
16391         class anyways.
16392
16393 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
16396         PropertyExprs.
16397         (FieldExpr, PropertyExprs): New resolved expressions.
16398         (SimpleName::MemberStaticCheck): Perform static checks for access
16399         to non-static fields on static methods. Maybe this should be
16400         generalized for MemberAccesses. 
16401         (SimpleName::ResolveSimpleName): More work on simple name
16402         resolution. 
16403
16404         * cs-parser.jay (primary_expression/qualified_identifier): track
16405         the parameter index.
16406
16407         * codegen.cs (CodeGen::Save): Catch save exception, report error.
16408         (EmitContext::EmitBoolExpression): Chain to expression generation
16409         instead of temporary hack.
16410         (::EmitStatementExpression): Put generic expression code generation.
16411
16412         * assign.cs (Assign::Emit): Implement variable assignments to
16413         local variables, parameters and fields.
16414
16415 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
16416
16417         * statement.cs (Block::GetVariableInfo): New method, returns the
16418         VariableInfo for a variable name in a block.
16419         (Block::GetVariableType): Implement in terms of GetVariableInfo
16420
16421         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
16422         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
16423
16424 2001-09-06  Ravi Pratap  <ravi@ximian.com>
16425
16426         * cs-parser.jay (operator_declaration): Continue on my quest : update
16427         to take attributes argument.
16428         (event_declaration): Ditto.
16429         (enum_declaration): Ditto.
16430         (indexer_declaration): Ditto.
16431
16432         * class.cs (Operator::Operator): Update constructor accordingly.
16433         (Event::Event): Ditto.
16434
16435         * delegate.cs (Delegate::Delegate): Same here.
16436
16437         * enum.cs (Enum::Enum): Same here.
16438
16439 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16440
16441         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
16442
16443         * ../tests/cs0658.cs : New file to demonstrate error 0658.
16444
16445         * attribute.cs (Attributes): New class to encapsulate all attributes which were
16446         being passed around as an arraylist.
16447         (Attributes::AddAttribute): Method to add attribute sections.
16448
16449         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
16450         (struct_declaration): Update accordingly.
16451         (constant_declaration): Update.
16452         (field_declaration): Update.
16453         (method_header): Update.
16454         (fixed_parameter): Update.
16455         (parameter_array): Ditto.
16456         (property_declaration): Ditto.
16457         (destructor_declaration): Ditto.
16458
16459         * class.cs (Struct::Struct): Update constructors accordingly.
16460         (Class::Class): Ditto.
16461         (Field::Field): Ditto.
16462         (Method::Method): Ditto.
16463         (Property::Property): Ditto.
16464         (TypeContainer::OptAttribute): update property's return type.
16465
16466         * interface.cs (Interface.opt_attributes): New member.
16467         (Interface::Interface): Update to take the extra Attributes argument.
16468
16469         * parameter.cs (Parameter::Parameter): Ditto.
16470
16471         * constant.cs (Constant::Constant): Ditto.
16472
16473         * interface.cs (InterfaceMemberBase): New OptAttributes field.
16474         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
16475         the attributes as a parameter.
16476         (InterfaceProperty): Update constructor call.
16477         (InterfaceEvent): Ditto.
16478         (InterfaceMethod): Ditto.
16479         (InterfaceIndexer): Ditto.
16480
16481         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
16482         pass the attributes too.
16483         (interface_event_declaration): Ditto.
16484         (interface_property_declaration): Ditto.
16485         (interface_method_declaration): Ditto.
16486         (interface_declaration): Ditto.
16487
16488 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * class.cs (Method::Define): Track the "static Main" definition to
16491         create an entry point. 
16492
16493         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16494         EntryPoint if we find it. 
16495
16496         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16497         (EmitContext::ig): Make this variable public.
16498
16499         * driver.cs: Make the default output file be the first file name
16500         with the .exe extension.  
16501
16502         Detect empty compilations
16503
16504         Handle various kinds of output targets.  Handle --target and
16505         rename -t to --dumper.
16506
16507         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16508         methods inherited from Expression return now an Expression.  This
16509         will is used during the tree rewriting as we resolve them during
16510         semantic analysis.
16511
16512         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16513         the spec.  Missing entirely is the information about
16514         accessability of elements of it.
16515
16516         (Expression::ExprClassFromMemberInfo): New constructor for
16517         Expressions that creates a fully initialized Expression based on
16518         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16519         a Type.
16520
16521         (Invocation::Resolve): Begin implementing resolution of invocations.
16522
16523         * literal.cs (StringLiteral):  Implement Emit.
16524
16525 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16526
16527         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16528         member.
16529
16530 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16531
16532         * cs-parser.jay (attribute_arguments): Implement actions.
16533         (attribute): Fix bug in production. Implement action.
16534         (attribute_list): Implement.
16535         (attribute_target): Implement.
16536         (attribute_target_specifier, opt_target_specifier): Implement
16537         (CheckAttributeTarget): New method to check if the attribute target
16538         is valid.
16539         (attribute_section): Implement.
16540         (opt_attributes): Implement.
16541
16542         * attribute.cs : New file to handle attributes.
16543         (Attribute): Class to hold attribute info.
16544
16545         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16546         (attribute_section): Modify production to use 2 different rules to 
16547         achieve the same thing. 1 s/r conflict down !
16548         Clean out commented, useless, non-reducing dimension_separator rules.
16549
16550         * class.cs (TypeContainer.attributes): New member to hold list
16551         of attributes for a type.
16552         (Struct::Struct): Modify to take one more argument, the attribute list.
16553         (Class::Class): Ditto.
16554         (Field::Field): Ditto.
16555         (Method::Method): Ditto.
16556         (Property::Property): Ditto.
16557
16558         * cs-parser.jay (struct_declaration): Update constructor call to
16559         pass in the attributes too.
16560         (class_declaration): Ditto.
16561         (constant_declaration): Ditto.
16562         (field_declaration): Ditto.
16563         (method_header): Ditto.
16564         (fixed_parameter): Ditto.
16565         (parameter_array): Ditto.
16566         (property_declaration): Ditto.
16567
16568         * constant.cs (Constant::Constant): Update constructor similarly.
16569         Use System.Collections.
16570
16571         * parameter.cs (Parameter::Parameter): Update as above.
16572
16573 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16574
16575         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16576         (TypeContainer.delegates): New member to hold list of delegates.
16577
16578         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16579         this time as I seem to be on crack ;-)
16580
16581 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16584         tell whether an identifier represents a namespace.
16585
16586         * expression.cs (NamespaceExpr): A namespace expression, used only
16587         temporarly during expression resolution.
16588         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16589         utility functions to resolve names on expressions.
16590
16591 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16592
16593         * codegen.cs: Add hook for StatementExpressions. 
16594
16595         * class.cs: Fix inverted test for static flag in methods.
16596
16597 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16598
16599         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16600         to make it coincide with MS' number.
16601         (Operator::CheckBinaryOperator): Ditto.
16602
16603         * ../errors/errors.txt : Remove error numbers added earlier.
16604
16605         * ../errors/cs1019.cs : Test case for error # 1019
16606
16607         * ../errros/cs1020.cs : Test case for error # 1020
16608
16609         * cs-parser.jay : Clean out commented cruft.
16610         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16611         used anywhere - non-reducing rule.
16612         (namespace_declarations): Non-reducing rule - comment out.
16613
16614         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16615         with TypeContainer::AddEnum.
16616
16617         * delegate.cs : New file for delegate handling classes.
16618         (Delegate): Class for declaring delegates.
16619
16620         * makefile : Update.
16621
16622         * cs-parser.jay (delegate_declaration): Implement.
16623
16624 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16625
16626         * class.cs (Event::Define): Implement.
16627         (Event.EventBuilder): New member.
16628
16629         * class.cs (TypeContainer::Populate): Update to define all enums and events
16630         we have.
16631         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16632         readonly fields for all these cases ?
16633
16634 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16635
16636         * class.cs (Property): Revamp to use the convention of making fields readonly.
16637         Accordingly modify code elsewhere.
16638
16639         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16640         the Define method of the Property class.
16641
16642         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16643         trivial bug.
16644         (TypeContainer::Populate): Update to define all the properties we have. Also
16645         define all enumerations.
16646
16647         * enum.cs (Define): Implement.
16648
16649 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16650
16651         * cs-parser.jay (overloadable_operator): The semantic value is an
16652         enum of the Operator class.
16653         (operator_declarator): Implement actions.
16654         (operator_declaration): Implement.
16655
16656         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16657         validity of definitions.
16658         (Operator::CheckBinaryOperator): Static method to check for binary operators
16659         (TypeContainer::AddOperator): New method to add an operator to a type.
16660
16661         * cs-parser.jay (indexer_declaration): Added line to actually call the
16662         AddIndexer method so it gets added ;-)
16663
16664         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
16665         already taken care of by the MS compiler ?  
16666
16667 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16668
16669         * class.cs (Operator): New class for operator declarations.
16670         (Operator::OpType): Enum for the various operators.
16671
16672 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16673
16674         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
16675         ostensibly handle this in semantic analysis.
16676
16677         * cs-parser.jay (general_catch_clause): Comment out
16678         (specific_catch_clauses, specific_catch_clause): Ditto.
16679         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
16680         (catch_args, opt_catch_args): New productions.
16681         (catch_clause): Rewrite to use the new productions above
16682         (catch_clauses): Modify accordingly.
16683         (opt_catch_clauses): New production to use in try_statement
16684         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
16685         and re-write the code in the actions to extract the specific and
16686         general catch clauses by being a little smart ;-)
16687
16688         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
16689         Hooray, try and catch statements parse fine !
16690
16691 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16692
16693         * statement.cs (Block::GetVariableType): Fix logic to extract the type
16694         string from the hashtable of variables.
16695
16696         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
16697         I end up making that mistake ;-)
16698         (catch_clauses): Fixed gross error which made Key and Value of the 
16699         DictionaryEntry the same : $1 !!
16700
16701 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16702
16703         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
16704
16705         * cs-parser.jay (event_declaration): Correct to remove the semicolon
16706         when the add and remove accessors are specified. 
16707
16708 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16709
16710         * cs-parser.jay (IndexerDeclaration): New helper class to hold
16711         information about indexer_declarator.
16712         (indexer_declarator): Implement actions.
16713         (parsing_indexer): New local boolean used to keep track of whether
16714         we are parsing indexers or properties. This is necessary because 
16715         implicit_parameters come into picture even for the get accessor in the 
16716         case of an indexer.
16717         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
16718
16719         * class.cs (Indexer): New class for indexer declarations.
16720         (TypeContainer::AddIndexer): New method to add an indexer to a type.
16721         (TypeContainer::indexers): New member to hold list of indexers for the
16722         type.
16723
16724 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16725
16726         * cs-parser.jay (add_accessor_declaration): Implement action.
16727         (remove_accessor_declaration): Implement action.
16728         (event_accessors_declaration): Implement
16729         (variable_declarators): swap statements for first rule - trivial.
16730
16731         * class.cs (Event): New class to hold information about event
16732         declarations.
16733         (TypeContainer::AddEvent): New method to add an event to a type
16734         (TypeContainer::events): New member to hold list of events.
16735
16736         * cs-parser.jay (event_declaration): Implement actions.
16737
16738 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16739
16740         * cs-parser.jay (dim_separators): Implement. Make it a string
16741         concatenating all the commas together, just as they appear.
16742         (opt_dim_separators): Modify accordingly
16743         (rank_specifiers): Update accordingly. Basically do the same
16744         thing - instead, collect the brackets here.
16745         (opt_rank_sepcifiers): Modify accordingly.
16746         (array_type): Modify to actually return the complete type string
16747         instead of ignoring the rank_specifiers.
16748         (expression_list): Implement to collect the expressions
16749         (variable_initializer): Implement. We make it a list of expressions
16750         essentially so that we can handle the array_initializer case neatly too.
16751         (variable_initializer_list): Implement.
16752         (array_initializer): Make it a list of variable_initializers
16753         (opt_array_initializer): Modify accordingly.
16754
16755         * expression.cs (New::NType): Add enumeration to help us
16756         keep track of whether we have an object/delegate creation
16757         or an array creation.
16758         (New:NewType, New::Rank, New::Indices, New::Initializers): New
16759         members to hold data about array creation.
16760         (New:New): Modify to update NewType
16761         (New:New): New Overloaded contructor for the array creation
16762         case.
16763
16764         * cs-parser.jay (array_creation_expression): Implement to call
16765         the overloaded New constructor.
16766
16767 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
16768
16769         * class.cs (TypeContainer::Constructors): Return member
16770         constructors instead of returning null.
16771
16772 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * typemanager.cs (InitCoreTypes): Initialize the various core
16775         types after we have populated the type manager with the user
16776         defined types (this distinction will be important later while
16777         compiling corlib.dll)
16778
16779         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
16780         on Expression Classification.  Now all expressions have a method
16781         `Resolve' and a method `Emit'.
16782
16783         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
16784         generation from working.     Also add some temporary debugging
16785         code. 
16786
16787 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * codegen.cs: Lots of code generation pieces.  This is only the
16790         beginning, will continue tomorrow with more touches of polish.  We
16791         handle the fundamentals of if, while, do, for, return.  Others are
16792         trickier and I need to start working on invocations soon.
16793
16794         * gen-treedump.cs: Bug fix, use s.Increment here instead of
16795         s.InitStatement. 
16796
16797         * codegen.cs (EmitContext): New struct, used during code
16798         emission to keep a context.   Most of the code generation will be
16799         here. 
16800
16801         * cs-parser.jay: Add embedded blocks to the list of statements of
16802         this block.  So code generation proceeds in a top down fashion.
16803
16804 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
16805
16806         * statement.cs: Add support for multiple child blocks.
16807
16808 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
16809
16810         * codegen.cs (EmitCode): New function, will emit the code for a
16811         Block of code given a TypeContainer and its ILGenerator. 
16812
16813         * statement.cs (Block): Standard public readonly optimization.
16814         (Block::Block constructors): Link children. 
16815         (Block::Child): Child Linker.
16816         (Block::EmitVariables): Emits IL variable declarations.
16817
16818         * class.cs: Drop support for MethodGroups here, delay until
16819         Semantic Analysis.
16820         (Method::): Applied the same simplification that I did before, and
16821         move from Properties to public readonly fields.
16822         (Method::ParameterTypes): Returns the parameter types for the
16823         function, and implements a cache that will be useful later when I
16824         do error checking and the semantic analysis on the methods is
16825         performed.
16826         (Constructor::GetCallingConvention): Renamed from CallingConvetion
16827         and made a method, optional argument tells whether this is a class
16828         or a structure to apply the `has-this' bit.
16829         (Method::GetCallingConvention): Implement, returns the calling
16830         convention. 
16831         (Method::Define): Defines the type, a second pass is performed
16832         later to populate the methods.
16833
16834         (Constructor::ParameterTypes): implement a cache similar to the
16835         one on Method::ParameterTypes, useful later when we do semantic
16836         analysis. 
16837
16838         (TypeContainer::EmitMethod):  New method.  Emits methods.
16839
16840         * expression.cs: Removed MethodGroup class from here.
16841
16842         * parameter.cs (Parameters::GetCallingConvention): new method.
16843
16844 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * class.cs (TypeContainer::Populate): Drop RootContext from the
16847         argument. 
16848
16849         (Constructor::CallingConvention): Returns the calling convention.
16850         (Constructor::ParameterTypes): Returns the constructor parameter
16851         types. 
16852
16853         (TypeContainer::AddConstructor): Keep track of default constructor
16854         and the default static constructor.
16855
16856         (Constructor::) Another class that starts using `public readonly'
16857         instead of properties. 
16858
16859         (Constructor::IsDefault): Whether this is a default constructor. 
16860
16861         (Field::) use readonly public fields instead of properties also.
16862
16863         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
16864         track of static constructors;  If none is used, turn on
16865         BeforeFieldInit in the TypeAttributes. 
16866
16867         * cs-parser.jay (opt_argument_list): now the return can be null
16868         for the cases where there are no arguments. 
16869
16870         (constructor_declarator): If there is no implicit `base' or
16871         `this', then invoke the default parent constructor. 
16872
16873         * modifiers.cs (MethodAttr): New static function maps a set of
16874         modifiers flags into a MethodAttributes enum
16875         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
16876         MethodAttr, TypeAttr to represent the various mappings where the
16877         modifiers are used.
16878         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
16879
16880 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * parameter.cs (GetParameterInfo): Fix bug where there would be no
16883         method arguments.
16884
16885         * interface.cs (PopulateIndexer): Implemented the code generator
16886         for interface indexers.
16887
16888 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * interface.cs (InterfaceMemberBase): Now we track the new status
16891         here.  
16892
16893         (PopulateProperty): Implement property population.  Woohoo!  Got
16894         Methods and Properties going today. 
16895
16896         Removed all the properties for interfaces, and replaced them with
16897         `public readonly' fields. 
16898
16899 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
16902         initialize their hashtables/arraylists only when they are needed
16903         instead of doing this always.
16904
16905         * parameter.cs: Handle refs and out parameters.
16906
16907         * cs-parser.jay: Use an ArrayList to construct the arguments
16908         instead of the ParameterCollection, and then cast that to a
16909         Parameter[] array.
16910
16911         * parameter.cs: Drop the use of ParameterCollection and use
16912         instead arrays of Parameters.
16913
16914         (GetParameterInfo): Use the Type, not the Name when resolving
16915         types. 
16916
16917 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
16918
16919         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
16920         and instead use public readonly fields.
16921
16922         * class.cs: Put back walking code for type containers.
16923
16924 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
16925
16926         * class.cs (MakeConstant): Code to define constants.
16927
16928         * rootcontext.cs (LookupType): New function.  Used to locate types 
16929
16930
16931 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
16932
16933         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
16934         this System.Reflection code is.  Kudos to Microsoft
16935
16936         * typemanager.cs: Implement a type cache and avoid loading all
16937         types at boot time.  Wrap in LookupType the internals.  This made
16938         the compiler so much faster.  Wow.  I rule!
16939
16940         * driver.cs: Make sure we always load mscorlib first (for
16941         debugging purposes, nothing really important).
16942
16943         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
16944         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
16945
16946         * rootcontext.cs: Lookup types on their namespace;  Lookup types
16947         on namespaces that have been imported using the `using' keyword.
16948
16949         * class.cs (TypeContainer::TypeAttr): Virtualize.
16950         (Class::TypeAttr): Return attributes suitable for this bad boy.
16951         (Struct::TypeAttr): ditto.
16952         Handle nested classes.
16953         (TypeContainer::) Remove all the type visiting code, it is now
16954         replaced with the rootcontext.cs code
16955
16956         * rootcontext.cs (GetClassBases): Added support for structs. 
16957
16958 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
16959
16960         * interface.cs, statement.cs, class.cs, parameter.cs,
16961         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
16962         Drop use of TypeRefs, and use strings instead.
16963
16964 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
16965
16966         * rootcontext.cs: 
16967
16968         * class.cs (Struct::Struct): set the SEALED flags after
16969         checking the modifiers.
16970         (TypeContainer::TypeAttr): new property, returns the
16971         TypeAttributes for a class.  
16972
16973         * cs-parser.jay (type_list): Oops, list production was creating a
16974         new list of base types.
16975
16976         * rootcontext.cs (StdLib): New property.
16977         (GetInterfaceTypeByName): returns an interface by type name, and
16978         encapsulates error handling here.
16979         (GetInterfaces): simplified.
16980         (ResolveTree): Encapsulated all the tree resolution here.
16981         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
16982         types. 
16983
16984         * driver.cs: Add support for --nostdlib, to avoid loading the
16985         default assemblies.
16986         (Main): Do not put tree resolution here. 
16987
16988         * rootcontext.cs: Beginning of the class resolution.
16989
16990 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * rootcontext.cs: Provide better error reporting. 
16993
16994         * cs-parser.jay (interface_base): set our $$ to be interfaces.
16995
16996         * rootcontext.cs (CreateInterface): Handle the case where there
16997         are no parent interfaces.
16998
16999         (CloseTypes): Routine to flush types at the end.
17000         (CreateInterface): Track types.
17001         (GetInterfaces): Returns an array of Types from the list of
17002         defined interfaces.
17003
17004         * typemanager.c (AddUserType): Mechanism to track user types (puts
17005         the type on the global type hash, and allows us to close it at the
17006         end). 
17007
17008 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
17011         RecordInterface instead.
17012
17013         * cs-parser.jay: Updated to reflect changes above.
17014
17015         * decl.cs (Definition): Keep track of the TypeBuilder type that
17016         represents this type here.  Not sure we will use it in the long
17017         run, but wont hurt for now.
17018
17019         * driver.cs: Smaller changes to accomodate the new code.
17020
17021         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
17022         when done. 
17023
17024         * rootcontext.cs (CreateInterface):  New method, used to create
17025         the System.TypeBuilder type for interfaces.
17026         (ResolveInterfaces): new entry point to resolve the interface
17027         hierarchy. 
17028         (CodeGen): Property, used to keep track of the code generator.
17029
17030 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
17031
17032         * cs-parser.jay: Add a second production for delegate_declaration
17033         with `VOID'.
17034
17035         (enum_body): Put an opt_comma here instead of putting it on
17036         enum_body or enum_member_declarations so we can handle trailing
17037         commas on enumeration members.  Gets rid of a shift/reduce.
17038
17039         (type_list): Need a COMMA in the middle.
17040
17041         (indexer_declaration): Tell tokenizer to recognize get/set
17042
17043         * Remove old targets.
17044
17045         * Re-add the parser target.
17046
17047 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17048
17049         * cs-parser.jay: Add precendence rules for a number of operators
17050         ot reduce the number of shift/reduce conflicts in the grammar.
17051
17052 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
17053
17054         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
17055         and put it here.
17056
17057         Get rid of old crufty code.
17058
17059         * rootcontext.cs: Use this to keep track of the parsed
17060         representation and the defined types available to the program. 
17061
17062         * gen-treedump.cs: adjust for new convention.
17063
17064         * type.cs: Split out the type manager, and the assembly builder
17065         from here. 
17066
17067         * typemanager.cs: the type manager will live here now.
17068
17069         * cil-codegen.cs: And the code generator here. 
17070
17071 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
17072
17073         * makefile: Fixed up for easy making.
17074
17075 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17076
17077         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
17078         the 
17079
17080         (unary_expression): Expand pre_increment_expression and
17081         post_decrement_expression to reduce a shift/reduce.
17082
17083 2001-07-11  Simon Cozens
17084
17085         * cs-tokenizer.cs: Hex numbers should begin with a 0.
17086
17087         Improve allow_keyword_as_indent name.
17088
17089 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
17090
17091         * Adjustments for Beta2. 
17092
17093 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * decl.cs: Added `Define' abstract method.
17096         (InTransit): new property, used to catch recursive definitions. 
17097
17098         * interface.cs: Implement `Define'. 
17099
17100         * modifiers.cs: Map Modifiers.constants to
17101         System.Reflection.TypeAttribute flags.
17102
17103         * class.cs: Keep track of types and user-defined types.
17104         (BuilderInit): New method for creating an assembly
17105         (ResolveType): New function to launch the resolution process, only
17106         used by interfaces for now.
17107
17108         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
17109         that are inserted into the name space. 
17110
17111 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
17112
17113         * ARGH.  I have screwed up my tree so many times due to the use of
17114         rsync rather than using CVS.  Going to fix this at once. 
17115
17116         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
17117         load types.
17118
17119 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
17120
17121         * Experiment successful: Use System.Type rather that our own
17122         version of Type.  
17123
17124 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
17125
17126         * cs-parser.jay: Removed nsAliases from here.
17127
17128         Use new namespaces, handle `using XXX;' 
17129
17130         * namespace.cs: Reimplemented namespace handling, use a recursive
17131         definition of the class.  Now we can keep track of using clauses
17132         and catch invalid using clauses.
17133
17134 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
17135
17136         * gen-treedump.cs: Adapted for all the renaming.
17137
17138         * expression.cs (Expression): this class now has a Type property
17139         which returns an expression Type.
17140
17141         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
17142         `Type', as this has a different meaning now in the base
17143
17144 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * interface.cs, class.cs: Removed from all the sources the
17147         references to signature computation, as we can not do method
17148         signature computation during the parsing time, as we are not
17149         trying to solve at that point distinguishing:
17150
17151         class X {
17152                 void a (Blah x) {}
17153                 void a (NS.Blah x) {}
17154         }
17155
17156         Which depending on the context might be valid or not, as we do not
17157         know if Blah is the same thing as NS.Blah at that point.
17158
17159         * Redid everything so the code uses TypeRefs now instead of
17160         Types.  TypeRefs are just temporary type placeholders, that need
17161         to be resolved.  They initially have a pointer to a string and the
17162         current scope in which they are used.  This is used later by the
17163         compiler to resolve the reference to an actual Type. 
17164
17165         * DeclSpace is no longer a CIR.Type, and neither are
17166         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
17167         are all DeclSpaces, but no Types. 
17168
17169         * type.cs (TypeRefManager): This implements the TypeRef manager,
17170         which keeps track of all the types that need to be resolved after
17171         the parsing has finished. 
17172
17173 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
17174
17175         * ARGH.  We are going to have to store `foreach' as a class rather
17176         than resolving it, as we need to verify error 1579 after name
17177         resolution.   *OR* we could keep a flag that says `This request to
17178         IEnumerator comes from a foreach statement' which we can then use
17179         to generate the error.
17180
17181 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * class.cs (TypeContainer.AddMethod): we now add methods to the
17184         MethodGroup instead of the method hashtable.  
17185
17186         * expression.cs: Add MethodGroup abstraction, which gets us one
17187         step closer to the specification in the way we handle method
17188         declarations.  
17189
17190         * cs-parser.jay (primary_expression): qualified_identifier now
17191         tried to match up an identifier to a local variable reference or
17192         to a parameter reference.
17193
17194         current_local_parameters is now a parser global variable that
17195         points to the current parameters for the block, used during name
17196         lookup.
17197
17198         (property_declaration): Now creates an implicit `value' argument to
17199         the set accessor.
17200
17201 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * parameter.cs: Do not use `param' arguments as part of the
17204         signature, per the spec.
17205
17206 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
17207
17208         * decl.cs: Base class for classes, structs and interfaces.  This
17209         is the "Declaration Space" 
17210
17211         * cs-parser.jay: Use CheckDef for checking declaration errors
17212         instead of having one on each function.
17213
17214         * class.cs: Factor out some code for handling error handling in
17215         accordance to the "Declarations" section in the "Basic Concepts"
17216         chapter in the ECMA C# spec.
17217
17218         * interface.cs: Make all interface member classes derive from
17219         InterfaceMemberBase.
17220
17221 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * Many things: all interfaces are parsed and generated in
17224         gen-treedump.  Support for member variables, constructors,
17225         destructors, properties, constants is there.
17226
17227         Beginning of the IL backend, but very little done, just there for
17228         testing purposes. 
17229
17230 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * cs-parser.jay: Fix labeled statement.
17233
17234         * cs-tokenizer.cs (escape): Escape " and ' always.
17235         ref_line, ref_name: keep track of the line/filename as instructed
17236         by #line by the compiler.
17237         Parse #line.
17238
17239 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
17242         to match the values in System.CodeDOM.
17243
17244         Divid renamed to Divide.
17245
17246         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
17247         statements. 
17248         (Statements.set): remove.
17249
17250         * System.CodeDOM/CodeCatchClause.cs: always have a valid
17251         statements. 
17252
17253         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
17254         falseStatements always have valid values. 
17255
17256         * cs-parser.jay: Use System.CodeDOM now.
17257