2004-11-05 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
2
3         * Indexers were using the ShortName when defining themselves,
4         causing a regression in the compiler bootstrap when applying the
5         patch from 2004-11-02 (first part), now they use their full name
6         and the bug is gone.
7
8 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9
10         * driver.cs: Strip the path from the names of embedded resources. Fixes
11         #68519.
12
13 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14
15         Fix error message regression: cs0104-2.cs.
16         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
17         (AliasEntry.Resolve): Update.
18         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
19         'silent' flag.
20         (RootContext.LookupType): Update.
21
22 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
23
24         * cs-parser.jay: Add support for handling accessor modifiers
25         * class: Add support port accessor modifiers and error checking,
26         define PropertyMethod.Define as virtual (not abstract anymore)
27         * ecore.cs: Add checking for proeprties access with access modifiers
28         * iterators.cs: Modify Accessor constructor call based in the modified
29         constructor
30 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
31
32         * expression.cs (StringConcat): Handle being called twice,
33         as when we have a concat in a field init with more than two
34         ctors in the class
35
36 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
37
38         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
39         special case explicit implementations, we should always produce
40         the .property or .event declaration.
41         
42         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
43         since it will not return correct data if people use this
44         unresolved in the presence of using statements (see test-313).
45
46         * class.cs (MethodData.Define): If we are an explicit interface
47         implementation, set the method name to the full name of the
48         interface plus the name of the method.  
49
50         Notice that using the method.MethodName.GetFullName() does not
51         work, as it will only contain the name as declared on the source
52         file (it can be a shorthand in the presence of using statements)
53         and not the fully qualifed type name, for example:
54
55         using System;
56
57         class D : ICloneable {
58                 object ICloneable.Clone ()  {
59                 }
60         }
61
62         Would produce a method called `ICloneable.Clone' instead of
63         `System.ICloneable.Clone'.
64
65         * namespace.cs (Alias.Resolve): Use GetPartialName.
66         
67 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
68
69         * cs-parser.jay: Add error 1055 report.
70
71 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
72
73         * assign.cs (Assign.DoResolve): Only do the transform of
74         assignment into a New if the types are compatible, if not, fall
75         through and let the implicit code deal with the errors and with
76         the necessary conversions. 
77
78 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
79
80         * cs-parser.jay: Add error 1031 report.
81
82         * cs-tokenizer.cs: Add location for error 1038.
83
84 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
85
86         * cs-parser.jay: Add error 1016 report.
87
88 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
89
90         * cs-parser.jay: Add errors 1575,1611 report.
91
92 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
93
94         * cs-parser.jay: Add error 1001 report.
95
96 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
97
98         Fix #68850
99         * attribute.cs (GetMarshal): Add method argument for
100         caller identification.
101
102         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
103         agument for GetMarshal and RuntimeMissingSupport.
104
105 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
106
107         * attribute.cs (ExtractSecurityPermissionSet): Removed
108         TypeManager.code_access_permission_type.
109
110         * typemanager.cs: Removed TypeManager.code_access_permission_type.
111
112 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
113
114         * expression.cs (LocalVariableReference.DoResolveLValue): Check
115         for obsolete use of a variable here.   Fixes regression on errors
116         cs0619-25 and cs0619-26.
117
118 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
119
120         Fix #62358, implemented security attribute encoding.
121
122         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
123         Tests permitted SecurityAction for assembly or other types.
124         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
125         data from SecurityPermissionAttribute to PermisionSet class.
126
127         * class.cs (ApplyAttributeBuilder): Added special handling
128         for System.Security.Permissions.SecurityAttribute based types.
129
130         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
131         special handling for System.Security.Permissions.SecurityAttribute
132         based types.
133
134         * enum.cs (ApplyAttributeBuilder): Added special handling
135         for System.Security.Permissions.SecurityAttribute based types.
136
137         * parameter.cs (ApplyAttributeBuilder): Added special handling
138         for System.Security.Permissions.SecurityAttribute based types.
139
140         * rootcontext.cs: Next 2 core types.
141
142         * typemanager.cs (TypeManager.security_permission_attr_type):
143         Built in type for the SecurityPermission Attribute.
144         (code_access_permission_type): Build in type.
145
146 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
147
148         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
149         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
150         all of this information into
151         EmitContext.EmitCapturedVariableInstance.
152         
153         * codegen.cs (EmitCapturedVariableInstance): move here the
154         funcionality of emitting an ldarg.0 in the presence of a
155         remapping.   This centralizes the instance emit code.
156
157         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
158         then emit a load of this: it means that we have reached the
159         topmost ScopeInfo: the one that contains the pointer to the
160         instance of the class hosting the anonymous method.
161
162         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
163         captures to the topmost CaptureContext.
164
165 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
166
167         * expression.cs (LocalVariableReference): Move the knowledge about
168         the iterators into codegen's EmitCapturedVariableInstance.
169
170 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
171
172         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
173         all code paths return a value from an anonymous method (it is the
174         same as the 161 error, but for anonymous methods).
175
176 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
177
178         The introduction of anonymous methods in the compiler changed
179         various ways of doing things in the compiler.  The most
180         significant one is the hard split between the resolution phase
181         and the emission phases of the compiler.
182
183         For instance, routines that referenced local variables no
184         longer can safely create temporary variables during the
185         resolution phase: they must do so from the emission phase,
186         since the variable might have been "captured", hence access to
187         it can not be done with the local-variable operations from the runtime.
188         
189         * statement.cs 
190
191         (Block.Flags): New flag `IsTopLevel' to indicate that this block
192         is a toplevel block.
193
194         (ToplevelBlock): A new kind of Block, these are the blocks that
195         are created by the parser for all toplevel method bodies.  These
196         include methods, accessors and anonymous methods.
197
198         These contain some extra information not found in regular blocks:
199         A pointer to an optional CaptureContext (for tracking captured
200         local variables and parameters).  A pointer to the parent
201         ToplevelBlock.
202         
203         (Return.Resolve): Catch missmatches when returning a value from an
204         anonymous method (error 1662).
205         Invoke NeedReturnLabel from the Resolve phase instead of the emit
206         phase.
207
208         (Break.Resolve): ditto.
209
210         (SwitchLabel): instead of defining the labels during the
211         resolution phase, we now turned the public ILLabel and ILLabelCode
212         labels into methods called GetILLabelCode() and GetILLabel() that
213         only define the label during the Emit phase.
214
215         (GotoCase): Track the SwitchLabel instead of the computed label
216         (its contained therein).  Emit the code by using
217         SwitchLabel.GetILLabelCode ().
218
219         (LocalInfo.Flags.Captured): A new flag has been introduce to track
220         whether the Local has been captured or not.
221
222         (LocalInfo.IsCaptured): New property, used to tell whether the
223         local has been captured.
224         
225         * anonymous.cs: Vastly updated to contain the anonymous method
226         support.
227
228         The main classes here are: CaptureContext which tracks any
229         captured information for a toplevel block and ScopeInfo used to
230         track the activation frames for various local variables.   
231
232         Each toplevel block has an optional capture context associated
233         with it.  When a method contains an anonymous method both the
234         toplevel method and the anonymous method will create a capture
235         context.   When variables or parameters are captured, they are
236         recorded on the CaptureContext that owns them, for example:
237
238         void Demo () {
239              int a;
240              MyDelegate d = delegate {
241                  a = 1;
242              }
243         }
244
245         Here `a' will be recorded as captured on the toplevel
246         CapturedContext, the inner captured context will not have anything
247         (it will only have data if local variables or parameters from it
248         are captured in a nested anonymous method.
249
250         The ScopeInfo is used to track the activation frames for local
251         variables, for example:
252
253         for (int i = 0; i < 10; i++)
254                 for (int j = 0; j < 10; j++){
255                    MyDelegate d = delegate {
256                         call (i, j);
257                    }
258                 }
259
260         At runtime this captures a single captured variable `i', but it
261         captures 10 different versions of the variable `j'.  The variable
262         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
263         recorded on a child.  
264
265         The toplevel ScopeInfo will also track information like the `this'
266         pointer if instance variables were referenced (this is necessary
267         as the anonymous method lives inside a nested class in the host
268         type of the method). 
269
270         (AnonymousMethod): Expanded to track the Toplevel, implement
271         `AnonymousMethod.Compatible' to tell whether an anonymous method
272         can be converted to a target delegate type. 
273
274         The routine now also produces the anonymous method content
275
276         (AnonymousDelegate): A helper class that derives from
277         DelegateCreation, this is used to generate the code necessary to
278         produce the delegate for the anonymous method that was created. 
279
280         * assign.cs: API adjustments for new changes in
281         Convert.ImplicitStandardConversionExists.
282
283         * class.cs: Adjustments to cope with the fact that now toplevel
284         blocks are of type `ToplevelBlock'. 
285
286         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
287         insteda of standard blocks.
288
289         Flag errors if params arguments are passed to anonymous methods.
290
291         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
292         `CurrentAnonymousMethod' which points to the current Anonymous
293         Method.  The variable points to the AnonymousMethod class that
294         holds the code being compiled.  It is set in the new EmitContext
295         created for the anonymous method.
296
297         (EmitContext.Phase): Introduce a variable and an enumeration to
298         assist in enforcing some rules about when and where we are allowed
299         to invoke certain methods (EmitContext.NeedsReturnLabel is the
300         only one that enfonces this right now).
301
302         (EmitContext.HaveCaptureInfo): new helper method that returns
303         whether we have a CapturedContext initialized.
304
305         (EmitContext.CaptureVariable): New method used to register that a
306         LocalInfo must be flagged for capturing. 
307
308         (EmitContext.CapturedParameter): New method used to register that a
309         parameters must be flagged for capturing. 
310         
311         (EmitContext.CapturedField): New method used to register that a
312         field must be flagged for capturing. 
313
314         (EmitContext.HaveCapturedVariables,
315         EmitContext.HaveCapturedFields): Return whether there are captured
316         variables or fields. 
317
318         (EmitContext.EmitMethodHostInstance): This is used to emit the
319         instance for the anonymous method.  The instance might be null
320         (static methods), this (for anonymous methods that capture nothing
321         and happen to live side-by-side with the current method body) or a
322         more complicated expression if the method has a CaptureContext.
323
324         (EmitContext.EmitTopBlock): Routine that drives the emission of
325         code: it will first resolve the top block, then emit any metadata
326         and then emit the code.  The split is done so that we can extract
327         any anonymous methods and flag any captured variables/parameters.
328         
329         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
330         during this phase, the ILGenerator should not be used as labels
331         and local variables declared here might not be accessible to any
332         code that is part of an anonymous method.  
333
334         Exceptions to this include the temporary variables that are
335         created by some statements internally for holding temporary
336         variables. 
337         
338         (EmitContext.EmitMeta): New routine, in charge of emitting all the
339         metadata for a cb
340
341         (EmitContext.TemporaryReturn): This method is typically called
342         from the Emit phase, and its the only place where we allow the
343         ReturnLabel to be defined other than the EmitMeta.  The reason is
344         that otherwise we would have to duplicate a lot of logic in the
345         Resolve phases of various methods that today is on the Emit
346         phase. 
347
348         (EmitContext.NeedReturnLabel): This no longer creates the label,
349         as the ILGenerator is not valid during the resolve phase.
350
351         (EmitContext.EmitThis): Extended the knowledge in this class to
352         work in anonymous methods in addition to iterators. 
353
354         (EmitContext.EmitCapturedVariableInstance): This emits whatever
355         code is necessary on the stack to access the instance to a local
356         variable (the variable will be accessed as a field).
357
358         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
359         EmitContext.EmitAddressOfParameter): Routines to support
360         parameters (not completed at this point). 
361         
362         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
363         will also remove the parameters.
364
365         * convert.cs (Convert): Define a `ConstantEC' which points to a
366         null.  This is just to prefity some code that uses
367         ImplicitStandardConversion code and do not have an EmitContext
368         handy.
369
370         The idea is to flag explicitly that at that point in time, it is
371         known that the conversion will not trigger the delegate checking
372         code in implicit conversions (which requires a valid
373         EmitContext). 
374
375         Everywhere: pass new EmitContext parameter since
376         ImplicitStandardConversionExists now requires it to check for
377         anonymous method conversions. 
378
379         (Convert.ImplicitStandardConversionExists): If the type of an
380         expression is the anonymous_method_type, and the type is a
381         delegate, we invoke the AnonymousMethod.Compatible method to check
382         whether an implicit conversion is possible. 
383
384         (Convert.ImplicitConversionStandard): Only do implicit method
385         group conversions if the language level is not ISO_1.
386
387         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
388         MethodInfo for the Invoke method.  used by Delegate and
389         AnonymousDelegate.
390
391         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
392         method conversions if the target type is a delegate.
393
394         Removed extra debugging nops.
395
396         (LocalVariableReference): Turn the `local_info' into a public
397         field. 
398
399         Add `prepared' field, the same hack used for FieldExprs to cope
400         with composed assignments, as Local variables do not necessarily
401         operate purely on the stack as they used to: they can be captured
402         fields. 
403
404         Add `temp' for a temporary result, like fields.
405
406         Refactor DoResolve and DoResolveLValue into DoResolveBase.
407
408         It now copes with Local variables that are captured and emits the
409         proper instance variable to load it from a field in the captured
410         case. 
411
412         (ParameterReference.DoResolveBase): During the resolve phase,
413         capture parameters if we are in an anonymous method.
414
415         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
416         anonymous method, use the EmitContext helper routines to emit the
417         parameter reference.
418
419         * iterators.cs: Set RemapToProxy to true/false during the
420         EmitDispose class.
421
422         * parameters.cs (GetParameterByName): New helper method. 
423
424         * typemanager.cs (anonymous_method_type) a new type that
425         represents an anonyous method.  This is always an internal type,
426         used as a fencepost to test against the anonymous-methodness of an
427         expression. 
428         
429 2004-10-24  Marek Safar  <marek.safar@seznam.cz>
430
431         Fixed bugs #63705, #67130
432         * decl.cs (MemberCache.MemberCache): Add parameter to distinguish
433         imported and defined interfaces.
434         (CacheEntry, EntryType): Changed to protected internal.
435
436         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
437         interfaces too.
438
439         * typemanager.cs (LookupInterfaceContainer): New method.
440         Fills member container from base interfaces.
441
442 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
443
444         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
445         561 report.
446         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
447
448 2004-10-18  Martin Baulig  <martin@ximian.com>
449
450         Merged latest changes into gmcs.  Please keep this comment in
451         here, it makes it easier for me to see what changed in MCS since
452         the last time I merged.
453
454 2004-10-18  Martin Baulig  <martin@ximian.com>
455
456         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
457         `Type' directly, but call ResolveType() on it.
458         (Catch.Resolve): Likewise.
459         (Foreach.Resolve): Likewise.
460
461 2004-10-18  Martin Baulig  <martin@ximian.com>
462
463         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
464         `Type' directly, but call ResolveType() on it.
465         (Probe.DoResolve): Likewise.
466         (ArrayCreation.LookupType): Likewise.
467         (TypeOf.DoResolve): Likewise.
468         (SizeOf.DoResolve): Likewise.
469
470 2004-10-18  Martin Baulig  <martin@ximian.com>
471
472         * expression.cs (Invocation.BetterFunction): Put back
473         TypeManager.TypeToCoreType().
474
475 2004-10-18  Raja R Harinath  <rharinath@novell.com>
476
477         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
478         the ResolveType.
479
480 2004-10-18  Martin Baulig  <martin@ximian.com>
481
482         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
483         `Type' directly, but call ResolveType() on it.
484
485 2004-10-18  Martin Baulig  <martin@ximian.com>
486
487         * class.cs (FieldMember.Define): Don't access the TypeExpr's
488         `Type' directly, but call ResolveType() on it.
489         (MemberBase.DoDefine): Likewise.
490
491         * expression.cs (New.DoResolve): Don't access the TypeExpr's
492         `Type' directly, but call ResolveType() on it.
493         (ComposedCast.DoResolveAsTypeStep): Likewise.
494
495         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
496         `Type' directly, but call ResolveType() on it.
497
498 2004-10-17  John Luke  <john.luke@gmail.com>
499
500         * class.cs (Operator.GetSignatureForError): use CSharpName
501
502         * parameter.cs (Parameter.GetSignatureForError): Returns
503         correct name even if was not defined.
504
505 2004-10-13  Raja R Harinath  <rharinath@novell.com>
506
507         Fix #65816.
508         * class.cs (TypeContainer.EmitContext): New property.
509         (DefineNestedTypes): Create an emitcontext for each part.
510         (MethodCore.DoDefineParameters): Use container's emitcontext.
511         Pass type array to InternalParameters.
512         (MemberBase.DoDefine): Use container's emitcontext.
513         (FieldMember.Define): Likewise.
514         (Event.Define): Likewise.
515         (SetMethod.GetParameterInfo): Change argument to EmitContext.
516         Pass type array to InternalParameters.
517         (SetIndexerMethod.GetParameterInfo): Likewise.
518         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
519         * delegate.cs (Define): Pass emitcontext to
520         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
521         array to InternalParameters.
522         * expression.cs (ParameterReference.DoResolveBase): Pass
523         emitcontext to GetParameterInfo.
524         (ComposedCast.DoResolveAsTypeStep): Remove check on
525         ec.ResolvingTypeTree.
526         * parameter.cs (Parameter.Resolve): Change argument to
527         EmitContext.  Use ResolveAsTypeTerminal.
528         (Parameter.GetSignature): Change argument to EmitContext.
529         (Parameters.ComputeSignature): Likewise.
530         (Parameters.ComputeParameterTypes): Likewise.
531         (Parameters.GetParameterInfo): Likewise.
532         (Parameters.ComputeAndDefineParameterTypes): Likewise.
533         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
534         * support.cs (InternalParameters..ctor): Remove variant that takes
535         a DeclSpace.
536         * typemanager.cs (system_intptr_expr): New.
537         (InitExpressionTypes): Initialize it.
538
539 2004-10-12  Chris Toshok  <toshok@ximian.com>
540
541         * cs-parser.jay: fix location for try_statement and catch_clause.
542
543 2004-10-11  Martin Baulig  <martin@ximian.com>
544
545         * report.cs: Don't make --fatal abort on warnings, we have
546         -warnaserror for that.
547
548 2004-10-07  Raja R Harinath  <rharinath@novell.com>
549
550         More DeclSpace.ResolveType avoidance.
551         * decl.cs (MemberCore.InUnsafe): New property.
552         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
553         with newly created EmitContext.
554         (FieldMember.Define): Likewise.
555         * delegate.cs (Delegate.Define): Likewise.
556         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
557         only if normal name-lookup fails.
558         (TypeExpr.DoResolve): Enable error-checking.
559         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
560         (SizeOf.DoResolve): Likewise.
561         (ComposedCast.DoResolveAsTypeStep): Likewise.
562         (StackAlloc.DoResolve): Likewise.
563         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
564         (Block.Unsafe): New property.
565         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
566         (Unsafe): Set 'unsafe' flag of contained block.
567         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
568         (Fixed.Resolve): Likewise.
569         (Catch.Resolve): Likewise.
570         (Using.ResolveLocalVariableDecls): Likewise.
571         (Foreach.Resolve): Likewise.
572
573 2004-10-05  John Luke <john.luke@gmail.com>
574
575         * cs-parser.jay: add location to error CS0175
576
577 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
578
579         * ecore.cs (Expression.Constantity): Add support for turning null
580         into a constant.
581
582         * const.cs (Const.Define): Allow constants to be reference types
583         as long as the value is Null.
584
585 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
586
587         * namespace.cs (NamespaceEntry.Using): No matter which warning
588         level is set, check if this namespace name has already been added.
589
590 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
591
592         * expression.cs: reftype [!=]= null should always use br[true,false].
593         # 67410
594
595 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
596
597         Fix #67108
598         * attribute.cs: Enum conversion moved to 
599         GetAttributeArgumentExpression to be applied to the all
600         expressions.
601
602 2004-10-01  Raja R Harinath  <rharinath@novell.com>
603
604         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
605         * class.c (TypeContainer.DefineType): Flag error if
606         base types aren't accessible due to access permissions.
607         * decl.cs (DeclSpace.ResolveType): Move logic to
608         Expression.ResolveAsTypeTerminal.
609         (DeclSpace.ResolveTypeExpr): Thin layer over
610         Expression.ResolveAsTypeTerminal.
611         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
612         Refactor code into NestedAccess.  Use it.
613         (DeclSpace.NestedAccess): New.
614         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
615         argument to silence errors.  Check access permissions.
616         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
617         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
618         (Cast.DoResolve): Likewise.
619         (New.DoResolve): Likewise.
620         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
621         (TypeOf.DoResolve): Likewise.
622
623         * expression.cs (Invocation.BetterConversion): Return the Type of
624         the better conversion.  Implement section 14.4.2.3 more faithfully.
625         (Invocation.BetterFunction): Make boolean.  Make correspondence to
626         section 14.4.2.2 explicit.
627         (Invocation.OverloadResolve): Update.
628         (Invocation): Remove is_base field.
629         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
630         (Invocation.Emit): Likewise.
631
632 2004-09-27  Raja R Harinath  <rharinath@novell.com>
633
634         * README: Update to changes.
635
636 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
637
638         * cs-parser.jay: Reverted 642 warning fix.
639
640 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
641
642         Fix bug #66615
643         * decl.cs (FindMemberWithSameName): Indexer can have more than
644         1 argument.
645
646 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
647
648         * expression.cs (LocalVariableReference.DoResolveLValue):
649         Do not report warning 219 for out values.
650         (EmptyExpression.Null): New member to avoid extra allocations.
651
652 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
653
654         * cs-parser.jay: Fix wrong warning 642 report.
655
656         * cs-tokenizer.cs (CheckNextToken): New helper;
657         Inspect next character if is same as expected.
658
659 2004-09-23  Martin Baulig  <martin@ximian.com>
660
661         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
662         (Convert.ImplicitReferenceConversionExists): Likewise.
663
664 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
665
666         * class.cs (Operator.Define): Add error 448 and 559 report.
667
668 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
669
670         * class.cs (MemberBase.IsTypePermitted): New protected
671         method for checking error CS0610.
672
673 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
674
675         * class.cs (TypeContainer.HasExplicitLayout): New property
676         Returns whether container has StructLayout attribute set Explicit.
677         (FieldMember): New abstract class for consts and fields.
678         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
679         (Field): Reuse FieldMember.
680
681         * const.cs (Const): Reuse FieldMember.
682
683         * rootcontext.cs: EmitConstants call moved to class.
684
685 2004-09-22  Martin Baulig  <martin@ximian.com>
686
687         Thanks to Peter Sestoft for this bug report.
688
689         * expression.cs (Conditional): If both the `trueExpr' and the
690         `falseExpr' is a NullLiteral, return a NullLiteral.
691
692 2004-09-22  Martin Baulig  <martin@ximian.com>
693
694         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
695         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
696         for the "get_Current" call.
697
698 2004-09-22  Martin Baulig  <martin@ximian.com>
699
700         Marek and me just fixed one of our oldest bugs: #28562 :-)
701
702         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
703
704         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
705         we're an EnumConstant, just return that.
706         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
707         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
708         to get the value which'll actually be written into the attribute.
709         However, we have to use GetValue() to access the attribute's value
710         in the compiler.        
711
712 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
713
714         * constant.cs (Constant.IsNegative): New abstract property
715         IsNegative.
716
717         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
718         (StackAlloc.DoResolve): Reused IsNegative.
719
720 2004-09-21  Martin Baulig  <martin@ximian.com>
721
722         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
723         if we're used in an iterator, we may be called from different
724         methods.
725
726         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
727         we actually have an exception block.
728
729 2004-09-20  John Luke <jluke@cfl.rr.com>
730
731         * class.cs, cs-parser.jay: Improve the error report for 1520:
732         report the actual line where the error happens, not where the
733         class was declared.
734
735         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
736         Pass location information that was available elsewhere.
737
738 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
739
740         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
741         runtime to delay sign assemblies.
742
743 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
744
745         * cs-parser.jay: Do not report the stack trace, this is barely
746         used nowadays.
747
748 2004-08-22  John Luke  <john.luke@gmail.com>
749  
750         * driver.cs : check that a resource id is not already used
751         before adding it, report CS1508 if it is, bug #63637
752
753 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
754
755         * ecore.cs: Removed dead code.
756
757 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
758
759         * class.cs: Do not report warning CS0067 on the interfaces.
760
761 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
762
763         * cs-parser.jay: Add error 504 report.
764
765 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
766
767         * rootcontext.cs: WarningLevel is 4 by default now.
768
769         * statement.cs (Fixed.Resolve): Do not null
770         VariableInfo.
771
772 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
773
774         Fixed bug #55780
775         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
776         deep search when property is not virtual.
777         (PropertyExpr.ResolveAccessors): Make one call for both
778         accessors.
779
780 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
781
782         Fixed bug #65766
783         * statement.cs: Error 152 report constains also location.
784
785 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
786
787         Fixed bug #65766
788         * const.cs: Explicitly set constant as static.
789
790 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
791
792         Fixed bug #64226
793         * cs-parser.jay: Add error 1017 report.
794
795 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
796
797         Fixed bug #59980, #64224
798         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
799
800         * typemanager.cs (IsSpecialMethod): Simplified
801
802 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
803
804         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
805         condition with better params.
806
807 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
808
809         Fixed bug #65238
810         * attribute.cs (Resolve): Property has to have both
811         accessors.
812
813 2004-09-14  Martin Baulig  <martin@ximian.com>
814
815         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
816
817 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
818
819         Fixed bug #61902
820         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
821         called and is obsolete then this member suppress message
822         when call is inside next [Obsolete] method or type.
823
824         * expression.cs: Use TestObsoleteMethodUsage member.
825
826 2004-09-14  Martin Baulig  <martin@ximian.com>
827
828         * cs-parser.jay: Sync a bit with the GMCS version.
829
830 2004-09-14  Martin Baulig  <martin@ximian.com>
831
832         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
833         (CSharpParser.yacc_verbose_flag): New public field.
834
835         * genericparser.cs: Removed.
836
837 2004-09-14  Raja R Harinath  <rharinath@novell.com>
838
839         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
840
841 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
842
843         * class.cs (MethodCore.CheckBase): Fix bug #65757.
844
845 2004-09-10  Martin Baulig  <martin@ximian.com>
846
847         Backported my MemberName changes from GMCS into MCS.
848
849         - we are now using a special `MemberName' class instead of using
850         strings; in GMCS, the `MemberName' also contains the type
851         arguments.
852
853         - changed the grammar rules a bit:
854           * the old `member_name' is now a `namespace_or_type_name':
855             The rule is that we use `namespace_or_type_name' everywhere
856             where we expect either a "member name" (GetEnumerator) or a
857             "member name" with an explicit interface name
858             (IEnumerable.GetEnumerator).
859             In GMCS, the explicit interface name may include type arguments
860             (IEnumerable<T>.GetEnumerator).
861           * we use `member_name' instead of just `IDENTIFIER' for
862             "member names":
863             The rule is that we use `member_name' wherever a member may
864             have type parameters in GMCS.       
865
866         * decl.cs (MemberName): New public class.
867         (MemberCore.MemberName): New public readonly field.
868         (MemberCore.ctor): Take a `MemberName' argument, not a string.
869         (DeclSpace): Likewise.
870
871         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
872         * enum.cs (Enum.ctor): Likewise.
873
874         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
875         MemberName.     
876         (AliasEntry.ctor): Take a MemberName, not an Expression.
877         (AliasEntry.UsingAlias): Likewise.
878
879         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
880         (IMethodData.MemberName): Changed type from string to MemberName.
881         (MemberBase.ExplicitInterfaceName): Likewise.
882         (AbstractPropertyEventMethod.SetupName): Make this private.
883         (AbstractPropertyEventMethod.ctor): Added `string prefix'
884         argument; compute the member name here.
885         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
886         on the `member.MemberName' and the `prefix'.
887
888         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
889         not `type_name'.
890         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
891         thus, we get a `MemberName' instead of a `string'.  These
892         declarations may have type parameters in GMCS.
893         (interface_method_declaration, delegate_declaration): Likewise.
894         (class_declaration, interface_declaration): Likewise.
895         (method_header): Use `namespace_or_type_name' instead of
896         `member_name'.  We may be an explicit interface implementation.
897         (property_declaration, event_declaration): Likewise.
898         (member_name): This is now just an `IDENTIFIER', not a
899         `namespace_or_type_name'.
900         (type_name, interface_type): Removed.
901         (namespace_or_type_name): Return a MemberName, not an Expression.
902         (primary_expression): Use `member_name' instead of `IDENTIFIER';
903         call GetTypeExpression() on the MemberName to get an expression.
904         (IndexerDeclaration.interface_type): Changed type from string to
905         MemberName.
906         (MakeName): Operate on MemberName's instead of string's.
907
908 2004-09-13  Raja R Harinath  <rharinath@novell.com>
909
910         Fix bug #55770.
911         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
912         (NamespaceEntry.Lookup): Add new argument to flag if we want the
913         lookup to avoid symbols introduced by 'using'.
914         * rootcontext.cs (NamespaceLookup): Update.
915
916 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
917
918         * class.cs (TypeContainer.DoDefineMembers): Do not call
919         DefineDefaultConstructor for static classes.
920
921 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
922
923         * attribute.cs (Attribute.Resolve): Add error 653 report.
924
925         * class.cs (Class.ApplyAttributeBuilder): Add error 641
926         report.
927         (Method.ApplyAttributeBuilder): Add error 685 report.
928         (Operator.Define): Add error 564 report.
929
930         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
931
932         * expression.cs (Invocation.DoResolve): Add error
933         245 and 250 report.
934
935         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
936         error 674 report.
937
938 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
939
940         * class.cs (ConstructorInitializer.Resolve):
941         Wrong error number (515->516).
942
943 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
944
945         * class.cs (Indexer.Define): Add error 631 report.
946
947 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
948
949         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
950
951 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
952
953         * expression.cs (Probe.DoResolve): Add error CS0241 report.
954
955 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
956
957         * cs-parser.jay: Added error CS0241 report.
958
959 2004-09-10  Raja R Harinath  <rharinath@novell.com>
960
961         * cs-parser.jay (fixed_statement): Introduce a scope for the
962         declaration in the 'fixed' statement.
963
964 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
965
966         * cs-parser.jay: Added CS0230 error report.
967
968 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
969
970         * cs-parser.jay: Added errors CS0231 and CS0257 report.
971
972 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
973
974         * expression.cs (Argument.Resolve): Added error CS0192 and
975         CS0199 report.
976
977 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
978
979         C# 2.0 #pragma warning feature
980
981         * cs-tokenizer.cs (PreProcessPragma): New method; 
982         Handles #pragma directive.
983
984         * report.cs (WarningRegions): New class; Support
985         class for #pragma warning directive. It tests whether
986         warning is enabled for a given line.
987
988 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
989
990         * const.cs: Add more descriptive error report, tahnks to
991         Sebastien. 
992
993 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
994
995         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
996
997 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
998
999         * expression.cs: Apply patch from Ben: Remove dead code from
1000         ArrayCreation, and remove the TurnintoConstant call in const.cs,
1001         as that code just threw an exception anwyays.
1002
1003         * const.cs: Remove the call to the turnintoconstant, for details
1004         see bug: #63144
1005         
1006         * literal.cs: The type of the null-literal is the null type;  So
1007         we use a placeholder type (literal.cs:System.Null, defined here)
1008         for it.
1009
1010         * expression.cs (Conditional.DoResolve): Remove some old code that
1011         is no longer needed, conversions have been fixed.
1012
1013         (ArrayCreationExpression.DoResolve): Return false if we fail to
1014         resolve the inner expression.
1015
1016 2004-09-07  Raja R Harinath  <rharinath@novell.com>
1017
1018         Fix test-290.cs.
1019         * cs-parser.jay (delegate_declaration): Record a delegate
1020         declaration as a type declaration.
1021         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
1022
1023 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
1024
1025         * parameter.cs: Do not crash if the type can not be resolved. 
1026
1027         * expression.cs: Report errors with unsafe pointers, fixes #64896
1028
1029 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
1030
1031         * expression.cs: Pointer arith always needs to do a conv.i
1032         if the operand is a long. fix 65320
1033
1034 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1035
1036         Fixed cs0619-37.cs, cs0619-38.cs
1037
1038         * enum.cs (GetObsoleteAttribute): Removed.
1039
1040         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
1041         on Enum member is double staged. The first is tested member
1042         and then enum.
1043
1044 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1045
1046         Fixed #56986, #63631, #65231
1047
1048         * class.cs: (TypeContainer.AddToMemberContainer): New method,
1049         adds member to name container.
1050         (TypeContainer.AddToTypeContainer): New method, adds type to
1051         name container.
1052         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
1053         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
1054         AddOperator): Simplified by reusing AddToMemberContainer.
1055         (TypeContainer.UserDefinedStaticConstructor): Changed to property
1056         instead of field.
1057         (Method.CheckForDuplications): Fixed implementation to test all
1058         possibilities.
1059         (MemberBase): Detection whether member is explicit interface
1060         implementation is now in constructor.
1061         (MemberBase.UpdateMemberName): Handles IndexerName.
1062         (Accessor): Changed to keep also location information.
1063         (AbstractPropertyEventMethod): Is derived from MemberCore.
1064         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
1065         will be emited or not.
1066         (PropertyBase.AreAccessorsDuplicateImplementation):
1067         Tests whether accessors are not in collision with some method.
1068         (Operator): Is derived from MethodCore to simplify common
1069         operations.
1070
1071         * decl.cs (Flags.TestMethodDuplication): Test for duplication
1072         must be performed.
1073         (DeclSpace.AddToContainer): Adds the member to defined_names
1074         table. It tests for duplications and enclosing name conflicts.
1075
1076         * enum.cs (EnumMember): Clean up to reuse the base structures
1077
1078 2004-09-03  Martin Baulig  <martin@ximian.com>
1079
1080         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
1081         into TypeContainer, to make partial classes work again.
1082
1083 2004-09-03  Martin Baulig  <martin@ximian.com>
1084
1085         * rootcontext.cs (RootContext.V2): Removed.
1086
1087 2004-03-23  Martin Baulig  <martin@ximian.com>
1088
1089         * expression.cs (Invocation.OverloadResolve): Added `bool
1090         may_fail' argument and use it instead of the Location.IsNull() hack.
1091
1092 2004-09-03  Martin Baulig  <martin@ximian.com>
1093
1094         Merged latest changes into gmcs.  Please keep this comment in
1095         here, it makes it easier for me to see what changed in MCS since
1096         the last time I merged.
1097
1098 2004-09-03  Raja R Harinath  <rharinath@novell.com>
1099
1100         Fix #61128.
1101         * expression.cs (BetterConversion): Don't allow either conversion 
1102         to be null.  Remove redundant implicit conversion test when 'q ==
1103         null' -- when this function is invoked, we already know that the
1104         implicit conversion exists.
1105         (BetterFunction): Assume that 'best' is non-null.  Remove
1106         redundant reimplementation of IsApplicable when 'best' is null.
1107         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
1108         number of arguments.
1109         (IsAncestralType): Extract from OverloadResolve.
1110         (OverloadResolve): Make robust to the MethodGroupExpr being
1111         unsorted.  Implement all the logic of Section 14.5.5.1, and
1112         support overloading of methods from multiple applicable types.
1113         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
1114
1115         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
1116         (RealError, Warning): Append type of report to related symbol.
1117
1118 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
1119
1120         * enum.cs: Fixed CLS-Compliance checks for enum members.
1121         Error tests cs3008-8.cs, cs3014-8.cs
1122
1123 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1124
1125         Fixed bug #62342, #63102
1126         * class.cs: ImplementIndexer uses member.IsExplicitImpl
1127         like ImplementMethod.
1128
1129 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1132         Fixed bug #65170.
1133
1134 2004-09-02  Martin Baulig  <martin@ximian.com>
1135
1136         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
1137         TypeManager.GetArgumentTypes() rather than calling GetParameters()
1138         on the MethodBase.
1139
1140 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
1141
1142         C# 2.0 Static classes implemented
1143
1144         * class.cs (TypeContainer): instance_constructors,
1145         initialized_fields, initialized_static_fields,
1146         default_constructor, base_inteface_types are protected to be
1147         accessible from StaticClass.
1148         (TypeContainer.DefineDefaultConstructor): New virtual method
1149         for custom default constructor generating
1150         (StaticClass): New class to handle "Static classes" feature.
1151
1152         * cs-parser.jay: Handle static keyword on class like instance
1153         of StaticClass.
1154
1155         * driver.cs: Added "/langversion" command line switch with two
1156         options (iso-1, default).
1157
1158 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
1159
1160         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
1161
1162 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
1163
1164         * delegate.cs: Style.
1165
1166 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
1167
1168         * delegate.cs: Add seperate instance expr field for miguel.
1169
1170 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1171
1172         * PointerArithmetic (Resolve): make sure we are not doing
1173         pointer arith on void*. Also, make sure we are resolved
1174         by not setting eclass until resolve.
1175
1176         All callers: Make sure that PointerArithmetic gets resolved.
1177
1178 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1179
1180         * ArrayCreation (LookupType): If the type does not resolve 
1181         to an array, give an error.
1182
1183 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
1184
1185         * statement.cs (Try.Resolve): Fixed bug #64222
1186
1187 2004-08-27  Martin Baulig  <martin@ximian.com>
1188
1189         * class.cs
1190         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
1191         crash here.     
1192
1193 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1194
1195         * ecore.cs (Constantify): Get underlying type via
1196         System.Enum.GetUnderlyingType to avoid StackOverflow on the
1197         Windows in special cases.
1198
1199 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1200
1201         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
1202         for obtaining also private methods.
1203         (GetRemoveMethod): Used GetRemoveMethod (true)
1204         for obtaining also private methods.
1205
1206 2004-08-24  Martin Baulig  <martin@ximian.com>
1207
1208         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
1209         MethodAttributes.HideBySig for operators.
1210
1211 2004-08-23  Martin Baulig  <martin@ximian.com>
1212
1213         Back to the old error reporting system :-)
1214
1215         * report.cs (Message): Removed.
1216         (Report.MessageData, ErrorData, WarningData): Removed.
1217         (Report.Error, Warning): Back to the old system.
1218
1219 2004-08-23  Martin Baulig  <martin@ximian.com>
1220
1221         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
1222
1223         * class.cs (TypeContainer.ParentContainer): New public virtual
1224         method; replaces the explicit interface implementation.
1225         (ClassPart.ParentContainer): Override.
1226
1227 2004-08-23  Martin Baulig  <martin@ximian.com>
1228
1229         * statement.cs (Switch): Added support for constant switches; see
1230         #59428 or test-285.cs.
1231
1232 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1233
1234         Fixed bug #62740.
1235         * statement.cs (GetEnumeratorFilter): Removed useless
1236         logic because C# specs is strict. GetEnumerator must be
1237         public.
1238
1239 2004-08-22  Martin Baulig  <martin@ximian.com>
1240
1241         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1242         a switch and may break, reset the barrier.  Fixes #59867.
1243
1244 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1245
1246         CLS-Compliance speed up (~5% for corlib)
1247
1248         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
1249         New method. Tests container for CLS-Compliant names
1250
1251         * class.cs (TypeContainer.VerifyClsName): New method.
1252         Checks whether container name is CLS Compliant.
1253         (Constructor): Implements IMethodData.
1254
1255         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
1256         low-case table for CLS Compliance test.
1257         (MemberCache.VerifyClsParameterConflict): New method.
1258         Checks method parameters for CS3006 error.
1259
1260         * enum.cs (EnumMember): Is derived from MemberCore.
1261         (Enum.VerifyClsName): Optimized for better performance.
1262
1263 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1264
1265         * report.cs: Renamed Error_T to Error and changed all
1266         references.
1267
1268 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * class.cs (TypeContainer.IndexerArrayList): New inner class
1271         container for indexers.
1272         (TypeContainer.DefaultIndexerName): New constant for default
1273         indexer name. Replaced all "Item" with this constant.
1274         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
1275
1276         * typemanager.cs (TypeManager.default_member_ctor): Cache here
1277         DefaultMemberAttribute constructor.
1278
1279 2004-08-05  Martin Baulig  <martin@ximian.com>
1280
1281         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1282         Fix bug #59429.
1283
1284 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
1285
1286         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
1287         multi platforms problem.
1288
1289         * compiler.csproj: Included shared files.
1290
1291 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1292
1293         Fix bug 60333, 55971 in the more general way
1294         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1295         Added arg_type argument for constant conversion.
1296         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
1297
1298 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1299
1300         Fix bug #59760
1301         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
1302         OperatorArrayList, MethodCoreArrayList for typecontainer
1303         containers. Changed class member types to these new types.
1304         (MethodArrayList.DefineMembers): Added test for CS0659.
1305
1306 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
1307
1308         * cfold.cs: Synchronize the folding with the code in expression.cs
1309         Binary.DoNumericPromotions for uint operands.
1310
1311         * attribute.cs: Revert patch from Raja, it introduced a regression
1312         while building Blam-1.2.1 (hard to isolate a test case).
1313
1314 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1315
1316         Fix for #55382
1317         * class.cs:
1318         (TypeContainer.Define): Renamed to DefineContainerMembers because of
1319         name collision.
1320         (MethodCore.parent_method): New member. The method we're overriding
1321         if this is an override method.
1322         (MethodCore.CheckBase): Moved from Method class and made common.
1323         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
1324         private.
1325         (MethodCore.CheckForDuplications): New abstract method. For custom
1326         member duplication search in a container
1327         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
1328         method and its return type.
1329         (Event.conflict_symbol): New member. Symbol with same name in the
1330         parent class.
1331
1332         * decl.cs:
1333         (MemberCache.FindMemberWithSameName): New method. The method
1334         is looking for conflict with inherited symbols.
1335
1336 2004-08-04  Martin Baulig  <martin@ximian.com>
1337
1338         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
1339
1340         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
1341
1342 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1343
1344         * report.cs (Message): New enum for better error, warning reference in
1345         the code.
1346         (MessageData): New inner abstract class. It generally handles printing of
1347         error and warning messages.
1348         Removed unused Error, Warning, Message methods.
1349
1350 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1351
1352         Fix for cs0592-8.cs test
1353         * attribute.cs
1354         (Attributable.ValidAttributeTargets): Made public.
1355         (Attribute.ExplicitTarget): New member for explicit target value.
1356         (Attribute.CheckTargets): Now we translate explicit attribute
1357         target to Target here.
1358
1359 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
1360
1361         * ecore.cs (MethodGroupExpr): new IsBase property.
1362
1363         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
1364
1365         * delegate.cs (DelegateCreation): store a MethodGroupExpr
1366         rather than an instance expr.
1367
1368         (DelegateCreation.Emit): Use the method group rather than
1369         the instance expression. Also, if you have base.Foo as the
1370         method for a delegate, make sure to emit ldftn, not ldftnvirt.
1371
1372         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
1373
1374         (NewDelegate.DoResolve): Only check for the existance of Invoke
1375         if the method is going to be needed. Use MethodGroupExpr.
1376
1377         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
1378
1379         * expression.cs: For pointer arith., make sure to use
1380         the size of the type, not the size of the pointer to
1381         the type.
1382
1383 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1384
1385         Fix for #60722
1386         * class.cs (Class): Added error CS0502 test.
1387
1388 2004-08-03  John Luke  <jluke@cfl.rr.com>
1389             Raja R Harinath  <rharinath@novell.com>
1390
1391         Fix for #60997.
1392         * attribute.cs (Attribute.complained_before): New flag.
1393         (Attribute.ResolveType, Attribute.Resolve),
1394         (Attribute.DefinePInvokeMethod): Set it.
1395         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
1396         
1397 2004-08-03  Martin Baulig  <martin@ximian.com>
1398
1399         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
1400         use a user-defined operator; we still need to do numeric
1401         promotions in case one argument is a builtin type and the other
1402         one has an implicit conversion to that type.  Fixes #62322.
1403
1404 2004-08-02  Martin Baulig  <martin@ximian.com>
1405
1406         * statement.cs (LocalInfo.Flags): Added `IsThis'.
1407         (LocalInfo.IsThis): New public property.
1408         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
1409
1410 2004-08-01  Martin Baulig  <martin@ximian.com>
1411
1412         * class.cs (TypeContainer.GetClassBases): Don't set the default
1413         here since we may get called from GetPartialBases().
1414         (TypeContainer.DefineType): If GetClassBases() didn't return a
1415         parent, use the default one.
1416
1417 2004-07-30  Duncan Mak  <duncan@ximian.com>
1418
1419         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
1420
1421 2004-07-30  Martin Baulig  <martin@ximian.com>
1422
1423         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
1424
1425         * class.cs (SourceMethod): New public class, derive from the
1426         symbol writer's ISourceMethod.
1427         (Method): Use the new symbol writer API.
1428
1429         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
1430         as argument and use the new symbol writer.
1431
1432         * location.cs
1433         (SourceFile): Implement the symbol writer's ISourceFile.
1434         (Location.SymbolDocument): Removed.
1435         (Location.SourceFile): New public property.
1436
1437         * symbolwriter.cs: Use the new symbol writer API.
1438
1439 2004-07-30  Raja R Harinath  <rharinath@novell.com>
1440
1441         * Makefile (install-local): Remove.  Functionality moved to
1442         executable.make.
1443
1444 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
1445
1446         * Makefile: Install mcs.exe.config file together with mcs.exe.
1447         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
1448         correct runtime version.
1449         
1450 2004-07-25  Martin Baulig  <martin@ximian.com>
1451
1452         * class.cs
1453         (TypeContainer.RegisterOrder): Removed, this was unused.
1454         (TypeContainer, interface_order): Removed.
1455         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
1456         TypeContainer as argument since we can also be called with a
1457         `PartialContainer' for a partial class/struct/interface.
1458         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
1459         of checking whether we're an `Interface' - we could be a
1460         `PartialContainer'.
1461         (PartialContainer.Register): Override; call
1462         AddClass()/AddStruct()/AddInterface() on our parent.
1463
1464         * cs-parser.jay (interface_member_declaration): Add things to the
1465         `current_container', not the `current_class'.
1466
1467         * rootcontext.cs (RegisterOrder): The overloaded version which
1468         takes an `Interface' was unused, removed.
1469
1470         * typemanager.cs (TypeManager.LookupInterface): Return a
1471         `TypeContainer', not an `Interface'.
1472         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
1473         contain a `PartialContainer' for an interface, so check it's
1474         `Kind' to figure out what it is.
1475
1476 2004-07-25  Martin Baulig  <martin@ximian.com>
1477
1478         * class.cs (Class.DefaultTypeAttributes): New public constant.
1479         (Struct.DefaultTypeAttributes): Likewise.
1480         (Interface.DefaultTypeAttributes): Likewise.
1481         (PartialContainer.TypeAttr): Override this and add the
1482         DefaultTypeAttributes.
1483
1484 2004-07-25  Martin Baulig  <martin@ximian.com>
1485
1486         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
1487         we can just use the `Parent' field instead.
1488
1489 2004-07-25  Martin Baulig  <martin@ximian.com>
1490
1491         * class.cs (TypeContainer.Emit): Renamed to EmitType().
1492
1493 2004-07-25  Martin Baulig  <martin@ximian.com>
1494
1495         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
1496         our parts before defining any methods.
1497         (TypeContainer.VerifyImplements): Make this virtual.
1498         (ClassPart.VerifyImplements): Override and call VerifyImplements()
1499         on our PartialContainer.
1500
1501 2004-07-25  Martin Baulig  <martin@ximian.com>
1502
1503         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
1504
1505         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
1506         argument, we can just use the `Parent' field instead.
1507
1508         * class.cs
1509         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
1510         (MemberBase.DoDefine): Likewise.
1511
1512 2004-07-24  Martin Baulig  <martin@ximian.com>
1513
1514         * decl.cs (MemberCore.Parent): New public field.
1515         (DeclSpace.Parent): Moved to MemberCore.
1516
1517         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
1518         (MemberBase.ctor): Added TypeContainer argument, pass it to our
1519         parent's .ctor.
1520         (FieldBase, Field, Operator): Likewise.
1521         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
1522         (EventField, Event): Likewise.
1523
1524 2004-07-23  Martin Baulig  <martin@ximian.com>
1525
1526         * class.cs (PartialContainer): New public class.
1527         (ClassPart): New public class.
1528         (TypeContainer): Added support for partial classes.
1529         (TypeContainer.GetClassBases): Splitted some of the functionality
1530         out into GetNormalBases() and GetPartialBases().
1531
1532         * cs-tokenizer.cs (Token.PARTIAL): New token.
1533         (Tokenizer.consume_identifier): Added some hacks to recognize
1534         `partial', but only if it's immediately followed by `class',
1535         `struct' or `interface'.
1536
1537         * cs-parser.jay: Added support for partial clases.
1538
1539 2004-07-23  Martin Baulig  <martin@ximian.com>
1540
1541         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
1542         a `DeclSpace' and also made it readonly.
1543         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
1544         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
1545         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
1546
1547         * cs-parser.jay: Pass the `current_class', not the
1548         `current_container' (at the moment, this is still the same thing)
1549         to a new Method, Property, Event, Indexer or Constructor.
1550
1551 2004-07-23  Martin Baulig  <martin@ximian.com>
1552
1553         * cs-parser.jay (CSharpParser): Added a new `current_class' field
1554         and removed the `current_interface' one.
1555         (struct_declaration, class_declaration, interface_declaration):
1556         Set `current_class' to the newly created class/struct/interface;
1557         set their `Bases' and call Register() before parsing their body.
1558
1559 2004-07-23  Martin Baulig  <martin@ximian.com>
1560
1561         * class.cs (Kind): New public enum.
1562         (TypeContainer): Made this class abstract.
1563         (TypeContainer.Kind): New public readonly field.
1564         (TypeContainer.CheckDef): New public method; moved here from
1565         cs-parser.jay.
1566         (TypeContainer.Register): New public abstract method.
1567         (TypeContainer.GetPendingImplementations): New public abstract
1568         method.
1569         (TypeContainer.GetClassBases): Removed the `is_class' and
1570         `is_iface' parameters.
1571         (TypeContainer.DefineNestedTypes): Formerly known as
1572         DoDefineType().
1573         (ClassOrStruct): Made this class abstract.
1574
1575         * tree.cs (RootTypes): New public type. 
1576
1577 2004-07-20  Martin Baulig  <martin@ximian.com>
1578
1579         * tree.cs (Tree.RecordNamespace): Removed.
1580         (Tree.Namespaces): Removed.
1581
1582         * rootcontext.cs (RootContext.IsNamespace): Removed.
1583
1584         * cs-parser.jay (namespace_declaration): Just create a new
1585         NamespaceEntry here.
1586
1587 2004-07-20  Martin Baulig  <martin@ximian.com>
1588
1589         * statement.cs (ExceptionStatement): New abstract class.  This is
1590         now used as a base class for everyone who's using `finally'.
1591         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
1592         our local variables before using them.
1593
1594         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
1595         virtual method.  This is used by Yield.Resolve() to "steal" an
1596         outer block's `finally' clauses.
1597         (FlowBranchingException): The .ctor now takes an ExceptionStatement
1598         argument.
1599
1600         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
1601         version which takes an ExceptionStatement.  This version must be
1602         used to create exception branchings.
1603
1604         * iterator.cs
1605         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
1606         (Iterator.EmitMoveNext): Added exception support; protect the
1607         block with a `fault' clause, properly handle 'finally' clauses.
1608         (Iterator.EmitDispose): Run all the `finally' clauses here.
1609
1610 2004-07-20  Martin Baulig  <martin@ximian.com>
1611
1612         * iterator.cs: This is the first of a set of changes in the
1613         iterator code.  Match the spec more closely: if we're an
1614         IEnumerable, then GetEnumerator() must be called.  The first time
1615         GetEnumerator() is called, it returns the current instance; all
1616         subsequent invocations (if any) must create a copy.
1617
1618 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
1619
1620         * expression.cs: Resolve the constant expression before returning
1621         it. 
1622
1623 2004-07-19  Martin Baulig  <martin@ximian.com>
1624
1625         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
1626         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
1627         the return type of the new EmitContext.
1628
1629 2004-07-18  Martin Baulig  <martin@ximian.com>
1630
1631         * class.cs (Property.Define): Fix iterators.
1632
1633         * iterators.cs (Iterator.Define): Moved the
1634         `container.AddInterator (this)' call here from the .ctor; only do
1635         it if we resolved successfully.
1636
1637 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
1638
1639         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
1640         `true' for preprocessing directives that we parse.  The return
1641         value indicates whether we should return to regular tokenizing or
1642         not, not whether it was parsed successfully.
1643
1644         In the past if we were in: #if false ... #line #endif, we would
1645         resume parsing after `#line'.  See bug 61604.
1646
1647         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
1648         building: IsEnumType should return true only for enums, not for
1649         enums or System.Enum itself.  This fixes #61593.
1650
1651         Likely what happened is that corlib was wrong: mcs depended on
1652         this bug in some places.  The bug got fixed, we had to add the
1653         hack, which caused bug 61593.
1654
1655         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
1656         that was a workaround for the older conditions.
1657
1658 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
1659
1660         * assign.cs: IAssignMethod has a new interface, as documented
1661         inline. All assignment code now uses this new api.
1662
1663         * ecore.cs, expression.cs: All classes which implement
1664         IAssignMethod now use the new interface.
1665
1666         * expression.cs (Invocation): add a hack to EmitCall so that
1667         IndexerAccess can be the target of a compound assignment without
1668         evaluating its arguments twice.
1669
1670         * statement.cs: Handle changes in Invocation api.
1671
1672 2004-07-16  Martin Baulig  <martin@ximian.com>
1673
1674         * iterators.cs: Rewrote this.  We're now using one single Proxy
1675         class for both the IEnumerable and the IEnumerator interface and
1676         `Iterator' derives from Class so we can use the high-level API.
1677
1678         * class.cs (TypeContainer.AddIterator): New method.
1679         (TypeContainer.DoDefineType): New protected virtual method, which
1680         is called from DefineType().
1681         (TypeContainer.DoDefineMembers): Call DefineType() and
1682         DefineMembers() on all our iterators.
1683         (TypeContainer.Emit): Call Emit() on all our iterators.
1684         (TypeContainer.CloseType): Call CloseType() on all our iterators.
1685
1686         * codegen.cs (EmitContext.CurrentIterator): New public field.
1687
1688 2004-07-15  Martin Baulig  <martin@ximian.com>
1689
1690         * typemanager.cs
1691         (TypeManager.not_supported_exception_type): New type.   
1692
1693 2004-07-14  Martin Baulig  <martin@ximian.com>
1694
1695         * iterators.cs: Use real error numbers.
1696
1697 2004-07-14  Martin Baulig  <martin@ximian.com>
1698
1699         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
1700         requires this to be a System.Collection.IEnumerable and not a
1701         class implementing that interface.
1702         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
1703
1704 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
1705
1706         * class.cs: Fixed previous fix, it broke some error tests.
1707
1708 2004-07-12  Martin Baulig  <martin@ximian.com>
1709
1710         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
1711         Fixes #61293.
1712
1713 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
1714
1715         * assign.cs (LocalTemporary): Add new argument: is_address,If
1716         `is_address' is true, then the value that we store is the address
1717         to the real value, and not the value itself.
1718         
1719         * ecore.cs (PropertyExpr): use the new local temporary
1720         stuff to allow us to handle X.Y += z (where X is a struct)
1721
1722 2004-07-08  Martin Baulig  <martin@ximian.com>
1723
1724         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
1725         not always return, just like we're doing in Using.Resolve().
1726
1727 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
1728
1729         * cs-parser.jay (fixed_statement): flag this as Pinned.
1730
1731 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
1732
1733         * typemanager.cs (TypeManager): Removed MakePinned method, this
1734         mechanism is replaced with the .NET 2.x compatible mechanism of
1735         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1736
1737         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1738         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1739         `IsFixed' property which has a different meaning.
1740
1741 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1742
1743         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1744         visible from inside a nested class, not just the names of the
1745         immediately enclosing class.
1746         Fix for bug #60730.
1747
1748 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1749
1750         * expression.cs (BetterConversion): Remove buggy special-case
1751         handling of "implicit constant expression conversions".  At this
1752         point, we already know that the conversion is possible -- we're
1753         only checking to see which is better.
1754
1755 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1756
1757         * cs-parser.jay: Added error CS0210 test.
1758
1759 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1760
1761         * cs-parser.jay: Added error CS0134 test.
1762
1763 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1764
1765         Fix bug #52507
1766         * cs-parser.jay: Added error CS0145 test.
1767
1768 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1769
1770         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1771
1772 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1773         
1774         * expression.cs (StackAlloc.Resolve): The argument may not
1775         be a constant; deal with this case.
1776         
1777 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1778
1779         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1780         GetIndexerAttributeValue.
1781         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1782
1783         * class.cs (Indexer.Define): Added error tests for CS0415,
1784         CS0609.
1785
1786 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1787
1788         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1789         property code.
1790
1791 2004-06-23  Martin Baulig  <martin@ximian.com>
1792
1793         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1794         neither return nor throw, reset the barrier as well.  Fixes #60457.
1795
1796 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1797
1798         * class.cs : EventAttributes is now set to None by default.
1799           This fixes bug #60459.
1800
1801 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1802
1803         Fix bug #60219
1804         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1805         Don't throw exception but return null (it's sufficient now).
1806
1807 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1808
1809         * typemanager.cs (GetArgumentTypes): Faster implementation.
1810
1811 2004-06-18  Martin Baulig  <martin@ximian.com>
1812
1813         * attribute.cs (Attribute.Resolve): Check whether we're an
1814         EmptyCast which a Constant child.  Fixes #60333.
1815
1816 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1817
1818         * statement.cs (EmitCollectionForeach): Account for the fact that
1819         not all valuetypes are in areas which we can take the address of.
1820         For these variables, we store to a temporary variable. Also, make
1821         sure that we dont emit a `callvirt' on a valuetype method.
1822
1823 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1824
1825         * expression.cs (StackAlloc.DoReSolve): Added test for
1826         negative parameter (CS0247).
1827
1828 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1829
1830         Fix bug #59792
1831         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1832
1833 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1834
1835         Fix bug #59781
1836         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1837         ulong.
1838
1839 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1840
1841         Fix bug #58254 & cs1555.cs, cs1556.cs
1842         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1843
1844 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1845
1846         * cs-parser.jay: Added error CS1669 test for indexers.
1847
1848 2004-06-11  Martin Baulig  <martin@ximian.com>
1849
1850         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1851         call this twice: for params and varargs methods.
1852
1853 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1854
1855         * class.cs:
1856         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1857
1858 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1859
1860         * attribute.cs (Attribute.GetValidTargets): Made public.
1861
1862         * class.cs: 
1863         (AbstractPropertyEventMethod): New class for better code sharing.
1864         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
1865         CS1667 report.
1866         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
1867
1868 2004-06-11  Raja R Harinath  <rharinath@novell.com>
1869
1870         Fix bug #59477.
1871         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
1872         that the call to Resolve is part of a MemberAccess.
1873         (Expression.Resolve): Use it for SimpleName resolution.
1874         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
1875         Add 'intermediate' boolean argument.
1876         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
1877         error message when the SimpleName can be resolved ambiguously
1878         between an expression and a type.
1879         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
1880         public.
1881         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
1882         call on the left-side.
1883
1884 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1885
1886         * class.cs:
1887         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
1888
1889 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1890
1891         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
1892
1893 2004-06-11  Martin Baulig  <martin@ximian.com>
1894
1895         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
1896         varargs methods if applicable.
1897
1898 2004-06-11  Martin Baulig  <martin@ximian.com>
1899
1900         * expression.cs (Invocation.EmitCall): Don't use
1901         `method.CallingConvention == CallingConventions.VarArgs' since the
1902         method could also have `CallingConventions.HasThis'.
1903
1904 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1905
1906         * class.cs (Event.GetSignatureForError): Implemented.
1907         Fixed crash in error test cs3010.cs
1908
1909 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
1910
1911         * cs-tokenizer.cs: Change the way we track __arglist to be
1912         consistent with the other keywords.
1913
1914 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
1915
1916         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
1917         tomorrow.
1918
1919 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
1920
1921         * codegen.cs: Check that all referenced assemblies have a strongname
1922         before strongnaming the compiled assembly. If not report error CS1577.
1923         Fix bug #56563. Patch by Jackson Harper.
1924         * typemanager.cs: Added a method to return all referenced assemblies.
1925         Fix bug #56563. Patch by Jackson Harper.
1926
1927 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1928
1929         * class.cs:
1930         (Method.ApplyAttributeBuilder): Moved and added conditional
1931         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
1932
1933         * delegate.cs:
1934         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
1935
1936 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1937
1938         Fixed #59640
1939         * class.cs: (EventField.attribute_targets): Changed default target.
1940
1941 2004-06-08  Martin Baulig  <martin@ximian.com>
1942
1943         * expression.cs (Invocation.EmitCall): Enable varargs methods.
1944
1945 2004-06-08  Martin Baulig  <martin@ximian.com>
1946
1947         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
1948
1949 2004-06-07  Martin Baulig  <martin@ximian.com>
1950
1951         Added support for varargs methods.
1952
1953         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
1954         keyword.
1955
1956         * cs-parser.jay: Added support for `__arglist'.
1957
1958         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
1959
1960         * expression.cs (Argument.AType): Added `ArgList'.
1961         (Invocation): Added support for varargs methods.
1962         (ArglistAccess): New public class.
1963         (Arglist): New public class.
1964
1965         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
1966
1967         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
1968         a method's top-level block if the method has varargs.
1969
1970         * support.cs (ReflectionParameters, InternalParameters): Added
1971         support for varargs methods.    
1972
1973 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
1974
1975         * class.cs: Provide location in indexer error report.
1976
1977         * driver.cs: Use standard names.
1978
1979         * namespace.cs: Catch the use of using after a namespace has been
1980         declared also on using aliases.
1981
1982 2004-06-03  Raja R Harinath  <rharinath@novell.com>
1983
1984         Bug #50820.
1985         * typemanager.cs (closure_private_ok, closure_invocation_type)
1986         (closure_qualifier_type, closure_invocation_assembly)
1987         (FilterWithClosure): Move to ...
1988         (Closure): New internal nested class.
1989         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
1990         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
1991         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
1992         (MemberLookup, MemberLookupFailed): Use it.
1993         * expression.cs (New.DoResolve): Treat the lookup for the
1994         constructor as being qualified by the 'new'ed type.
1995         (Indexers.GetIndexersForTypeOrInterface): Update.
1996
1997 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
1998
1999         * attribute.cs
2000         (GetConditionalAttributeValue): New method. Returns
2001         condition of ConditionalAttribute.
2002         (SearchMulti): New method.  Returns all attributes of type 't'.
2003         Use it when attribute is AllowMultiple = true.
2004         (IsConditionalMethodExcluded): New method.
2005
2006         * class.cs
2007         (Method.IsExcluded): Implemented. Returns true if method has conditional
2008         attribute and the conditions is not defined (method is excluded).
2009         (IMethodData): Extended interface for ConditionalAttribute support.
2010         (PropertyMethod.IsExcluded): Implemented.
2011
2012         * decl.cs
2013         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
2014
2015         * expression.cs
2016         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
2017         on the method.
2018
2019 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2020
2021         * expression.cs (ArrayCreationExpression): Make this just an
2022         `expression'. It can't be a statement, so the code here was
2023         dead.
2024
2025 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
2026
2027         Fixed #59072
2028         * typemanager.cs (GetFullNameSignature): New method for
2029         MethodBase types.
2030
2031 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
2032
2033         Fixed #56452
2034         * class.cs (MemberBase.GetSignatureForError): New virtual method.
2035         Use this method when MethodBuilder is null.
2036         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
2037         Added test for error CS0626 (MONO reports error for this situation).
2038         (IMethodData.GetSignatureForError): Extended interface.
2039
2040 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
2041
2042         * attribute.cs
2043         (AttributeTester.GetObsoleteAttribute): Returns instance of
2044         ObsoleteAttribute when type is obsolete.
2045
2046         * class.cs
2047         (TypeContainer.VerifyObsoleteAttribute): Override.
2048         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
2049         (MethodCode.VerifyObsoleteAttribute): Override.
2050         (MemberBase.VerifyObsoleteAttribute): Override.
2051
2052         * decl.cs
2053         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
2054         and report proper error.
2055
2056         *delegate.cs
2057         Delegate.VerifyObsoleteAttribute): Override.
2058
2059         * ecore.cs
2060         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
2061         and report proper error.
2062         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
2063
2064         * enum.cs
2065         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
2066         and enum member.
2067
2068         * expression.cs
2069         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
2070         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
2071         Added test for ObsoleteAttribute.
2072
2073         * statement.cs
2074         (Catch): Derived from Statement.
2075
2076 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
2077  
2078         Fixed bug #59071 & cs0160.cs
2079  
2080         * statement.cs (Try.Resolve): Check here whether order of catch
2081         clauses matches their dependencies.
2082
2083 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
2084
2085         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
2086         caused a regression: #59343.  Referencing nested classes from an
2087         assembly stopped working.
2088
2089 2004-05-31  Martin Baulig  <martin@ximian.com>
2090
2091         MCS is now frozen for beta 2.
2092
2093 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2094
2095         * convert.cs: add a trivial cache for overload operator resolution.
2096
2097 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2098
2099         * decl.cs: If possible, use lookuptypedirect here. We can only do
2100         this if there is no `.' after the namespace. Avoids using
2101         LookupType, which does lots of slow processing.
2102         (FindNestedType) New method, does what it says :-).
2103         * namespace.cs: use LookupTypeDirect.
2104         * rootcontext.cs: use membercache, if possible.
2105         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
2106
2107 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2108
2109         * expression.cs:
2110         According to the spec, 
2111
2112         In a member access of the form E.I, if E is a single identifier,
2113         and if the meaning of E as a simple-name (§7.5.2) is a constant,
2114         field, property, localvariable, or parameter with the same type as
2115         the meaning of E as a type-name (§3.8), then both possible
2116         meanings of E are permitted.
2117
2118         We did not check that E as a simple-name had the same type as E as
2119         a type name.
2120
2121         This trivial check gives us 5-7% on bootstrap time.
2122
2123 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2124
2125         * expression.cs (Invocation.OverloadResolve): Avoid the
2126         use of hashtables and boxing here by allocating on demand.
2127
2128 2004-05-30  Martin Baulig  <martin@ximian.com>
2129
2130         * rootcontext.cs (RootContext.LookupType): Don't cache things if
2131         we're doing a silent lookup.  Don't try to lookup nested types in
2132         TypeManager.object_type (thanks to Ben Maurer).
2133
2134 2004-05-30  Martin Baulig  <martin@ximian.com>
2135
2136         Committing a patch from Ben Maurer.
2137
2138         * rootcontext.cs (RootContext.LookupType): Cache negative results.
2139
2140 2004-05-29  Martin Baulig  <martin@ximian.com>
2141
2142         * class.cs (IMethodData.ShouldIgnore): New method.
2143
2144         * typemanager.cs (TypeManager.MethodFlags): Don't take a
2145         `Location' argument, we don't need it anywhere.  Use
2146         `IMethodData.ShouldIgnore ()' instead of
2147         `MethodData.GetMethodFlags ()'.
2148         (TypeManager.AddMethod): Removed.
2149         (TypeManager.AddMethod2): Renamed to AddMethod.
2150
2151 2004-05-29  Martin Baulig  <martin@ximian.com>
2152
2153         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
2154
2155         * convert.cs (Convert.ImplicitReferenceConversion): If we're
2156         converting from a class type S to an interface type and we already
2157         have an object on the stack, don't box it again.  Fixes #52578.
2158
2159 2004-05-29  Martin Baulig  <martin@ximian.com>
2160
2161         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
2162         Added support for `params' parameters.  Fixes #59267.
2163
2164 2004-05-29  Martin Baulig  <martin@ximian.com>
2165
2166         * literal.cs (NullPointer): Provide a private .ctor which sets
2167         `type' to TypeManager.object_type.  Fixes #59048.
2168
2169 2004-05-29  Martin Baulig  <martin@ximian.com>
2170
2171         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
2172         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
2173
2174         * ecore.cs (EventExpr.instance_expr): Make the field private.
2175
2176 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
2177
2178         Fixed bug #50080 & cs0214-2.cs
2179         * expression.cs (Cast.DoResolve): Check unsafe context here.
2180         
2181         * statement.cs (Resolve.DoResolve): Likewise.
2182
2183 2004-05-26  Martin Baulig  <martin@ximian.com>
2184
2185         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
2186
2187         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
2188         (RootContext.LookupType): Pass down the `silent' flag.
2189
2190 2004-05-25  Martin Baulig  <martin@ximian.com>
2191
2192         * expression.cs
2193         (MethodGroupExpr.IdenticalTypeName): New public property.
2194         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
2195         expression actually refers to a type.
2196
2197 2004-05-25  Martin Baulig  <martin@ximian.com>
2198
2199         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
2200         for #56176 and made it actually work.
2201
2202 2004-05-25  Martin Baulig  <martin@ximian.com>
2203
2204         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
2205         (FieldExpr, PropertyExpr): Override and implement
2206         CacheTemporaries.  Fixes #52279.
2207
2208 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
2209
2210         * location.cs: In the new compiler listing a file twice is a
2211         warning, not an error.
2212
2213 2004-05-24  Martin Baulig  <martin@ximian.com>
2214
2215         * enum.cs (Enum.DefineType): For the `BaseType' to be a
2216         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
2217
2218 2004-05-24  Martin Baulig  <martin@ximian.com>
2219
2220         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
2221         walking the `using' list.  Fixes #53921.
2222
2223 2004-05-24  Martin Baulig  <martin@ximian.com>
2224
2225         * const.cs (Const.LookupConstantValue): Added support for
2226         EmptyCast's; fixes #55251.
2227
2228 2004-05-24  Martin Baulig  <martin@ximian.com>
2229
2230         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
2231         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
2232         which does the CS0135 check.  The reason is that we first need to
2233         check whether the variable actually exists.
2234
2235 2004-05-24  Martin Baulig  <martin@ximian.com>
2236
2237         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
2238         than RootContext.LookupType() to find the explicit interface
2239         type.  Fixes #58584.
2240
2241 2004-05-24  Raja R Harinath  <rharinath@novell.com>
2242
2243         * Makefile: Simplify.  Use executable.make.
2244         * mcs.exe.sources: New file.  List of sources of mcs.exe.
2245
2246 2004-05-24  Anders Carlsson  <andersca@gnome.org>
2247
2248         * decl.cs:
2249         * enum.cs:
2250         Use the invariant culture when doing String.Compare for CLS case
2251         sensitivity.
2252         
2253 2004-05-23  Martin Baulig  <martin@ximian.com>
2254
2255         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
2256         don't have any dots.  Fixes #52622, added cs0246-8.cs.
2257
2258         * namespace.cs (NamespaceEntry.Lookup): Likewise.
2259         
2260 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2261
2262         * class.cs (MemberBase.Define): Reuse MemberType member for 
2263         resolved type. Other methods can use it too.
2264
2265 2004-05-23  Martin Baulig  <martin@ximian.com>
2266
2267         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
2268         the variable also exists in the current block (otherwise, we need
2269         to report a CS0103).  Fixes #58670.
2270
2271 2004-05-23  Martin Baulig  <martin@ximian.com>
2272
2273         * flowanalysis.cs (Reachability.Reachable): Compute this
2274         on-the-fly rather than storing it as a field.
2275
2276 2004-05-23  Martin Baulig  <martin@ximian.com>
2277
2278         * flowanalysis.cs (Reachability.And): Manually compute the
2279         resulting `barrier' from the reachability.      
2280        
2281 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2282
2283         Fix bug #57835
2284         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
2285         instance of ObsoleteAttribute when symbol is obsolete.
2286
2287         * class.cs
2288         (IMethodData): Extended interface for ObsoleteAttribute support.
2289
2290 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2291
2292         * attribute.cs: Fix bug #55970
2293
2294 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2295
2296         Fix bug #52705
2297         * attribute.cs
2298         (GetObsoleteAttribute): New method. Creates the instance of
2299         ObsoleteAttribute.
2300         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
2301         ObsoleteAttribute when member is obsolete.
2302         (AttributeTester.Report_ObsoleteMessage): Common method for
2303         Obsolete error/warning reporting.
2304
2305         * class.cs
2306         (TypeContainer.base_classs_type): New member for storing parent type.
2307
2308         * decl.cs
2309         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
2310         for this MemberCore.
2311
2312 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2313
2314         * attribute.cs, const.cs: Fix bug #58590
2315
2316 2004-05-21  Martin Baulig  <martin@ximian.com>
2317
2318         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
2319         out parameters if the end of the method is unreachable.  Fixes
2320         #58098. 
2321
2322 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
2325         Hari was right, why extra method.
2326
2327 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2328
2329         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
2330
2331 2004-05-20  Martin Baulig  <martin@ximian.com>
2332
2333         Merged this back from gmcs to keep the differences to a minumum.
2334
2335         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
2336         instead of a Declspace.
2337         (Attribute.ResolveType): Likewise.
2338         (Attributes.Search): Likewise.
2339         (Attributes.Contains): Likewise.
2340         (Attributes.GetClsCompliantAttribute): Likewise.
2341
2342         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
2343         argument.
2344         (MethodData.ApplyAttributes): Take an EmitContext instead of a
2345         DeclSpace.
2346
2347 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
2348
2349         Fix bug #58688 (MCS does not report error when the same attribute
2350         is assigned twice)
2351
2352         * attribute.cs (Attribute.Emit): Distinction between null and default.
2353
2354 2004-05-19  Raja R Harinath  <rharinath@novell.com>
2355
2356         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
2357         of a top-level attribute without an attribute target.
2358         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
2359         Make non-static.
2360         (Attribute.Conditional_GetConditionName), 
2361         (Attribute.Obsolete_GetObsoleteMessage): Update.
2362         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
2363         part of ScanForIndexerName.
2364         (Attribute.CanIgnoreInvalidAttribute): New function.
2365         (Attribute.ScanForIndexerName): Move to ...
2366         (Attributes.ScanForIndexerName): ... here.
2367         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
2368         (Attributes.Search): New internal variant that can choose not to
2369         complain if types aren't resolved.  The original signature now
2370         complains.
2371         (Attributes.GetClsCompliantAttribute): Use internal variant, with
2372         complaints suppressed.
2373         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
2374         only if it not useful.
2375         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
2376         top-level for attributes that are shared between the assembly
2377         and a top-level class.
2378         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
2379         * class.cs: Update to reflect changes.
2380         (DefineIndexers): Fuse loops.
2381         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
2382         a couple more variants of attribute names.
2383
2384 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
2385
2386         Fix bug #52585 (Implemented explicit attribute declaration)
2387
2388         * attribute.cs:
2389         (Attributable.ValidAttributeTargets): New abstract method. It gets
2390         list of valid attribute targets for explicit target declaration.
2391         (Attribute.Target): It holds target itself.
2392         (AttributeSection): Removed.
2393         (Attribute.CheckTargets): New method. It checks whether attribute
2394         target is valid for the current element.
2395
2396         * class.cs:
2397         (EventProperty): New class. For events that are declared like
2398         property (with add and remove accessors).
2399         (EventField): New class. For events that are declared like field.
2400         class.cs
2401
2402         * cs-parser.jay: Implemented explicit attribute target declaration.
2403
2404         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
2405         Override ValidAttributeTargets.
2406
2407         * parameter.cs:
2408         (ReturnParameter): Class for applying custom attributes on 
2409         the return type.
2410         (ParameterAtribute): New class. Class for applying custom
2411         attributes on the parameter type.
2412
2413 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
2414
2415         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
2416         definitions. 
2417
2418         (Method): Allow UNSAFE here.
2419
2420         * modifiers.cs: Support unsafe reporting.
2421
2422 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
2423
2424         * decl.cs: Fix bug #58478.
2425
2426 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2427
2428         * statement.cs: When checking for unreachable code on an EmptyStatement,
2429         set the location. Fixes bug #58488.
2430
2431 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
2432
2433         * driver.cs: Add -pkg handling.
2434
2435         From Gonzalo: UseShelLExecute=false
2436
2437 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
2438
2439         * attribute.cs:
2440         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
2441         for attribute.
2442         (Attribute.IsClsCompliaceRequired): Moved to base for better
2443         accesibility.
2444         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
2445         when attribute is AttributeUsageAttribute.
2446         (Attribute.GetValidTargets): Simplified.
2447         (Attribute.GetAttributeUsage): New method returns AttributeUsage
2448         attribute for this type.
2449         (Attribute.ApplyAttributes): Method renamed to Emit and make
2450         non-static.
2451         (GlobalAttributeSection): New class for special handling of global
2452         attributes (assembly, module).
2453         (AttributeSection.Emit): New method.
2454
2455         * class.cs: Implemented Attributable abstract methods.
2456         (MethodCore.LabelParameters): Moved to Parameter class.
2457         (Accessor): Is back simple class.
2458         (PropertyMethod): Implemented Attributable abstract class.
2459         (DelegateMethod): Implemented Attributable abstract class.
2460         (Event): New constructor for disctintion between normal Event
2461         and Event with accessors.
2462
2463         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
2464
2465         * codegen.cs, const.cs, decl.cs, delegate.cs:
2466         (CommonAssemblyModulClass): Implemented Attributable abstract class
2467         and simplified.
2468
2469         * enum.cs: Implement IAttributeSupport interface.
2470         (EnumMember): New class for emum members. Implemented Attributable
2471         abstract class
2472
2473         * parameter.cs:
2474         (ParameterBase): Is abstract.
2475         (ReturnParameter): New class for easier [return:] attribute handling.
2476
2477         * typemanager.cs: Removed builder_to_attr.
2478
2479 2004-05-11  Raja R Harinath  <rharinath@novell.com>
2480
2481         Fix bug #57151.
2482         * attribute.cs (Attribute.GetPositionalValue): New function.
2483         * class.cs (TypeContainer.VerifyMembers): New function.
2484         (TypeContainer.Emit): Use it.
2485         (ClassOrStruct): New base class for Class and Struct.
2486         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
2487         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
2488         class.
2489         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
2490         then each non-static field should have a FieldOffset attribute.
2491         Otherwise, none of the fields should have a FieldOffset attribute.
2492         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
2493         and FieldOffset attributes.
2494         * typemanager.cs (TypeManager.struct_layout_attribute_type)
2495         (TypeManager.field_offset_attribute_type): New core types.
2496         (TypeManager.InitCoreTypes): Initialize them.
2497
2498 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
2499
2500         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
2501         Return correct type.
2502         From bug #58270.
2503
2504 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
2505
2506         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
2507         be implicitly converted to ulong.
2508         
2509         * expression.cs: The logic for allowing operator &, | and ^ worked
2510         was wrong, it worked before because we did not report an error in
2511         an else branch.  Fixes 57895.
2512
2513         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
2514         allow volatile fields to be reference types.
2515
2516 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
2517
2518         * driver.cs: Add support for /debug-
2519
2520 2004-05-07  Raja R Harinath  <rharinath@novell.com>
2521
2522         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
2523         Add a 'complain' parameter to silence errors.
2524         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
2525         silently overlooked type-resolutions.
2526         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
2527         to reflect changes.
2528         (Attributes.Search): New function.
2529         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
2530         (Attributes.GetAttributeFullName): Remove hack.
2531         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
2532         Update to reflect changes.
2533         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2534         Use Attributes.Search instead of nested loops.
2535
2536 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
2537
2538         * decl.cs:
2539         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
2540         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
2541         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
2542
2543         * report.cs: (Report.Warning): Renamed to Warning_T because of
2544         parameter collision.
2545
2546 2004-05-05  Raja R Harinath  <rharinath@novell.com>
2547
2548         * expression.cs (MemberAccess.ResolveMemberAccess):
2549         Exit with non-zero status after Report.Error.
2550         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
2551         Likewise.
2552         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
2553
2554 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2555
2556         * support.cs: Don't hang when the file is empty.
2557
2558 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2559
2560         * support.cs: In SeekableStreamReader, compute the preamble size of the
2561           underlying stream. Position changes should take into account that initial
2562           count of bytes.
2563
2564 2004-05-03  Todd Berman  <tberman@sevenl.net>
2565
2566         * driver.cs: remove unused GetSysVersion function.
2567
2568 2004-05-03  Todd Berman  <tberman@sevenl.net>
2569
2570         * driver.cs: Remove the hack from saturday, as well as the hack
2571         from jackson (LoadAssemblyFromGac), also adds the CWD to the
2572         link_paths to get that bit proper.
2573
2574 2004-05-01  Todd Berman  <tberman@sevenl.net>
2575
2576         * driver.cs: Try a LoadFrom before a Load, this checks the current
2577         path. This is currently a bug in mono that is be fixed, however, this
2578         provides a workaround for now. This will be removed when the bug
2579         is fixed.
2580
2581 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
2582
2583         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2584         incomplete key pairs (#57941).
2585
2586 2004-05-01  Todd Berman  <tberman@sevenl.net>
2587
2588         * driver.cs: Remove '.' from path_chars, now System.* loads properly
2589         from the GAC
2590
2591 2004-04-30  Jackson Harper  <jackson@ximian.com>
2592
2593         * codegen.cs: Open keys readonly.
2594         
2595 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2596
2597         * typemanager.cs: don't report cyclic struct layout when a struct
2598         contains 2 or more fields of the same type. Failed for Pango.AttrShape
2599         which has 2 Pango.Rectangle fields.
2600
2601 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2602
2603         * expression.cs: Handle IntPtr comparisons with IL code
2604         rather than a method call.
2605
2606 2004-04-29  Martin Baulig  <martin@ximian.com>
2607
2608         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
2609         the list of PropertyInfo's in class hierarchy and find the
2610         accessor.  Fixes #56013.
2611
2612 2004-04-29  Martin Baulig  <martin@ximian.com>
2613
2614         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2615
2616 2004-04-29  Martin Baulig  <martin@ximian.com>
2617
2618         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2619
2620         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2621
2622 2004-04-29  Martin Baulig  <martin@ximian.com>
2623
2624         * class.cs (ConstructorInitializer.Resolve): Check whether the
2625         parent .ctor is accessible.  Fixes #52146.
2626
2627 2004-04-29  Martin Baulig  <martin@ximian.com>
2628
2629         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2630
2631         * statement.cs (Using.EmitLocalVariableDecls): Use
2632         TypeManager.idisposable_type, not typeof (IDisposable).
2633         (Foreach.EmitCollectionForeach): Added support for valuetypes.
2634
2635 2004-04-29  Martin Baulig  <martin@ximian.com>
2636
2637         * class.cs (Event.Define): Don't emit the field and don't set
2638         RTSpecialName and SpecialName for events on interfaces.  Fixes
2639         #57703. 
2640
2641 2004-04-29  Raja R Harinath  <rharinath@novell.com>
2642
2643         Refactor Attribute.ApplyAttributes.
2644         * attribute.cs (Attributable): New base class for objects that can
2645         have Attributes applied on them.
2646         (Attribute): Make AttributeUsage fields public.
2647         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
2648         (Attribute.IsInternalCall): New property.
2649         (Attribute.UsageAttr): Convert to a public read-only property.
2650         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
2651         (Attribute.ResolveType, Attribute.Resolve)
2652         (Attribute.ScanForIndexerName): Update to reflect changes.
2653         (Attribute.CheckAttributeTarget): Re-format.
2654         (Attribute.ApplyAttributes): Refactor, to various
2655         Attributable.ApplyAttributeBuilder methods.
2656         * decl.cs (MemberCore): Make Attributable.
2657         * class.cs (Accessor): Make Attributable.
2658         (MethodData.ApplyAttributes): Use proper attribute types, not
2659         attribute names.
2660         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
2661         (TypeContainer.ApplyAttributeBuilder)
2662         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
2663         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
2664         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
2665         (Operator.ApplyAttributeBuilder): New factored-out methods.
2666         * const.cs (Const.ApplyAttributeBuilder): Likewise.
2667         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
2668         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
2669         * parameter.cs (ParameterBase): New Attributable base class
2670         that can also represent Return types.
2671         (Parameter): Update to the changes.
2672
2673 2004-04-29  Jackson Harper  <jackson@ximian.com>
2674
2675         * driver.cs: Prefer the corlib system version when looking for
2676         assemblies in the GAC. This is still a hack, but its a better hack
2677         now.
2678         
2679 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * decl.cs, enum.cs: Improved error 3005 reporting.
2682   
2683         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
2684         (related_symbols): New private member for list of symbols
2685         related to reported error/warning.
2686         
2687         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2688
2689 2004-04-29  Martin Baulig  <martin@ximian.com>
2690
2691         * ecore.cs (Expression.Constantify): If we're an enum and
2692         TypeManager.TypeToCoreType() doesn't give us another type, use
2693         t.UnderlyingSystemType.  Fixes #56178.  
2694
2695 2004-04-29  Martin Baulig  <martin@ximian.com>
2696
2697         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
2698         interfaces and for each interface, only add members directly
2699         declared in that interface.  Fixes #53255.
2700
2701 2004-04-28  Martin Baulig  <martin@ximian.com>
2702
2703         * expression.cs (ConditionalLogicalOperator): Use a temporary
2704         variable for `left' to avoid that we evaluate it more than once;
2705         bug #52588.
2706
2707 2004-04-28  Martin Baulig  <martin@ximian.com>
2708
2709         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
2710         `void[]' (CS1547).
2711
2712 2004-04-28  Martin Baulig  <martin@ximian.com>
2713
2714         * statement.cs (LocalInfo.Resolve): Check whether the type is not
2715         void (CS1547).
2716
2717         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
2718         whether the type is not void (CS1547).
2719
2720 2004-04-28  Martin Baulig  <martin@ximian.com>
2721
2722         * expression.cs (Unary.DoResolveLValue): Override this and report
2723         CS0131 for anything but Operator.Indirection.
2724
2725 2004-04-28  Martin Baulig  <martin@ximian.com>
2726
2727         Committing a patch from Ben Maurer; see bug #50820.
2728
2729         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2730         check for classes.
2731
2732         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2733         classes.        
2734
2735 2004-04-28  Martin Baulig  <martin@ximian.com>
2736
2737         Committing a patch from Ben Maurer; see bug #50820.
2738
2739         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2740         check for classes.
2741
2742         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2743         classes.        
2744
2745 2004-04-28  Martin Baulig  <martin@ximian.com>
2746
2747         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
2748         (Block.AddLabel): Call DoLookupLabel() to only search in the
2749         current block.
2750
2751 2004-04-28  Martin Baulig  <martin@ximian.com>
2752
2753         * cfold.cs (ConstantFold.BinaryFold): Added special support for
2754         comparing StringConstants and NullLiterals in Equality and Inequality.
2755
2756 2004-04-28  Jackson Harper  <jackson@ximian.com>
2757
2758         * driver.cs: Attempt to load referenced assemblies from the
2759         GAC. This is the quick and dirty version of this method that
2760         doesnt take into account versions and just takes the first
2761         canidate found. Will be good enough for now as we will not have more
2762         then one version installed into the GAC until I update this method.
2763
2764 2004-04-28  Martin Baulig  <martin@ximian.com>
2765
2766         * typemanager.cs (TypeManager.CheckStructCycles): New public
2767         static method to check for cycles in the struct layout.
2768
2769         * rootcontext.cs (RootContext.PopulateTypes): Call
2770         TypeManager.CheckStructCycles() for each TypeContainer.
2771         [Note: We only need to visit each type once.]
2772
2773 2004-04-28  Martin Baulig  <martin@ximian.com>
2774
2775         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
2776
2777         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
2778         success and added `out object value'.  Use a `bool resolved' field
2779         to check whether we've already been called rather than
2780         `ConstantValue != null' since this breaks for NullLiterals.
2781
2782 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2783
2784         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
2785         setting of this flag, since the 'set' method may be non-public.
2786
2787 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2788
2789         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
2790         check on current_vector.Block.
2791
2792 2004-04-27  Martin Baulig  <martin@ximian.com>
2793
2794         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
2795         a field initializer.  Fixes #56459.
2796
2797 2004-04-27  Martin Baulig  <martin@ximian.com>
2798
2799         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
2800         we're not attempting to use an indexer.  Fixes #52154.
2801
2802 2004-04-27  Martin Baulig  <martin@ximian.com>
2803
2804         * statement.cs (Return): Don't create a return label if we don't
2805         need it; reverts my change from January 20th.  Thanks to Ben
2806         Maurer for this.
2807
2808 2004-04-27  Martin Baulig  <martin@ximian.com>
2809
2810         According to the spec, `goto' can only leave a nested scope, but
2811         never enter it.
2812
2813         * statement.cs (Block.LookupLabel): Only lookup in the current
2814         block, don't recurse into parent or child blocks.
2815         (Block.AddLabel): Check in parent and child blocks, report
2816         CS0140/CS0158 if we find a duplicate.
2817         (Block): Removed this indexer for label lookups.
2818         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2819         this already does the error reporting for us.
2820
2821         * flowanalysis.cs
2822         (FlowBranching.UsageVector.Block): New public variable; may be null.
2823         (FlowBranching.CreateSibling): Added `Block' argument.
2824         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2825         label for the target of a `goto' and check whether we're not
2826         leaving a `finally'.
2827
2828 2004-04-27  Martin Baulig  <martin@ximian.com>
2829
2830         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2831         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2832         just for returns).
2833
2834 2004-04-27  Martin Baulig  <martin@ximian.com>
2835
2836         * statement.cs (Block.AddLabel): Also check for implicit blocks
2837         and added a CS0158 check.
2838
2839 2004-04-27  Martin Baulig  <martin@ximian.com>
2840
2841         * flowanalysis.cs (FlowBranchingLoop): New class.
2842         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2843         UsageVector's instead of an ArrayList.
2844         (FlowBranching.Label): Likewise.
2845         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2846         (FlowBranching.AddBreakVector): New method.
2847
2848 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2849
2850         * attribute.cs: Small regression fix: only convert the type if we
2851         the type is different, fixes System.Drawing build.
2852
2853 2004-04-27  Martin Baulig  <martin@ximian.com>
2854
2855         * attribute.cs (Attribute.Resolve): If we have a constant value
2856         for a named field or property, implicity convert it to the correct
2857         type.
2858
2859 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2860
2861         * statement.cs (Block.Block): Implicit blocks share
2862         'child_variable_names' fields with parent blocks.
2863         (Block.AddChildVariableNames): Remove.
2864         (Block.AddVariable): Mark variable as "used by a child block" in
2865         every surrounding block.
2866         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
2867         been used in a child block, complain about violation of "Invariant
2868         meaning in blocks" rule.
2869         * cs-parser.jay (declare_local_variables): Don't use
2870         AddChildVariableNames.
2871         (foreach_statement): Don't create an implicit block: 'foreach'
2872         introduces a scope.
2873
2874 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
2875
2876         * convert.cs (ImplicitNumericConversion): 0 is also positive when
2877         converting from 0L to ulong.  Fixes 57522.
2878
2879 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2880
2881         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
2882         derived class hides via 'new' keyword field from base class (test-242.cs).
2883         TODO: Handle this in the more general way.
2884         
2885         * class.cs (CheckBase): Ditto.
2886
2887 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2888
2889         * decl.cs (caching_flags): New member for storing cached values
2890         as bit flags.
2891         (MemberCore.Flags): New enum where bit flags for caching_flags
2892         are defined.
2893         (MemberCore.cls_compliance): Moved to caching_flags.
2894         (DeclSpace.Created): Moved to caching_flags.
2895
2896         * class.cs: Use caching_flags instead of DeclSpace.Created
2897         
2898 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
2899
2900         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
2901         if we are only a derived class, not a nested class.
2902
2903         * typemanager.cs: Same as above, but do this at the MemberLookup
2904         level (used by field and methods, properties are handled in
2905         PropertyExpr).   Allow for the qualified access if we are a nested
2906         method. 
2907
2908 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
2909
2910         * class.cs: Refactoring.
2911         (IMethodData): New inteface; Holds links to parent members
2912         to avoid member duplication (reduced memory allocation).
2913         (Method): Implemented IMethodData interface.
2914         (PropertyBase): New inner classes for get/set methods.
2915         (PropertyBase.PropertyMethod): Implemented IMethodData interface
2916         (Event): New inner classes for add/remove methods.
2917         (Event.DelegateMethod): Implemented IMethodData interface.
2918
2919         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
2920         EmitContext (related to class.cs refactoring).
2921
2922 2004-04-21  Raja R Harinath  <rharinath@novell.com>
2923
2924         * delegate.cs (Delegate.VerifyApplicability): If the number of
2925         arguments are the same as the number of parameters, first try to
2926         verify applicability ignoring  any 'params' modifier on the last
2927         parameter.
2928         Fixes #56442.
2929
2930 2004-04-16  Raja R Harinath  <rharinath@novell.com>
2931
2932         * class.cs (TypeContainer.AddIndexer): Use
2933         'ExplicitInterfaceName' to determine if interface name was
2934         explicitly specified.  'InterfaceType' is not initialized at this time.
2935         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
2936         Indexers array is already in the required order.  Initialize
2937         'IndexerName' only if there are normal indexers.
2938         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
2939         (TypeContainer.Emit): Emit DefaultMember attribute only if
2940         IndexerName is initialized.
2941         Fixes #56300.
2942
2943 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
2944
2945         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
2946         Fixes #57007
2947
2948 2004-04-15  Raja R Harinath  <rharinath@novell.com>
2949
2950         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
2951         attributes.
2952         Fix for #56456.
2953
2954         * attribute.cs (Attribute.Resolve): Check for duplicate named
2955         attributes.
2956         Fix for #56463.
2957
2958 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
2959
2960         * iterators.cs (MarkYield): track whether we are in an exception,
2961         and generate code accordingly.  Use a temporary value to store the
2962         result for our state.
2963
2964         I had ignored a bit the interaction of try/catch with iterators
2965         since their behavior was not entirely obvious, but now it is
2966         possible to verify that our behavior is the same as MS .NET 2.0
2967
2968         Fixes 54814
2969
2970 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
2971
2972         * iterators.cs: Avoid creating temporaries if there is no work to
2973         do. 
2974
2975         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
2976         Enumerations, use TypeManager.EnumToUnderlying and call
2977         recursively. 
2978
2979         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
2980         bug #57013
2981
2982         (This.Emit): Use EmitContext.EmitThis to emit our
2983         instance variable.
2984
2985         (This.EmitAssign): Ditto.
2986
2987         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
2988         codepaths, we will move all the functionality into
2989         Mono.CSharp.This 
2990
2991         (FieldExpr.EmitAssign): Ditto.
2992
2993         This fixes several hidden bugs that I uncovered while doing a code
2994         review of this today.
2995
2996         * codegen.cs (EmitThis): reworked so the semantics are more clear
2997         and also support value types "this" instances.
2998
2999         * iterators.cs: Changed so that for iterators in value types, we
3000         do not pass the value type as a parameter.  
3001
3002         Initialization of the enumerator helpers is now done in the caller
3003         instead of passing the parameters to the constructors and having
3004         the constructor set the fields.
3005
3006         The fields have now `assembly' visibility instead of private.
3007
3008 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
3009
3010         * expression.cs (Argument.Resolve): Check if fields passed as ref
3011         or out are contained in a MarshalByRefObject.
3012
3013         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
3014         another compiler type.
3015
3016 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3017
3018         * class.cs (Indexer.Define): use the new name checking method.
3019         Also, return false on an error.
3020         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
3021         (is_identifier_[start/part]_character): make static.
3022
3023 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
3024
3025         * expression.cs (Binary.ResolveOperator): Do no append strings
3026         twice: since we can be invoked more than once (array evaluation)
3027         on the same concatenation, take care of this here.  Based on a fix
3028         from Ben (bug #56454)
3029
3030 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3031
3032         * codegen.cs: Fix another case where CS1548 must be reported (when 
3033         delay-sign isn't specified and no private is available #56564). Fix
3034         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
3035         error when MCS is used on the MS runtime and we need to delay-sign 
3036         (which seems unsupported by AssemblyBuilder - see #56621).
3037
3038 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
3039
3040         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
3041         (TypeManager.ComputeNamespaces): Faster implementation for
3042         Microsoft runtime.
3043
3044         * compiler.csproj: Updated AssemblyName to mcs.
3045
3046 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
3047
3048         * rootcontext.cs: Add new types to the boot resolution.
3049
3050         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
3051         MulticastDelegate is not allowed.
3052
3053         * typemanager.cs: Add new types to lookup: System.TypedReference
3054         and ArgIterator.
3055
3056         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
3057         check for TypedReference or ArgIterator, they are not allowed. 
3058
3059         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
3060         makes us properly catch 1510 in some conditions (see bug 56016 for
3061         details). 
3062
3063 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
3064
3065         * CryptoConvert.cs: update from corlib version
3066         with endian fixes.
3067
3068 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
3069
3070         * class.cs (Indexer.Define): Check indexername declaration
3071
3072 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
3073
3074         * attribute.cs (IsClsCompliant): Fixed problem with handling
3075         all three states (compliant, not-compliant, undetected).
3076
3077 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
3078
3079         * attribute.cs (Attribute): Location is now public.
3080         (Resolve): Store resolved arguments (pos_values) in attribute class.
3081         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
3082         (GetClsCompliantAttributeValue): New method that gets
3083         CLSCompliantAttribute value.
3084         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
3085         if exists else null.
3086         (AttributeTester): New class for CLS-Compliant verification routines.
3087
3088         * class.cs (Emit): Add CLS-Compliant verification.
3089         (Method.GetSignatureForError): Implemented.
3090         (Constructor.GetSignatureForError): Implemented
3091         (Constructor.HasCompliantArgs): Returns if constructor has
3092         CLS-Compliant arguments.
3093         (Constructor.Emit): Override.
3094         (Construcor.IsIdentifierClsCompliant): New method; For constructors
3095         is needed to test only parameters.
3096         (FieldBase.GetSignatureForError): Implemented.
3097         (TypeContainer): New member for storing base interfaces.
3098         (TypeContainer.FindMembers): Search in base interfaces too.
3099
3100         * codegen.cs (GetClsComplianceAttribute): New method that gets
3101         assembly or module CLSCompliantAttribute value.
3102         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
3103         for assembly.
3104         (ModuleClass.Emit): Add error 3012 test.
3105
3106         * const.cs (Emit): Override and call base for CLS-Compliant tests.
3107
3108         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
3109         state for all decl types.
3110         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
3111         if CLS-Compliant tests are required.
3112         (IsClsCompliaceRequired): New method. Analyze whether code
3113         must be CLS-Compliant.
3114         (IsExposedFromAssembly): New method. Returns true when MemberCore
3115         is exposed from assembly.
3116         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
3117         value or gets cached value.
3118         (HasClsCompliantAttribute): New method. Returns true if MemberCore
3119         is explicitly marked with CLSCompliantAttribute.
3120         (IsIdentifierClsCompliant): New abstract method. This method is
3121         used to testing error 3005.
3122         (IsIdentifierAndParamClsCompliant): New method. Common helper method
3123         for identifier and parameters CLS-Compliant testing.
3124         (VerifyClsCompliance): New method. The main virtual method for
3125         CLS-Compliant verifications.
3126         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
3127         null. I don't know why is null (too many public members !).
3128         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
3129         and get value of first CLSCompliantAttribute that found.
3130
3131         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
3132         (VerifyClsCompliance): Override and add extra tests.
3133
3134         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
3135         clscheck- disable CLS-Compliant verification event if assembly is has
3136         CLSCompliantAttribute(true).
3137
3138         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
3139         ApllyAttribute is now called in emit section as in the other cases.
3140         Possible future Emit integration.
3141         (IsIdentifierClsCompliant): New override.
3142         (VerifyClsCompliance): New override.
3143         (GetEnumeratorName): Returns full enum name.
3144
3145         * parameter.cs (GetSignatureForError): Implemented.
3146
3147         * report.cs (WarningData): New struct for Warning message information.
3148         (LocationOfPreviousError): New method.
3149         (Warning): New method. Reports warning based on the warning table.
3150         (Error_T): New method. Reports error based on the error table.
3151
3152         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
3153         verifications are done here.
3154
3155         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
3156
3157         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
3158         CLSCompliantAttribute.
3159         (all_imported_types): New member holds all imported types from other
3160         assemblies.
3161         (LoadAllImportedTypes): New method fills static table with exported types
3162         from all referenced assemblies.
3163         (Modules): New property returns all assembly modules.
3164
3165 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
3166
3167         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
3168         throwing a parser error.
3169
3170         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
3171         which removes the hardcoded get_/set_ prefixes for properties, as
3172         IL allows for the properties to be named something else.  
3173
3174         Bug #56013
3175
3176         * expression.cs: Do not override operand before we know if it is
3177         non-null.  Fix 56207
3178
3179 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3180
3181         * typemanager.cs: support for pinned variables.
3182
3183 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3184
3185         * decl.cs, typemanager.cs: Avoid using an arraylist
3186         as a buffer if there is only one result set.
3187
3188 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3189
3190         * expression.cs: Make sure you cant call a static method
3191         with an instance expression, bug #56174.
3192
3193 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
3194
3195         * class.cs (IsDuplicateImplementation): Improve error reporting to
3196         flag 663 (method only differs in parameter modifier).
3197
3198         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
3199         in preprocessor directives.
3200
3201         * location.cs (LookupFile): Allow for the empty path.
3202
3203         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
3204         better approach for some of that patch, but its failing with the
3205         CharSet enumeration.  For now try/catch will do.
3206
3207         * typemanager.cs: Do not crash if a struct does not have fields.
3208         Fixes 56150.
3209
3210 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3211
3212         * expression.cs: cs0213, cant fix a fixed expression.
3213         fixes 50231.
3214
3215 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3216
3217         * cs-parser.jay: detect invalid embeded statements gracefully.
3218         bug #51113.
3219
3220 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3221
3222         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
3223         As a regex:
3224         s/
3225         the invocation type may not be a subclass of the tye of the item/
3226         The type of the item must be a subclass of the invocation item.
3227         /g
3228
3229         Fixes bug #50820.
3230
3231 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
3232
3233         * attribute.cs: Added methods to get a string and a bool from an
3234         attribute. Required to information from AssemblyKeyFileAttribute,
3235         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
3236         * codegen.cs: Modified AssemblyName creation to include support for
3237         strongnames. Catch additional exceptions to report them as CS1548.
3238         * compiler.csproj: Updated include CryptoConvert.cs.
3239         * compiler.csproj.user: Removed file - user specific configuration.
3240         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
3241         Mono.Security assembly. The original class is maintained and tested in
3242         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
3243         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
3244         like CSC 8.0 (C# v2) supports.
3245         * Makefile: Added CryptoConvert.cs to mcs sources.
3246         * rootcontext.cs: Added new options for strongnames.
3247
3248 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
3249
3250         * driver.cs: For --expect-error, report error code `2'
3251         if the program compiled with no errors, error code `1' if
3252         it compiled with an error other than the one expected.
3253
3254 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
3255
3256         * compiler.csproj: Updated for Visual Studio .NET 2003.
3257         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
3258         * compiler.sln: Updated for Visual Studio .NET 2003.
3259
3260 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
3261
3262         * expression.cs: Fix bug #47234. We basically need to apply the
3263         rule that we prefer the conversion of null to a reference type
3264         when faced with a conversion to 'object' (csc behaviour).
3265
3266 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3267
3268         * statement.cs: Shorter form for foreach, eliminates
3269         a local variable. r=Martin.
3270
3271 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3272
3273         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
3274         checks if we can use brtrue/brfalse to test for 0.
3275         * expression.cs: use the above in the test for using brtrue/brfalse.
3276         cleanup code a bit.
3277
3278 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3279
3280         * expression.cs: Rewrite string concat stuff. Benefits:
3281
3282         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
3283         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
3284         rather than a concat chain.
3285
3286         * typemanager.cs: Add lookups for more concat overloads.
3287
3288 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3289
3290         * expression.cs: Emit shorter il code for array init.
3291
3292         newarr
3293         dup
3294         // set 1
3295
3296         // set 2
3297
3298         newarr
3299         stloc.x
3300
3301         ldloc.x
3302         // set 1
3303
3304         ldloc.x
3305         // set 2
3306
3307 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
3308
3309         * statement.cs: Before, two switch blocks would be merged if the
3310         total size of the blocks (end_item - begin_item + 1) was less than
3311         two times the combined sizes of the blocks.
3312
3313         Now, it will only merge if after the merge at least half of the
3314         slots are filled.
3315
3316         fixes 55885.
3317
3318 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
3319
3320         * class.cs : csc build fix for GetMethods(). See bug #52503.
3321
3322 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
3323
3324         * expression.cs: Make sure fp comparisons work with NaN.
3325         This fixes bug #54303. Mig approved this patch a long
3326         time ago, but we were not able to test b/c the runtime
3327         had a related bug.
3328
3329 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
3330
3331         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
3332
3333 2004-03-19  Martin Baulig  <martin@ximian.com>
3334
3335         * class.cs (MemberCore.IsDuplicateImplementation): Report the
3336         error here and not in our caller.
3337
3338 2004-03-19  Martin Baulig  <martin@ximian.com>
3339
3340         * interface.cs: Completely killed this file.
3341         (Interface): We're now a TypeContainer and live in class.cs.
3342
3343         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
3344         argument; we're now also called for interfaces.
3345         (TypeContainer.DefineMembers): Allow this method being called
3346         multiple times.
3347         (TypeContainer.GetMethods): New public method; formerly known as
3348         Interface.GetMethod().  This is used by PendingImplementation.
3349         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
3350         it's now private and non-static.
3351         (Interface): Moved this here; it's now implemented similar to
3352         Class and Struct.
3353         (Method, Property, Event, Indexer): Added `bool is_interface'
3354         argument to their .ctor's.
3355         (MemberBase.IsInterface): New public field.
3356
3357         * cs-parser.jay: Create normal Method, Property, Event, Indexer
3358         instances instead of InterfaceMethod, InterfaceProperty, etc.
3359         (opt_interface_base): Removed; we now use `opt_class_base' instead.
3360         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
3361
3362 2004-03-19  Martin Baulig  <martin@ximian.com>
3363
3364         * class.cs (MethodCore.IsDuplicateImplementation): New private
3365         method which does the CS0111 checking.
3366         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
3367         Use IsDuplicateImplementation().
3368
3369 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
3370
3371         * decl.cs (FindMemberToOverride): New method to find the correct
3372         method or property to override in the base class.
3373         * class.cs
3374             - Make Method/Property use the above method to find the
3375               version in the base class.
3376             - Remove the InheritableMemberSignatureCompare as it is now
3377               dead code.
3378
3379         This patch makes large code bases much faster to compile, as it is
3380         O(n) rather than O(n^2) to do this validation.
3381
3382         Also, it fixes bug 52458 which is that nested classes are not
3383         taken into account when finding the base class member.
3384
3385         Reviewed/Approved by Martin.
3386
3387 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
3388
3389         * interface.cs: In all interface classes removed redundant
3390         member initialization.
3391
3392 2004-03-16  Martin Baulig  <martin@ximian.com>
3393
3394         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
3395
3396 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
3397
3398         * decl.cs (DefineTypeAndParents): New helper method to define a
3399         type's containers before the type itself is defined;  This is a
3400         bug exposed by the recent changes to Windows.Forms when an
3401         implemented interface was defined inside a class that had not been
3402         built yet.   
3403
3404         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
3405
3406         (Check): Loop correctly to report errors modifiers
3407         (UNSAFE was not in the loop, since it was the same as TOP).
3408
3409         * interface.cs: Every interface member now takes a ModFlags,
3410         instead of a "is_new" bool, which we set on the base MemberCore. 
3411
3412         Every place where we called "UnsafeOk" in the interface, now we
3413         call the proper member (InterfaceMethod.UnsafeOK) instead to get
3414         the unsafe settings from the member declaration instead of the
3415         container interface. 
3416
3417         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
3418
3419         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
3420         `set_indexer_name' to the pending bits (one per type).
3421
3422         We fixed a bug today that was picking the wrong method to
3423         override, since for properties the existing InterfaceMethod code
3424         basically ignored the method name.  Now we make sure that the
3425         method name is one of the valid indexer names.
3426
3427 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
3428  
3429         * support.cs (SeekableStreamReader): Keep track of stream byte
3430         positions and don't mix them with character offsets to the buffer.
3431
3432         Patch from Gustavo Giráldez
3433
3434 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
3435
3436         * interface.cs (InterfaceSetGetBase): Removed double member
3437         initialization, base class does it as well.
3438
3439 2004-03-13  Martin Baulig  <martin@ximian.com>
3440
3441         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
3442         when compiling corlib.
3443
3444 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
3445
3446         * convert.cs (ExplicitConversion): We were reporting an error on
3447         certain conversions (object_type source to a value type, when the
3448         expression was `null') before we had a chance to pass it through
3449         the user defined conversions.
3450
3451         * driver.cs: Replace / and \ in resource specifications to dots.
3452         Fixes 50752
3453
3454         * class.cs: Add check for duplicate operators.  Fixes 52477
3455
3456 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
3457
3458         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
3459         that are in the middle of the statements, not only at the end.
3460         Fixes #54987
3461
3462         * class.cs (TypeContainer.AddField): No longer set the
3463         `HaveStaticConstructor' flag, now we call it
3464         `UserDefineStaticConstructor' to diferentiate the slightly
3465         semantic difference.
3466
3467         The situation is that we were not adding BeforeFieldInit (from
3468         Modifiers.TypeAttr) to classes that could have it.
3469         BeforeFieldInit should be set to classes that have no static
3470         constructor. 
3471
3472         See:
3473
3474         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
3475
3476         And most importantly Zoltan's comment:
3477
3478         http://bugzilla.ximian.com/show_bug.cgi?id=44229
3479
3480         "I think beforefieldinit means 'it's ok to initialize the type sometime 
3481          before its static fields are used', i.e. initialization does not need
3482          to be triggered by the first access to the type. Setting this flag
3483          helps the JIT to compile better code, since it can run the static
3484          constructor at JIT time, and does not need to generate code to call it
3485          (possibly lots of times) at runtime. Unfortunately, mcs does not set
3486          this flag for lots of classes like String. 
3487          
3488          csc sets this flag if the type does not have an explicit static 
3489          constructor. The reasoning seems to be that if there are only static
3490          initalizers for a type, and no static constructor, then the programmer
3491          does not care when this initialization happens, so beforefieldinit
3492          can be used.
3493          
3494          This bug prevents the AOT compiler from being usable, since it 
3495          generates so many calls to mono_runtime_class_init that the AOT code
3496          is much slower than the JITted code. The JITted code is faster, 
3497          because it does not generate these calls if the vtable is type is
3498          already initialized, which is true in the majority of cases. But the
3499          AOT compiler can't do this."
3500
3501 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
3502
3503         * class.cs (MethodData.Emit): Refactor the code so symbolic
3504         information is generated for destructors;  For some reasons we
3505         were taking a code path that did not generate symbolic information
3506         before. 
3507
3508 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3509
3510         * class.cs: Create a Constructor.CheckBase method that
3511         takes care of all validation type code. The method
3512         contains some code that was moved from Define.
3513
3514         It also includes new code that checks for duplicate ctors.
3515         This fixes bug #55148.
3516
3517 2004-03-09  Joshua Tauberer <tauberer@for.net>
3518
3519         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
3520         a { ... }-style array creation invokes EmitStaticInitializers
3521         which is not good for reference-type arrays.  String, decimal
3522         and now null constants (NullCast) are not counted toward
3523         static initializers.
3524
3525 2004-03-05  Martin Baulig  <martin@ximian.com>
3526
3527         * location.cs (SourceFile.HasLineDirective): New public field;
3528         specifies whether the file contains or is referenced by a "#line"
3529         directive.
3530         (Location.DefineSymbolDocuments): Ignore source files which
3531         either contain or are referenced by a "#line" directive.        
3532
3533 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
3534
3535         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
3536         direct access to our parent, so check the method inline there.
3537
3538 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3539
3540         * expression.cs (Invocation.EmitCall): Miguel's last commit
3541         caused a regression. If you had:
3542
3543             T t = null;
3544             t.Foo ();
3545
3546         In Foo the implict this would be null.
3547
3548 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
3549
3550         * expression.cs (Invocation.EmitCall): If the method is not
3551         virtual, do not emit a CallVirt to it, use Call.
3552
3553         * typemanager.cs (GetFullNameSignature): Improve the method to
3554         cope with ".ctor" and replace it with the type name.
3555
3556         * class.cs (ConstructorInitializer.Resolve): Now the method takes
3557         as an argument the ConstructorBuilder where it is being defined,
3558         to catch the recursive constructor invocations.
3559
3560 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
3561
3562         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
3563         routines to check if a type is an enumerable/enumerator allow
3564         classes that implement the IEnumerable or IEnumerator interfaces.
3565
3566         * class.cs (Property, Operator): Implement IIteratorContainer, and
3567         implement SetYields.
3568
3569         (Property.Define): Do the block swapping for get_methods in the
3570         context of iterators.   We need to check if Properties also
3571         include indexers or not.
3572
3573         (Operator): Assign the Block before invoking the
3574         OperatorMethod.Define, so we can trigger the Iterator code
3575         replacement. 
3576
3577         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3578         Property and Operator classes are not created when we parse the
3579         declarator but until we have the block completed, so we use a
3580         singleton SimpleIteratorContainer.Simple to flag whether the
3581         SetYields has been invoked.
3582
3583         We propagate this setting then to the Property or the Operator to
3584         allow the `yield' to function.
3585
3586 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3587
3588         * codegen.cs: Implemented attribute support for modules.
3589         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3590         Assembly/Module functionality.
3591
3592         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3593         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3594         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3595
3596 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3597
3598         * interface.cs (FindMembers): The operation is performed on all base
3599         interfaces and not only on the first. It is required for future CLS Compliance patch.
3600
3601 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3602
3603         * statement.cs, codegen.cs:
3604         This patch deals with patterns such as:
3605
3606         public class List : IEnumerable {
3607
3608                 public MyEnumerator GetEnumerator () {
3609                         return new MyEnumerator(this);
3610                 }
3611
3612                 IEnumerator IEnumerable.GetEnumerator () {
3613                         ...
3614                 }
3615                 
3616                 public struct MyEnumerator : IEnumerator {
3617                         ...
3618                 }
3619         }
3620
3621         Before, there were a few things we did wrong:
3622         1) we would emit callvirt on a struct, which is illegal
3623         2) we emited ldarg when we needed to emit ldarga
3624         3) we would mistakenly call the interface methods on an enumerator
3625         type that derived from IEnumerator and was in another assembly. For example:
3626
3627         public class MyEnumerator : IEnumerator
3628
3629         Would have the interface methods called, even if there were public impls of the
3630         method. In a struct, this lead to invalid IL code.
3631
3632 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3633
3634         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3635           renamed to Emit.
3636
3637         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3638
3639 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3640
3641         * cs-parser.jay: Fix small regression: we were not testing V2
3642         compiler features correctly.
3643
3644         * interface.cs: If the emit context is null, then create one
3645
3646 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3647
3648         * decl.cs (GetSignatureForError): New virtual method to get full name
3649           for error messages.
3650
3651         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3652           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3653
3654         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3655           Duplicated members and code in these classes has been removed.
3656           Better encapsulation in these classes.
3657
3658 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3659
3660         * assign.cs (Assign.DoResolve): When dealing with compound
3661         assignments, there is a new rule in ECMA C# 2.4 (might have been
3662         there before, but it is documented here) that states that in:
3663
3664         a op= b;
3665
3666         If b is of type int, and the `op' is a shift-operator, then the
3667         above is evaluated as:
3668
3669         a = (int) a op b 
3670
3671         * expression.cs (Binary.ResolveOperator): Instead of testing for
3672         int/uint/long/ulong, try to implicitly convert to any of those
3673         types and use that in pointer arithmetic.
3674
3675         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3676         method to print information for from the type, not from the
3677         null-method we were given.
3678
3679 2004-02-01  Duncan Mak  <duncan@ximian.com>
3680
3681         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3682         parsing for cmd, fixes bug #53694.
3683
3684 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3685
3686         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3687         in the member name duplication tests. Property and operator name duplication
3688         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3689
3690 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3691
3692         * interface.cs (PopulateMethod): Fixed crash when interface method
3693         returns not existing type (error test cs0246-3.cs).
3694
3695 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3696
3697         * cs-parser.jay (interface_accessors): Re-write actions to also
3698         store attributes attached to get and set methods. Fix spelling
3699         while at it.
3700
3701         (inteface_property_declaration): Modify accordingly.
3702
3703         (InterfaceAccessorInfo): New helper class to store information to pass
3704         around between rules that use interface_accessors.
3705
3706         * interface.cs (Emit): Apply attributes on the get and set
3707         accessors of properties and indexers too.
3708
3709         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3710         right MethodBuilder when applying attributes to the get and set accessors.
3711
3712 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3713
3714         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3715
3716 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3717
3718         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3719
3720 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3721
3722         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3723         changes that treat `yield' specially when present before `break'
3724         or `return' tokens.
3725
3726         * cs-tokenizer.cs: yield is no longer a keyword.
3727
3728 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3729
3730         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3731         setting for default constructors.
3732         For default constructors are almost every time set wrong Modifier. The
3733         generated IL code has been alright. But inside mcs this values was
3734         wrong and this was reason why several of my CLS Compliance tests
3735         failed.
3736
3737 2004-01-22  Martin Baulig  <martin@ximian.com>
3738
3739         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3740         not a QualifiedIdentifier.  This is what `type_name_expression'
3741         was previously doing.
3742         (type_name_expression): Removed; the code is now in
3743         `namespace_or_type_name'.
3744         (qualified_identifier): Removed, use `namespace_or_type_name'
3745         instead.
3746         (QualifiedIdentifier): Removed this class.      
3747
3748 2004-01-22  Martin Baulig  <martin@ximian.com>
3749
3750         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3751         not a string as alias name.
3752
3753 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3754
3755         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3756         #52730 bug, and instead compute correctly the need to use a
3757         temporary variable when requesting an address based on the
3758         static/instace modified of the field and the constructor.
3759  
3760 2004-01-21  Martin Baulig  <martin@ximian.com>
3761
3762         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3763         class and namespace before looking up aliases.  Fixes #52517.
3764
3765 2004-01-21  Martin Baulig  <martin@ximian.com>
3766
3767         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3768         assinged in a 'try'; fixes exception4.cs.
3769
3770 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3771         * class.cs : Implemented parameter-less constructor for TypeContainer
3772
3773         * decl.cs: Attributes are now stored here. New property OptAttributes
3774
3775         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3776
3777         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3778
3779 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3780
3781         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3782           (CSharpSignature): New method for indexer and property signature.
3783
3784 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * pending.cs (IsVirtualFilter): Faster implementation.
3787
3788 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * typemanager.cs: Avoid inclusion of same assembly more than once.
3791
3792 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3793
3794         * cs-parser.jay: Fixed problem where the last assembly attribute
3795           has been applied also to following declaration (class, struct, etc.)
3796           
3797 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3798
3799         * class.cs: Added error CS0538, CS0539 reporting.
3800         Fixed crash on Microsoft runtime when field type is void.
3801
3802         * cs-parser.jay: Added error CS0537 reporting.
3803
3804         * pending.cs: Added error CS0535 reporting.
3805         Improved error report for errors CS0536, CS0534.
3806
3807 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3808
3809         Merge a few bits from the Anonymous Method MCS tree.
3810
3811         * statement.cs (ToplevelBlock): New class for toplevel methods,
3812         will hold anonymous methods, lifted variables.
3813
3814         * cs-parser.jay: Create toplevel blocks for delegates and for
3815         regular blocks of code. 
3816
3817 2004-01-20  Martin Baulig  <martin@ximian.com>
3818
3819         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3820         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3821         and `NeedExplicitReturn'; added `IsLastStatement'.
3822         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3823         have a `ReturnLabel' or we're not unreachable.
3824
3825         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3826         child's reachability; don't just override ours with it.  Fixes
3827         #58058 (lluis's example).
3828         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3829         InFinally(), InLoop(), InSwitch() and
3830         BreakCrossesTryCatchBoundary() methods.
3831
3832         * statement.cs (Return): Do all error checking in Resolve().
3833         Unless we are the last statement in a top-level block, always
3834         create a return label and jump to it.
3835         (Break, Continue): Do all error checking in Resolve(); also make
3836         sure we aren't leaving a `finally'.
3837         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3838         statement in a top-level block.
3839         (Block.Flags): Added `IsDestructor'.
3840         (Block.IsDestructor): New public property.
3841
3842 2004-01-20  Martin Baulig  <martin@ximian.com>
3843
3844         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3845
3846 2004-01-20  Martin Baulig  <martin@ximian.com>
3847
3848         * statement.cs (Statement.ResolveUnreachable): New public method.
3849         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3850         (Block.Resolve): Resolve unreachable statements.
3851
3852 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3853
3854         * expression.cs: We need to fix the case where we do
3855         not have a temp variable here.
3856
3857         * assign.cs: Only expression compound assignments need
3858         temporary variables.
3859
3860 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3861
3862         * flowanalysis.cs: Reduce memory allocation in a few ways:
3863           - A block with no variables should not allocate a bit
3864             vector for itself.
3865           - A method with no out parameters does not need any tracking
3866             for assignment of the parameters, so we need not allocate
3867             any data for it.
3868           - The arrays:
3869                 public readonly Type[] VariableTypes;
3870                 public readonly string[] VariableNames;
3871             Are redundant. The data is already stored in the variable
3872             map, so we need not allocate another array for it.
3873           - We need to add alot of checks for if (params | locals) == null
3874             due to the first two changes.
3875
3876 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
3877
3878         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
3879         implement IMemoryLocation, we store a copy on a local variable and
3880         take the address of it.  Patch from Benjamin Jemlich
3881
3882         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
3883         to use a special "type_name_expression" rule which reduces the
3884         number of "QualifiedIdentifier" classes created, and instead
3885         directly creates MemberAccess expressions.
3886
3887 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
3888
3889         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
3890         that fixes #52853.  Null literal assignment to ValueType
3891
3892         * class.cs (MethodData.Emit): Instead of checking the name of the
3893         method to determine if its a destructor, create a new derived
3894         class from Method called Destructor, and test for that.  
3895
3896         * cs-parser.jay: Create a Destructor object instead of a Method.  
3897
3898         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
3899
3900         Fixes: 52933
3901
3902 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
3903
3904         * expression.cs (Binary.ResolveOperator): Perform an implicit
3905         conversion from MethodGroups to their delegate types on the
3906         Addition operation.
3907
3908         * delegate.cs: Introduce a new class DelegateCreation that is the
3909         base class for `NewDelegate' and `ImplicitDelegateCreation',
3910         factor some code in here.
3911
3912         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
3913         conversion from MethodGroups to compatible delegate types. 
3914
3915         * ecore.cs (Expression.Resolve): Do not flag error 654
3916         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
3917         we allow conversions from MethodGroups to delegate types now.
3918
3919         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
3920         assignments in v2 either.
3921
3922 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
3923
3924         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
3925         static read-only fields in ctors.
3926
3927         Applied patch from Benjamin Jemlich 
3928
3929         * expression.cs (UnaryMutator): Avoid leaking local variables. 
3930
3931 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
3932
3933         * cs-tokenizer.cs (IsCastToken): Allow the various native types
3934         here to return true, as they can be used like this:
3935
3936                 (XXX) int.MEMBER ()
3937
3938         Fixed 49836 and all the other dups
3939
3940 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
3941
3942         * driver.cs: Implement /win32res and /win32icon.
3943
3944 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
3945
3946         * cs-parser.jay: Add a rule to improve error handling for the
3947         common mistake of placing modifiers after the type.
3948
3949 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
3950
3951         * cs-parser.jay (interface_event_declaration): Catch
3952         initialization of events on interfaces, and report cs0068
3953
3954         * cs-parser.jay (interface_event_declaration): Catch
3955         initialization of events. 
3956
3957         * ecore.cs: Better report missing constructors.
3958
3959         * expression.cs (Binary.ResolveOperator): My previous bug fix had
3960         the error reporting done in the wrong place.  Fix.
3961
3962         * expression.cs (Binary.ResolveOperator): Catch the 
3963         operator + (E x, E y) error earlier, and later allow for implicit
3964         conversions in operator +/- (E e, U x) from U to the underlying
3965         type of E.
3966
3967         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
3968         52596, if the container class is abstract, the default constructor
3969         is protected otherwise its public (before, we were always public).
3970
3971         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
3972         fixed statement.
3973
3974         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
3975         Jemlich that fixes bug #52597, MCS was generating invalid code for
3976         idisposable structs.   Thanks to Ben for following up with this
3977         bug as well.
3978
3979 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
3980
3981         * driver.cs: Allow assemblies without code to be generated, fixes
3982         52230.
3983
3984 2004-01-07  Nick Drochak <ndrochak@gol.com>
3985
3986         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
3987
3988 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
3989
3990         * cs-parser.jay: Add rules to improve error reporting if fields or
3991         methods are declared at the namespace level (error 116)
3992
3993         * Add rules to catch event add/remove
3994
3995 2004-01-04  David Sheldon <dave-mono@earth.li>
3996
3997   * expression.cs: Added matching ")" to error message for 
3998   CS0077
3999
4000 2004-01-03 Todd Berman <tberman@gentoo.org>
4001
4002         * ecore.cs, attribute.cs:
4003         Applying fix from #52429.
4004
4005 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4006
4007         * ecore.cs, expression.cs, statement.cs:
4008         Total rewrite of how we handle branching. We
4009         now handle complex boolean expressions with fewer
4010         jumps. As well if (x == 0) no longer emits a ceq.
4011
4012         if (x is Foo) is much faster now, because we generate
4013         better code.
4014
4015         Overall, we get a pretty big improvement on our benchmark
4016         tests. The code we generate is smaller and more readable.
4017
4018         I did a full two-stage bootstrap. The patch was reviewed
4019         by Martin and Miguel.
4020
4021 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4022
4023         * cs-parser.jay: Make primary_expression not take a QI.
4024         we dont need this because the member_access rule covers
4025         us here. So we replace the rule with just IDENTIFIER.
4026
4027         This has two good effects. First, we remove a s/r conflict.
4028         Second, we allocate many fewer QualifiedIdentifier objects.
4029
4030 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4031
4032         * attribute.cs: Handle MarshalAs attributes as pseudo, and
4033         set the correct information via SRE. This prevents
4034         hanging on the MS runtime. Fixes #29374.
4035
4036 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4037
4038         * convert.cs: correctly handle conversions to value types
4039         from Enum and ValueType as unboxing conversions.
4040
4041         Fixes bug #52569. Patch by Benjamin Jemlich.
4042
4043 2004-01-02  Ravi Pratap  <ravi@ximian.com>
4044
4045         * expression.cs (BetterConversion): Prefer int -> uint
4046         over int -> ulong (csc's behaviour). This fixed bug #52046.
4047
4048 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4049
4050         * decl.cs (MemberCache.FindMembers): now returns a
4051         MemberInfo [].
4052
4053         * typemanager.cs: In general, go with with ^^.
4054         (CopyNewMethods): take an IList.
4055         (RealMemberLookup): Only allocate an arraylist
4056         if we copy from two sets of methods.
4057
4058         This change basically does two things:
4059         1) Fewer array lists allocated due to CopyNewMethods.
4060         2) the explicit cast in MemberList costed ALOT.
4061
4062 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
4063
4064         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
4065         a hashtable to avoid needless string allocations when an identifier is
4066         used more than once (the common case).
4067
4068 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
4069
4070         * pending.cs: MS's TypeBuilder.GetInterfaces ()
4071         is broken, it will not return anything. So, we
4072         have to use the information we have in mcs to
4073         do the task.
4074
4075         * typemanager.cs: Add a cache for GetInterfaces,
4076         since this will now be used more often (due to ^^)
4077
4078         (GetExplicitInterfaces) New method that gets the
4079         declared, not effective, interfaces on a type
4080         builder (eg, if you have interface IFoo, interface
4081         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
4082         { IBar }.
4083
4084         This patch makes MCS able to bootstrap itself on
4085         Windows again.
4086
4087 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
4088
4089         * expression.cs: Remove the Nop's that Miguel put
4090         in by mistake.
4091
4092 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4093
4094         * report.cs, codegen.cs: Give the real stack trace to
4095         the error when an exception is thrown.
4096
4097 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4098
4099         * decl.cs: only allocate hashtables for ifaces if 
4100         it is an iface!
4101
4102 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4103
4104         * expression.cs: fix the error from cs0121-2.cs
4105         (a parent interface has two child interfaces that
4106         have a function with the same name and 0 params
4107         and the function is called through the parent).
4108
4109 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4110
4111         * class.cs, rootcontext.cs, typmanager.cs: do not
4112         leak pointers.
4113
4114 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4115
4116         * codegen.cs: remove stack for the ec flow branching.
4117         It is already a linked list, so no need.
4118
4119 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
4120
4121         * Makefile: Allow custom profiler here.
4122
4123 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4124
4125         * typemanager.cs (LookupType):
4126           - Use a static char [], because split takes
4127             a param array for args, so it was allocating
4128             every time.
4129           - Do not store true in a hashtable, it boxes.
4130
4131 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4132
4133         * flowanalysis.cs: bytify common enums.
4134
4135 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4136
4137         * modifiers.cs: Add a new set of flags for the
4138         flags allowed on explicit interface impls.
4139         * cs-parser.jay: catch the use of modifiers in
4140         interfaces correctly.
4141         * class.cs: catch private void IFoo.Blah ().
4142
4143         All related to bug #50572.
4144
4145 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4146
4147         * decl.cs: Rewrite the consistant accessability checking.
4148         Accessability is not linear, it must be implemented in
4149         a tableish way. Fixes #49704.
4150
4151 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4152
4153         * expression.cs: Handle negation in a checked context.
4154         We must use subtraction from zero. Fixes #38674.
4155
4156 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4157
4158         * class.cs: Ignore static void main in DLLs.
4159         * rootcontext.cs: Handle the target type here,
4160         since we are have to access it from class.cs
4161         * driver.cs: account for the above.
4162
4163 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4164
4165         * report.cs: Give line numbers and files if available.
4166
4167 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
4168
4169         * driver.cs: Implement /addmodule.
4170
4171         * typemanager.cs:  Change 'modules' field so it now contains Modules not
4172         ModuleBuilders.
4173
4174 2003-12-20  Martin Baulig  <martin@ximian.com>
4175
4176         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
4177         (FieldBase.IsAssigned): Removed this field.
4178         (FieldBase.SetAssigned): New public method.
4179         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
4180
4181 2003-12-20  Martin Baulig  <martin@ximian.com>
4182
4183         * expression.cs (LocalVariableReference.DoResolve): Don't set
4184         `vi.Used' if we're called from DoResolveLValue().
4185
4186         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
4187         returns the usage vector it just merged into the current one -
4188         pass this one to UsageWarning().
4189         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
4190         of the `EmitContext', don't call this recursively on our children.
4191
4192 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
4193
4194         * driver.cs: Implement /target:module.
4195
4196 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
4197
4198         * support.cs (CharArrayHashtable): New helper class.
4199
4200         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
4201         char arrays, not strings, so we can avoid creating a string in
4202         consume_identifier if the identifier is a keyword.
4203
4204 2003-12-16  Martin Baulig  <martin@ximian.com>
4205
4206         * statement.cs (LocalInfo.Assigned): Removed this property.
4207         (LocalInfo.Flags): Removed `Assigned'.
4208         (LocalInfo.IsAssigned): New public method; takes the EmitContext
4209         and uses flow analysis.
4210         (Block.UsageWarning): Made this method private.
4211         (Block.Resolve): Call UsageWarning() if appropriate.
4212
4213         * expression.cs (LocalVariableReference.DoResolve): Always set
4214         LocalInfo.Used here.
4215
4216 2003-12-13  Martin Baulig  <martin@ximian.com>
4217
4218         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
4219         any value here; we're now using flow analysis to figure out
4220         whether a statement/block returns a value.
4221
4222 2003-12-13  Martin Baulig  <martin@ximian.com>
4223
4224         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
4225         working again.
4226         (FlowBranching.MergeFinally): Don't call
4227         `branching.CheckOutParameters()' here, this is called in
4228         MergeTopBlock().
4229         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
4230         when adding the `finally' vector.       
4231
4232 2003-12-13  Martin Baulig  <martin@ximian.com>
4233
4234         * flowanalysis.cs
4235         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
4236         actually work and also fix #48962.
4237
4238 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
4239
4240         * decl.cs: Do not check System.Object for nested types,
4241         since we know it does not have any. Big bang for buck:
4242
4243         BEFORE:
4244            Run 1:   8.35 seconds
4245            Run 2:   8.32 seconds
4246            corlib:  17.99 seconds
4247         AFTER:
4248            Run 1:   8.17 seconds
4249            Run 2:   8.17 seconds
4250            corlib:  17.39 seconds
4251
4252 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
4253
4254         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
4255         time we are returning 0 members, so we save alot here.
4256
4257 2003-12-11  Martin Baulig  <martin@ximian.com>
4258
4259         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
4260         `MergeChild()', also just take the `FlowBranching' as argument;
4261         call Merge() on it and return the result.
4262         (FlowBranching.Merge): We don't need to do anything if we just
4263         have one sibling.
4264
4265 2003-12-11  Martin Baulig  <martin@ximian.com>
4266
4267         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
4268         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
4269         Maurer for this idea.
4270
4271 2003-12-11  Martin Baulig  <martin@ximian.com>
4272
4273         * flowanalysis.cs (MergeResult): This class is now gone; we now
4274         use the `UsageVector' for this.  The reason for this is that if a
4275         branching just has one sibling, we don't need to "merge" them at
4276         all - that's the next step to do.
4277         (FlowBranching.Merge): We now return a `UsageVector' instead of a
4278         `MergeResult'.
4279
4280 2003-12-11  Martin Baulig  <martin@ximian.com>
4281
4282         Reworked flow analyis and made it more precise and bug-free.  The
4283         most important change is that we're now using a special `Reachability'
4284         class instead of having "magic" meanings of `FlowReturns'.  I'll
4285         do some more cleanups and optimizations and also add some more
4286         documentation this week.
4287
4288         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
4289         largely reworked this class.
4290         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
4291         the new `Reachability' class instead of having "magic" values here.
4292         (FlowBranching): We're now using an instance of `Reachability'
4293         instead of having separate `Returns', `Breaks' etc. fields.
4294
4295         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
4296         based on flow analysis; ignore the return value of block.Emit ().
4297
4298 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
4299
4300         * driver.cs typemanager.cs: Find the mono extensions to corlib even
4301         if they are private.
4302
4303 2003-12-09  Martin Baulig  <martin@ximian.com>
4304
4305         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
4306         call them directly on the UsageVector.
4307
4308 2003-12-09  Martin Baulig  <martin@ximian.com>
4309
4310         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
4311         Changed return type from `FlowReturns' to `Reachability'.
4312
4313 2003-12-09  Martin Baulig  <martin@ximian.com>
4314
4315         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
4316         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
4317         `Reachable' fields with a single `Reachability' one.
4318
4319 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4320
4321         * class.cs (FindMembers): Remove foreach's.
4322
4323         Bootstrap times:
4324
4325         BEFORE
4326                 Run 1:   8.74 seconds
4327                 Run 2:   8.71 seconds
4328
4329         AFTER
4330                 Run 1:   8.64 seconds
4331                 Run 2:   8.58 seconds
4332
4333
4334 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4335
4336         * cs-parser.jay:
4337         * gen-treedump.cs:
4338         * statement.cs:
4339         This patch does a few things:
4340                 1. EmptyStatement is now a singleton, so it is never reallocated.
4341                 2. All blah is EmptyStatement constructs have been changed to
4342                    blah == EmptyStatement.Value, which is much faster and valid
4343                    now that EmptyStatement is a singleton.
4344                 3. When resolving a block, rather than allocating a new array for
4345                    the non-empty statements, empty statements are replaced with
4346                    EmptyStatement.Value
4347                 4. Some recursive functions have been made non-recursive.
4348         Mainly the performance impact is from (3), however (1) and (2) are needed for
4349         this to work. (4) does not make a big difference in normal situations, however
4350         it makes the profile look saner.
4351
4352         Bootstrap times:
4353
4354         BEFORE
4355         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4356         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4357         Total memory allocated: 56397 KB
4358
4359         AFTER
4360         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
4361         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
4362         Total memory allocated: 55666 KB
4363
4364 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4365
4366         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
4367         than the hashtable in a hashtable version
4368
4369         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
4370         we always end up concating a string. This results in a huge perf
4371         loss, because many strings have to be tracked by the GC. In this
4372         patch, we first use a hashtable that works with two keys, so that
4373         the strings do not need to be concat'ed.
4374
4375         Bootstrap times:
4376         BEFORE
4377                 Run 1:   8.74 seconds
4378                 Run 2:   8.71 seconds
4379
4380         AFTER
4381                 Run 1:   8.65 seconds
4382                 Run 2:   8.56 seconds
4383
4384 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4385
4386         * Makefile: Add a new target `do-time' that does a quick and simple
4387         profile, leaving easy to parse output.
4388
4389 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
4390
4391         * codegen.cs (Init): Create the dynamic assembly with 
4392         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
4393
4394 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4395
4396         * support.cs: Make the PtrHashtable use only one
4397         instance of its comparer.
4398
4399 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
4400
4401         * typemanager.cs: Fix lookup of GetNamespaces.
4402
4403 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
4404
4405         * expression.cs: Removed redundant line.
4406
4407         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
4408         ArrayLists, use for loops with bounds.  
4409
4410         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
4411         arraylist.
4412
4413         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
4414         arraylists, use for loop with bounds.
4415
4416         The above three changes give us a 0.071 second performance
4417         improvement out of 3.294 seconds down to 3.223.  On my machine
4418         the above changes reduced the memory usage by 1,387 KB during
4419         compiler bootstrap.
4420
4421         * cs-parser.jay (QualifiedIdentifier): New class used to represent
4422         QualifiedIdentifiers.  Before we created a new string through
4423         concatenation, and mostly later on, the result would be
4424         manipulated by DecomposeQI through string manipulation.
4425
4426         This reduced the compiler memory usage for bootstrapping from
4427         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
4428         compile times in 0.05 seconds.
4429
4430 2003-11-28  Dick Porter  <dick@ximian.com>
4431
4432         * support.cs: Do string compares with the Invariant culture.
4433
4434         * rootcontext.cs: 
4435         * gen-treedump.cs: 
4436         * expression.cs: 
4437         * driver.cs: 
4438         * decl.cs: 
4439         * codegen.cs: 
4440         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
4441         the comparison is done with the Invariant culture.
4442
4443 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
4444
4445         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
4446         GetEnumerator method.
4447
4448         (ProbeCollectionType): Iterate starting at the most specific type
4449         upwards looking for a GetEnumerator
4450
4451         * expression.cs: Shift count can be up to 31 for int/uint and 63
4452         for long/ulong.
4453
4454 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
4455
4456         * statement.cs (Block.LookupLabel): Also look for the label on the
4457         children blocks.  Use a hash table to keep track of visited
4458         nodes. 
4459
4460         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
4461         we actually did transform the other operand, otherwise fall back
4462         to the common codepath that casts to long.
4463
4464         * cs-tokenizer.cs: Use the same code pattern as the int case.
4465         Maybe I should do the parsing myself, and avoid depending on the
4466         Parse routines to get this done.
4467
4468 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
4469
4470         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4471         which fixes bug 51347.  This time test it.
4472
4473         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
4474         attributes for example can not tell the difference between these.
4475         The difference was only a syntax feature of the language. 
4476
4477         * attribute.cs: Apply attributes to delegates.
4478
4479         * delegate.cs: Call the apply attributes method.
4480
4481 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
4482
4483         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
4484         comparing 0 vs Byte.MinValue, not the value
4485
4486         (ImplicitConversionRequired): When reporting a conversion error,
4487         use error 31 to print out the constant error instead of the
4488         simpler 29.
4489
4490         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4491         which fixes bug 51347.
4492
4493 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
4494
4495         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
4496         which fixes the -warnaserror command line option.
4497
4498 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
4499
4500         * cfold.cs (DoNumericPromotions): During constant folding of
4501         additions on UIntConstant, special case intconstants with
4502         IntConstants like we do on the expression binary operator. 
4503
4504 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
4505
4506         * convert.cs (ImplicitReferenceConversion): We were missing a case
4507         (System.Enum are not value types or class types, so we need to
4508         classify them separatedly).
4509
4510         * driver.cs: We do not support error 2007.
4511
4512 2003-11-12 Jackson Harper <jackson@ximian.com>
4513
4514         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
4515         system directory. Also use the full file name so users can
4516         libraries names mscorlib-o-tron.dll in a non system dir.
4517
4518 2003-11-10  Martin Baulig  <martin@ximian.com>
4519
4520         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
4521         (TypeManager.InitCoreTypes): Initialize them here, but instead of
4522         calling `ResolveType()' on them, directly assign their `Type'.
4523
4524 2003-11-08  Martin Baulig  <martin@ximian.com>
4525
4526         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
4527         return value and the `out parent' parameter.
4528         (TypeContainer.DefineType): Moved the CS0644 check into
4529         GetClassBases().  Don't pass the interface types to the
4530         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
4531         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
4532
4533         * ecore.cs (TypeExpr.IsAttribute): New property.
4534         (TypeExpr.GetInterfaces): New method.
4535
4536         * interface.cs (Interface.GetInterfaceTypeByName): Return a
4537         TypeExpr instead of a Type.
4538         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
4539         (Interface.DefineType): Don't pass the interface types to the
4540         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
4541         them later and then call `TypeBulider.AddInterfaceImplementation()'.
4542
4543         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
4544         instead of a `Type[]'.
4545         (TypeManager.RegisterBuilder): Likewise.
4546         (TypeManager.AddUserInterface): Likewise.
4547         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
4548         `Type[]' and also return a `TypeExpr[]'.
4549         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
4550
4551 2003-11-08  Martin Baulig  <martin@ximian.com>
4552
4553         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
4554         Expression.     
4555
4556 2003-11-08  Martin Baulig  <martin@ximian.com>
4557
4558         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
4559         TypeManager.ResolveExpressionTypes().
4560
4561         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
4562         instead of an Expression.
4563         (TypeExpr): This is now an abstract base class for `TypeExpression'.
4564         (TypeExpression): New public class; formerly known as `TypeExpr'.
4565
4566         * expression.cs (ComposedCast): Derive from TypeExpr.
4567
4568         * typemanager.cs (TypeManager.system_*_expr): These are now
4569         TypExpr's instead of Expression's.
4570         (TypeManager.ResolveExpressionTypes): New public static function;
4571         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
4572         of them.        
4573
4574 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
4575
4576         * expression.cs (New.DoResolve): Do not dereference value that
4577         might be a null return.
4578
4579         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4580         sure that the constant value has the right type.  Fixes an
4581         unreported bug, similar to 50425.
4582
4583         * const.cs (Const.LookupConstantValue): Call
4584         ImplicitStandardConversionExists before doing a conversion to
4585         avoid havng the TypeManager.ChangeType do conversions.
4586
4587         Reduced the number of casts used
4588
4589         (Const.ChangeType): New routine to enable reuse of the constant
4590         type changing code from statement.
4591
4592         * typemanager.cs (ChangeType): Move common initialization to
4593         static global variables.
4594
4595         Fixes #50425.
4596
4597         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4598         every value type to go through, even if it was void.  Fix that. 
4599
4600         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4601         character of the define, and the is_identifier_part_character for
4602         the rest of the string.
4603
4604 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4605
4606         * expression.cs (UnaryMutator.EmitCode): When I updated
4607         LocalVariableReference.DoResolve, I overdid it, and dropped an
4608         optimization done on local variable references.
4609
4610 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4611
4612         * ecore.cs: Convert the return from Ldlen into an int.
4613
4614 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4615
4616         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4617         the accessibility, this is a special case for toplevel non-public
4618         classes (internal for instance).
4619
4620 2003-10-20  Nick Drochak <ndrochak@gol.com>
4621
4622         * ecore.cs: Fix typo and build.  Needed another right paren.
4623
4624 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4625
4626         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4627         `internal' case regular and protected, but not allowing protected
4628         to be evaluated later.  Bug 49840
4629
4630 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4631
4632         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4633         to kb.Nlast, and not the kb.nFirst to isolate the switch
4634         statement.
4635
4636         Extract the underlying type, so enumerations of long/ulong are
4637         treated like long/ulong.
4638
4639 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4640
4641         * expression.cs (New): Overload the meaning of RequestedType to
4642         track the possible creation of the NewDelegate type, since
4643         DoResolve is invoked more than once for new constructors on field
4644         initialization.
4645
4646         See bugs: #48800 and #37014
4647
4648         * cs-parser.jay (declare_local_constants): Take an arraylist
4649         instead of a single constant.
4650
4651         (local_constant_declaration): It should take a
4652         constant_declarators, not a constant_declarator.  Fixes 49487
4653
4654         * convert.cs: Fix error report.
4655
4656 2003-10-13 Jackson Harper <jackson@ximian.com>
4657
4658         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4659         bug #49611
4660
4661 2003-10-09  Martin Baulig  <martin@ximian.com>
4662
4663         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4664         to the .ctor.
4665         (MethodCore.DoDefineParameters): Removed the TypeContainer
4666         argument; use the DeclSpace which was passed to the .ctor instead.
4667         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4668         TypeContainer; we only need a DeclSpace here.
4669
4670 2003-10-09  Martin Baulig  <martin@ximian.com>
4671
4672         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4673         to the .ctor.
4674         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4675         EmitContext's .ctor.    
4676
4677 2003-10-09  Martin Baulig  <martin@ximian.com>
4678
4679         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4680         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4681         AsAccessible(), moved them as well.
4682
4683         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4684
4685 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4686
4687         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4688
4689 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4690
4691         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4692         generation for >=, as spotted by Paolo, bug 48679.  
4693         Patch from David Waite.
4694
4695         * cs-tokenizer.cs: Add handling for #pragma.
4696
4697         * cs-parser.jay: Allow for both yield and yield return in the
4698         syntax.  The anti-cobolization of C# fight will go on!
4699
4700         * class.cs (TypeBuilder.DefineType): Catch error condition here
4701         (Parent.DefineType erroring out and returning null).
4702
4703         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4704         coping with enumerations variables, we were mistakenly processing
4705         them as a regular value type instead of built-in types.  Fixes the
4706         bug #48063
4707
4708         * typemanager.cs (IsBuiltinOrEnum): New method.
4709
4710 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4711
4712         * cs-parser.jay: Upgrade: yield now needs the return clause.
4713
4714 2003-09-19  Martin Baulig  <martin@ximian.com>
4715
4716         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4717         `MemberCache parent' argument.  Normally, an interface doesn't
4718         have a parent type except System.Object, but we use this in gmcs
4719         for generic type parameters.
4720
4721 2003-09-18  Martin Baulig  <martin@ximian.com>
4722
4723         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4724         on `type.IsInterface'; don't check whether the type has a parent
4725         to determine whether it's an interface.
4726
4727 2003-09-15  Martin Baulig  <martin@ximian.com>
4728
4729         * class.cs (TypeContainer.DefineType): Added an error flag to
4730         avoid reporting duplicate CS0146's ("class definition is
4731         circular.").
4732
4733         * driver.cs (Driver.MainDriver): Abort if
4734         RootContext.ResolveTree() reported any errors.
4735
4736 2003-09-07  Martin Baulig  <martin@ximian.com>
4737
4738         * report.cs (Error, Warning): Added overloaded versions which take
4739         a `params object[] args' and call String.Format().
4740
4741 2003-09-07  Martin Baulig  <martin@ximian.com>
4742
4743         * decl.cs (DeclSpace..ctor): Don't call
4744         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4745         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4746         (DeclSpace.RecordDecl): New method.
4747
4748         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4749
4750 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4751
4752         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4753         value attributes to be applied to ParameterBuilders.
4754
4755         * class.cs (MethodCore.LabelParameters): Make static and more
4756         generic so that it can be used from other places - like interface
4757         methods, for instance.
4758
4759         * interface.cs (Interface.Emit): Call LabelParameters before
4760         emitting attributes on the InterfaceMethod.
4761
4762 2003-08-26  Martin Baulig  <martin@ximian.com>
4763
4764         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4765         resolving aliases; fixes #47927.
4766
4767 2003-08-26  Martin Baulig  <martin@ximian.com>
4768
4769         * statement.cs (Using.DoResolve): This is internally emitting a
4770         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4771         do not always return.  Fixes #47681.
4772
4773 2003-08-26  Martin Baulig  <martin@ximian.com>
4774
4775         * decl.cs (MemberCore): Moved WarningNotHiding(),
4776         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4777         into MemberBase.
4778         (AdditionResult): Make this nested in DeclSpace.
4779         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4780         argument; call NamespaceEntry.Define() unless we're nested in a
4781         class or struct.
4782
4783         * namespace.cs (Namespace.DefineName): New public function.  This
4784         is called from DeclSpace's .ctor to add 
4785         (Namespace.Lookup): Include DeclSpaces in the lookup.
4786
4787         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4788
4789         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4790
4791 2003-08-25  Martin Baulig  <martin@ximian.com>
4792
4793         * convert.cs (Convert.ExplicitReferenceConversion): When
4794         converting from an interface type to a class, unbox if the target
4795         type is a struct type.  Fixes #47822.
4796
4797 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4798
4799         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
4800         #47854.
4801
4802 2003-08-22  Martin Baulig  <martin@ximian.com>
4803
4804         * class.cs (TypeManager.DefineType): When defining a nested type,
4805         call DefineType() on our parent; fixes #47801.
4806
4807 2003-08-22  Martin Baulig  <martin@ximian.com>
4808
4809         * class.cs (MethodData.Define): While checking if a method is an
4810         interface implementation, improve the test a bit more to fix #47654.
4811
4812 2003-08-22  Martin Baulig  <martin@ximian.com>
4813
4814         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
4815         correctly; fixes #47722.
4816
4817 2003-08-22  Martin Baulig  <martin@ximian.com>
4818
4819         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
4820         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
4821
4822         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
4823
4824 2003-08-22  Martin Baulig  <martin@ximian.com>
4825
4826         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
4827         can only be assigned in static constructors.  Fixes #47161.
4828
4829 2003-08-22  Martin Baulig  <martin@ximian.com>
4830
4831         Rewrote and improved the flow analysis code.
4832
4833         * flowbranching.cs (FlowBranching): Make this class abstract.
4834         (FlowBranching.CreateBranching): New static function to create a
4835         new flow branching.
4836         (FlowBranchingBlock, FlowBranchingException): New classes.
4837         (FlowBranching.UsageVector.Type): New public readonly field.
4838         (FlowBranching.UsageVector.Breaks): Removed the setter.
4839         (FlowBranching.UsageVector.Returns): Removed the setter.
4840         (FlowBranching.UsageVector): Added Break(), Return(),
4841         NeverReachable() and Throw() methods to modify the reachability.
4842         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
4843         done by FlowBranching.Merge().
4844         (FlowBranching.UsageVector.MergeChild): New method; merges the
4845         merge result into the current vector.
4846         (FlowBranching.Merge): New abstract method to merge a branching.
4847
4848 2003-08-12  Martin Baulig  <martin@ximian.com>
4849
4850         * expression.cs (Indirection.CacheTemporaries): Create the
4851         LocalTemporary with the pointer type, not its element type.
4852
4853 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
4854
4855         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
4856         token was a keyword or not.
4857
4858         Add `error' options where an IDENTIFIER was expected;  Provide
4859         CheckToken and CheckIdentifierToken convenience error reporting
4860         functions. 
4861
4862         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
4863
4864         * decl.cs: Rename `NamespaceEntry Namespace' public field into
4865         NameSpaceEntry NameSpaceEntry.
4866
4867         (LookupInterfaceOrClass): Avoid creating a full qualified name
4868         from namespace and name: avoid doing lookups when we know the
4869         namespace is non-existant.   Use new Tree.LookupByNamespace which
4870         looks up DeclSpaces based on their namespace, name pair.
4871
4872         * driver.cs: Provide a new `parser verbose' to display the
4873         exception thrown during parsing.  This is turned off by default
4874         now, so the output of a failure from mcs is more graceful.
4875
4876         * namespace.cs: Track all the namespaces defined in a hashtable
4877         for quick lookup.
4878
4879         (IsNamespace): New method
4880
4881 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
4882
4883         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
4884         we know that we need to concatenate (full typename can never be
4885         null). 
4886
4887         * class.cs: ditto.
4888
4889         * statement.cs: Use a bitfield;  Do not initialize to null things
4890         which are done by the constructor by default.
4891
4892         * cs-parser.jay: bug fix, parameter was 4, not 3.
4893
4894         * expression.cs: Just use the property;
4895
4896         * statement.cs: No need for GetVariableInfo method.
4897
4898 2003-08-08  Martin Baulig  <martin@ximian.com>
4899
4900         * flowanalysis.cs (FlowReturns): This is now nested in the
4901         `FlowBranching' class.
4902         (MyBitVector): Moved this here from statement.cs.
4903         (FlowBranching.SiblingType): New enum type.
4904         (FlowBranching.CreateSibling): Added `SiblingType' argument.
4905
4906 2003-08-07  Martin Baulig  <martin@ximian.com>
4907
4908         * flowanalysis.cs (FlowBranchingType): This is now nested in the
4909         `FlowBranching' class and called `BranchingType'.
4910
4911 2003-08-07  Martin Baulig  <martin@ximian.com>
4912
4913         * flowanalysis.cs: Moved all the control flow analysis code into
4914         its own file.
4915
4916 2003-08-07  Martin Baulig  <martin@ximian.com>
4917
4918         * assign.cs (Assign.DoResolve): `target' must either be an
4919         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
4920         #37319.
4921
4922 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
4923
4924         * expression.cs (BinaryMethod): This kind of expression is created by the
4925         Binary class if it determines that the operator has to be handled
4926         by a method.
4927
4928         (BinaryDelegate): This kind of expression is created if we are
4929         dealing with a + or - operator on delegates.
4930
4931         (Binary): remove method, argumetns, and DelegateOperator: when
4932         dealing with methods, 
4933
4934         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
4935
4936         * statement.cs (Block): use bitfields for the three extra booleans
4937         we had in use.   Remove unused topblock parameter.
4938
4939         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
4940
4941         * assign.cs: Drop extra unneeded tests.
4942
4943 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
4944
4945         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
4946
4947         * statement.cs (Foreach): Use VariableStorage instead of
4948         LocalBuilders.   
4949
4950         * codegen.cs (VariableStorage): New class used by clients that
4951         require a variable stored: locals or fields for variables that
4952         need to live across yield.
4953
4954         Maybe provide a convenience api for EmitThis+EmitLoad?
4955
4956         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
4957         these bad boys.
4958
4959 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
4960
4961         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
4962         RemapParameterLValue): New methods that are used to turn a
4963         precomputed FieldInfo into an expression like this:
4964
4965                 instance.FieldInfo
4966
4967         The idea is to use this instead of making LocalVariableReference
4968         have more than one meaning.
4969
4970         * cs-parser.jay: Add error production to BASE.
4971
4972         * ecore.cs: Deal with TypeManager.GetField returning null, which
4973         is now a valid return value.
4974
4975         (FieldExprNoAddress): New expression for Fields whose address can
4976         not be taken.
4977
4978         * expression.cs (LocalVariableReference): During the resolve
4979         phases, create new expressions if we are in a remapping context.
4980         Remove code that dealt with remapping here.
4981
4982         (ParameterReference): same.
4983
4984         (ProxyInstance): New expression, like the `This' expression, but
4985         it is born fully resolved.  We know what we are doing, so remove
4986         the errors that are targeted to user-provided uses of `this'.
4987
4988         * statement.cs (Foreach): our variable is now stored as an
4989         Expression;  During resolution, follow the protocol, dont just
4990         assume it will return this.
4991
4992 2003-08-06  Martin Baulig  <martin@ximian.com>
4993
4994         * support.cs (SeekableStreamReader.cs): New public class.
4995
4996         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
4997         SeekableStreamReader instead of the normal StreamReader.
4998
4999 2003-08-04  Martin Baulig  <martin@ximian.com>
5000
5001         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
5002         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
5003         deambiguate casts and delegate invocations.
5004         (parenthesized_expression): Use the new tokens to ensure this is
5005         not a cast of method invocation.
5006
5007         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
5008         when reading a `)' and Deambiguate_CloseParens () was previously
5009         called.
5010
5011         * expression.cs (ParenthesizedExpression): New class.  This is
5012         just used for the CS0075 test.
5013         (Binary.DoResolve): Check for CS0075.   
5014
5015 2003-07-29  Ravi Pratap  <ravi@ximian.com>
5016
5017         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
5018         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
5019         reference comparison.
5020
5021         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
5022         examine the ReturnType for equality - this is necessary in the
5023         cases of implicit and explicit operators whose signature also
5024         includes the return type.
5025
5026 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
5027
5028         * namespace.cs: Cache the result of the namespace computation,
5029         instead of computing it every time.
5030
5031 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
5032
5033         * decl.cs: Use a global arraylist that we reuse over invocations
5034         to avoid excesive memory consumption.  Reduces memory usage on an
5035         mcs compile by one meg (45 average).
5036
5037         * typemanager.cs (LookupTypeReflection): In .NET pointers are
5038         private, work around that.
5039
5040 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
5041
5042         * literal.cs (IntLiteral): Define Zero and One static literals. 
5043
5044         * cs-parser.jay (integer_literal): use static literals to reduce
5045         memory usage for the most used literals (0, 1 and -1).  211kb
5046         reduced in memory usage.
5047
5048         Replace all calls to `new ArrayList' with `new
5049         ArrayList(4)' which is a good average number for most allocations,
5050         and also requires only 16 bytes of memory for its buffer by
5051         default. 
5052
5053         This reduced MCS memory usage in seven megabytes for the RSS after
5054         bootstrapping.
5055
5056 2003-07-28  Ravi Pratap  <ravi@ximian.com>
5057
5058         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
5059         handle params methods the correct way by forming only one
5060         applicable set with params and normal methods in them. Earlier we
5061         were looking at params methods only if we found no normal methods
5062         which was not the correct thing to do.
5063
5064         (Invocation.BetterFunction): Take separate arguments indicating
5065         when candidate and the best method are params methods in their
5066         expanded form.
5067
5068         This fixes bugs #43367 and #46199.
5069
5070         * attribute.cs: Documentation updates.
5071
5072         (CheckAttribute): Rename to CheckAttributeTarget.
5073         (GetValidPlaces): Rename to GetValidTargets.
5074
5075         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
5076         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
5077
5078         Fixes bug #44468.
5079
5080 2003-07-28  Martin Baulig  <martin@ximian.com>
5081
5082         * class.cs (TypeContainer.DefineMembers): Use the base type's full
5083         name when looking up the base class of a nested class.  Fixes #46977.
5084
5085 2003-07-26  Martin Baulig  <martin@ximian.com>
5086
5087         * expression.cs (Indexers.Indexer): New nested struct; contains
5088         getter, setter and the indexer's type.
5089         (Indexers.Properties): This is now an ArrayList of
5090         Indexers.Indexer's.
5091         (IndexerAccess.DoResolveLValue): Correctly set the type if the
5092         indexer doesn't have any getters.
5093
5094         * assign.cs (Assign.DoResolve): Also do the implicit conversions
5095         for embedded property and indexer assignments.
5096
5097 2003-07-26  Martin Baulig  <martin@ximian.com>
5098
5099         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
5100         preprocessor directive is not the first non-whitespace character
5101         on a line.
5102
5103 2003-07-26  Martin Baulig  <martin@ximian.com>
5104
5105         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
5106         namespace parsing, follow the spec more closely.
5107
5108         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
5109         NamespaceEntry.Lookup().
5110
5111 2003-07-25  Martin Baulig  <martin@ximian.com>
5112
5113         * MethodCore.cs (OverridesSomething): New public field; it's set
5114         from TypeContainer.DefineMembers if this method overrides
5115         something (which doesn't need to be a method).  Fix #39462.
5116
5117 2003-07-25  Ravi Pratap  <ravi@ximian.com>
5118
5119         * typemanager.cs (GetMembers): Ensure that the list of members is
5120         reversed. This keeps things in sync.
5121
5122         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
5123         find an AttributeUsage attribute.
5124
5125         * expression.cs (Invocation.OverloadResolve): Perform the check
5126         which disallows Invoke to be directly called on a Delegate.
5127
5128         (Error_InvokeOnDelegate): Report error cs1533.
5129
5130 2003-07-25  Martin Baulig  <martin@ximian.com>
5131
5132         * expression.cs (Indexers.GetIndexersForType): Only look in the
5133         interface hierarchy if the requested type is already an
5134         interface.  Fixes #46788 while keeping #46502 fixed.
5135
5136 2003-07-25  Martin Baulig  <martin@ximian.com>
5137
5138         * class.cs (TypeContainer.DefineMembers): Check whether all
5139         readonly fields have been assigned and report warning CS0649 if
5140         not.
5141
5142         * statement.cs (LocalInfo.IsFixed): Always return true if this is
5143         a valuetype.
5144
5145 2003-07-24  Ravi Pratap  <ravi@ximian.com>
5146
5147         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
5148         returned from GetMethods to make things consistent with the
5149         assumptions MCS makes about ordering of methods.
5150
5151         This should comprehensively fix bug #45127 and it does :-)
5152
5153         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
5154         ordering is actually reverse.
5155
5156         * Clean up some debug messages I left lying around.
5157
5158         * interface.cs (Populate*): Get rid of code which emits attributes
5159         since the stage in which we emit attributes is the 'Emit' stage,
5160         not the define stage.
5161
5162         (Emit): Move attribute emission for interface members here.
5163
5164 2003-07-22  Ravi Pratap  <ravi@ximian.com>
5165
5166         * expression.cs (Invocation.OverloadResolve): Follow the spec more
5167         closely: we eliminate methods in base types when we have an
5168         applicable method in a top-level type.
5169
5170         Please see section 14.5.5.1 for an exact description of what goes
5171         on. 
5172
5173         This fixes bug #45127 and a host of other related to corlib compilation.
5174
5175         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
5176         array is the method corresponding to the top-level type (this is
5177         because of the changes made to icall.c) so we change this
5178         accordingly.
5179
5180         (MethodGroupExpr.Name): This too.
5181
5182         * typemanager.cs (GetElementType): New method which does the right
5183         thing when compiling corlib. 
5184
5185         * everywhere: Make use of the above in the relevant places.
5186
5187 2003-07-22  Martin Baulig  <martin@ximian.com>
5188
5189         * cs-parser.jay (invocation_expression): Moved
5190         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
5191         `cast_expression', but create a InvocationOrCast which later
5192         resolves to either an Invocation or a Cast.
5193
5194         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
5195         method; call this before EmitStatement() to make sure that this
5196         expression can be used as a statement.
5197
5198         * expression.cs (InvocationOrCast): New class; resolves to either
5199         an Invocation or a Cast.
5200
5201         * statement.cs (StatementExpression): Call ResolveStatement() on
5202         the ExpressionStatement before emitting it.
5203
5204 2003-07-21  Martin Baulig  <martin@ximian.com>
5205
5206         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
5207         `ref' and `out' attributes match; fixes #46220.
5208         (MemberAccess.ResolveMemberAccess): You can't reference a type
5209         through an expression; fixes #33180.
5210         (Indexers.GetIndexersForType): Don't return the indexers from
5211         interfaces the class implements; fixes #46502.
5212
5213 2003-07-21  Martin Baulig  <martin@ximian.com>
5214
5215         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
5216         CS0661 checks; fixes bug #30442.
5217
5218 2003-07-21  Martin Baulig  <martin@ximian.com>
5219
5220         * decl.cs (AdditionResult): Added `Error'.
5221
5222         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
5223
5224         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
5225         makes cs0031.cs actually work.
5226
5227 2003-07-20  Martin Baulig  <martin@ximian.com>
5228
5229         * namespace.cs: Fixed that bug which caused a crash when compiling
5230         the debugger's GUI.
5231
5232 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
5233
5234         * typemanager.cs (LookupTypeReflection): Never expose types which
5235         are NotPublic, NestedPrivate, NestedAssembly, or
5236         NestedFamANDAssem.  We used to return these, and later do a check
5237         that would report a meaningful error, but the problem is that we
5238         would not get the real match, if there was a name override.
5239
5240 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
5241
5242         * namespace.cs (Namespace, Name): Do not compute the namespace
5243         name dynamically, compute it in the constructor.  This reduced
5244         memory usage by 1697 KB.
5245
5246         * driver.cs: Use --pause to pause at the end.
5247
5248 2003-07-17  Peter Williams  <peter@newton.cx>
5249
5250         * Makefile: Change the name of the test target so that it doesn't
5251         conflict with the recursive test target.
5252
5253 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
5254
5255         * expression.cs (LocalVariableReference.Emit, EmitAssign,
5256         AddressOf): Do not use EmitThis, that was wrong, use the actual
5257         this pointer.
5258
5259 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
5260
5261         * class.cs (MethodData.Define): While checking if a method is an
5262         interface implementation, improve the test: If we are not public
5263         (use new test here: use the computed MethodAttributes directly,
5264         instead of the parsed modifier flags) check if the `implementing'
5265         method comes from an interface or not.
5266
5267         * pending.cs (VerifyPendingMethods): Slightly better error
5268         message.
5269
5270         * makefile: add test target that does the mcs bootstrap.
5271
5272 2003-07-16  Ravi Pratap  <ravi@ximian.com>
5273
5274         * interface.cs (Define): Do nothing here since there are no
5275         members to populate etc. Move the attribute emission out of here
5276         since this was just totally the wrong place to put it. Attribute
5277         application happens during the 'Emit' phase, not in the 'Define'
5278         phase.
5279
5280         (Emit): Add this method and move the attribute emission here
5281
5282         * rootcontext.cs (EmitCode): Call the Emit method on interface
5283         types too.
5284
5285 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5286
5287         * expression.cs (OverloadResolve): Report error only if Location
5288         is not 'Null' which means that there was a probe going on.
5289
5290 2003-07-14  Martin Baulig  <martin@ximian.com>
5291
5292         * expression.cs (ConditionalLogicalOperator): New public class to
5293         implement user defined conditional logical operators.
5294         This is section 14.11.2 in the spec and bug #40505.
5295
5296 2003-07-14  Martin Baulig  <martin@ximian.com>
5297
5298         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
5299
5300 2003-07-14  Martin Baulig  <martin@ximian.com>
5301
5302         * codegen.cs (EmitContext.InFixedInitializer): New public field.
5303
5304         * ecore.cs (IVariable.VerifyFixed): New interface method.
5305
5306         * expression.cs (Unary.ResolveOperator): When resolving the `&'
5307         operator, check whether the variable is actually fixed.  Fixes bug
5308         #36055.  Set a variable definitely assigned when taking its
5309         address as required by the spec.
5310
5311         * statement.cs (LocalInfo.IsFixed): New field.
5312         (LocalInfo.MakePinned): Set `IsFixed' to true.
5313
5314 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5315
5316         * attribute.cs (Attribute.Resolve): While doing a Member lookup
5317         for .ctors, ensure that we only ask for members declared in the
5318         attribute type (BindingFlags.DeclaredOnly).
5319
5320         Fixes bug #43632.
5321
5322         * expression.cs (Error_WrongNumArguments): Report error 1501
5323         correctly the way CSC does.
5324
5325 2003-07-13  Martin Baulig  <martin@ximian.com>
5326
5327         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
5328         lookup on the fully qualified name, to make things like "X.X" work
5329         where "X.X" is a fully qualified type name, but we also have a
5330         namespace "X" in the using list.  Fixes #41975.
5331
5332 2003-07-13  Martin Baulig  <martin@ximian.com>
5333
5334         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
5335         function. If we're a CompoundAssign, we need to create an embedded
5336         CompoundAssign, not an embedded Assign.
5337         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
5338         Fixes #45854.
5339
5340 2003-07-13  Martin Baulig  <martin@ximian.com>
5341
5342         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
5343         work to fix bug #46088.
5344
5345 2003-07-13  Ravi Pratap <ravi@ximian.com>
5346
5347         * class.cs (Operator.Emit): Do not emit attributes here - it is
5348         taken care of by the Method class that we delegate too. This takes
5349         care of bug #45876.
5350
5351 2003-07-10  Martin Baulig  <martin@ximian.com>
5352
5353         * expression.cs (TypeOfVoid): New class.
5354         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
5355
5356 2003-07-10  Martin Baulig  <martin@ximian.com>
5357
5358         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
5359         bug #35957.
5360
5361 2003-07-10  Martin Baulig  <martin@ximian.com>
5362
5363         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
5364         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
5365
5366         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
5367
5368         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
5369
5370 2003-07-10  Martin Baulig  <martin@ximian.com>
5371
5372         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
5373         of decimal.  Fixes #42850.
5374
5375         NOTE: I also fixed the created byte blob, but this doesn't work on
5376         the MS runtime and csc never produces any byte blobs for decimal
5377         arrays.
5378
5379 2003-07-10  Martin Baulig  <martin@ximian.com>
5380
5381         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
5382         structs; fixes #32068.
5383         (Block.AddChildVariableNames): Fixed #44302.
5384
5385 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5386
5387         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
5388
5389 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5390
5391         * attribute.cs: And this test is onger needed.
5392
5393 2003-07-08  Martin Baulig  <martin@ximian.com>
5394
5395         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
5396         inaccessible types.  Fixes #36313.
5397
5398         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
5399
5400         * namespace.cs (NamespaceEntry): Create implicit entries for all
5401         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
5402         implicit entries for N1.N2 and N1.
5403
5404 2003-07-08  Martin Baulig  <martin@ximian.com>
5405
5406         Rewrote the handling of namespaces to fix a lot of the issues
5407         wrt. `using' aliases etc.
5408
5409         * namespace.cs (Namespace): Splitted this class into a
5410         per-assembly `Namespace' and a per-file `NamespaceEntry'.
5411
5412         * typemanager.cs (TypeManager.IsNamespace): Removed.
5413         (TypeManager.ComputeNamespaces): Only compute namespaces from
5414         loaded assemblies here, not the namespaces from the assembly we're
5415         currently compiling.
5416
5417 2003-07-08  Martin Baulig  <martin@ximian.com>
5418
5419         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
5420
5421 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5422
5423         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
5424         already fixed it.  
5425
5426         I thought about the memory savings here, but LookupTypeReflection
5427         is used under already very constrained scenarios.  Compiling
5428         corlib or mcs only exposes one hit, so it would not really reduce
5429         any memory consumption.
5430
5431 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5432
5433         * typemanager.cs: fixes bug #45889 by only adding public types from
5434         other assemblies to the list of known types.
5435
5436 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5437
5438         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
5439         on the type we resolved.
5440
5441 2003-07-05  Martin Baulig  <martin@ximian.com>
5442
5443         * pending.cs (PendingImplementation.ParentImplements): Don't
5444         create the proxy if the parent is abstract.
5445
5446         * class.cs (TypeContainer.DefineIndexers): Process explicit
5447         interface implementations first.  Fixes #37714.
5448
5449 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
5450
5451         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
5452         defined recursively;  but since we modify the input parameters
5453         (left is set to `this' temporarily), we reset this value if the
5454         left_is_explicit is false, which gives the original semantics to
5455         the code.  
5456
5457         * literal.cs (NullPointer): new class used to represent a null
5458         literal in a pointer context.
5459
5460         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
5461         type is a pointer, use a NullPointer object instead of a
5462         NullLiteral.   Closes 43687
5463
5464         (ExplicitConversion): Convert pointer values using
5465         the conv opcode to the proper type.
5466
5467         * ecore.cs (New): change ValueTypeVariable property into a method,
5468         that returns whether the valuetype is suitable for being used.
5469
5470         * expression.cs (Binary.DoNumericPromotions): Only return if we
5471         the int constant was a valid uint, and we can return both left and
5472         right as uints.  If not, we continue processing, to trigger the
5473         type conversion.  This fixes 39018.
5474
5475         * statement.cs (Block.EmitMeta): During constant resolution, set
5476         the CurrentBlock property on the emitcontext, so that we resolve
5477         constants propertly.
5478
5479 2003-07-02  Martin Baulig  <martin@ximian.com>
5480
5481         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
5482         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
5483
5484         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
5485         than emitting it here.
5486
5487         * statement.cs: Fixed some more flow analysis bugs.
5488
5489 2003-07-02  Martin Baulig  <martin@ximian.com>
5490
5491         * class.cs (MethodData.Define): When implementing interface
5492         methods, set Final unless we're Virtual.
5493
5494         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
5495         check work for interface methods.
5496
5497 2003-07-01  Martin Baulig  <martin@ximian.com>
5498
5499         * ecore.cs (EmitContext.This): Replaced this property with a
5500         GetThis() method which takes a Location argument.  This ensures
5501         that we get the correct error location for a CS0188.
5502
5503 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
5504
5505         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
5506         ImplicitStandardConversion.
5507
5508         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
5509
5510 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
5511
5512         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
5513         optimization.
5514
5515 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
5516
5517         * class.cs (Constructor.Define): Turn off initlocals for unsafe
5518         constructors.
5519
5520         (MethodData.Define): Turn off initlocals for unsafe methods.
5521
5522 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
5523
5524         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
5525         complete;  Fixes #37521.
5526
5527         * delegate.cs: Use Modifiers.TypeAttr to compute the
5528         TypeAttributes, instead of rolling our own.  This makes the flags
5529         correct for the delegates.
5530
5531 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
5532
5533         * class.cs (Constructor.Define): Set the private flag for static
5534         constructors as well.
5535
5536         * cs-parser.jay (statement_expression): Set the return value to
5537         null, to avoid a crash when we catch an error.
5538
5539 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
5540
5541         * cs-parser.jay: Applied patch from Jackson that adds support for
5542         extern and unsafe modifiers to destructor declarations.
5543
5544         * expression.cs: Report error 21 if the user is trying to index a
5545         System.Array.
5546
5547         * driver.cs: Add an error message, suggested by the bug report.
5548
5549         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
5550         if we do not have a ": this ()" constructor initializer.  Fixes 45149
5551
5552 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
5553
5554         * namespace.cs: Add some information to reduce FAQs.
5555
5556 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
5557
5558         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
5559         underlying enumeration types.  Fixes #43915.
5560
5561         * expression.cs: Treat ushort/short as legal values to be used in
5562         bitwise operations.
5563
5564 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
5565
5566         * delegate.cs: transfer custom attributes for paramenters from
5567         the delegate declaration to Invoke and BeginInvoke.
5568
5569 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
5570
5571         * attribute.cs: handle custom marshalers and emit marshal info
5572         for fields, too.
5573
5574 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
5575
5576         * makefile.gnu: Added anonymous.cs to the compiler sources.
5577
5578 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5579
5580         * iterators.cs: Change the name of the proxy class to include two
5581         underscores.
5582
5583         * cs-parser.jay: Update grammar to include anonymous methods.
5584
5585         * anonymous.cs: new file.
5586
5587 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5588
5589         * class.cs (Field.Define): Add missing test for pointers and
5590         safety. 
5591
5592 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5593
5594         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5595         we use the stobj opcode.
5596
5597         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5598         since it wasn't the correct fix. 
5599
5600         It still is puzzling that we are required to use stobj for IntPtr
5601         which seems to be a ValueType.
5602
5603 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5604
5605         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5606         during regular simple name resolution.   Now, the trick is that
5607         instead of returning for processing the simplename, we do a
5608         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5609         contextual lookup type).   If a match is found, return that, if
5610         not, return for further composition.
5611
5612         This fixes long-standing 30485.
5613
5614         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5615         using the address to initialize an object, do an Stobj instead of
5616         using the regular Stelem.
5617
5618         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5619         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5620         Because if we are a BaseIndexerAccess that value will be true.
5621         Fixes 43643.
5622
5623         * statement.cs (GotoCase.Resolve): Return after reporting an
5624         error, do not attempt to continue. 
5625
5626         * expression.cs (PointerArithmetic.Emit): If our operand is a
5627         long, convert our constants to match the operand before
5628         multiplying.  Convert to I type before adding.   Fixes 43670.
5629
5630 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5631
5632         * enum.cs (ImplicitConversionExists) : Rename to
5633         ImplicitEnumConversionExists to remove ambiguity. 
5634
5635         * ecore.cs (NullCast): New type of cast expression class which
5636         basically is very similar to EmptyCast with the difference being
5637         it still is a constant since it is used only to cast a null to
5638         something else
5639         (eg. (string) null)
5640
5641         * convert.cs (ImplicitReferenceConversion): When casting a null
5642         literal, we return a NullCast.
5643
5644         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5645         should be around anymore.
5646
5647         The renaming (reported was slightly wrong). Corrections:
5648
5649         ConvertImplicitStandard -> ImplicitConversionStandard
5650         ConvertExplicitStandard -> ExplicitConversionStandard
5651
5652         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5653         before passing them in !
5654
5655         * convert.cs (ImplicitConversionStandard): When comparing for
5656         equal expr and target types, ensure that expr is not a
5657         NullLiteral.
5658
5659         In general, we must not be checking (expr_type ==
5660         target_type) in the top level conversion methods
5661         (ImplicitConversion, ExplicitConversion etc). This checking is
5662         done in the methods that they delegate to.
5663
5664 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5665
5666         * convert.cs: Move Error_CannotConvertType,
5667         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5668         ImplicitNumericConversion, ImplicitConversionExists,
5669         ImplicitUserConversionExists, StandardConversionExists,
5670         FindMostEncompassedType, FindMostSpecificSource,
5671         FindMostSpecificTarget, ImplicitUserConversion,
5672         ExplicitUserConversion, GetConversionOperators,
5673         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5674         TryImplicitIntConversion, Error_CannotConvertImplicit,
5675         ConvertImplicitRequired, ConvertNumericExplicit,
5676         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5677         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5678         its own file.
5679
5680         Perform the following renames:
5681
5682         StandardConversionExists -> ImplicitStandardConversionExists
5683         ConvertImplicit -> ImplicitConversion
5684         ConvertImplicitStandard -> ImplicitStandardConversion
5685         TryImplicitIntConversion -> ImplicitIntConversion
5686         ConvertImplicitRequired -> ImplicitConversionRequired
5687         ConvertNumericExplicit -> ExplicitNumericConversion
5688         ConvertReferenceExplicit -> ExplicitReferenceConversion
5689         ConvertExplicit -> ExplicitConversion
5690         ConvertExplicitStandard -> ExplicitStandardConversion
5691
5692 2003-05-19  Martin Baulig  <martin@ximian.com>
5693
5694         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5695         (TypeInfo): Added support for structs having structs as fields.
5696
5697         * ecore.cs (FieldExpr): Implement IVariable.
5698         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5699         VariableInfo for the field.
5700
5701 2003-05-18  Martin Baulig  <martin@ximian.com>
5702
5703         * expression.cs (This.DoResolve): Report a CS0027 if we're
5704         emitting a field initializer.
5705
5706 2003-05-18  Martin Baulig  <martin@ximian.com>
5707
5708         * expression.cs (This.ResolveBase): New public function.
5709         (This.DoResolve): Check for CS0188.
5710
5711         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5712         This.Resolve().
5713
5714         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5715         `instance_expression' to null if we don't have any non-static
5716         methods.
5717
5718 2003-05-18  Martin Baulig  <martin@ximian.com>
5719
5720         Reworked the way how local variables and parameters are handled by
5721         the flow analysis code.
5722
5723         * statement.cs (TypeInfo, VariableMap): New public classes.
5724         (VariableInfo): New public class.  This is now responsible for
5725         checking whether a variable has been assigned.  It is used for
5726         parameters and local variables.
5727         (Block.EmitMeta): Take the InternalParameters as argument; compute
5728         the layout of the flow vectors here.
5729         (Block.LocalMap, Block.ParameterMap): New public properties.
5730         (FlowBranching): The .ctor doesn't get the InternalParameters
5731         anymore since Block.EmitMeta() now computes the layout of the flow
5732         vector.
5733         (MyStructInfo): This class is now known as `StructInfo' and nested
5734         in `TypeInfo'; we don't access this directly anymore.
5735
5736         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5737         property and removed IsAssigned(), IsFieldAssigned(),
5738         SetAssigned() and SetFieldAssigned(); we now call them on the
5739         VariableInfo so we don't need to duplicate this code everywhere.
5740
5741         * expression.cs (ParameterReference): Added `Block block' argument
5742         to the .ctor.
5743         (LocalVariableReference, ParameterReference, This): The new
5744         VariableInfo class is now responsible for all the definite
5745         assignment stuff.
5746
5747         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5748         IsParameterAssigned, SetParameterAssigned): Removed.
5749
5750 2003-05-18  Martin Baulig  <martin@ximian.com>
5751
5752         * typemanager.cs (InitCoreTypes): Try calling
5753         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5754         the 3-args-version.  Corlib now also needs our `void_type'.
5755         (GetMethod): Added overloaded version which takes an optional
5756         `bool report_errors' to allow lookups of optional methods.
5757
5758 2003-05-12  Martin Baulig  <martin@ximian.com>
5759
5760         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5761         only used for locals and not for parameters.
5762
5763 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5764
5765         * support.cs (InternalParameters.ParameterType): Return the
5766         ExternalType of the parameter.
5767
5768         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5769         they were unused.
5770
5771 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5772
5773         * class.cs (MethodData.Define): Do not set the `newslot' on
5774         interface members, if they are also flagged as "override".
5775
5776         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5777         better code for ++i and i++.  This only works for static fields
5778         and local variables.
5779
5780         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5781         want to pull the DeclSpace out of the builder_to_declspace instead
5782         of the TypeBuilder (like in TypeContainer.FindMembers).
5783
5784         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
5785         instead of LookupTypeContainer.  Fixes the crash on .NET for
5786         looking up interface members.
5787
5788         * const.cs: Create our own emit context during the Definition
5789         stage, so that constants are evaluated in the proper context, when
5790         a recursive definition happens.
5791
5792 2003-05-11  Martin Baulig  <martin@ximian.com>
5793
5794         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
5795         new block for a switch section.
5796         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
5797         the adding/lookup in the switch block.  Fixes #39828.
5798
5799 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
5800
5801         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
5802         functionality: I needed to convert the data after I had performed
5803         the add/sub operation into the operands type size.
5804
5805         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
5806         pass the type for the box operation, otherwise the resulting
5807         object would have been of type object.
5808
5809         (BoxedCast): Add constructor to specify the type to box as.
5810
5811 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
5812
5813         * iterators.cs: I was reusing the `count' variable inadvertently,
5814         take steps to not allow this to happen.
5815
5816 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
5817
5818         * attribute.cs (Attribute.Resolve): Params attributes are encoded
5819         by creating an array at the point where the params starts and
5820         putting all those arguments there, then adjusting the size of the
5821         array.
5822
5823 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
5824
5825         * expression.cs (New.AddressOf): Implement interface
5826         IMemoryLocation.  This is used when the `new' operator is used in
5827         the context of an invocation to a method on a value type.
5828
5829         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
5830         example. 
5831
5832         * namespace.cs: Also check the using aliases here.
5833
5834         * driver.cs: Move the test for using validity after the types have
5835         been entered, so we do a single pass that also includes the using
5836         aliases. 
5837
5838         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
5839         in the regular case.   CreateSiblingForFinally is doing extra
5840         error checking.
5841
5842         * attribute.cs (GetAttributeArgumentExpression): Store the result
5843         on an out value, and use the return value to indicate failure
5844         instead of using null (which is a valid return for Constant.GetValue).
5845
5846         * statement.cs: Perform the analysis flow for the increment
5847         portion after the statement, because this will be the real flow of
5848         execution.  Fixes #42385
5849
5850         * codegen.cs (EmitContext.EmitArgument,
5851         EmitContext.EmitStoreArgument): New helper functions when the
5852         RemapToProxy flag is set.
5853
5854         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
5855         function.
5856
5857         Add support for remapping parameters. 
5858
5859         * iterators.cs: Propagate parameter values;  Store parameter
5860         values in the proxy classes.
5861
5862 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
5863
5864         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
5865         need a proxy reference;  I do not know what I was thinking
5866
5867         * cs-parser.jay (constructor_initializer): catch another error,
5868         and display nice message.
5869
5870         (field_declaration): catch void field declaration
5871         to flag a better error. 
5872
5873         * class.cs (MemberBase.CheckBase): Report an error instead of a
5874         warning if a new protected member is declared in a struct. 
5875         (Field.Define): catch the error of readonly/volatile.
5876
5877         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
5878
5879         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
5880         volatile variable is taken
5881
5882 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
5883
5884         * statement.cs (Fixed.Resolve): Report an error if we are not in
5885         an unsafe context.
5886
5887 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
5888
5889         * typemanager.cs: reuse the code that handles type clashes for
5890         delegates and enumerations.
5891
5892         * class.cs (Report28): Always report.
5893
5894         * expression.cs (EncodeAsAttribute): Allow nulls here.
5895
5896 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
5897
5898         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
5899         the functionality for testing whether an expression is valid for
5900         an attribute here.  Also handle the case of arrays of elements
5901         being stored. 
5902
5903         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
5904         encoding a linear array into an array of objects that are suitable
5905         to be passed to an CustomAttributeBuilder.
5906
5907         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
5908
5909         * ecore.cs: (FieldExpr): Handle field remapping here.
5910
5911         * iteratators.cs: Pass the instance variable (if the method is an
5912         instance method) to the constructors, so we can access the field
5913         variables on the class.
5914
5915         TODO: Test this with structs.  I think the THIS variable on
5916         structs might have to be a pointer, and not a refenrece
5917
5918 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
5919
5920         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
5921         local variables to fields in a proxy class.
5922
5923         * iterators.cs (PopulateProxy): Rename our internal fields to
5924         <XXX>.  
5925         Create a <THIS> field if we are an instance method, so we can
5926         reference our parent container variables.
5927         (MapVariable): Called back from the EmitContext code to enter a
5928         new variable to field mapping into the proxy class (we just create
5929         a FieldBuilder).
5930
5931         * expression.cs
5932         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
5933         for using the remapped locals to fields.
5934
5935         I placed the code here, because that gives the same semantics to
5936         local variables, and only changes the Emit code.
5937
5938         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
5939         statements inside iterators.
5940         (VariableInfo): Add a FieldBuilder for the cases when we are
5941         remapping local variables to fields in a proxy class
5942
5943         * ecore.cs (SimpleNameResolve): Avoid testing two times for
5944         current_block != null.
5945
5946         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
5947         not cope with strings, as it has been moved to the
5948         TableSwitchEmit.  Fixed bug in switch generation.
5949
5950         * expression.cs (New.DoResolve): Provide more context for the user
5951         when reporting an error.
5952
5953         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
5954         pointers. 
5955
5956         * expression.cs (MemberAccess.DoResolve): When we get a type back,
5957         check the permissions for it.  Note than in a type-resolution
5958         context the check was already present in DeclSpace.ResolveType,
5959         but was missing from the MemberAccess.
5960
5961         (ArrayCreation.CheckIndices): warn if the user has
5962         more nested levels of expressions, but there are no more
5963         dimensions specified.  Avoids crash on bug 41906.
5964
5965 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
5966
5967         * statement.cs (Block): replace Implicit bool, for a generic
5968         flags.   
5969         New flag: `Unchecked'.  This is used during the EmitMeta phase
5970         (which is out-of-line with the regular Resolve/Emit process for a
5971         statement, as this is done ahead of time, but still gets a chance
5972         to call constant resolve).
5973
5974         (Block.Flags): new enum for adding a new flag.
5975
5976         (Block.EmitMeta): track the state of unchecked.
5977
5978         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
5979         to enable constant resolution to work there as well.
5980
5981 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * typemanager.cs (ienumerable_type): Also look up
5984         System.Collections.IEnumerable. 
5985
5986 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
5987
5988         TODO: Test more than one conditional per method.
5989
5990         * class.cs (Indexer.Define): Report the location where the user is
5991         referencing the unsupported feature.
5992
5993         (MethodData): Overload the use of `conditionals' to
5994         minimize the creation of needless ArrayLists.   This saves roughly
5995         212kb on my machine.
5996
5997         (Method): Implement the new IIteratorContainer interface.
5998         (Method.SetYields): Implement the method by setting the ModFlags
5999         to contain METHOD_YIELDS.
6000
6001         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
6002         which just got set to null.
6003
6004         * iterators.cs: New file.
6005
6006         (Yield, YieldBreak): New statements.
6007
6008         * statement.cs (Return.Resolve): Flag an error if we are used in
6009         an iterator method.
6010
6011         * codegen.cs (InIterator): New flag set if the code is being
6012         compiled in an iterator method.
6013
6014         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
6015         internal modifier, and we just use it to avoid adding extra
6016         fields, as this is seldom used.  
6017
6018         * cs-parser.jay: Add yield_statement (yield and yield break).
6019
6020         * driver.cs: New flag -v2 to turn on version 2 features. 
6021
6022         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
6023         hashtable when v2 is enabled.
6024
6025 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
6026
6027         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
6028         there is already a namespace defined with this name.
6029
6030         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
6031         people upgraded their corlibs.
6032
6033         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
6034         always use fully qualified types, no need to use the compiler
6035         front end.
6036
6037         (TypeManager.IsNamespace): Use binarysearch.
6038
6039         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
6040         AddDelegate): I did not quite use the new IsValid API properly: I
6041         have to pass the short-name and the fullname.  I was passing only
6042         the basename instead of the fullname sometimes. 
6043
6044         (TypeContainer.DefineType): call NamespaceClash.
6045
6046         * interface.cs (Interface.DefineType): use NamespaceClash before
6047         defining the type.
6048
6049         * delegate.cs (Delegate.DefineType): use NamespaceClash before
6050         defining the type.
6051
6052         * enum.cs: (Enum.DefineType): use NamespaceClash before
6053         defining the type.
6054
6055         * typemanager.cs (: 3-line patch that gives us some tasty 11%
6056         speed increase.  First, use the negative_hits cache when we get a
6057         negative.  Second, add the type with its full original name
6058         instead of the new . and + encoded name (reflection uses + to
6059         separate type from a nested type).  Use LookupTypeReflection
6060         directly which bypasses the type->name hashtable (that we already
6061         know does not contain the type.
6062
6063         * decl.cs (DeclSpace.ResolveTypeExpr): track the
6064         location/container type. 
6065
6066         * driver.cs: When passing utf8, use directly the UTF8Encoding.
6067
6068 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
6069
6070         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
6071
6072         * delegate.cs (NewDelegate.Resolve): Test whether an instance
6073         method is being referenced in the method group from a static
6074         context, and report error 120 if so.
6075
6076         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
6077         Error118. 
6078
6079         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
6080         is created, we create the A namespace).
6081
6082         * cs-parser.jay: A namespace also introduces a DeclarationFound.
6083         Fixes #41591
6084
6085 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
6086
6087         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
6088         invocation to ModuleBuilder.GetType with the same values will
6089         return a new type instance, so we need to cache its return
6090         values. 
6091
6092         * expression.cs (Binary.ResolveOperator): Only allow the compare
6093         operators on enums if they are of the same type.
6094
6095         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
6096         types of ValueType on their own case.  Before we were giving them
6097         the same treatment as objects.
6098
6099         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
6100         fullname.  Short name is used to compare against container name.
6101         Fullname is used to check against defined namespace names.
6102
6103         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
6104         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
6105
6106         (Method.CheckBase): Call parent.
6107         (MemberBase.CheckBase): Check for protected members on sealed
6108         classes.
6109         (PropertyBase.CheckBase): Call parent.
6110         (Field.Define): Call parent.
6111
6112         * report.cs: Negative error codes are now mapped to 8000 - code,
6113         so that the display is render more nicely.
6114
6115         * typemanager.cs: Do not use try/catch, instead report a regular
6116         error. 
6117
6118         (GetPointerType, GetReferenceType): These methods provide
6119         mechanisms to obtain the T* and T& from a T.  We had the code
6120         previously scattered around the code base, and it also used
6121         TypeManager.LookupType that would go through plenty of caches.
6122         This one goes directly to the type source.
6123
6124         In some places we did the Type.GetType followed by
6125         ModuleBuilder.GetType, but not in others, so this unifies the
6126         processing as well.
6127
6128         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
6129         statements now that we have namespace information.
6130
6131         * typemanager.cs (IsNamespace): New method, returns whether the
6132         string presented is a namespace or not.
6133
6134         (ComputeNamespaces): New public entry point, computes the list of
6135         available namespaces, using the GetNamespaces API call in Mono, or
6136         the slower version in MS.NET.   
6137
6138         Now before we start the semantic analysis phase, we have a
6139         complete list of namespaces including everything that the user has
6140         provided.
6141
6142         Deleted old code to cache namespaces in .nsc files.
6143
6144 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
6145
6146         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
6147         class/struct location definition Location for the implicit
6148         constructor location.
6149
6150         (Operator.Define): Use the location of the operator for the
6151         implicit Method definition.
6152
6153         (Constructor.Emit): use the constructor location for the implicit
6154         base initializer constructor.
6155
6156         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
6157         and the Expression class now contains two new methods:
6158
6159         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
6160         isolate type lookup from the rest of the resolution process.
6161
6162         Since we use Expressions to hold type definitions due to the way
6163         we parse the input we have historically overloaded Resolve to
6164         perform the Type lookups if a special flag is passed.  Now this is
6165         eliminated and two methods take their place. 
6166
6167         The differences in the two methods between xStep and xTerminal is
6168         that xStep is involved in our current lookup system that uses
6169         SimpleNames to compose a name, while xTerminal is used just to
6170         catch the case where the simplename lookup failed.
6171
6172 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * expression.cs (ResolveMemberAccess): Remove redundant code.
6175         TypeExpr expressions are always born fully resolved.
6176
6177         * interface.cs (PopulateMethod): Do not lookup the types twice.
6178         We were doing it once during SemanticAnalysis and once during
6179         PopulateMethod.
6180
6181         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
6182         in local variable type definitions, were being returned as a
6183         SimpleName (we decomposed everything into a string), that is
6184         because primary_expression was being used instead of a type in the
6185         grammar (reduce/reduce conflicts).
6186
6187         The part that was wrong is that we converted the expression into a
6188         string (an oversimplification in one hand, compounded with primary
6189         expressions doing string concatenation).
6190
6191         So things like:
6192
6193         A.B.C [] x;
6194
6195         Would return "A.B.C[]" as a SimpleName.  This stopped things like
6196         using clauses from working on this particular context.  And a type
6197         was being matched directly against "A.B.C[]".
6198
6199         We now use the correct approach, and allow for ComposedCast to be
6200         part of the unary expression.  So the "A.B.C []" become a composed
6201         cast of "A.B.C" (as a nested group of MemberAccess with a
6202         SimpleName at the end) plus the rank composition "[]". 
6203
6204         Also fixes 35567
6205
6206 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
6207
6208         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
6209         for the access level checking.
6210
6211         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
6212         `TypeContainer container', because I kept getting confused when I
6213         was debugging this code.
6214
6215         * expression.cs (Indexers): Instead of tracking getters/setters,
6216         we now track them in parallel.  We create one arraylist less, but
6217         most importantly it is possible now for the LValue code to find a
6218         matching get for a set.
6219
6220         (IndexerAccess.DoResolveLValue): Update the code.
6221         GetIndexersForType has been modified already to extract all the
6222         indexers from a type.  The code assumed it did not.
6223
6224         Also make the code set the correct return type for the indexer.
6225         This was fixed a long time ago for properties, but was missing for
6226         indexers.  It used to be void_type.
6227
6228         (Binary.Emit): Test first for doubles instead of
6229         floats, as they are more common.
6230
6231         (Binary.EmitBranchable): Use the .un version of the branch opcodes
6232         when dealing with floats and the <=, >= operators.  This fixes bug
6233         #39314 
6234
6235         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
6236         to load the array value by emitting a load on the foreach variable
6237         type.  This was incorrect.  
6238
6239         We now emit the code to load an element using the the array
6240         variable type, and then we emit the conversion operator.
6241
6242         Fixed #40176
6243
6244 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
6245
6246         * attribute.cs: Avoid allocation of ArrayLists in the common case.
6247
6248 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
6251         test for protection before we test for signatures. 
6252
6253         (MethodSignature.ToString): implement.
6254
6255         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
6256         to the case where we reduced into a LongConstant.
6257
6258         * decl.cs (CheckAccessLevel): If the type is an array, we can not
6259         depend on whether the information is acurrate, because the
6260         Microsoft runtime will always claim that the array type is public,
6261         regardless of the real state.
6262
6263         If the type is a pointer, another problem happens: the type is
6264         reported as non-public in Microsoft.  
6265
6266         In both cases we have to call CheckAccessLevel recursively with
6267         the underlying type as the argument to be tested.
6268
6269 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
6270
6271         * assign.cs (Assign.Emit): If we are dealing with a compound
6272         assignment expression, we should use the code path that stores the
6273         intermediate result in a temporary value.  This fixes #40903.
6274
6275         *expression.cs (Indirection.ToString): Provide ToString method for
6276         debugging. 
6277
6278 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
6279
6280         * class.cs: Null out fields holding references to Block objects so
6281         they can be garbage collected.
6282
6283         * expression.cs (OverloadResolve): Remove unused local.
6284
6285 2003-04-07  Martin Baulig  <martin@ximian.com>
6286
6287         * codegen.cs (EmitContext.CurrentFile): New public field.
6288         (EmitContext.Mark): Use the CurrentFile to check whether the
6289         location is in the correct file.
6290         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
6291
6292 2003-04-07  Martin Baulig  <martin@ximian.com>
6293
6294         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
6295
6296         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
6297         location.  [FIXME: The location argument which gets passed to this
6298         method is sometimes wrong!]
6299
6300 2003-04-07  Nick Drochak <ndrochak@gol.com>
6301
6302         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
6303
6304 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
6305
6306         * expression.cs (Indirection.EmitAssign): We were using the
6307         temporary, but returning immediately instead of continuing the
6308         EmitAssing flow.
6309
6310 2003-04-06  Martin Baulig  <martin@ximian.com>
6311
6312         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
6313         if it's a nested child, but also deriving from the outer class.
6314         See test 190.cs.
6315
6316         * typemanager.cs (IsNestedChildOf): Make this work if it's a
6317         nested child, but also deriving from the outer class.  See
6318         test-190.cs.
6319         (FilterWithClosure): We may access private members of the outer
6320         class if we're a nested child and deriving from the outer class.
6321         (RealMemberLookup): Only set `closure_private_ok' if the
6322         `original_bf' contained BindingFlags.NonPublic.
6323
6324 2003-04-05  Martin Baulig  <martin@ximian.com>
6325
6326         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
6327
6328 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
6329
6330         * class.cs (Event.Define): Do not allow abstract events to have
6331         initializers. 
6332
6333 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
6336         block in event declarations.
6337
6338         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
6339         value type, get its address.
6340
6341         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
6342         leaving a class on the stack instead of a boolean value (int
6343         0/1).  Change the code so we compare against null, and then the
6344         result against zero.
6345
6346         * class.cs (TypeContainer.GetClassBases): We were checking for the
6347         parent class being sealed too late.
6348
6349         * expression.cs (Binary.Emit): For <= and >= when dealing with
6350         floating point values, use cgt.un and clt.un instead of cgt and
6351         clt alone.
6352
6353 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
6354
6355         * statement.cs: Apply the same optimization as MS: skip the 
6356         GetEnumerator returning an IEnumerator, and use the one returning a 
6357         CharEnumerator instead. This allows us to avoid the try-finally block 
6358         and the boxing.
6359
6360 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
6361
6362         * cs-parser.jay: Attributes cannot be applied to
6363                          namespaces. Fixes #40473
6364
6365 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6366
6367         * class.cs:
6368         (Add*): check if the name is valid using the full name for constants,
6369         fields, properties and events.
6370
6371 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
6372
6373         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
6374         char constants to be part of the enumeration.
6375
6376         * expression.cs (Conditional.DoResolve): Add support for operator
6377         true. Implements the missing functionality from 14.12
6378
6379         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
6380         operator true/false as required by the spec.
6381
6382         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
6383         implicit conversion to boolean.
6384
6385         * statement.cs (Statement.ResolveBoolean): A boolean expression is
6386         also one where the type implements `operator true'. 
6387
6388         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
6389         get an expression that will invoke operator true based on an
6390         expression.  
6391
6392         (GetConversionOperators): Removed the hack that called op_True
6393         here.  
6394
6395         (Expression.ResolveBoolean): Move this from Statement.
6396
6397 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
6398
6399         * ecore.cs (FieldExpr): do not allow initialization of initonly
6400         fields on derived classes
6401
6402 2003-03-13  Martin Baulig  <martin@ximian.com>
6403
6404         * statement.cs (Block.Emit): Call ig.BeginScope() and
6405         ig.EndScope() when compiling with debugging info; call
6406         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
6407
6408 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
6409
6410         * expression.cs (Indexers): Do not construct immediately, allow
6411         for new members to be appended as we go.  Fixes 38143
6412
6413 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6414
6415         * expression.cs: save/restore context when resolving an unchecked
6416         expression.
6417
6418 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
6419
6420         * cfold.cs: Catch division by zero in modulus operator during
6421         constant folding.
6422
6423 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
6424
6425         * interface.cs (Interface.DefineMembers): Avoid defining members
6426         twice. 
6427
6428 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
6429
6430         * driver.cs: handle the +/- options for -noconfig
6431
6432         * statement.cs (Unckeched.Resolve): Also track the state of
6433         unchecked in the Resolve phase.
6434
6435 2003-02-27  Martin Baulig  <martin@ximian.com>
6436
6437         * ecore.cs (Expression.MemberLookup): Don't create a
6438         MethodGroupExpr for something which is not a method.  Fixes #38291.
6439
6440 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
6441
6442         * class.cs (MemberBase.CheckParameters): Also check that the type
6443         is unmanaged if it is a pointer.
6444
6445         * expression.cs (SizeOf.Resolve): Add location information.
6446
6447         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
6448         a managed type is declared.
6449
6450         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
6451         parameter modifiers as well.  Fixes bug 38606
6452
6453         * class.cs: Very sad.  Am backing out the speed up changes
6454         introduced by the ArrayList -> Array in the TypeContainer, as they
6455         were not actually that much faster, and introduced a bug (no error
6456         reports on duplicated methods).
6457
6458         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
6459         source first, this will guarantee that we have a valid expression
6460         before calling in lower levels functions that will require a
6461         resolved object.  Then use this original_source in the
6462         target.ResolveLValue instead of the original source that was
6463         passed to us.
6464
6465         Another change.  Use target.Resolve instead of LValueResolve.
6466         Although we are resolving for LValues, we will let the Assign code
6467         take care of that (it will be called again from Resolve).  This
6468         basically allows code like this:
6469
6470         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
6471         class Y { void A (X x) { x [0] += o; }
6472
6473         The problem was that the indexer was trying to resolve for
6474         set_Item (idx, object o) and never finding one.  The real set_Item
6475         was set_Item (idx, X).  By delaying the process we get the right
6476         semantics. 
6477
6478         Fixes bug 36505
6479
6480 2003-02-23  Martin Baulig  <martin@ximian.com>
6481
6482         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
6483         while calling DoEmit ().
6484
6485         * codegen.cs (EmitContext.Mark): Don't mark locations in other
6486         source files; if you use the #line directive inside a method, the
6487         compiler stops emitting line numbers for the debugger until it
6488         reaches the end of the method or another #line directive which
6489         restores the original file.
6490
6491 2003-02-23  Martin Baulig  <martin@ximian.com>
6492
6493         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
6494
6495 2003-02-23  Martin Baulig  <martin@ximian.com>
6496
6497         * statement.cs (Block.AddChildVariableNames): We need to call this
6498         recursively, not just for our immediate children.
6499
6500 2003-02-23  Martin Baulig  <martin@ximian.com>
6501
6502         * class.cs (Event.Define): Always make the field private, like csc does.
6503
6504         * typemanager.cs (TypeManager.RealMemberLookup): Make events
6505         actually work, fixes bug #37521.
6506
6507 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
6508
6509         * delegate.cs: When creating the various temporary "Parameters"
6510         classes, make sure that we call the ComputeAndDefineParameterTypes
6511         on those new parameters (just like we do with the formal ones), to
6512         allow them to be resolved in the context of the DeclSpace.
6513
6514         This fixes the bug that Dick observed in Bugzilla #38530.
6515
6516 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
6517
6518         * expression.cs (ResolveMemberAccess): When resolving a constant,
6519         do not attempt to pull a constant if the value was not able to
6520         generate a valid constant.
6521
6522         * const.cs (LookupConstantValue): Do not report more errors than required.
6523
6524 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6525
6526         * expression.cs: fixes bug #38328.
6527
6528 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6529
6530         * class.cs: Changed all the various members that can be part of a
6531         class from being an ArrayList to be an Array of the right type.
6532         During the DefineType type_list, interface_list, delegate_list and
6533         enum_list are turned into types, interfaces, delegates and enums
6534         arrays.  
6535
6536         And during the member population, indexer_list, event_list,
6537         constant_list, field_list, instance_constructor_list, method_list,
6538         operator_list and property_list are turned into their real arrays.
6539
6540         Although we could probably perform this operation earlier, for
6541         good error reporting we need to keep the lists and remove the
6542         lists for longer than required.
6543
6544         This optimization was triggered by Paolo profiling the compiler
6545         speed on the output of `gen-sample-program.pl' perl script. 
6546
6547         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
6548         not crash in methods like MemberLookupFailed that use this field.  
6549
6550         This problem arises when the compiler fails to resolve a type
6551         during interface type definition for example.
6552
6553 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6554
6555         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
6556         inherit from System.Object, so we have to stop at null, not only
6557         when reaching System.Object.
6558
6559 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
6560
6561         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
6562         DeclaredOnly because the parent indexer might have had a different
6563         name, but did not loop until the top of the hierarchy was reached.
6564
6565         The problem this one fixes is 35492: when a class implemented an
6566         indexer from an interface, we were getting the interface method
6567         (which was abstract) and we were flagging an error (can not invoke
6568         abstract method).
6569
6570         This also keeps bug 33089 functioning, and test-148 functioning.
6571
6572         * typemanager.cs (IsSpecialMethod): The correct way of figuring
6573         out if a method is special is to see if it is declared in a
6574         property or event, or whether it is one of the predefined operator
6575         names.   This should fix correctly #36804.
6576
6577 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6578
6579         The goal here is to remove the dependency on EmptyCast.Peel ().
6580         Killing it completely.
6581
6582         The problem is that currently in a number of places where
6583         constants are expected, we have to "probe" for an EmptyCast, and
6584         Peel, which is not the correct thing to do, as this will be
6585         repetitive and will likely lead to errors. 
6586
6587         The idea is to remove any EmptyCasts that are used in casts that
6588         can be reduced to constants, so we only have to cope with
6589         constants. 
6590
6591         This bug hunt was triggered by Bug 37363 and the desire to remove
6592         the duplicate pattern where we were "peeling" emptycasts to check
6593         whether they were constants.  Now constants will always be
6594         constants.
6595
6596         * ecore.cs: Use an enumconstant here instead of wrapping with
6597         EmptyCast.  
6598
6599         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6600         throwing me off.  By handling this we can get rid of a few hacks.
6601
6602         * statement.cs (Switch): Removed Peel() code.
6603
6604 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6605
6606         * class.cs: Location information for error 508
6607
6608         * expression.cs (New.DoResolve): Add a guard against double
6609         resolution of an expression.  
6610
6611         The New DoResolve might be called twice when initializing field
6612         expressions (see EmitFieldInitializers, the call to
6613         GetInitializerExpression will perform a resolve on the expression,
6614         and later the assign will trigger another resolution
6615
6616         This leads to bugs (#37014)
6617
6618         * delegate.cs: The signature for EndInvoke should contain any ref
6619         or out parameters as well.  We were not doing this in the past. 
6620
6621         * class.cs (Field.Define): Do not overwrite the type definition
6622         inside the `volatile' group.  Turns out that volatile enumerations
6623         were changing the type here to perform a validity test, which
6624         broke conversions. 
6625
6626 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6627
6628         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6629         and structs, we do not want to load the instance variable
6630
6631         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6632         enum_type has to be handled like an object reference (implicit
6633         conversions exists from this to object), but the regular IsClass
6634         and IsValueType tests will never return true for this one.
6635
6636         Also we use TypeManager.IsValueType instead of type.IsValueType,
6637         just for consistency with the rest of the code (this is only
6638         needed if we ever use the construct exposed by test-180.cs inside
6639         corlib, which we dont today).
6640
6641 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6642
6643         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6644         just InternalCall.
6645
6646 2003-02-09  Martin Baulig  <martin@ximian.com>
6647
6648         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6649         (Namespace.DefineNamespaces): New static public method; this is
6650         called when we're compiling with debugging to add all namespaces
6651         to the symbol file.
6652
6653         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6654         pass it to the Namespace's .ctor.
6655
6656         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6657         and MethodBase arguments; pass the namespace ID to the symwriter;
6658         pass the MethodBase instead of the token to the symwriter.
6659         (SymbolWriter.DefineNamespace): New method to add a namespace to
6660         the symbol file.
6661
6662 2003-02-09  Martin Baulig  <martin@ximian.com>
6663
6664         * symbolwriter.cs: New file.  This is a wrapper around
6665         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6666         methods here in near future.
6667
6668 2003-02-09  Martin Baulig  <martin@ximian.com>
6669
6670         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6671         ILGenerator.MarkSequencePoint() which are actually used by the
6672         symbol writer.
6673
6674 2003-02-09  Martin Baulig  <martin@ximian.com>
6675
6676         * location.cs (SourceFile): New public sealed class.  This
6677         contains the name and an index which is used in the location's token.
6678         (Location): Reserve an appropriate number of bits in the token for
6679         the source file instead of walking over that list, this gives us a
6680         really huge performance improvement when compiling with debugging.
6681
6682         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6683         `SourceFile' argument instead of a string.
6684         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6685         but don't parse/tokenize here, we need to generate the list of all
6686         source files before we do that.
6687         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6688         the files.
6689
6690         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6691         instead of a string.
6692
6693         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6694         of a string.
6695
6696 2003-02-09  Martin Baulig  <martin@ximian.com>
6697
6698         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6699         filename on `#line default'.
6700
6701 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6702
6703         * statement.cs: don't clear the pinned var when the fixed statement
6704         returns from the method (fixes bug#37752).
6705
6706 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6707
6708         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6709         to IsValueType.
6710
6711 2003-02-07  Martin Baulig  <martin@ximian.com>
6712
6713         * driver.cs: Removed the `--debug-args' command line argument.
6714
6715         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6716         automatically by the AsssemblyBuilder.
6717         (CodeGen.InitializeSymbolWriter): We don't need to call any
6718         initialization function on the symbol writer anymore.  This method
6719         doesn't take any arguments.
6720
6721 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6722
6723         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6724         from referenced assemblies as well.
6725
6726 2003-02-02  Martin Baulig  <martin@ximian.com>
6727
6728         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6729
6730 2003-02-02  Martin Baulig  <martin@ximian.com>
6731
6732         * class.cs (Constructor.Emit): Open the symbol writer before
6733         emitting the constructor initializer.
6734         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6735         single-stepping through constructor initializers.
6736
6737 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6738
6739         * class.cs: Handle error 549: do not allow virtual methods in
6740         sealed classes. 
6741
6742 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6743
6744         * decl.cs: Check access levels when resolving types
6745
6746 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6747
6748         * statement.cs: Add parameters and locals set in catch blocks that might 
6749         return to set vector
6750
6751 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6752
6753         * class.cs (Operator): Set the SpecialName flags for operators.
6754
6755         * expression.cs (Invocation.DoResolve): Only block calls to
6756         accessors and operators on SpecialName methods.
6757
6758         (Cast.TryReduce): Handle conversions from char constants.
6759
6760
6761 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
6762
6763         * statement.cs: small memory and time optimization in FlowBranching.
6764
6765 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
6766
6767         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
6768         problem that the last fix but in the other sid (Set).
6769
6770         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
6771         access when there is no indexer in the hierarchy.
6772
6773 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
6774
6775         * class.cs: Combine some if statements.
6776
6777 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6778
6779         * driver.cs: fixed bug #37187.
6780
6781 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
6782
6783         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
6784         any indexer, it's needed to build a list with all the indexers in the
6785         hierarchy (AllGetters), else we have problems. Fixes #35653.
6786
6787 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
6788
6789         * class.cs (MethodData.Define): It is wrong for an interface
6790         implementation to be static in both cases: explicit and implicit.
6791         We were only handling this in one case.
6792
6793         Improve the if situation there to not have negations.
6794
6795         * class.cs (Field.Define): Turns out that we do not need to check
6796         the unsafe bit on field definition, only on usage.  Remove the test.
6797
6798 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6799
6800         * driver.cs: use assembly.Location instead of Codebase (the latest
6801         patch made mcs fail when using MS assemblies).
6802
6803 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
6804
6805         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
6806         get the path to *corlib.dll.
6807
6808 2003-01-21  Nick Drochak <ndrochak@gol.com>
6809
6810         * cs-tokenizer.cs:
6811         * pending.cs:
6812         * typemanager.cs: Remove compiler warnings
6813
6814 2003-01-20  Duncan Mak  <duncan@ximian.com>
6815
6816         * AssemblyInfo.cs: Bump the version number to 0.19.
6817
6818 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6819
6820         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
6821
6822 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
6823
6824         * class.cs (Constructor::Emit): Emit debugging info for constructors.
6825
6826 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
6827
6828         * cs-parser.jay: Small fix: we were not comparing the constructor
6829         name correctly.   Thanks to Zoltan for the initial pointer.
6830
6831 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
6832
6833         * cs-tokenizer.cs: Set file name when specified with #line
6834
6835 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
6836
6837         * cs-parser.jay: Only perform the constructor checks here if we
6838         are named like the class;  This will help provider a better
6839         error.  The constructor path is taken when a type definition is
6840         not found, but most likely the user forgot to add the type, so
6841         report that rather than the constructor error.
6842
6843 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
6844
6845         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
6846         allocations.
6847
6848 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6849
6850         * cs-parser.jay: Add cleanup call.
6851
6852 2003-01-13  Duncan Mak  <duncan@ximian.com>
6853
6854         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
6855         consistent with other methods.
6856
6857 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6858
6859         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
6860
6861 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
6862
6863         * attribute.cs: only set GuidAttr to true when we have a
6864         GuidAttribute.
6865
6866 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6867
6868         * ecore.cs:
6869         * expression.cs:
6870         * typemanager.cs: fixes to allow mcs compile corlib with the new
6871         Type.IsSubclassOf fix.
6872
6873 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * expression.cs (LocalVariableReference.DoResolve): Classify a
6876         constant as a value, not as a variable.   Also, set the type for
6877         the variable.
6878
6879         * cs-parser.jay (fixed_statement): take a type instead of a
6880         pointer_type, so we can produce a better error message later.
6881
6882         * statement.cs (Fixed.Resolve): Flag types that are not pointers
6883         as an error.  
6884
6885         (For.DoEmit): Make inifinite loops have a
6886         non-conditional branch back.
6887
6888         (Fixed.DoEmit): First populate the pinned variables, then emit the
6889         statement, then clear the variables.  Before I was emitting the
6890         code once for each fixed piece.
6891
6892
6893 2003-01-08  Martin Baulig  <martin@ximian.com>
6894
6895         * statement.cs (FlowBranching.MergeChild): A break in a
6896         SWITCH_SECTION does not leave a loop.  Fixes #36155.
6897
6898 2003-01-08  Martin Baulig  <martin@ximian.com>
6899
6900         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
6901         lives in the same number space than `param_map'.  Fixes #36154.
6902
6903 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
6904
6905         * cs-parser.jay (constructor_declaration): Set the
6906         Constructor.ModFlags before probing for it.  This makes the
6907         compiler report 514, 515 and 132 (the code was there, but got
6908         broken). 
6909
6910         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
6911         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
6912         (GotoCase.Resolve): Set `Returns' to ALWAYS.
6913
6914 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
6915
6916         * enum.cs: create the enum static fields using the enum type.
6917
6918 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
6919
6920         * class.cs: don't try to create the ParamBuilder for the return
6921         type if it's not needed (and handle it breaking for the ms runtime
6922         anyway).
6923
6924 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
6925
6926         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
6927
6928 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
6931         the command.   This showed up while compiling the JANET source
6932         code, which used \r as its only newline separator.
6933
6934 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
6935
6936         * class.cs (Method.Define): If we are an operator (because it
6937         reuses our code), then set the SpecialName and HideBySig.  #36128
6938
6939 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
6940
6941         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
6942         exception, report error 120 `object reference required'.
6943
6944         * driver.cs: Add --pause option, used during to measure the size
6945         of the process as it goes with --timestamp.
6946
6947         * expression.cs (Invocation.DoResolve): Do not allow methods with
6948         SpecialName to be invoked.
6949
6950 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
6951
6952         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
6953         number before adding it.
6954
6955 2002-12-21  Ravi Pratap  <ravi@ximian.com>
6956
6957         * ecore.cs (StandardImplicitConversion): When in an unsafe
6958         context, we allow conversion between void * to any other pointer
6959         type. This fixes bug #35973.
6960
6961 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
6962
6963         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
6964         is not thrown when extensionless outputs are used 
6965
6966 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6967
6968         * rootcontext.cs: fixed compilation of corlib.
6969
6970 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
6971
6972         * attribute.cs (Attributes.Contains): Add new method.
6973
6974         * class.cs (MethodCore.LabelParameters): if the parameter is an
6975         `out' parameter, check that no attribute `[In]' has been passed.
6976
6977         * enum.cs: Handle the `value__' name in an enumeration.
6978
6979 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
6980
6981         * decl.cs: Added special case to allow overrides on "protected
6982         internal" methods
6983
6984 2002-12-18  Ravi Pratap  <ravi@ximian.com>
6985
6986         * attribute.cs (Attributes.AddAttributeSection): Rename to this
6987         since it makes much more sense.
6988
6989         (Attributes.ctor): Don't require a Location parameter.
6990
6991         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
6992
6993         * attribute.cs (ApplyAttributes): Remove extra Location parameters
6994         since we already have that information per attribute.
6995
6996         * everywhere : make appropriate changes.
6997
6998         * class.cs (LabelParameters): Write the code which actually
6999         applies attributes to the return type. We can't do this on the MS
7000         .NET runtime so we flag a warning in the case an exception is
7001         thrown.
7002
7003 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
7004
7005         * const.cs: Handle implicit null conversions here too.
7006
7007 2002-12-17  Ravi Pratap  <ravi@ximian.com>
7008
7009         * class.cs (MethodCore.LabelParameters): Remove the extra
7010         Type [] parameter since it is completely unnecessary. Instead
7011         pass in the method's attributes so that we can extract
7012         the "return" attribute.
7013
7014 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
7015
7016         * cs-parser.jay (parse): Use Report.Error to flag errors instead
7017         of ignoring it and letting the compile continue.
7018
7019         * typemanager.cs (ChangeType): use an extra argument to return an
7020         error condition instead of throwing an exception.
7021
7022 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
7023
7024         * expression.cs (Unary.TryReduce): mimic the code for the regular
7025         code path.  Perform an implicit cast in the cases where we can
7026         implicitly convert to one of the integral types, and then reduce
7027         based on that constant.   This fixes bug #35483.
7028
7029 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7030
7031         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
7032
7033 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7034
7035         * namespace.cs: fixed bug #35489.
7036
7037 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
7038
7039         * class.cs: Remove some dead code.
7040
7041         * cs-parser.jay: Estimate the number of methods needed
7042         (RootContext.MethodCount);
7043
7044         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
7045         numbers instead of StringBuilders.
7046
7047         * support.cs (PtrHashtable): Add constructor with initial size;
7048         We can now reduce reallocations of the method table.
7049
7050 2002-12-10  Ravi Pratap  <ravi@ximian.com>
7051
7052         * attribute.cs (ApplyAttributes): Keep track of the emitted
7053         attributes on a per-target basis. This fixes bug #35413.
7054
7055 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
7056
7057         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
7058         default to the Windows 1252 encoding.
7059
7060         (UnixParseOption): Support version, thanks to Alp for the missing
7061         pointer. 
7062
7063         * AssemblyInfo.cs: Add nice assembly information.
7064
7065         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
7066         (bug 35169).
7067
7068         * cs-parser.jay: Allow a trailing comma before the close bracked
7069         in the attribute_section production.
7070
7071         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
7072         address of the instance was being taken, I will take this out,
7073         because we take the address of the object immediately here.
7074
7075 2002-12-09  Ravi Pratap  <ravi@ximian.com>
7076
7077         * typemanager.cs (AreMultipleAllowed): Take care of the most
7078         obvious case where attribute type is not in the current assembly -
7079         stupid me ;-)
7080
7081 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
7082
7083         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
7084         definitions, instead of doing that afterwards.  
7085
7086         Also we use a nice little hack, depending on the constructor, we
7087         know if we are a "composed" name or a simple name.  Hence, we
7088         avoid the IndexOf test, and we avoid 
7089
7090         * codegen.cs: Add code to assist in a bug reporter to track down
7091         the source of a compiler crash. 
7092
7093 2002-12-07  Ravi Pratap  <ravi@ximian.com>
7094
7095         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
7096         types have been emitted for a given element and flag an error
7097         if something which does not have AllowMultiple set is used more
7098         than once.
7099
7100         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
7101         attribute types and their corresponding AllowMultiple properties
7102
7103         (AreMultipleAllowed): Check the property for a given type.
7104
7105         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
7106         property in the case we have a TypeContainer.
7107
7108         (Attributes.AddAttribute): Detect duplicates and just skip on
7109         adding them. This trivial fix catches a pretty gross error in our
7110         attribute emission - global attributes were being emitted twice!
7111
7112         Bugzilla bug #33187 is now fixed.
7113
7114 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
7115
7116         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
7117         instead of pp_and).
7118
7119         * expression.cs (Binary.ResolveOperator): I can only use the
7120         Concat (string, string, string) and Concat (string, string,
7121         string, string) if the child is actually a concatenation of
7122         strings. 
7123
7124 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
7125
7126         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
7127         context where we need a 2-character lookahead.
7128
7129         * pending.cs (PendingImplementation): Rework so we can keep track
7130         of interface types all the time, and flag those which were
7131         implemented by parents as optional.
7132
7133 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
7134
7135         * expression.cs (Binary.ResolveOperator): Use
7136         String.Concat(string,string,string) or
7137         String.Concat(string,string,string,string) when possible. 
7138
7139         * typemanager: More helper methods.
7140
7141
7142 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
7143
7144         * pending.cs: remove the bogus return from GetMissingInterfaces()
7145         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
7146
7147 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7148
7149         * namespace.cs: avoid duplicated 'using xxx' being added to
7150         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
7151         when we get more than one 'using' statement for the same namespace.
7152         Report a CS0105 warning for it.
7153
7154 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
7155
7156         * cs-tokenizer.cs (consume_identifier): use read directly, instead
7157         of calling getChar/putback, uses internal knowledge of it.    
7158
7159         (xtoken): Reorder tokenizer so most common patterns are checked
7160         first.  This reduces the compilation time in another 5% (from 8.11s
7161         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
7162
7163         The parsing time is 22% of the compilation in mcs, and from that
7164         64% is spent on the tokenization process.  
7165
7166         I tried using a binary search for keywords, but this is slower
7167         than the hashtable.  Another option would be to do a couple of
7168         things:
7169
7170                 * Not use a StringBuilder, instead use an array of chars,
7171                   with a set value.  Notice that this way we could catch
7172                   the 645 error without having to do it *afterwards*.
7173
7174                 * We could write a hand-parser to avoid the hashtable
7175                   compares altogether.
7176
7177         The identifier consumption process takes 37% of the tokenization
7178         time.  Another 15% is spent on is_number.  56% of the time spent
7179         on is_number is spent on Int64.Parse:
7180
7181                 * We could probably choose based on the string length to
7182                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
7183                   computations. 
7184
7185         Another 3% is spend on wrapping `xtoken' in the `token' function.
7186
7187         Handle 0xa0 as whitespace (#34752)
7188
7189 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
7190
7191         * typemanager.cs (IsCLRType): New routine to tell whether a type
7192         is one of the builtin types.  
7193
7194         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
7195         typecode in more places instead of doing pointer comparissions.
7196         We could leverage some knowledge about the way the typecodes are
7197         laid out.
7198
7199         New code to cache namespaces in assemblies, it is currently not
7200         invoked, to be used soon.
7201
7202         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
7203
7204         * expression.cs (Binary.ResolveOperator): specially handle
7205         strings, and do not perform user-defined operator overloading for
7206         built-in types.
7207
7208 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
7209
7210         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
7211         internalcall as it is a pretty simple operation;  Avoid whenever
7212         possible to call Char.IsLetter.
7213
7214         (consume_identifier): Cut by half the number of
7215         hashtable calls by merging the is_keyword and GetKeyword behavior.
7216
7217         Do not short-circuit, because if we do, we
7218         report errors (ie, #if false && true would produce an invalid
7219         directive error);
7220
7221
7222 2002-11-24  Martin Baulig  <martin@ximian.com>
7223
7224         * expression.cs (Cast.TryReduce): If we're in checked syntax,
7225         check constant ranges and report a CS0221.  Fixes #33186.
7226
7227 2002-11-24  Martin Baulig  <martin@ximian.com>
7228
7229         * cs-parser.jay: Make this work for uninitialized variable
7230         declarations in the `for' initializer.  Fixes #32416.
7231
7232 2002-11-24  Martin Baulig  <martin@ximian.com>
7233
7234         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
7235         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
7236
7237 2002-11-24  Martin Baulig  <martin@ximian.com>
7238
7239         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
7240         argument; if true, we also check for user-defined conversions.
7241         This is only needed if both arguments are of a user-defined type.
7242         Fixes #30443, added test-175.cs.
7243         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
7244
7245         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
7246
7247 2002-11-24  Martin Baulig  <martin@ximian.com>
7248
7249         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
7250         function to get the store opcode.
7251         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
7252         only emit the Ldelema if the store opcode is Stobj.  You must run
7253         both test-34 and test-167 to test this.  Fixes #34529.
7254
7255 2002-11-23  Martin Baulig  <martin@ximian.com>
7256
7257         * ecore.cs (Expression.MemberLookup): Added additional
7258         `qualifier_type' argument which is used when we're being called
7259         from MemberAccess.DoResolve() and null if we're called from a
7260         SimpleName lookup.
7261         (Expression.MemberLookupFailed): New method to report errors; this
7262         does the CS1540 check and reports the correct error message.
7263
7264         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
7265         argument for the CS1540 check and redone the way how we're dealing
7266         with private members.  See the comment in the source code for details.
7267         (FilterWithClosure): Reverted this back to revision 1.197; renamed
7268         `closure_start_type' to `closure_qualifier_type' and check whether
7269         it's not null.  It was not this filter being broken, it was just
7270         being called with the wrong arguments.
7271
7272         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
7273         and pass it the correct `qualifier_type'; this also does the error
7274         handling for us.
7275
7276 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
7277
7278         * expression.cs (Invocation.EmitParams): If the we are dealing
7279         with a non-built-in value type, load its address as well.
7280
7281         (ArrayCreation): Use a a pretty constant instead
7282         of the hardcoded value 2.   Use 6 instead of 2 for the number of
7283         static initializers.  
7284
7285         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
7286         because they are not really value types, just glorified integers. 
7287
7288         * driver.cs: Do not append .exe, the CSC compiler does not do it.
7289
7290         * ecore.cs: Remove redundant code for enumerations, make them use
7291         the same code path as everything else, fixes the casting issue
7292         with enumerations in Windows.Forms.
7293
7294         * attribute.cs: Do only cast to string if it is a string, the
7295         validation happens later.
7296
7297         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
7298         people upgrade their corlibs.
7299
7300         * ecore.cs: Oops, enumerations were not following the entire code path
7301
7302 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
7303
7304         * typemanager.cs (FilterWithClosure): Commented out the test for
7305         1540 in typemanager.cs, as it has problems when accessing
7306         protected methods from a parent class (see test-174.cs). 
7307
7308         * attribute.cs (Attribute.ValidateGuid): new method.
7309         (Attribute.Resolve): Use above.
7310
7311 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
7314
7315         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
7316         handling for enumerations, as we only needed the TypeContainer
7317         functionality to begin with (this is required for the fix below to
7318         work for enums that reference constants in a container class for
7319         example). 
7320
7321         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
7322
7323         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
7324         a valid TypeBuilder to perform lookups on.o
7325
7326         * class.cs (InheritableMemberSignatureCompare): Use true in the
7327         call to GetGetMethod and GetSetMethod, because we are comparing
7328         the signature, and we need to get the methods *even* if they are
7329         private. 
7330
7331         (PropertyBase.CheckBase): ditto.
7332
7333         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
7334         GotoCase.Resolve): Use Peel on EmpytCasts.
7335
7336         * ecore.cs (EmptyCast): drop child, add Peel method.
7337
7338 2002-11-17  Martin Baulig  <martin@ximian.com>
7339
7340         * ecore.cs (EmptyCast.Child): New public property.
7341
7342         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
7343         label resolved to an EmptyCast.  Fixes #34162.
7344         (GotoCase.Resolve): Likewise.
7345         (Block.EmitMeta): Likewise.
7346
7347 2002-11-17  Martin Baulig  <martin@ximian.com>
7348
7349         * expression.cs (Invocation.BetterConversion): Prefer int over
7350         uint; short over ushort; long over ulong for integer literals.
7351         Use ImplicitConversionExists instead of StandardConversionExists
7352         since we also need to check for user-defined implicit conversions.
7353         Fixes #34165.  Added test-173.cs.
7354
7355 2002-11-16  Martin Baulig  <martin@ximian.com>
7356
7357         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
7358         with the `true' and `false' literals.  Fixes #33151.
7359
7360 2002-11-16  Martin Baulig  <martin@ximian.com>
7361
7362         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
7363         October 22nd; don't do the cs1540 check for static members.
7364
7365         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
7366         now using our own filter here and doing the cs1540 check again.
7367
7368 2002-11-16  Martin Baulig  <martin@ximian.com>
7369
7370         * support.cs (InternalParameters): Don't crash if we don't have
7371         any fixed parameters.  Fixes #33532.
7372
7373 2002-11-16  Martin Baulig  <martin@ximian.com>
7374
7375         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
7376         when looking up static methods to make this work on Windows.
7377         Fixes #33773.
7378
7379 2002-11-16  Martin Baulig  <martin@ximian.com>
7380
7381         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
7382         a setter rather than using PropertyInfo.CanWrite.
7383
7384 2002-11-15  Nick Drochak  <ndrochak@gol.com>
7385
7386         * class.cs: Allow acces to block member by subclasses. Fixes build
7387         breaker.
7388
7389 2002-11-14  Martin Baulig  <martin@ximian.com>
7390
7391         * class.cs (Constructor.Emit): Added the extern/block check.
7392         Fixes bug #33678.
7393
7394 2002-11-14  Martin Baulig  <martin@ximian.com>
7395
7396         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
7397         iteration while looking for indexers, this is needed because the
7398         indexer may have a different name in our base classes.  Fixed the
7399         error reporting (no indexers at all, not get accessor, no
7400         overloaded match).  Fixes bug #33089.
7401         (IndexerAccess.DoResolveLValue): Likewise.
7402
7403 2002-11-14  Martin Baulig  <martin@ximian.com>
7404
7405         * class.cs (PropertyBase.CheckBase): Make this work for multiple
7406         indexers.  Fixes the first part of bug #33089.
7407         (MethodSignature.InheritableMemberSignatureCompare): Added support
7408         for properties.
7409
7410 2002-11-13  Ravi Pratap  <ravi@ximian.com>
7411
7412         * attribute.cs (Attribute.Resolve): Catch the
7413         NullReferenceException and report it since it isn't supposed to
7414         happen. 
7415
7416 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
7417
7418         * expression.cs (Binary.EmitBranchable): Also handle the cases for
7419         LogicalOr and LogicalAnd that can benefit from recursively
7420         handling EmitBranchable.  The code now should be nice for Paolo.
7421
7422 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
7423
7424         * typemanager.cs (LookupType): Added a negative-hit hashtable for
7425         the Type lookups, as we perform quite a number of lookups on
7426         non-Types.  This can be removed once we can deterministically tell
7427         whether we have a type or a namespace in advance.
7428
7429         But this might require special hacks from our corlib.
7430
7431         * TODO: updated.
7432
7433         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
7434         and double which avoids a conversion from an integer to a double.
7435
7436         * expression.cs: tiny optimization, avoid calling IsConstant,
7437         because it effectively performs the lookup twice.
7438
7439 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
7440
7441         But a bogus return here to keep the semantics of the old code
7442         until the Mono runtime is fixed.
7443
7444         * pending.cs (GetMissingInterfaces): New method used to remove all
7445         the interfaces that are already implemented by our parent
7446         classes from the list of pending methods. 
7447
7448         * interface.cs: Add checks for calls after ResolveTypeExpr.
7449
7450 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * class.cs (Class.Emit): Report warning 67: event not used if the
7453         warning level is beyond 3.
7454
7455         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
7456         being a NullLiteral.
7457
7458         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
7459         specifiers. 
7460
7461         * class.cs (TypeContainer.GetClassBases): Cover a missing code
7462         path that might fail if a type can not be resolved.
7463
7464         * expression.cs (Binary.Emit): Emit unsigned versions of the
7465         operators. 
7466
7467         * driver.cs: use error 5.
7468
7469 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
7470
7471         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
7472
7473 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
7474
7475         * cs-parser.jay (switch_section): A beautiful patch from Martin
7476         Baulig that fixed 33094.
7477
7478 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
7479
7480         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
7481         Check whether the base is abstract and report an error if so.
7482
7483         * expression.cs (IndexerAccess.DoResolveLValue,
7484         IndexerAccess.DoResolve): ditto. 
7485
7486         (Invocation.DoResolve): ditto.
7487
7488         (Invocation.FullMethodDesc): Improve the report string.
7489
7490         * statement.cs (Block): Eliminate IsVariableDefined as it is
7491         basically just a wrapper for GetVariableInfo.
7492
7493         * ecore.cs (SimpleName): Use new 
7494
7495         * support.cs (ReflectionParamter.ParameterType): We unwrap the
7496         type, as we return the actual parameter ref/unref state on a
7497         different call.
7498
7499 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
7500
7501         * support.cs: Return proper flags REF/OUT fixing the previous
7502         commit.  
7503
7504         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
7505         not used to mean `ref' but `ref or out' in ParameterReference
7506
7507         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
7508         full type signature instead of calling TypeManger.CSharpName
7509         ourselves. 
7510
7511         * support.cs (InternalParameters.ParameterDesc): Do not compare
7512         directly to the modflags, because REF/OUT will actually be bitsets
7513         if set. 
7514
7515         * delegate.cs (VerifyMethod): Check also the modifiers.
7516
7517         * cs-tokenizer.cs: Fix bug where floating point values with an
7518         exponent where a sign was missing was ignored.
7519
7520         * driver.cs: Allow multiple assemblies to be specified in a single
7521         /r: argument
7522
7523 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
7524
7525         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
7526         because identifiers after a parenthesis would end up in this kind
7527         of production, and we needed to desamiguate it for having casts
7528         like:
7529
7530                 (UserDefinedType *) xxx
7531
7532 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
7533
7534         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
7535         we should set on the Bindingflags.NonPublic, but not turn on
7536         private_ok.  private_ok controls whether a Private member is
7537         returned (this is chekced on the filter routine), while the
7538         BindingFlags.NonPublic just controls whether private/protected
7539         will be allowed.   This fixes the problem part of the problem of
7540         private properties being allowed to be used in derived classes.
7541
7542         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
7543         so we can call the children DoResolveLValue method (this will
7544         properly signal errors on lvalue assignments to base properties)
7545
7546         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
7547         getter are null, and we have a property info, we know that this
7548         happened because the lookup failed, so we report an error 122 for
7549         protection level violation.
7550
7551         We also silently return if setter and getter are null in the
7552         resolve functions, this condition only happens if we have flagged
7553         the error before.  This is the other half of the problem. 
7554
7555         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
7556         not have accessibility information, that is why we were returning
7557         true in the filter function in typemanager.cs.
7558
7559         To properly report 122 (property is inaccessible because of its
7560         protection level) correctly, we report this error in ResolveAccess
7561         by failing if both the setter and the getter are lacking (ie, the
7562         lookup failed). 
7563
7564         DoResolve and DoLResolve have been modified to check for both
7565         setter/getter being null and returning silently, the reason being
7566         that I did not want to put the knowledge about this error in upper
7567         layers, like:
7568
7569         int old = Report.Errors;
7570         x = new PropertyExpr (...);
7571         if (old != Report.Errors)
7572                 return null;
7573         else
7574                 return x;
7575
7576         So the property expr is returned, but it is invalid, so the error
7577         will be flagged during the resolve process. 
7578
7579         * class.cs: Remove InheritablePropertySignatureCompare from the
7580         class, as we no longer depend on the property signature to compute
7581         whether it is possible to implement a method or not.
7582
7583         The reason is that calling PropertyInfo.GetGetMethod will return
7584         null (in .NET, in Mono it works, and we should change this), in
7585         cases where the Get Method does not exist in that particular
7586         class.
7587
7588         So this code:
7589
7590         class X { public virtual int A { get { return 1; } } }
7591         class Y : X { }
7592         class Z : Y { public override int A { get { return 2; } } }
7593
7594         Would fail in Z because the parent (Y) would not have the property
7595         defined.  So we avoid this completely now (because the alternative
7596         fix was ugly and slow), and we now depend exclusively on the
7597         method names.
7598
7599         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7600         reference method, instead of using the property.
7601
7602         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7603         routines are gone now.
7604
7605         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7606         names, they were incorrectly named.
7607
7608         * cs-tokenizer.cs: Return are more gentle token on failure. 
7609
7610         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7611         had an out-of-sync index variable, which caused it to remove from
7612         the list of pending methods the wrong method sometimes.
7613
7614 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7615
7616         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7617         CanWrite, because those refer to this particular instance of the
7618         property, and do not take into account the fact that we can
7619         override single members of a property.
7620
7621         Constructor requires an EmitContext.  The resolution process does
7622         not happen here, but we need to compute the accessors before,
7623         because the resolution does not always happen for properties.
7624
7625         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7626         subclass, before we did not update this flag, but we did update
7627         bindingflags. 
7628
7629         (GetAccessors): Drop this routine, as it did not work in the
7630         presence of partially overwritten set/get methods. 
7631
7632         Notice that this broke the cs1540 detection, but that will require
7633         more thinking. 
7634
7635 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7636
7637         * class.cs:
7638         * codegen.cs:
7639         * driver.cs: issue a warning instead of an error if we don't support
7640         debugging for the platform. Also ignore a couple of errors that may
7641         arise when trying to write the symbols. Undo my previous patch.
7642
7643 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7644
7645         * driver.cs: ignore /debug switch except for Unix platforms.
7646
7647 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7648
7649         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7650
7651 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7652
7653         * driver.cs: Do not make mcs-debug conditional, so we do not break
7654         builds that use it.
7655
7656         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7657         review this patch.  But basically after all the children variables
7658         have been merged, the value of "Breaks" was not being set to
7659         new_breaks for Switch blocks.  I think that it should be set after
7660         it has executed.  Currently I set this to the value of new_breaks,
7661         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7662         conservative, but I do not understand this code very well.
7663
7664         I did not break anything in the build, so that is good ;-)
7665
7666         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7667
7668 2002-10-20  Mark Crichton  <crichton@gimp.org>
7669
7670         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7671
7672 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7673
7674         * cfold.cs: Fixed compile blocker.
7675
7676 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7677
7678         * driver.cs: I was chekcing the key, not the file.
7679
7680 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7681
7682         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7683         message that we were generating - we just need to silently return
7684         a null.
7685
7686 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7687
7688         * class.cs (Event.Define): Change my previous commit, as this
7689         breaks the debugger.  This is a temporary hack, as it seems like
7690         the compiler is generating events incorrectly to begin with.
7691
7692         * expression.cs (Binary.ResolveOperator): Added support for 
7693         "U operator - (E x, E y)"
7694
7695         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7696         y)".
7697
7698         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7699         init-only variables, but this path did not take into account that
7700         there might be also instance readonly variables.  Correct this
7701         problem. 
7702
7703         This fixes bug 32253
7704
7705         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7706         delegates as well.
7707
7708         * driver.cs: Change the extension for modules to `netmodule'
7709
7710         * cs-parser.jay: Improved slightly the location tracking for
7711         the debugger symbols.
7712
7713         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7714         modifiers that were specified instead of the hardcoded value
7715         (FamAndAssem).  This was basically ignoring the static modifier,
7716         and others.  Fixes 32429.
7717
7718         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7719         fixed a bug in the process (32476)
7720
7721         * expression.cs (ArrayAccess.EmitAssign): Patch from
7722         hwang_rob@yahoo.ca that fixes bug 31834.3
7723
7724 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7725
7726         * driver.cs: Make the module extension .netmodule.
7727
7728 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7729
7730         * driver.cs: Report an error if the resource file is not found
7731         instead of crashing.
7732
7733         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7734         false, like Emit does.
7735
7736 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7737
7738         * typemanager.cs: Remove unused private member.  Also reported mcs
7739         bug to report this as a warning like csc.
7740
7741 2002-10-15  Martin Baulig  <martin@gnome.org>
7742
7743         * statement.cs (Statement.Emit): Made this a virtual method; emits
7744         the line number info and calls DoEmit().
7745         (Statement.DoEmit): New protected abstract method, formerly knows
7746         as Statement.Emit().
7747
7748         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7749
7750 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7751
7752         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7753         have fixed a remaining problem: not every AddXXXX was adding a
7754         fully qualified name.  
7755
7756         Now everyone registers a fully qualified name in the DeclSpace as
7757         being defined instead of the partial name.  
7758
7759         Downsides: we are slower than we need to be due to the excess
7760         copies and the names being registered this way.  
7761
7762         The reason for this is that we currently depend (on the corlib
7763         bootstrap for instance) that types are fully qualified, because
7764         we dump all the types in the namespace, and we should really have
7765         types inserted into the proper namespace, so we can only store the
7766         basenames in the defined_names array.
7767
7768 2002-10-10  Martin Baulig  <martin@gnome.org>
7769
7770         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
7771         from bug #31834, see the bug report for a testcase which is
7772         miscompiled.
7773
7774 2002-10-10  Martin Baulig  <martin@gnome.org>
7775
7776         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
7777         flow analysis code for this.
7778
7779         * statement.cs (Do, While, For): Tell the flow analysis code about
7780         infinite loops.
7781         (FlowBranching.UsageVector): Added support for infinite loops.
7782         (Block.Resolve): Moved the dead code elimination here and use flow
7783         analysis to do it.
7784
7785 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
7786
7787         * class.cs (Field.Define): Catch cycles on struct type
7788         definitions. 
7789
7790         * typemanager.cs (IsUnmanagedtype): Do not recursively check
7791         fields if the fields are static.  We only need to check instance
7792         fields. 
7793
7794         * expression.cs (As.DoResolve): Test for reference type.
7795
7796         * statement.cs (Using.ResolveExpression): Use
7797         ConvertImplicitRequired, not ConvertImplicit which reports an
7798         error on failture
7799         (Using.ResolveLocalVariableDecls): ditto.
7800
7801         * expression.cs (Binary.ResolveOperator): Report errors in a few
7802         places where we had to.
7803
7804         * typemanager.cs (IsUnmanagedtype): Finish implementation.
7805
7806 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
7807
7808         * expression.cs: Use StoreFromPtr instead of extracting the type
7809         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
7810
7811         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
7812         an enumeration value to a System.Enum, but System.Enum is not a
7813         value type, but an class type, so we need to box.
7814
7815         (Expression.ConvertExplicit): One codepath could return
7816         errors but not flag them.  Fix this.  Fixes #31853
7817
7818         * parameter.cs (Resolve): Do not allow void as a parameter type.
7819
7820 2002-10-06  Martin Baulig  <martin@gnome.org>
7821
7822         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
7823         if it's a class type and not a struct.  Fixes #31815.
7824
7825 2002-10-06  Martin Baulig  <martin@gnome.org>
7826
7827         * statement.cs: Reworked the flow analysis code a bit to make it
7828         usable for dead code elimination.
7829
7830 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7831
7832         * cs-parser.jay: allow empty source files. Fixes bug #31781.
7833
7834 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7835
7836         * expression.cs (ComposedCast.DoResolveType): A quick workaround
7837         to fix the test 165, will investigate deeper.
7838
7839 2002-10-04  Martin Baulig  <martin@gnome.org>
7840
7841         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
7842         finally blocks actually work.
7843         (Try.Resolve): We don't need to create a sibling for `finally' if
7844         there is no finally block.
7845
7846 2002-10-04  Martin Baulig  <martin@gnome.org>
7847
7848         * class.cs (Constructor.Define): The default accessibility for a
7849         non-default constructor is private, not public.
7850
7851 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7852
7853         * class.cs (Constructor): Make AllowedModifiers public, add
7854         EXTERN.
7855
7856         * cs-parser.jay: Perform the modifiers test here, as the
7857         constructor for the Constructor class usually receives a zero
7858         because of the way we create it (first we create, later we
7859         customize, and we were never checking the modifiers).
7860
7861         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
7862         is a version of LookupTypeReflection that includes the type-name
7863         cache.  This can be used as a fast path for functions that know
7864         the fully qualified name and are only calling into *.GetType() to
7865         obtain a composed type.
7866
7867         This is also used by TypeManager.LookupType during its type
7868         composition.
7869
7870         (LookupType): We now also track the real type name, as sometimes
7871         we can get a quey for the real type name from things like
7872         ComposedCast.  This fixes bug 31422.
7873
7874         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
7875         complete type fullname, it does not have to go through the type
7876         resolution system to obtain the composed version of the type (for
7877         obtaining arrays or pointers).
7878
7879         (Conditional.Emit): Use the EmitBoolExpression to
7880         generate nicer code, as requested by Paolo.
7881
7882         (ArrayCreation.CheckIndices): Use the patch from
7883         hwang_rob@yahoo.ca to validate the array initializers. 
7884
7885 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * class.cs (ConstructorInitializer.Emit): simplify code by using
7888         Invocation.EmitCall, and at the same time, fix the bugs in calling
7889         parent constructors that took variable arguments. 
7890
7891         * ecore.cs (Expression.ConvertNumericExplicit,
7892         Expression.ImplicitNumericConversion): Remove the code that
7893         manually wrapped decimal (InternalTypeConstructor call is now gone
7894         as well).
7895
7896         * expression.cs (Cast.TryReduce): Also handle decimal types when
7897         trying to perform a constant fold on the type.
7898
7899         * typemanager.cs (IsUnmanagedtype): Partially implemented.
7900
7901         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
7902         that only turned off an error report, and did nothing else. 
7903
7904 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
7905
7906         * driver.cs: Handle and ignore /fullpaths
7907
7908 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
7909
7910         * expression.cs (Binary.ResolveOperator): Catch the case where
7911         DoNumericPromotions returns true, 
7912
7913         (Binary.DoNumericPromotions): Simplify the code, and the tests.
7914
7915 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
7916
7917         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
7918         report error 70.
7919
7920 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
7921
7922         * ecore.cs (ConvertNumericExplicit): It is not enough that the
7923         conversion exists, but it is also required that the conversion be
7924         performed.  This manifested in "(Type64Enum) 2".  
7925
7926         * class.cs (TypeManager.AddMethod): The fix is not to change
7927         AddEnum, because that one was using a fully qualified name (every
7928         DeclSpace derivative does), but to change the AddMethod routine
7929         that was using an un-namespaced name.  This now correctly reports
7930         the duplicated name.
7931
7932         Revert patch until I can properly fix it.  The issue
7933         is that we have a shared Type space across all namespaces
7934         currently, which is wrong.
7935
7936         Options include making the Namespace a DeclSpace, and merge
7937         current_namespace/current_container in the parser.
7938
7939 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
7940
7941         * cs-parser.jay: Improve error reporting when we get a different
7942         kind of expression in local_variable_type and
7943         local_variable_pointer_type. 
7944
7945         Propagate this to avoid missleading errors being reported.
7946
7947         * ecore.cs (ImplicitReferenceConversion): treat
7948         TypeManager.value_type as a target just like object_type.   As
7949         code like this:
7950
7951         ValueType v = 1;
7952
7953         Is valid, and needs to result in the int 1 being boxed before it
7954         is assigned to the value type v.
7955
7956         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
7957         to validate the enumeration name.
7958
7959         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
7960         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
7961         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
7962
7963         * ecore.cs (TryImplicitIntConversion): When doing an
7964         implicit-enumeration-conversion, check if the type is 64-bits and
7965         perform a conversion before passing to EnumConstant.
7966
7967 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
7968
7969         * decl.cs (Error_AmbiguousTypeReference); New routine used to
7970         report ambiguous type references.  Unlike the MS version, we
7971         report what the ambiguity is.   Innovation at work ;-)
7972
7973         (DeclSpace.FindType): Require a location argument to
7974         display when we display an ambiguous error.
7975
7976         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
7977
7978         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
7979
7980         * expression.cs (EmitDynamicInitializers): Apply patch from
7981         hwang_rob@yahoo.ca that fixes the order in which we emit our
7982         initializers. 
7983
7984 2002-09-21  Martin Baulig  <martin@gnome.org>
7985
7986         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
7987         delegate takes no arguments.
7988
7989 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
7990
7991         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
7992         from integers.
7993
7994         * expression.cs: Extract the underlying type.
7995
7996         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
7997
7998         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
7999
8000 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * class.cs (TypeContainer.DefineType): We can not use the nice
8003         PackingSize with the size set to 1 DefineType method, because it
8004         will not allow us to define the interfaces that the struct
8005         implements.
8006
8007         This completes the fixing of bug 27287
8008
8009         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
8010         means also structs.  This fixes part of the problem. 
8011         (Expresion.ImplicitReferenceConversionExists): ditto.
8012
8013         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
8014         error if there were no errors reported during the type lookup
8015         process, to avoid duplicates or redundant errors.  Without this
8016         you would get an ambiguous errors plus a type not found.  We have
8017         beaten the user enough with the first error.  
8018
8019         (DeclSparce.FindType): Emit a warning if we have an ambiguous
8020         reference. 
8021
8022         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
8023         during the resolution process, stop the lookup, this avoids
8024         repeated error reports (same error twice).
8025
8026         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
8027
8028         * typemanager.cs (LookupType): Redo the type lookup code to match
8029         the needs of System.Reflection.  
8030
8031         The issue is that System.Reflection requires references to nested
8032         types to begin with a "+" sign instead of a dot.  So toplevel
8033         types look like: "NameSpace.TopLevelClass", and nested ones look
8034         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
8035         levels. 
8036
8037 2002-09-19  Martin Baulig  <martin@gnome.org>
8038
8039         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
8040         says that a method always returns or always throws an exception,
8041         don't report the CS0161.
8042
8043         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
8044         set `Returns = new_returns'.
8045
8046 2002-09-19  Martin Baulig  <martin@gnome.org>
8047
8048         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
8049         to an enum constant, check for a CS0176.
8050
8051 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
8052
8053         * class.cs (TypeContainer.CheckPairedOperators): Now we check
8054         for operators that must be in pairs and report errors.
8055
8056         * ecore.cs (SimpleName.DoResolveType): During the initial type
8057         resolution process, when we define types recursively, we must
8058         check first for types in our current scope before we perform
8059         lookups in the enclosing scopes.
8060
8061         * expression.cs (MakeByteBlob): Handle Decimal blobs.
8062
8063         (Invocation.VerifyArgumentsCompat): Call
8064         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
8065         I thought we were supposed to always call this, but there are a
8066         few places in the code where we dont do it.
8067
8068 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
8069
8070         * driver.cs: Add support in -linkres and -resource to specify the
8071         name of the identifier.
8072
8073 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8074
8075         * ecore.cs (StandardConversionExists): Sync with the conversion
8076         code: allow anything-* to void* conversions.
8077
8078         (FindMostSpecificSource): Use an Expression argument
8079         instead of a Type, because we might be handed over a Literal which
8080         gets a few more implicit conversions that plain types do not.  So
8081         this information was being lost.
8082
8083         Also, we drop the temporary type-holder expression when not
8084         required.
8085
8086 2002-09-17  Martin Baulig  <martin@gnome.org>
8087
8088         * class.cs (PropertyBase.CheckBase): Don't check the base class if
8089         this is an explicit interface implementation.
8090
8091 2002-09-17  Martin Baulig  <martin@gnome.org>
8092
8093         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
8094         different `IndexerName' attributes.
8095
8096         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
8097         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
8098         virtual CommonResolve().
8099
8100 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8101
8102         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
8103         and convert that to the UnderlyingType.
8104
8105         * statement.cs (Foreach.Resolve): Indexers are just like variables
8106         or PropertyAccesses.
8107
8108         * cs-tokenizer.cs (consume_string): Track line numbers and columns
8109         inside quoted strings, we were not doing this before.
8110
8111 2002-09-16  Martin Baulig  <martin@gnome.org>
8112
8113         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
8114         resolve it.  This is needed for the definite assignment check of the
8115         instance expression, fixes bug #29846.
8116         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
8117
8118 2002-09-16  Nick Drochak  <ndrochak@gol.com>
8119
8120         * parameter.cs: Fix compile error.  Cannot reference static member
8121         from an instance object.  Is this an mcs bug?
8122
8123 2002-09-14  Martin Baulig  <martin@gnome.org>
8124
8125         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
8126         multiple times.  Fixes bug #30295, added test-166.cs.
8127
8128 2002-09-14  Martin Baulig  <martin@gnome.org>
8129
8130         * statement.cs (Block.Emit): Don't emit unreachable code.
8131         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
8132         `break' statements.
8133         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
8134
8135 2002-09-14  Martin Baulig  <martin@gnome.org>
8136
8137         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
8138         is set.
8139
8140 2002-09-14  Martin Baulig  <martin@gnome.org>
8141
8142         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
8143         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
8144         be false on the ms runtime.
8145
8146 2002-09-13  Martin Baulig  <martin@gnome.org>
8147
8148         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
8149         the CS0038 error message.
8150
8151 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
8154         constant inside, return it.
8155
8156 2002-09-12  Martin Baulig  <martin@gnome.org>
8157
8158         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
8159         implicit conversion can be done between enum types.
8160
8161         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
8162         check whether an implicit conversion to the current enum's UnderlyingType
8163         exists and report an error if not.
8164
8165         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
8166         without debugging support.
8167
8168         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
8169         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
8170
8171 2002-09-12  Martin Baulig  <martin@gnome.org>
8172
8173         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
8174
8175         * ecore.cs (IMemberExpr.DeclaringType): New property.
8176         (SimpleName.SimpleNameResolve): Check whether we're accessing a
8177         nonstatic member of an outer type (CS0038).
8178
8179 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
8180
8181         * driver.cs: Activate the using-error detector at warning level
8182         4 (at least for MS-compatible APIs).
8183
8184         * namespace.cs (VerifyUsing): Small buglett fix.
8185
8186         * pending.cs (PendingImplementation): pass the container pointer. 
8187
8188         * interface.cs (GetMethods): Allow for recursive definition.  Long
8189         term, I would like to move every type to support recursive
8190         definitions, not the current ordering mechanism that we have right
8191         now.
8192
8193         The situation is this: Attributes are handled before interfaces,
8194         so we can apply attributes to interfaces.  But some attributes
8195         implement interfaces, we will now handle the simple cases
8196         (recursive definitions will just get an error).  
8197
8198         * parameter.cs: Only invalidate types at the end if we fail to
8199         lookup all types.  
8200
8201 2002-09-09  Martin Baulig  <martin@gnome.org>
8202
8203         * ecore.cs (PropertyExpr.Emit): Also check for
8204         TypeManager.system_int_array_get_length so this'll also work when
8205         compiling corlib.  Fixes #30003.
8206
8207 2002-09-09  Martin Baulig  <martin@gnome.org>
8208
8209         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
8210         and throw an exception if we can't get the type's size.  Fixed #30040,
8211         added test-165.cs.
8212
8213 2002-09-09  Martin Baulig  <martin@gnome.org>
8214
8215         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
8216
8217         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
8218         context.  Fixes bug #30027.
8219
8220         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
8221         virtual functions.  Fixes bug #30043, added test-164.cs.
8222
8223 2002-09-08  Ravi Pratap  <ravi@ximian.com>
8224
8225         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
8226
8227 2002-09-08  Nick Drochak  <ndrochak@gol.com>
8228
8229         * driver.cs: Use an object to get the windows codepage since it's not a
8230         static property.
8231
8232 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
8233
8234         * statement.cs (For.Emit): for infinite loops (test == null)
8235         return whether there is a break inside, not always "true".
8236
8237         * namespace.cs (UsingEntry): New struct to hold the name of the
8238         using definition, the location where it is defined, and whether it
8239         has been used in a successful type lookup.
8240
8241         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
8242         strings.
8243
8244         * decl.cs: ditto.
8245
8246 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8247
8248         * attribute.cs : Fix incorrect code which relied on catching
8249         a NullReferenceException to detect a null being passed in
8250         where an object was expected.
8251
8252 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * statement.cs (Try): flag the catch variable as assigned
8255
8256         * expression.cs (Cast): Simplified by using ResolveType instead of
8257         manually resolving.
8258
8259         * statement.cs (Catch): Fix bug by using ResolveType.
8260
8261 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8262
8263         * expression.cs (BetterConversion): Special case for when we have
8264         a NullLiteral as the argument and we have to choose between string
8265         and object types - we choose string the way csc does.
8266
8267         * attribute.cs (Attribute.Resolve): Catch the
8268         NullReferenceException and report error #182 since the Mono
8269         runtime no more has the bug and having this exception raised means
8270         we tried to select a constructor which takes an object and is
8271         passed a null.
8272
8273 2002-09-05  Ravi Pratap  <ravi@ximian.com>
8274
8275         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
8276         message (1502, 1503) when we can't locate a method after overload
8277         resolution. This is much more informative and closes the bug
8278         Miguel reported.
8279
8280         * interface.cs (PopulateMethod): Return if there are no argument
8281         types. Fixes a NullReferenceException bug.
8282
8283         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
8284         expressions too. Previously we were checking only in one place for
8285         positional arguments leaving out named arguments.
8286
8287         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
8288         type to the enum type is not allowed. Remove code corresponding to
8289         that.
8290
8291         (ConvertNumericExplicit): Allow explicit conversions from
8292         the underlying type to enum type. This precisely follows the spec
8293         and closes a bug filed by Gonzalo.
8294
8295 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8296
8297         * compiler.csproj:
8298         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
8299
8300 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
8301
8302         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
8303         it was important that we stored the right value after the
8304         reduction in `converted'.
8305
8306 2002-09-04  Martin Baulig  <martin@gnome.org>
8307
8308         * location.cs (Location.SymbolDocument): Use full pathnames for the
8309         source files.
8310
8311 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
8312
8313         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
8314         of the expression resolve mechanism, because that will catch the
8315         SimpleName error failures.
8316
8317         (Conditional): If we can not resolve the
8318         expression, return, do not crash.
8319
8320 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8321
8322         * cs-tokenizer.cs:
8323         (location): display token name instead of its number.
8324
8325 2002-08-28  Martin Baulig  <martin@gnome.org>
8326
8327         * expression.cs (Binary.ResolveOperator): Don't silently return
8328         but return an error if an operator cannot be applied between two
8329         enum types.
8330
8331 2002-08-28  Martin Baulig  <martin@gnome.org>
8332
8333         * class.cs (Constructor.Define): Set the permission attributes
8334         correctly instead of making all constructors public.
8335
8336 2002-08-28  Martin Baulig  <martin@gnome.org>
8337
8338         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
8339         for private members before reporting a CS0103; if we find anything,
8340         it's a CS0122.
8341
8342 2002-08-28  Martin Baulig  <martin@gnome.org>
8343
8344         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
8345         to check whether `closure_start_type == closure_invocation_type',
8346         we also need to check whether `m.DeclaringType == closure_invocation_type'
8347         before bypassing the permission checks.  We might be accessing
8348         protected/private members from the base class.
8349         (TypeManager.RealMemberLookup): Only set private_ok if private
8350         members were requested via BindingFlags.NonPublic.
8351
8352         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
8353
8354         * expression.cs (MemberAccess.ResolveMemberAccess): Set
8355         MethodGroupExpr.IsExplicitImpl if appropriate.
8356         (Invocation.DoResolve): Don't report the CS0120 for explicit
8357         interface implementations.
8358
8359 2002-08-27  Martin Baulig  <martin@gnome.org>
8360
8361         * expression.cs (Invocation.DoResolve): If this is a static
8362         method and we don't have an InstanceExpression, we must report
8363         a CS0120.
8364
8365 2002-08-25  Martin Baulig  <martin@gnome.org>
8366
8367         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
8368         `==' between a valuetype and an object.
8369
8370 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
8371
8372         * ecore.cs (TypeExpr): Provide a ToString method.
8373
8374 2002-08-24  Martin Baulig  <martin@gnome.org>
8375
8376         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
8377         now called proggie.dbg and it's a binary file.
8378
8379 2002-08-23  Martin Baulig  <martin@gnome.org>
8380
8381         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
8382
8383 2002-08-23  Martin Baulig  <martin@gnome.org>
8384
8385         * struct.cs (MyStructInfo.ctor): Make this work with empty
8386         structs; it's not allowed to use foreach() on null.
8387
8388 2002-08-23  Martin Baulig  <martin@gnome.org>
8389
8390         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
8391         writer the full pathname of the generated assembly.
8392
8393 2002-08-23  Martin Baulig  <martin@gnome.org>
8394
8395         * statements.cs (FlowBranching.UsageVector.MergeChildren):
8396         A `finally' block never returns or breaks; improved handling of
8397         unreachable code.
8398
8399 2002-08-23  Martin Baulig  <martin@gnome.org>
8400
8401         * statement.cs (Throw.Resolve): Allow `throw null'.
8402
8403 2002-08-23  Martin Baulig  <martin@gnome.org>
8404
8405         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
8406         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
8407         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
8408         MemberLookup would return a wrong event if this is an explicit
8409         interface implementation and the class has an event with the same
8410         name.
8411
8412 2002-08-23  Martin Baulig  <martin@gnome.org>
8413
8414         * statement.cs (Block.AddChildVariableNames): New public method.
8415         (Block.AddChildVariableName): Likewise.
8416         (Block.IsVariableNameUsedInChildBlock): Likewise.
8417         (Block.AddVariable): Check whether a variable name has already
8418         been used in a child block.
8419
8420         * cs-parser.jay (declare_local_variables): Mark all variable names
8421         from the current block as being used in a child block in the
8422         implicit block.
8423
8424 2002-08-23  Martin Baulig  <martin@gnome.org>
8425
8426         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
8427         find the symbol writer.
8428
8429         * driver.cs: csc also allows the arguments to /define being
8430         separated by commas, not only by semicolons.
8431
8432 2002-08-23  Martin Baulig  <martin@gnome.org>
8433
8434         * interface.cs (Interface.GetMembers): Added static check for events.
8435
8436 2002-08-15  Martin Baulig  <martin@gnome.org>
8437
8438         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
8439         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
8440
8441         * ecore.cs (Expression.MemberLookup): Added documentation and explained
8442         why the MethodData.EmitDestructor() change was necessary.
8443
8444 2002-08-20  Martin Baulig  <martin@gnome.org>
8445
8446         * class.cs (TypeContainer.FindMembers): Added static check for events.
8447
8448         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
8449
8450         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
8451         use Type.GetEvents(), not Type.FindMembers().
8452
8453 2002-08-20  Martin Baulig  <martin@gnome.org>
8454
8455         * decl.cs (MemberCache): Added a special method cache which will
8456         be used for method-only searched.  This ensures that a method
8457         search will return a MethodInfo with the correct ReflectedType for
8458         inherited methods.      
8459
8460 2002-08-20  Martin Baulig  <martin@gnome.org>
8461
8462         * decl.cs (DeclSpace.FindMembers): Made this public.
8463
8464 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8465
8466         * delegate.cs: fixed build on windows.
8467         [FIXME:  Filed as bug #29150: MCS must report these errors.]
8468
8469 2002-08-19  Ravi Pratap  <ravi@ximian.com>
8470
8471         * ecore.cs (StandardConversionExists): Return a false
8472         if we are trying to convert the void type to anything else
8473         since that is not allowed.
8474
8475         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
8476         we flag error 70 in the event an event is trying to be accessed
8477         directly from outside the declaring type.
8478
8479 2002-08-20  Martin Baulig  <martin@gnome.org>
8480
8481         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
8482         MemberCache from typemanager.cs to decl.cs.
8483
8484 2002-08-19  Martin Baulig  <martin@gnome.org>
8485
8486         * class.cs (TypeContainer): Implement IMemberContainer.
8487         (TypeContainer.DefineMembers): Create the MemberCache.
8488         (TypeContainer.FindMembers): Do better BindingFlags checking; only
8489         return public members if BindingFlags.Public was given, check
8490         whether members are static.
8491
8492 2002-08-16  Martin Baulig  <martin@gnome.org>
8493
8494         * decl.cs (DeclSpace.Define): Splitted this in Define and
8495         DefineMembers.  DefineMembers is called first and initializes the
8496         MemberCache.
8497
8498         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
8499         DefineMembers() on all our DeclSpaces.
8500
8501         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
8502         but call DefineMembers() on all nested interfaces.  We call their
8503         Define() in our new Define() function.
8504
8505         * interface.cs (Interface): Implement IMemberContainer.
8506         (Interface.Define): Moved all code except the attribute stuf to
8507         DefineMembers().
8508         (Interface.DefineMembers): Initialize the member cache.
8509
8510         * typemanager.cs (IMemberFinder): Removed this interface, we don't
8511         need this anymore since we can use MemberCache.FindMembers directly.
8512
8513 2002-08-19  Martin Baulig  <martin@gnome.org>
8514
8515         * typemanager.cs (MemberCache): When creating the cache for an
8516         interface type, add all inherited members.
8517         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
8518         to `out bool used_cache' and documented it.
8519         (TypeManager.MemberLookup): If we already used the cache in the first
8520         iteration, we don't need to do the interfaces check.
8521
8522 2002-08-19  Martin Baulig  <martin@gnome.org>
8523
8524         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
8525         here from IMemberFinder and don't implement this interface anymore.
8526         (DeclSpace.MemberCache): Moved here from IMemberFinder.
8527
8528         * typemanager.cs (IMemberFinder): This interface is now only used by
8529         classes which actually support the member cache.
8530         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
8531         since we only put DeclSpaces into this Hashtable.
8532         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
8533         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
8534
8535 2002-08-16  Martin Baulig  <martin@gnome.org>
8536
8537         * typemanager.cs (ICachingMemberFinder): Removed.
8538         (IMemberFinder.MemberCache): New property.
8539         (TypeManager.FindMembers): Merged this with RealFindMembers().
8540         This function will never be called from TypeManager.MemberLookup()
8541         so we can't use the cache here, just the IMemberFinder.
8542         (TypeManager.MemberLookup_FindMembers): Check whether the
8543         IMemberFinder has a MemberCache and call the cache's FindMembers
8544         function.
8545         (MemberCache): Rewrote larger parts of this yet another time and
8546         cleaned it up a bit.
8547
8548 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
8549
8550         * driver.cs (LoadArgs): Support quoting.
8551
8552         (Usage): Show the CSC-like command line arguments.
8553
8554         Improved a few error messages.
8555
8556 2002-08-15  Martin Baulig  <martin@gnome.org>
8557
8558         * typemanager.cs (IMemberContainer.Type): New property.
8559         (IMemberContainer.IsInterface): New property.
8560
8561         The following changes are conditional to BROKEN_RUNTIME, which is
8562         defined at the top of the file.
8563
8564         * typemanager.cs (MemberCache.MemberCache): Don't add the base
8565         class'es members, but add all members from TypeHandle.ObjectType
8566         if we're an interface.
8567         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
8568         is the current type.
8569         (MemberCache.CacheEntry.Container): Removed this field.
8570         (TypeHandle.GetMembers): Include inherited members.
8571
8572 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8573
8574         * typemanager.cs: fixed compilation and added a comment on a field that
8575         is never used.
8576
8577 2002-08-15  Martin Baulig  <martin@gnome.org>
8578
8579         * class.cs (ConstructorInitializer.Resolve): In the
8580         Expression.MemberLookup call, use the queried_type as
8581         invocation_type.
8582
8583         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8584         declared' attribute, it's always true.
8585         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8586         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8587         temporary wrapper for FindMembers which tells MemberLookup whether
8588         members from the base classes are included in the return value.
8589         This will go away soon.
8590         (TypeManager.MemberLookup): Use this temporary hack here; once the
8591         new MemberCache is completed, we don't need to do the DeclaredOnly
8592         looping here anymore since the MemberCache will take care of this.
8593         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8594         (MemberCache): When creating the MemberCache for a class, get
8595         members from the current class and all its base classes.
8596         (MemberCache.CacheEntry.Container): New field.  This is a
8597         temporary hack until the Mono runtime is fixed to distinguish
8598         between ReflectedType and DeclaringType.  It allows us to use MCS
8599         with both the MS runtime and the unfixed Mono runtime without
8600         problems and without accecting performance.
8601         (MemberCache.SearchMembers): The DeclaredOnly looping from
8602         TypeManager.MemberLookup is now done here.      
8603
8604 2002-08-14  Martin Baulig  <martin@gnome.org>
8605
8606         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8607         Type.GetFields on dynamic types but get the fields from the
8608         corresponding TypeContainer.
8609         (MyStructInfo.GetStructInfo): Added check for enum types.
8610
8611         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8612         (MemberList.SyncRoot): Implemented.
8613         (TypeManager.FilterWithClosure): No need to check permissions if
8614         closure_start_type == closure_invocation_type, don't crash if
8615         closure_invocation_type is null.
8616
8617 2002-08-13  Martin Baulig  <martin@gnome.org>
8618
8619         Rewrote TypeContainer.FindMembers to use a member cache.  This
8620         gives us a speed increase of about 35% for the self-hosting MCS
8621         build and of about 15-20% for the class libs (both on GNU/Linux).
8622
8623         * report.cs (Timer): New class to get enhanced profiling.  This
8624         whole class is "TIMER" conditional since it remarkably slows down
8625         compilation speed.
8626
8627         * class.cs (MemberList): New class.  This is an IList wrapper
8628         which we're now using instead of passing MemberInfo[]'s around to
8629         avoid copying this array unnecessarily.
8630         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8631         (ICachingMemberFinder, IMemberContainer): New interface.
8632         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8633         has already been checked, otherwise use it for the name comparision.
8634         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8635         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8636         if possible.  Returns a MemberList, not a MemberInfo [].
8637         (TypeHandle): New class, implements IMemberContainer.  We create
8638         one instance of this class per type, it contains a MemberCache
8639         which is used to do the member lookups.
8640         (MemberCache): New class.  Each instance of this class contains
8641         all members of a type and a name-based hash table.
8642         (MemberCache.FindMembers): This is our new member lookup
8643         function.  First, it looks up all members of the requested name in
8644         the hash table.  Then, it walks this list and sorts out all
8645         applicable members and returns them.
8646
8647 2002-08-13  Martin Baulig  <martin@gnome.org>
8648
8649         In addition to a nice code cleanup, this gives us a performance
8650         increase of about 1.4% on GNU/Linux - not much, but it's already
8651         half a second for the self-hosting MCS compilation.
8652
8653         * typemanager.cs (IMemberFinder): New interface.  It is used by
8654         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8655         Enum, Delegate or Interface.
8656         (TypeManager.finder_to_member_finder): New PtrHashtable.
8657         (TypeManager.finder_to_container): Removed.
8658         (TypeManager.finder_to_delegate): Removed.
8659         (TypeManager.finder_to_interface): Removed.
8660         (TypeManager.finder_to_enum): Removed.
8661
8662         * interface.cs (Interface): Implement IMemberFinder.
8663
8664         * delegate.cs (Delegate): Implement IMemberFinder.
8665
8666         * enum.cs (Enum): Implement IMemberFinder.
8667
8668         * class.cs (TypeContainer): Implement IMemberFinder.
8669
8670 2002-08-12  Martin Baulig  <martin@gnome.org>
8671
8672         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8673
8674 2002-08-12  Martin Baulig  <martin@gnome.org>
8675
8676         * ecore.cs (ITypeExpression): New interface for expressions which
8677         resolve to a type.
8678         (TypeExpression): Renamed to TypeLookupExpression.
8679         (Expression.DoResolve): If we're doing a types-only lookup, the
8680         expression must implement the ITypeExpression interface and we
8681         call DoResolveType() on it.
8682         (SimpleName): Implement the new ITypeExpression interface.
8683         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8684         hack, the situation that we're only looking up types can't happen
8685         anymore when this method is called.  Moved the type lookup code to
8686         DoResolveType() and call it.
8687         (SimpleName.DoResolveType): This ITypeExpression interface method
8688         is now doing the types-only lookup.
8689         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8690         (ResolveFlags): Added MaskExprClass.
8691
8692         * expression.cs (MemberAccess): Implement the ITypeExpression
8693         interface.
8694         (MemberAccess.DoResolve): Added support for a types-only lookup
8695         when we're called via ITypeExpression.DoResolveType().
8696         (ComposedCast): Implement the ITypeExpression interface.
8697
8698         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8699         Expression.Resolve() with ResolveFlags.Type instead.
8700
8701 2002-08-12  Martin Baulig  <martin@gnome.org>
8702
8703         * interface.cs (Interface.Define): Apply attributes.
8704
8705         * attribute.cs (Attribute.ApplyAttributes): Added support for
8706         interface attributes.
8707
8708 2002-08-11  Martin Baulig  <martin@gnome.org>
8709
8710         * statement.cs (Block.Emit): Only check the "this" variable if we
8711         do not always throw an exception.
8712
8713         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8714         whether the property has a set accessor.
8715
8716 2002-08-11  Martin Baulig  <martin@gnome.org>
8717
8718         Added control flow analysis support for structs.
8719
8720         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8721         with control flow analysis turned off.
8722         (IVariable): New interface.
8723         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8724         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8725         (FieldExpr.DoResolve): Resolve the instance expression with flow
8726         analysis turned off and do the definite assignment check after the
8727         resolving when we know what the expression will resolve to.
8728
8729         * expression.cs (LocalVariableReference, ParameterReference):
8730         Implement the new IVariable interface, only call the flow analysis
8731         code if ec.DoFlowAnalysis is true.
8732         (This): Added constructor which takes a Block argument.  Implement
8733         the new IVariable interface.
8734         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8735         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8736         This does the definite assignment checks for struct members.
8737
8738         * class.cs (Constructor.Emit): If this is a non-static `struct'
8739         constructor which doesn't have any initializer, call
8740         Block.AddThisVariable() to tell the flow analysis code that all
8741         struct elements must be initialized before control returns from
8742         the constructor.
8743
8744         * statement.cs (MyStructInfo): New public class.
8745         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8746         argument to this indexer.  If non-zero, check an individual struct
8747         member, not the whole struct.
8748         (FlowBranching.CheckOutParameters): Check struct members.
8749         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8750         overloaded versions of these methods which take an additional
8751         `int field_idx' argument to check struct members.
8752         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8753         overloaded versions of these methods which take an additional
8754         `string field_name' argument to check struct member.s
8755         (VariableInfo): Implement the IVariable interface.
8756         (VariableInfo.StructInfo): New public property.  Returns the
8757         MyStructInfo instance of the variable if it's a struct or null.
8758         (Block.AddThisVariable): New public method.  This is called from
8759         Constructor.Emit() for non-static `struct' constructor which do
8760         not have any initializer.  It creates a special variable for the
8761         "this" instance variable which will be checked by the flow
8762         analysis code to ensure that all of the struct's fields are
8763         initialized before control returns from the constructor.
8764         (UsageVector): Added support for struct members.  If a
8765         variable/parameter is a struct with N members, we reserve a slot
8766         in the usage vector for each member.  A struct is considered fully
8767         initialized if either the struct itself (slot 0) or all its
8768         members are initialized.
8769
8770 2002-08-08  Martin Baulig  <martin@gnome.org>
8771
8772         * driver.cs (Driver.MainDriver): Only report an error CS5001
8773         if there were no compilation errors.
8774
8775         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
8776         `UnsafeContext' property to determine whether the parent is in
8777         unsafe context rather than checking the parent's ModFlags:
8778         classes nested in an unsafe class are unsafe as well.
8779
8780 2002-08-08  Martin Baulig  <martin@gnome.org>
8781
8782         * statement.cs (UsageVector.MergeChildren): Distinguish between
8783         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
8784         we return.  Added test17() and test18() to test-154.cs.
8785
8786 2002-08-08  Martin Baulig  <martin@gnome.org>
8787
8788         * typemanager.cs (TypeManager.FilterWithClosure): If we have
8789         Family access, make sure the invoking type isn't a subclass of the
8790         queried type (that'd be a CS1540).
8791
8792         * ecore.cs (Expression.MemberLookup): Added overloaded version of
8793         this method which takes an additional `Type invocation_type'.
8794
8795         * expression.cs (BaseAccess.DoResolve): Use the base type as
8796         invocation and query type.
8797         (MemberAccess.DoResolve): If the lookup failed and we're about to
8798         report a CS0122, try a lookup with the ec.ContainerType - if this
8799         succeeds, we must report a CS1540.
8800
8801 2002-08-08  Martin Baulig  <martin@gnome.org>
8802
8803         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
8804         (MethodGroupExpr): Implement the IMemberExpr interface.
8805
8806         * expression (MemberAccess.ResolveMemberAccess): No need to have
8807         any special code for MethodGroupExprs anymore, they're now
8808         IMemberExprs.   
8809
8810 2002-08-08  Martin Baulig  <martin@gnome.org>
8811
8812         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
8813         Family, FamANDAssem and FamORAssem permissions.
8814         (TypeManager.IsSubclassOrNestedChildOf): New public method.
8815
8816 2002-08-08  Martin Baulig  <martin@gnome.org>
8817
8818         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
8819         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
8820         or loop block.
8821
8822 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
8823
8824         * driver.cs: implemented /resource option to embed managed resources.
8825
8826 2002-08-07  Martin Baulig  <martin@gnome.org>
8827
8828         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
8829         (FieldBase.HasFieldInitializer): New public property.
8830         (FieldBase.GetInitializerExpression): New public method.  Resolves and
8831         returns the field initializer and makes sure it is only resolved once.
8832         (TypeContainer.EmitFieldInitializers): Call
8833         FieldBase.GetInitializerExpression to get the initializer, this ensures
8834         that it isn't resolved multiple times.
8835
8836         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
8837         the resolving process (SimpleName/MemberLookup) that we're currently
8838         emitting a field initializer (which must not access any instance members,
8839         this is an error CS0236).
8840
8841         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
8842         argument, if the `IsFieldInitializer' flag is set, we must report and
8843         error CS0236 and not an error CS0120.   
8844
8845 2002-08-07  Martin Baulig  <martin@gnome.org>
8846
8847         * ecore.cs (IMemberExpr): New public interface.
8848         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
8849         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
8850         if the expression is an IMemberExpr.
8851
8852         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
8853         to be null, implicitly default to `this' if we're non-static in
8854         this case.  Simplified the code a lot by using the new IMemberExpr
8855         interface.  Also fixed bug #28176 here.
8856
8857 2002-08-06  Martin Baulig  <martin@gnome.org>
8858
8859         * cs-parser.jay (SimpleLookup): Removed.  We need to create
8860         ParameterReferences during semantic analysis so that we can do a
8861         type-only search when resolving Cast, TypeOf and SizeOf.
8862         (block): Pass the `current_local_parameters' to the Block's
8863         constructor.
8864
8865         * class.cs (ConstructorInitializer): Added `Parameters parameters'
8866         argument to the constructor.
8867         (ConstructorInitializer.Resolve): Create a temporary implicit
8868         block with the parameters.
8869
8870         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
8871         references here if we aren't doing a type-only search.
8872
8873         * statement.cs (Block): Added constructor which takes a
8874         `Parameters parameters' argument.
8875         (Block.Parameters): New public property.
8876
8877         * support.cs (InternalParameters.Parameters): Renamed `parameters'
8878         to `Parameters' and made it public readonly.
8879
8880 2002-08-06  Martin Baulig  <martin@gnome.org>
8881
8882         * ecore.cs (Expression.Warning): Made this public as well.
8883
8884         * report.cs (Report.Debug): Print the contents of collections.
8885
8886 2002-08-06  Martin Baulig  <martin@gnome.org>
8887
8888         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
8889         used to tell Resolve() which kinds of expressions it may return.
8890         (Expression.Resolve): Added overloaded version of this method which
8891         takes a `ResolveFlags flags' argument.  This can be used to tell
8892         Resolve() which kinds of expressions it may return.  Reports a
8893         CS0118 on error.
8894         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
8895         ResolveFlags.SimpleName.
8896         (Expression.Error118): Added overloaded version of this method which
8897         takes a `ResolveFlags flags' argument.  It uses the flags to determine
8898         which kinds of expressions are allowed.
8899
8900         * expression.cs (Argument.ResolveMethodGroup): New public method.
8901         Resolves an argument, but allows a MethodGroup to be returned.
8902         This is used when invoking a delegate.
8903
8904         * TODO: Updated a bit.
8905
8906 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8907
8908         Fixed compilation with csc.
8909
8910         * ecore.cs: Expression.Error made public. Is this correct? Should
8911         Warning be made public too?
8912
8913         * expression.cs: use ea.Location instead of ea.loc.
8914         [FIXME:  Filed as bug #28607: MCS must report these errors.]
8915
8916 2002-08-06  Martin Baulig  <martin@gnome.org>
8917
8918         * ecore.cs (Expression.loc): Moved the location here instead of
8919         duplicating it in all derived classes.
8920         (Expression.Location): New public property.
8921         (Expression.Error, Expression.Warning): Made them non-static and
8922         removed the location argument.
8923         (Expression.Warning): Added overloaded version which takes an
8924         `int level' argument.
8925         (Expression.Error118): Make this non-static and removed the
8926         expression and location arguments.
8927         (TypeExpr): Added location argument to the constructor.
8928
8929         * expression.cs (StaticCallExpr): Added location argument to
8930         the constructor.
8931         (Indirection, PointerArithmetic): Likewise.
8932         (CheckedExpr, UnCheckedExpr): Likewise.
8933         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
8934         (StringPtr): Likewise.
8935
8936
8937 2002-08-05  Martin Baulig  <martin@gnome.org>
8938
8939         * expression.cs (BaseAccess.DoResolve): Actually report errors.
8940
8941         * assign.cs (Assign.DoResolve): Check whether the source
8942         expression is a value or variable.
8943
8944         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
8945         while resolving the corresponding blocks.
8946
8947         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
8948         an error, don't silently return null.
8949
8950         * statement.cs (Block.AddVariable): Do the error reporting here
8951         and distinguish between CS0128 and CS0136.
8952         (Block.DoResolve): Report all unused labels (warning CS0164).
8953         (LabeledStatement): Pass the location to the constructor.
8954         (LabeledStatement.HasBeenReferenced): New property.
8955         (LabeledStatement.Resolve): Set it to true here.
8956
8957         * statement.cs (Return.Emit): Return success even after reporting
8958         a type mismatch error (CS0126 or CS0127), this is what csc does and
8959         it avoids confusing the users with any consecutive errors.
8960
8961 2002-08-05  Martin Baulig  <martin@gnome.org>
8962
8963         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
8964
8965         * const.cs (Const.LookupConstantValue): Catch circular definitions.
8966
8967         * expression.cs (MemberAccess.DoResolve): Silently return if an
8968         error has already been reported.
8969
8970         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
8971         error has already been reported.
8972
8973 2002-08-05  Martin Baulig  <martin@gnome.org>
8974
8975         * statement.cs (UsageVector): Only initialize the `parameters'
8976         vector if we actually have any "out" parameters.
8977
8978 2002-08-05  Martin Baulig  <martin@gnome.org>
8979
8980         * expression.cs (Binary.ResolveOperator): When combining delegates,
8981         they must have the same type.
8982
8983 2002-08-05  Martin Baulig  <martin@gnome.org>
8984
8985         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
8986         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
8987         work with the ms runtime and we also don't need it: if we're a
8988         PropertyBuilder and not in the `indexer_arguments' hash, then we
8989         are a property and not an indexer.
8990
8991         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
8992         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
8993         since the latter one doesn't work with the ms runtime.
8994
8995 2002-08-03  Martin Baulig  <martin@gnome.org>
8996
8997         Fixed bugs #27998 and #22735.
8998
8999         * class.cs (Method.IsOperator): New public field.
9000         (Method.CheckBase): Report CS0111 if there's already a method
9001         with the same parameters in the current class.  Report CS0508 when
9002         attempting to change the return type of an inherited method.
9003         (MethodData.Emit): Report CS0179 if a method doesn't have a body
9004         and it's not marked abstract or extern.
9005         (PropertyBase): New abstract base class for Property and Indexer.
9006         (PropertyBase.CheckBase): Moved here from Property and made it work
9007         for indexers.
9008         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
9009         the same so we can reuse it there.
9010         (Property, Indexer): Derive from PropertyBase.
9011         (MethodSignature.inheritable_property_signature_filter): New delegate
9012         to find properties and indexers.
9013
9014         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
9015         argument and improved error reporting.
9016
9017         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
9018         EmptyReadOnlyParameters and made it a property.
9019
9020         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
9021         version of this method which takes a `PropertyInfo indexer'.
9022         (TypeManager.RegisterIndexer): New method.
9023
9024         * class.cs: Added myself as author of this file :-)
9025
9026 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9027
9028         * class.cs: fixed compilation on windoze.
9029
9030 2002-08-03  Martin Baulig  <martin@gnome.org>
9031
9032         * interface.cs (Interface.GetInterfaceBases): Check whether all
9033         base interfaces are at least as accessible than the current one.
9034
9035         * class.cs (TypeContainer.GetClassBases): Check whether base types
9036         are at least as accessible than the current type.
9037         (TypeContainer.AsAccessible): Implemented and made non-static.
9038         (MemberBase.CheckParameters): Report errors if the accessibility
9039         checks fail.
9040
9041         * delegate.cs (Delegate.Delegate): The default visibility is
9042         internal for top-level types and private for nested types.
9043         (Delegate.Define): Report errors if the accessibility checks fail.
9044
9045         * enum.cs (Enum.Enum): The default visibility is internal for
9046         top-level types and private for nested types.
9047         (Enum.DefineType): Compute the correct visibility.
9048
9049         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
9050         function which takes a `bool is_toplevel' instead of a TypeContainer.
9051
9052         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
9053         builtin type.
9054
9055 2002-08-02  Martin Baulig  <martin@gnome.org>
9056
9057         * expression.cs (LocalVariableReferenc): Added constructor which
9058         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
9059         (LocalVariableReference.IsReadOnly): New property.
9060         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
9061         variable is readonly, use our own readonly flag to do this; you can
9062         use the new constructor to get a writable reference to a read-only
9063         variable.
9064
9065         * cs-parser.jay (foreach_statement, using_statement): Get a writable
9066         reference to the local variable.
9067
9068 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
9069
9070         * rootcontext.cs (ResolveCore): Also include System.Exception
9071
9072         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
9073         we reach an EmptyStatement.
9074
9075         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
9076         is also fine.
9077
9078         * expression.cs (Binary.ResolveOperator): Check error result in
9079         two places.
9080
9081         use brtrue/brfalse directly and avoid compares to null.
9082
9083 2002-08-02  Martin Baulig  <martin@gnome.org>
9084
9085         * class.cs (TypeContainer.Define): Define all nested interfaces here.
9086         Fixes bug #28407, added test-155.cs.
9087
9088 2002-08-01  Martin Baulig  <martin@gnome.org>
9089
9090         * class.cs (Event.EmitDefaultMethod): Make this work with static
9091         events.  Fixes #28311, added verify-3.cs.
9092
9093 2002-08-01  Martin Baulig  <martin@gnome.org>
9094
9095         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
9096         `is_disposable' fields.
9097         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
9098         `hm.is_disposable' if we're using the collection pattern.
9099         (Foreach.EmitCollectionForeach): Use the correct type for the
9100         enumerator's local variable, only emit the try/finally block if
9101         necessary (fixes #27713).
9102
9103 2002-08-01  Martin Baulig  <martin@gnome.org>
9104
9105         * ecore.cs (Expression.report118): Renamed to Error118 and made
9106         it public static.
9107
9108         * statement.cs (Throw.Resolve): Check whether the expression is of
9109         the correct type (CS0118) and whether the type derives from
9110         System.Exception (CS0155).
9111         (Catch.Resolve): New method.  Do the type lookup here and check
9112         whether it derives from System.Exception (CS0155).
9113         (Catch.CatchType, Catch.IsGeneral): New public properties.
9114
9115         * typemanager.cs (TypeManager.exception_type): Added.
9116
9117 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
9118
9119         * driver.cs: Updated About function.
9120
9121 2002-07-31  Martin Baulig  <martin@gnome.org>
9122
9123         Implemented Control Flow Analysis.
9124
9125         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
9126         (EmitContext.CurrentBranching): Added.
9127         (EmitContext.StartFlowBranching): Added.
9128         (EmitContext.EndFlowBranching): Added.
9129         (EmitContext.KillFlowBranching): Added.
9130         (EmitContext.IsVariableAssigned): Added.
9131         (EmitContext.SetVariableAssigned): Added.
9132         (EmitContext.IsParameterAssigned): Added.
9133         (EmitContext.SetParameterAssigned): Added.
9134         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
9135         Added control flow analysis stuff here.
9136
9137         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
9138         resolve the expression as lvalue.
9139         (LocalVariableReference.DoResolve): Check whether the variable has
9140         already been assigned.
9141         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
9142         the parameter as assigned here.
9143         (ParameterReference.DoResolve): Check whether the parameter has already
9144         been assigned.
9145         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
9146         expression as lvalue.
9147
9148         * statement.cs (FlowBranching): New class for the flow analysis code.
9149         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
9150         (LabeledStatement.IsDefined): New public property.
9151         (LabeledStatement.AddUsageVector): New public method to tell flow
9152         analyis that the label may be reached via a forward jump.
9153         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
9154         flow analysis.
9155         (VariableInfo.Number): New public field.  This is used by flow analysis
9156         to number all locals of a block.
9157         (Block.CountVariables): New public property.  This is the number of
9158         local variables in this block (including the locals from all parent
9159         blocks).
9160         (Block.EmitMeta): Number all the variables.
9161
9162         * statement.cs: Added flow analysis support to all classes.
9163
9164 2002-07-31  Martin Baulig  <martin@gnome.org>
9165
9166         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
9167         To get debugging messages, compile mcs with /define:MCS_DEBUG and
9168         then use this argument.
9169
9170         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
9171
9172         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
9173         use this to specify /define options.
9174
9175 2002-07-29  Martin Baulig  <martin@gnome.org>
9176
9177         * statement.cs (Fixed): Moved all code that does variable lookups
9178         and resolvings from Emit to Resolve.
9179
9180         * statement.cs (For): Moved all code that does variable lookups
9181         and resolvings from Emit to Resolve.
9182
9183         * statement.cs (Using): Moved all code that does variable lookups
9184         and resolvings from Emit to Resolve.
9185
9186 2002-07-29  Martin Baulig  <martin@gnome.org>
9187
9188         * attribute.cs (Attribute.Resolve): Explicitly catch a
9189         System.NullReferenceException when creating the
9190         CustromAttributeBuilder and report a different warning message.
9191
9192 2002-07-29  Martin Baulig  <martin@gnome.org>
9193
9194         * support.cs (ParameterData.ParameterName): Added method to
9195         get the name of a parameter.
9196
9197         * typemanager.cs (TypeManager.IsValueType): New public method.
9198
9199 2002-07-29  Martin Baulig  <martin@gnome.org>
9200
9201         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
9202         is a flag which specifies that it's either ref or out.
9203         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
9204         the out parameter to `out Parameter.Modifier mod', also set the
9205         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
9206
9207         * support.cs (InternalParameters.ParameterModifier): Distinguish
9208         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9209         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9210
9211         * expression.cs (Argument.GetParameterModifier): Distinguish
9212         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9213         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9214
9215 2002-07-29  Martin Baulig  <martin@gnome.org>
9216
9217         * expression.cs (ParameterReference.ParameterReference): Added
9218         `Location loc' argument to the constructor.
9219
9220         * cs-parser.jay: Pass location to ParameterReference.
9221
9222 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
9223
9224         * statement.cs (Try): Initialize the location.
9225
9226         * cs-parser.jay: pass location to Try.
9227
9228         * expression.cs (Unary.Reduce): Change the prototype to return
9229         whether a constant fold could be performed or not.  The result is
9230         returned in an out parameters.  In the case of Indirection and
9231         AddressOf, we want to perform the full tests.
9232
9233 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
9234
9235         * statement.cs (Statement.Emit): Flag dead code.
9236
9237 2002-07-27  Andrew Birkett  <andy@nobugs.org>
9238
9239         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
9240
9241 2002-07-27  Martin Baulig  <martin@gnome.org>
9242
9243         * class.cs (MethodData.Define): Put back call to
9244         TypeManager.AddMethod(), accidentally commented this out.
9245
9246         * report.cs (Debug): New public method to print debugging information,
9247         this is `[Conditional ("DEBUG")]'.
9248
9249 2002-07-26  Martin Baulig  <martin@gnome.org>
9250
9251         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
9252         (switch_statement): Push the current_block to the switch_stack and
9253         pop it again when we're done with the switch.
9254         (switch_section): The new block is a child of the current_block.
9255         Fixes bug #24007, added test-152.cs.
9256
9257 2002-07-27  Martin Baulig  <martin@gnome.org>
9258
9259         * expression.cs (Invocation.EmitArguments): When calling a varargs
9260         function with only its fixed arguments, we need to pass an empty
9261         array.
9262
9263 2002-07-27  Martin Baulig  <martin@gnome.org>
9264
9265         Mono 0.13 has been released.
9266
9267 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
9268
9269         * driver.cs: Rename --resource to --linkres, because that is what
9270         we do currently, we dont support --resource yet.
9271
9272         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
9273
9274 2002-07-25  Martin Baulig  <martin@gnome.org>
9275
9276         * class.cs (MethodData): New public class.  This is a `method builder'
9277         class for a method or one accessor of a Property/Indexer/Event.
9278         (MethodData.GetMethodFlags): Moved here from MemberBase.
9279         (MethodData.ApplyAttributes): Likewise.
9280         (MethodData.ApplyObsoleteAttribute): Likewise.
9281         (MethodData.ApplyConditionalAttribute): Likewise.
9282         (MethodData.ApplyDllImportAttribute): Likewise.
9283         (MethodData.CheckAbstractAndExternal): Likewise.
9284         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
9285         (MethodData.Emit): Formerly known as Method.Emit().
9286         (MemberBase): Moved everything which was specific to a single
9287         accessor/method to MethodData.
9288         (Method): Create a new MethodData and call Define() and Emit() on it.
9289         (Property, Indexer, Event): Create a new MethodData objects for each
9290         accessor and call Define() and Emit() on them.
9291
9292 2002-07-25  Martin Baulig  <martin@gnome.org>
9293
9294         Made MethodCore derive from MemberBase to reuse the code from there.
9295         MemberBase now also checks for attributes.
9296
9297         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
9298         (MemberBase.GetMethodFlags): Moved here from class Method and marked
9299         as virtual.
9300         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
9301         `CallingConventions cc' and `Attributes opt_attrs' arguments.
9302         (MemberBase.ApplyAttributes): New virtual method; applies the
9303         attributes to a method or accessor.
9304         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
9305         (MemberBase.ApplyConditionalAttribute): Likewise.
9306         (MemberBase.ApplyDllImportAttribute): Likewise.
9307         (MemberBase.CheckAbstractAndExternal): Likewise.
9308         (MethodCore.ParameterTypes): This is now a property instead of a
9309         method, it's initialized from DoDefineParameters().
9310         (MethodCore.ParameterInfo): Removed the set accessor.
9311         (MethodCore.DoDefineParameters): New protected virtual method to
9312         initialize ParameterTypes and ParameterInfo.
9313         (Method.GetReturnType): We can now simply return the MemberType.
9314         (Method.GetMethodFlags): Override the MemberBase version and add
9315         the conditional flags.
9316         (Method.CheckBase): Moved some code from Define() here, call
9317         DoDefineParameters() here.
9318         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
9319         here to avoid some larger code duplication.
9320         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
9321         ensure that abstract and external accessors don't declare a body.
9322
9323         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
9324         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
9325         lookup in the attribute's parent classes, so we need to abort as soon
9326         as we found the first match.
9327         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
9328         the attribute has no arguments.
9329
9330         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
9331         of a Method.
9332
9333 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9334
9335         * cs-parser.jay: reverted previous patch.
9336
9337 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9338
9339         * cs-parser.jay: fixed bug #22119.
9340
9341 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9342
9343         * attribute.cs: fixed compilation. The error was:
9344         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
9345         be assigned to before control leaves the current method."
9346         [FIXME:  Filed as bug #28186: MCS must report this error.]
9347
9348 2002-07-25  Martin Baulig  <martin@gnome.org>
9349
9350         * attribute.cs (Attribute.Conditional_GetConditionName): New static
9351         method to pull the condition name ouf of a Conditional attribute.
9352         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
9353         the obsolete message and error flag out of an Obsolete attribute.
9354
9355         * class.cs (Method.GetMethodFlags): New public method to get the
9356         TypeManager.MethodFlags for this method.
9357         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
9358         private methods.
9359         (Method.Define): Get and apply the Obsolete and Conditional attributes;
9360         if we're overriding a virtual function, set the new private variable
9361         `parent_method'; call the new TypeManager.AddMethod().
9362
9363         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
9364         the MethodBuilder and the Method in a PtrHashtable.
9365         (TypeManager.builder_to_method): Added for this purpose.
9366         (TypeManager.MethodFlags): Added IsObsoleteError.
9367         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
9368         Obsolete and Conditional arguments in MethodBuilders.  If we discover
9369         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
9370         the message from the attribute.
9371
9372 2002-07-24  Martin Baulig  <martin@gnome.org>
9373
9374         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
9375         preprocessor directives, ensure that the argument to #define/#undef is
9376         exactly one identifier and that it's actually an identifier.
9377
9378         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
9379         did not work ....
9380
9381 2002-07-24  Martin Baulig  <martin@gnome.org>
9382
9383         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
9384         initialize it to TypeManager.object_type in the constructor.
9385         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
9386         of the `hm.get_current' method if we're using the collection pattern.
9387         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
9388         for the explicit conversion to make it work when we're using the collection
9389         pattern and the `Current' property has a different return type than `object'.
9390         Fixes #27713.
9391
9392 2002-07-24  Martin Baulig  <martin@gnome.org>
9393
9394         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
9395         does not match, but don't report any errors.  This method is called in
9396         order for all methods in a MethodGroupExpr until a matching method is
9397         found, so we don't want to bail out if the first method doesn't match.
9398         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
9399         matches, report the 123.  Fixes #28070.
9400
9401 2002-07-24  Martin Baulig  <martin@gnome.org>
9402
9403         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
9404         TypeManager.TypeToCoreType() to the top of the method so the
9405         following equality checks will work.  Fixes #28107.
9406
9407 2002-07-24  Martin Baulig  <martin@gnome.org>
9408
9409         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
9410         operand is of type uint, and the other operand is of type sbyte,
9411         short or int, the operands are converted to type long." -
9412         Actually do what this comment already told us.  Fixes bug #28106,
9413         added test-150.cs.
9414
9415 2002-07-24  Martin Baulig  <martin@gnome.org>
9416
9417         * class.cs (MethodBase): New abstract class.  This is now a base
9418         class for Property, Indexer and Event to avoid some code duplication
9419         in their Define() and DefineMethods() methods.
9420         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
9421         generic methods for Define() and DefineMethods().
9422         (FieldBase): Derive from MemberBase, not MemberCore.
9423         (Property): Derive from MemberBase, not MemberCore.
9424         (Property.DefineMethod): Moved all the code from this method to the
9425         new MethodBase.DefineAccessor(), just call it with appropriate
9426         argumetnts.
9427         (Property.Define): Call the new Property.DoDefine(), this does some
9428         sanity checks and we don't need to duplicate the code everywhere.
9429         (Event): Derive from MemberBase, not MemberCore.
9430         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
9431         accessors, this will also make them work with interface events.
9432         (Indexer): Derive from MemberBase, not MemberCore.
9433         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
9434         (Indexer.Define): Use the new MethodBase functions.
9435
9436         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
9437         argument to the constructor.
9438         (Interface.FindMembers): Added support for interface events.
9439         (Interface.PopluateEvent): Implemented.
9440
9441         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
9442
9443 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
9444
9445         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
9446         but this is required to check for a method name being the same as
9447         the containing class.  
9448
9449         Handle this now.
9450
9451 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9452
9453         * interface.cs: initialize variable.
9454
9455 2002-07-23  Martin Baulig  <martin@gnome.org>
9456
9457         Implemented the IndexerName attribute in interfaces.
9458
9459         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
9460         name if this is an explicit interface implementation.
9461         (Indexer.InterfaceIndexerName): New public variable.  If we're
9462         implementing an interface indexer, this is the IndexerName in that
9463         interface.  Otherwise, it's the IndexerName.
9464         (Indexer.DefineMethod): If we're implementing interface indexer,
9465         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
9466         and Pending.ImplementIndexer methods.
9467         (Indexer.Define): Also define the PropertyBuilder if we're
9468         implementing an interface indexer and this is neither an explicit
9469         interface implementation nor do the IndexerName match the one in
9470         the interface.
9471
9472         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
9473         If a method is defined here, then we always need to create a proxy
9474         for it.  This is used when implementing interface indexers.
9475         (Pending.IsInterfaceIndexer): New public method.
9476         (Pending.ImplementIndexer): New public method.
9477         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
9478         This is used when implementing interface indexers to define a proxy
9479         if necessary.
9480         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
9481         define a proxy if necessary.
9482
9483         * interface.cs (Interface.IndexerName): New public variable.
9484         (Interface.PopulateIndexer): Set the IndexerName.
9485         (Interface.DefineIndexers): New private method.  Populate all the
9486         indexers and make sure their IndexerNames match.
9487
9488         * typemanager.cs (IndexerPropertyName): Added support for interface
9489         indexers.
9490
9491 2002-07-22  Martin Baulig  <martin@gnome.org>
9492
9493         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
9494         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
9495         ret if HasReturnLabel.
9496         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
9497         variables.
9498
9499         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
9500         and set the ec.LoopBeginTryCatchLevel.
9501         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
9502         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
9503         the current ec.TryCatchLevel, the branch goes out of an exception
9504         block.  In this case, we need to use Leave and not Br.
9505
9506 2002-07-22  Martin Baulig  <martin@gnome.org>
9507
9508         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
9509         block unless the block does not always return or it is contained in
9510         another try { ... } catch { ... } block.  Fixes bug #26506.
9511         Added verify-1.cs to the test suite.
9512
9513 2002-07-22  Martin Baulig  <martin@gnome.org>
9514
9515         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
9516         then we do not always return.  Fixes bug #24985.
9517
9518 2002-07-22  Martin Baulig  <martin@gnome.org>
9519
9520         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
9521         lookup on a per-class level; ie. walk up the class hierarchy until we
9522         found at least one applicable method, then choose the best among them.
9523         Fixes bug #24463 and test-29.cs.
9524
9525 2002-07-22  Martin Baulig  <martin@gnome.org>
9526
9527         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
9528         return types of the methods.  The return type is not part of the
9529         signature and we must not check it to make the `new' modifier work.
9530         Fixes bug #27999, also added test-147.cs.
9531         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
9532
9533         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
9534         on the method's return type.
9535
9536 2002-07-21  Martin Baulig  <martin@gnome.org>
9537
9538         * assign.cs: Make this work if the rightmost source is a constant and
9539         we need to do an implicit type conversion.  Also adding a few more tests
9540         to test-38.cs which should have caught this.
9541
9542         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
9543         target in the makefile for this.  The makefile.gnu is primarily intended
9544         for end-users who don't want to debug the compiler.
9545
9546 2002-07-21  Martin Baulig  <martin@gnome.org>
9547
9548         * assign.cs: Improved the Assign class so it can now handle embedded
9549         assignments (X = Y = Z = something).  As a side-effect this'll now also
9550         consume less local variables.  test-38.cs now passes with MCS, added
9551         a few new test cases to that test.
9552
9553 2002-07-20  Martin Baulig  <martin@gnome.org>
9554
9555         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
9556         instructions.  Fixes bug #27977, also added test-146.cs.
9557
9558 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9559
9560         * cs-tokenizer.cs: fixed getHex ().
9561
9562 2002-07-19  Martin Baulig  <martin@gnome.org>
9563
9564         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
9565         not Type.GetType() to lookup the array type.  This is needed when
9566         we're constructing an array of a user-defined type.
9567         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
9568         single-dimensional arrays, but also for single-dimensial arrays of
9569         type decimal.
9570
9571 2002-07-19  Martin Baulig  <martin@gnome.org>
9572
9573         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
9574         this function is called, it's not allowed to share LocalBuilders
9575         among ILGenerators.
9576
9577 2002-07-19  Martin Baulig  <martin@gnome.org>
9578
9579         * expression.cs (Argument.Resolve): Report an error 118 when trying
9580         to pass a type as argument.
9581
9582 2002-07-18  Martin Baulig  <martin@gnome.org>
9583
9584         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9585         Conv_R_Un for the signed `long' type.
9586
9587 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9588
9589         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9590         `expr' for the temporary result, as that will fail if we do
9591         multiple resolves on the same expression.
9592
9593 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9594
9595         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9596         ec.TypeContainer for looking up aliases. 
9597
9598         * class.cs (TypeContainer): Remove LookupAlias from here.
9599
9600         * decl.cs (DeclSpace); Move here.
9601
9602 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9603
9604         * class.cs (FindMembers): Only call filter if the constructor
9605         bulider is not null.
9606
9607         Also handle delegates in `NestedTypes' now.  Now we will perform
9608         type lookups using the standard resolution process.  This also
9609         fixes a bug.
9610
9611         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9612         This uses Expressions (the limited kind that can be parsed by the
9613         tree) instead of strings.
9614
9615         * expression.cs (ComposedCast.ToString): Implement, used to flag
9616         errors since now we have to render expressions.
9617
9618         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9619         FormArrayType. 
9620
9621         * ecore.cs (SimpleName.ToString): ditto.
9622
9623         * cs-parser.jay: Instead of using strings to assemble types, use
9624         Expressions to assemble the type (using SimpleName, ComposedCast,
9625         MemberAccess).  This should fix the type lookups in declarations,
9626         because we were using a different code path for this.
9627
9628         * statement.cs (Block.Resolve): Continue processing statements
9629         even when there is an error.
9630
9631 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * class.cs (Event.Define): Also remove the `remove' method from
9634         the list of pending items.
9635
9636         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9637         generate more compact code. 
9638
9639 2002-07-17  Martin Baulig  <martin@gnome.org>
9640
9641         * const.cs (Const.LookupConstantValue): Add support for constant
9642         `unchecked' and `checked' expressions.
9643         Also adding test case test-140.cs for this.
9644
9645 2002-07-17  Martin Baulig  <martin@gnome.org>
9646
9647         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9648         check whether mi.ReturnType implements the IEnumerator interface; the
9649         `==' and the IsAssignableFrom() will fail in this situation.
9650
9651 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9652
9653         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9654         here too.
9655
9656 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9657
9658         * expression.cs: fixed bug #27811.
9659
9660 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9663         Molaro: when we are a ref, the value already contains a pointer
9664         value, do not take the address of it.
9665
9666 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9667         * removed mb-parser.jay and mb-tokenizer.cs
9668
9669 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9670
9671         * expression.cs: check against the building corlib void type.
9672
9673 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9674
9675         * ecore.cs: fix for valuetype static readonly fields: when 
9676         initializing them, we need their address, not the address of a copy.
9677
9678 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9679
9680         * typemanager.cs: register also enum_type in corlib.
9681
9682 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9683
9684         * class.cs: allow calling this (but not base) initializers in structs.
9685
9686 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9687
9688         * ecore.cs: make sure we compare against the building base types
9689         in GetTypeSize ().
9690
9691 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9692
9693         * typemanager.cs: fix TypeToCoreType() to handle void and object
9694         (corlib gets no more typerefs after this change).
9695
9696 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * expression.cs (ArrayCreation.EmitArrayArguments): use
9699         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9700
9701         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9702         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9703         array indexes, the runtime actually forbids them.
9704
9705         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9706         for array arguments here.
9707
9708         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9709         instead of the default for ValueTypes.
9710
9711         (New.DoEmit): Use IsValueType instead of
9712         IsSubclassOf (value_type)
9713         (New.DoResolve): ditto.
9714         (Invocation.EmitCall): ditto.
9715
9716         * assign.cs (Assign): ditto.
9717
9718         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9719         Statements *are* currently doing part of their resolution during
9720         Emit.  
9721
9722         Expressions do always resolve during resolve, but statements are
9723         only required to propagate resolution to their children.
9724
9725 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9726
9727         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9728
9729         (LoadAssembly): Do not add the dll if it is already specified
9730
9731         (MainDriver): Add the System directory to the link path at the end,
9732         after all the other -L arguments. 
9733
9734         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9735         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9736         ldelem.u1) and using the opposite for sbytes.
9737
9738         This fixes Digger, and we can finally run it.
9739
9740         * driver.cs (UnixParseOption): Move the option parsing here.  
9741         (CSCParseOption): Implement CSC-like parsing of options.
9742
9743         We now support both modes of operation, the old Unix way, and the
9744         new CSC-like way.  This should help those who wanted to make cross
9745         platform makefiles.
9746
9747         The only thing broken is that /r:, /reference: and /lib: are not
9748         implemented, because I want to make those have the same semantics
9749         as the CSC compiler has, and kill once and for all the confussion
9750         around this.   Will be doing this tomorrow.
9751
9752         * statement.cs (Unsafe.Resolve): The state is checked during
9753         resolve, not emit, so we have to set the flags for IsUnsfe here.
9754
9755 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9756
9757         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9758         not catch the Error_ObjectRefRequired in SimpleName (as it is
9759         possible to have a class/instance variable name that later gets
9760         deambiguated), we have to check this here.      
9761
9762 2002-07-10  Ravi Pratap  <ravi@ximian.com>
9763
9764         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
9765         make static and put into Expression.
9766
9767         (Event.Define): Register the private field of the event with the 
9768         TypeManager so that GetFieldFromEvent can get at it.
9769
9770         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
9771         keep track of the private field associated with an event which
9772         has no accessors.
9773
9774         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
9775         private field.
9776
9777         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
9778
9779 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9780
9781         * expression.cs (Binary.EmitBranchable): this routine emits the
9782         Binary expression in a branchable context.  This basically means:
9783         we need to branch somewhere, not just get the value on the stack.
9784
9785         This works together with Statement.EmitBoolExpression.
9786
9787         * statement.cs (Statement.EmitBoolExpression): Use
9788         EmitBranchable. 
9789
9790 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
9791
9792         * statement.cs (For): Reduce the number of jumps in loops.
9793
9794         (For): Implement loop inversion for the For statement.
9795
9796         (Break): We can be breaking out of a Try/Catch controlled section
9797         (foreach might have an implicit try/catch clause), so we need to
9798         use Leave instead of Br.
9799
9800         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
9801         now).  If the instace expression supports IMemoryLocation, we use
9802         the AddressOf method from the IMemoryLocation to extract the
9803         address instead of emitting the instance.
9804
9805         This showed up with `This', as we were emitting the instance
9806         always (Emit) instead of the Address of This.  Particularly
9807         interesting when This is a value type, as we dont want the Emit
9808         effect (which was to load the object).
9809
9810 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
9811
9812         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
9813
9814         * statement.cs (Checked): Set the CheckedState during the resolve
9815         process too, as the ConvCast operations track the checked state on
9816         the resolve process, and not emit.
9817
9818         * cs-parser.jay (namespace_member_declaration): Flag that we have
9819         found a declaration when we do.  This is used to flag error 1529
9820
9821         * driver.cs: Report ok when we display the help only.
9822
9823 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
9824
9825         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
9826
9827 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cs-tokenizer.cs (define): We also have to track locally the
9830         defines.  AllDefines is just used for the Conditional Attribute,
9831         but we also need the local defines for the current source code. 
9832
9833 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
9834
9835         * statement.cs (While, For, Do): These loops can exit through a
9836         Break statement, use this information to tell whether the
9837         statement is the last piece of code.
9838
9839         (Break): Flag that we break.
9840
9841         * codegen.cs (EmitContexts): New `Breaks' state variable.
9842
9843 2002-07-03  Martin Baulig  <martin@gnome.org>
9844
9845         * class.cs (TypeContainer.MethodModifiersValid): Allow override
9846         modifiers in method declarations in structs.  Otherwise, you won't
9847         be able to override things like Object.Equals().
9848
9849 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9850
9851         * class.cs (Method, Property, Indexer): Do not allow the public
9852         modifier to be used in explicit interface implementations.
9853
9854         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
9855         override modifiers in method declarations in structs
9856
9857 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
9858
9859         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
9860         integer or real overflow, report an error
9861
9862 2002-07-02  Martin Baulig  <martin@gnome.org>
9863
9864         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
9865         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
9866         to tell the runtime about our newly created System.Object and
9867         System.ValueType types.
9868
9869 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9870
9871         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
9872         struct instead of Ldarg/Starg.
9873
9874 2002-07-02  Martin Baulig  <martin@gnome.org>
9875
9876         * expression.cs (Indirection.Indirection): Call
9877         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
9878
9879 2002-07-02  Martin Baulig  <martin@gnome.org>
9880
9881         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
9882         ValueType, call TypeManager.TypeToCoreType() on it.
9883         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
9884         the OpCodes.Newarr argument.
9885
9886 2002-07-02  Martin Baulig  <martin@gnome.org>
9887
9888         * expression.cs (Invocation.EmitCall): When compiling corlib,
9889         replace all calls to the system's System.Array type to calls to
9890         the newly created one.
9891
9892         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
9893         System.Array methods.
9894         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
9895         from the system's System.Array type which must be replaced.
9896
9897 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
9898
9899         * typemanager.cs: load unverifiable_code_ctor so we can build
9900         corlib using the correct type. Avoid using GetTypeCode() with
9901         TypeBuilders.
9902         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
9903         TypeManager.object_type to allow building corlib.
9904
9905 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
9906
9907         * ecore.cs: handle System.Enum separately in LoadFromPtr().
9908
9909 2002-07-01  Martin Baulig  <martin@gnome.org>
9910
9911         * class.cs: Make the last change actually work, we need to check
9912         whether `ifaces != null' to avoid a crash.
9913
9914 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9915
9916         * class.cs: when we build structs without fields that implement
9917         interfaces, we need to add the interfaces separately, since there is
9918         no API to both set the size and add the interfaces at type creation
9919         time.
9920
9921 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9922
9923         * expression.cs: the dimension arguments to the array constructors
9924         need to be converted if they are a long.
9925
9926 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
9927
9928         * class.cs: don't emit ldarg.0 if there is no parent constructor
9929         (fixes showstopper for corlib).
9930
9931 2002-06-29  Martin Baulig  <martin@gnome.org>
9932
9933         MCS now compiles corlib on GNU/Linux :-)
9934
9935         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
9936         ie. check for MethodImplOptions.InternalCall.
9937
9938         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
9939         and TypeManager.attribute_type are null, so we must explicitly check
9940         whether parent is not null to find out whether it's an attribute type.
9941         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
9942         and SetBuilder, not only if the property is neither abstract nor external.
9943         This is necessary to set the MethodImplOptions on the accessor methods.
9944         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
9945         SetBuilder, see Property.Emit().
9946
9947         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
9948         populate "System.Object", "System.ValueType" and "System.Attribute" since
9949         they've already been populated from BootCorlib_PopulateCoreTypes().
9950
9951 2002-06-29  Martin Baulig  <martin@gnome.org>
9952
9953         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
9954         is the NullLiteral, we also need to make sure that target_type is not
9955         an enum type.   
9956
9957 2002-06-29  Martin Baulig  <martin@gnome.org>
9958
9959         * rootcontext.cs (RootContext.ResolveCore): We must initialize
9960         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
9961         before calling BootstrapCorlib_ResolveDelegate ().
9962
9963 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9964
9965         * statement.cs: fixed build-breaker. All tests passed ok.
9966
9967 2002-06-27  Martin Baulig  <martin@gnome.org>
9968
9969         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
9970         for System.Decimal when compiling corlib.
9971
9972 2002-06-27  Martin Baulig  <martin@gnome.org>
9973
9974         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
9975         switch blocks which contain nothing but a default clause.
9976
9977 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
9978
9979        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
9980
9981 2002-06-27  Martin Baulig  <martin@gnome.org>
9982
9983         * ecore.cs (PropertyExpr.PropertyExpr): Call
9984         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
9985
9986         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
9987         is already a TypeBuilder.
9988
9989 2002-06-27  Martin Baulig  <martin@gnome.org>
9990
9991         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
9992         `target_type == TypeManager.array_type', not IsAssignableFrom() in
9993         the "from an array-type to System.Array" case.  This makes it work
9994         when compiling corlib.
9995
9996 2002-06-27  Martin Baulig  <martin@gnome.org>
9997
9998         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
9999         non-static PropertyExpr, set its InstanceExpression.  This makes
10000         the `ICollection.Count' property work in System/Array.cs.
10001
10002 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
10003
10004         * driver.cs: Made error handling more consistent.  Errors now
10005         tracked by Report class, so many methods which used to return int
10006         now return void.  Main() now prints success/failure and 
10007         errors/warnings message.
10008
10009         Renamed '--probe' compiler argument to '--expect-error'.  Removed
10010         the magic number return values (123 and 124).  Now, if the
10011         expected error occurs, the compiler exits with success (exit value
10012         0).  If the compilation completes without seeing that particular
10013         error, the compiler exits with failure (exit value 1).  The
10014         makefile in mcs/errors has been changed to handle the new behaviour.
10015
10016         * report.cs: Made 'expected error' number a property and renamed
10017         it from 'Probe' to 'ExpectedError'.
10018
10019         * genericparser.cs: Removed error handling support, since it is
10020         now all done by Report class.
10021
10022         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
10023         class, so parse() no longer returns an int.
10024
10025         * namespace.cs: Use Report.Error instead of GenericParser.error
10026
10027 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
10030         TypeContainer.AddOperator): At the front of the list put the
10031         explicit implementations, so they get resolved/defined first. 
10032
10033 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
10034
10035         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
10036         interface type is implemented by this TypeContainer.  Used during
10037         explicit interface implementation.
10038
10039         (Property.Define, Indexer.Define, Method.Define): Validate that
10040         the given interface in the explicit implementation is one of the
10041         base classes for the containing type.
10042
10043         Also if we are explicitly implementing an interface, but there is
10044         no match in the pending implementation table, report an error.
10045
10046         (Property.Define): Only define the property if we are
10047         not explicitly implementing a property from an interface.  Use the
10048         correct name also for those properties (the same CSC uses,
10049         although that is really not needed).
10050
10051         (Property.Emit): Do not emit attributes for explicitly implemented
10052         properties, as there is no TypeBuilder.
10053
10054         (Indexer.Emit): ditto.
10055
10056         Hiding then means that we do not really *implement* a pending
10057         implementation, which makes code fail.
10058
10059 2002-06-22  Martin Baulig  <martin@gnome.org>
10060
10061         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
10062         the return value of Object.GetType().  [FIXME: we need to do this whenever
10063         we get a type back from the reflection library].
10064
10065 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
10066
10067         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
10068
10069 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
10070
10071         * attribute.cs: Return null if we can not look up the type.
10072
10073         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
10074         the interface types found.
10075
10076         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
10077         interface types found.
10078
10079         * typemanager.cs (GetInterfaces): Make this routine returns alll
10080         the interfaces and work around the lame differences between
10081         System.Type and System.Reflection.Emit.TypeBuilder in the results
10082         result for GetInterfaces.
10083
10084         (ExpandInterfaces): Given an array of interface types, expand and
10085         eliminate repeated ocurrences of an interface.  This expands in
10086         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
10087         be IA, IB, IC.
10088
10089 2002-06-21  Martin Baulig  <martin@gnome.org>
10090
10091         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
10092         on System.Enum.
10093
10094 2002-06-21  Martin Baulig  <martin@gnome.org>
10095
10096         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
10097         and called with one of the core types, return the corresponding typebuilder for
10098         that type.
10099
10100         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
10101         element type.
10102
10103 2002-06-21  Martin Baulig  <martin@gnome.org>
10104
10105         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
10106         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
10107         (Expression.ConvertReferenceExplicit): Likewise.
10108
10109         * expression.cs (ElementAccess.DoResolve): Likewise.
10110         (ElementAccess.DoResolveLValue): Likewise.
10111
10112 2002-06-10  Martin Baulig  <martin@gnome.org>
10113
10114         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
10115         add the "value" parameter to the parameter list.
10116
10117         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
10118         to our caller.
10119
10120 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
10121
10122         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
10123         the argument to an int, uint, long or ulong, per the spec.  Also
10124         catch negative constants in array creation.
10125
10126 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
10127
10128         * class.cs: do not allow the same interface to appear twice in
10129         the definition list.
10130
10131 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
10132
10133         * ecore.cs: don't use ldlen with System.Array.
10134
10135 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
10136
10137         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
10138
10139 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
10140
10141         * modifiers.cs: produce correct field attributes for protected
10142         internal. Easy fix so miguel can work on ther harder stuff:-)
10143
10144 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
10145
10146         * pending.cs: New file.  Move the code from class.cs here.
10147         Support clearning the pending flag for all methods (when not doing
10148         explicit interface implementation).
10149
10150 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
10151
10152         * rootcontext.cs: added a couple more types needed to bootstrap.
10153
10154 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
10155
10156         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
10157         constructor in the type, instead of any constructor in the type
10158         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
10159         a bug in the Mono runtime when applying the params attribute). 
10160
10161 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
10162         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
10163
10164 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
10165
10166         * expression.cs (Unary.ResolveOperator): Use TypeManager
10167         to resolve the type.
10168
10169 2002-06-13  Ravi Pratap  <ravi@ximian.com>
10170
10171         * cs-parser.jay (enum_member_declaration): Pass in the attributes
10172         attached.
10173
10174         * enum.cs (AddEnumMember): Add support to store the attributes associated 
10175         with each member too.
10176
10177         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
10178         field builders too - this takes care of the enum member case.
10179
10180 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
10181
10182         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
10183         address-of operator on both value types and pointers.
10184
10185 2002-06-10  Martin Baulig  <martin@gnome.org>
10186
10187         * interface.cs (Interface.PopulateIndexer): Add the indexer's
10188         PropertyBuilder to the `property_builders' list.
10189
10190         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
10191         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
10192         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
10193         find any indexers which are inherited from an interface.
10194
10195 2002-06-09  Martin Baulig  <martin@gnome.org>
10196
10197         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
10198         the same type as the constant if necessary.  There's also a test-130.cs
10199         for this.
10200
10201         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
10202
10203         * typemanager.cs (TypeManager.ChangeType): Previously known as
10204         Enum.ChangeEnumType().
10205
10206 2002-06-09  Martin Baulig  <martin@gnome.org>
10207
10208         * expression.cs (Cast.TryReduce): Added support for consts.
10209
10210 2002-06-08  Ravi Pratap  <ravi@ximian.com>
10211
10212         * class.cs (Accessor): Hold attributes information so we can pass
10213         it along.
10214
10215         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
10216         Modify to pass in attributes attached to the methods.
10217
10218         (add_accessor_declaration, remove_accessor_declaration): Ditto.
10219
10220         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
10221         to handle the Accessor kind :-)
10222
10223         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
10224
10225 2002-06-08  Martin Baulig  <martin@gnome.org>
10226
10227         * expression.cs (Unary.TryReduceNegative): Added support for
10228         ULongConstants.
10229
10230 2002-06-08  Martin Baulig  <martin@gnome.org>
10231
10232         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
10233         name can't be found in the `defined_names' - the caller will do a
10234         MemberLookup in this case and thus find methods in System.Enum
10235         such as Enum.IsDefined().
10236
10237 2002-06-08  Martin Baulig  <martin@gnome.org>
10238
10239         * enum.cs (Enum.ChangeEnumType): This is a custom version of
10240         Convert.ChangeType() which works with TypeBuilder created types.
10241         (Enum.LookupEnumValue, Enum.Define): Use it here.
10242
10243         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
10244         `TypeBuilder.BaseType != null' check.
10245         (TypeContainer.FindMembers): Only lookup parent members if we
10246         actually have a parent.
10247         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
10248         (ConstructorInitializer.Resolve): Likewise.
10249
10250         * interface.cs (Interface.FindMembers): Added
10251         `TypeBuilder.BaseType != null' check.
10252
10253         * rootcontext.cs (RootContext.ResolveCore): Added
10254         "System.Runtime.CompilerServices.IndexerNameAttribute" to
10255         classes_second_stage.
10256
10257         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
10258         debug_type and trace_type when compiling with --nostdlib.       
10259
10260 2002-06-07  Martin Baulig  <martin@gnome.org>
10261
10262         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
10263         (AddField): Set it to true when adding a non-static field.
10264         (DefineType): Use `have_nonstatic_fields' to find out whether we
10265         have non-static fields, not `Fields != null'.
10266
10267 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
10270         dereferencing a null on the static-field code path)
10271
10272 2002-05-30  Martin Baulig  <martin@gnome.org>
10273
10274         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
10275         to take command line arguments.  Use reflection to call the new
10276         custom `Initialize' function on the symbol writer and pass it the
10277         command line arguments.
10278
10279         * driver.cs (--debug-args): New command line argument to pass command
10280         line arguments to the symbol writer.
10281
10282 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * assign.cs (DoResolve): Forgot to do the implicit conversion to
10285         the target type for indexers and properties.  Thanks to Joe for
10286         catching this.
10287
10288 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
10289
10290         * typemanager.cs (MethodFlags): returns the method flags
10291         (Obsolete/ShouldIgnore) that control warning emission and whether
10292         the invocation should be made, or ignored. 
10293
10294         * expression.cs (Invocation.Emit): Remove previous hack, we should
10295         not do this on matching a base type, we should do this based on an attribute
10296
10297         Only emit calls to System.Diagnostics.Debug and
10298         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
10299         on the command line.
10300
10301         * rootcontext.cs: Global settings for tracing and debugging.
10302
10303         * cs-tokenizer.cs (define): New utility function to track
10304         defines.   Set the global settings for TRACE and DEBUG if found.
10305
10306 2002-05-25  Ravi Pratap  <ravi@ximian.com>
10307
10308         * interface.cs (Populate*): Pass in the TypeContainer as well as
10309         the DeclSpace as parameters so that we can create EmitContexts and
10310         then use that to apply attributes etc.
10311
10312         (PopulateMethod, PopulateEvent, PopulateProperty)
10313         (PopulateIndexer): Apply attributes everywhere.
10314
10315         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
10316         etc.
10317
10318         (ApplyAttributes): Update accordingly.
10319
10320         We now apply interface attributes for all members too.
10321
10322 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
10323
10324         * class.cs (Indexer.Define); Correctly check if we are explicit
10325         implementation (instead of checking the Name for a ".", we
10326         directly look up if the InterfaceType was specified).
10327
10328         Delay the creation of the PropertyBuilder.
10329
10330         Only create the PropertyBuilder if we are not an explicit
10331         interface implementation.   This means that explicit interface
10332         implementation members do not participate in regular function
10333         lookups, and hence fixes another major ambiguity problem in
10334         overload resolution (that was the visible effect).
10335
10336         (DefineMethod): Return whether we are doing an interface
10337         implementation. 
10338
10339         * typemanager.cs: Temporary hack until we get attributes in
10340         interfaces (Ravi is working on that) and we get IndexerName
10341         support in interfaces.
10342
10343         * interface.cs: Register the indexers as properties.
10344
10345         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
10346         warning, I have verified that this is a bug in the .NET runtime
10347         (JavaScript suffers of the same problem).
10348
10349         * typemanager.cs (MemberLookup): When looking up members for
10350         interfaces, the parent of an interface is the implicit
10351         System.Object (so we succeed in searches of Object methods in an
10352         interface method invocation.  Example:  IEnumerable x;  x.ToString
10353         ()) 
10354
10355 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
10356
10357         * class.cs (Event): Events should also register if they do
10358         implement the methods that an interface requires.
10359
10360         * typemanager.cs (MemberLookup); use the new GetInterfaces
10361         method. 
10362
10363         (GetInterfaces): The code used to lookup interfaces for a type is
10364         used in more than one place, factor it here. 
10365
10366         * driver.cs: Track the errors at the bottom of the file, we kept
10367         on going.
10368
10369         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
10370         instance if the method we are calling is static!
10371
10372 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
10373
10374         * attribute.cs (ApplyAttributes): Make this function filter out
10375         the IndexerName attribute (as that attribute in reality is never
10376         applied) and return the string constant for the IndexerName
10377         attribute. 
10378
10379         * class.cs (TypeContainer.Emit): Validate that all the indexers
10380         have the same IndexerName attribute, and if so, set the
10381         DefaultName attribute on the class. 
10382
10383         * typemanager.cs: The return value might contain other stuff (not
10384         only methods).  For instance, consider a method with an "Item"
10385         property and an Item method.
10386
10387         * class.cs: If there is a problem with the parameter types,
10388         return. 
10389
10390 2002-05-24  Ravi Pratap  <ravi@ximian.com>
10391
10392         * ecore.cs (ImplicitConversionExists): Wrapper function which also
10393         looks at user defined conversion after making a call to 
10394         StandardConversionExists - we need this for overload resolution.
10395
10396         * expression.cs : Update accordingly the various method calls.
10397
10398         This fixes 2 bugs filed against implicit user defined conversions 
10399
10400 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
10401
10402         * statement.cs: Track the result of the assignment.
10403
10404 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
10405
10406         * expression.cs (MemberAccess): Improved error reporting for
10407         inaccessible members.
10408
10409 2002-05-22  Martin Baulig  <martin@gnome.org>
10410
10411         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
10412         itself with debugging support.
10413
10414 2002-05-22  Martin Baulig  <martin@gnome.org>
10415
10416         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
10417         Removed, this isn't needed anymore.
10418
10419 2002-05-20  Martin Baulig  <martin@gnome.org>
10420
10421         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
10422         be underlying type for an enum.
10423
10424 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
10427         that splits out the loading of just the core types.
10428
10429         * rootcontext.cs (ResolveCore): Split the struct resolution in
10430         two, so we can load the enumeration underlying types before any
10431         enums are used.
10432
10433         * expression.cs (Is): Bandaid until we fix properly Switch (see
10434         bug #24985 for details).
10435
10436         * typemanager.cs (ImplementsInterface): The hashtable will contain
10437         a null if there are no interfaces implemented.
10438
10439 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * cs-parser.jay (indexer_declarator): It is fine to have array
10442         parameters
10443
10444 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10445
10446         * typemanager.cs: (RegisterBuilder): New function used to register
10447         TypeBuilders that implement interfaces.  Since
10448         TypeBuilder.GetInterfaces (as usual) does not work with lame
10449         Reflection.Emit. 
10450         (AddUserType): register interfaces.
10451
10452         (ImplementsInterface): Use the builder_to_ifaces hash if we are
10453         dealing with TypeBuilder.  Also, arrays are showing up as
10454         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
10455         methods can not be invoked on them!
10456
10457         * ecore.cs (ExplicitReferenceConversionExists): Made public.
10458         (ImplicitReferenceConversionExists): Split out from
10459         StandardConversionExists. 
10460
10461         * expression.cs (As): We were only implementing one of the three
10462         cases for the as operator.  We now implement them all.
10463         (Is): Implement the various other cases for Is as well.
10464
10465         * typemanager.cs (CACHE): New define used to control if we want or
10466         not the FindMembers cache.  Seems to have a negative impact on
10467         performance currently
10468
10469         (MemberLookup): Nested types have full acess to
10470         enclosing type members
10471
10472         Remove code that coped with instance/static returns for events, we
10473         now catch this in RealFindMembers.
10474
10475         (RealFindMembers): only perform static lookup if the instance
10476         lookup did not return a type or an event.  
10477
10478 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10479
10480         * assign.cs (CompoundAssign): We pass more semantic information
10481         now to Compound Assignments than we did before: now we have all
10482         the information at hand, and now we resolve the target *before* we
10483         do the expression expansion, which allows the "CacheValue" method
10484         to have the effect we intended (before, a [x] += 1 would generate
10485         two differen ArrayAccess expressions from the ElementAccess,
10486         during the resolution process).
10487
10488         (CompoundAssign.DoResolve): Resolve target and original_source here.
10489
10490 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * expression.cs (ArrayAccess): dropped debugging information. 
10493
10494         * typemanager.cs: Small bug fix: I was always returning i_members,
10495         instead of one of i_members or s_members (depending on which had
10496         the content).
10497
10498         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
10499         method is invoked before any code generation takes place, and it
10500         is a mechanism to inform that the expression will be invoked more
10501         than once, and that the method should use temporary values to
10502         avoid having side effects
10503
10504         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
10505
10506         * ecore.cs (Expression.CacheTemporaries): Provide empty default
10507         implementation.
10508
10509         * expression.cs (Indirection, ArrayAccess): Add support for
10510         CacheTemporaries in these two bad boys. 
10511
10512         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
10513         ldobj or ldind_ref.  
10514         (StoreFromPtr): Handle stobj as well.
10515
10516         * expression.cs (UnaryMutator): Share more code.
10517
10518         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
10519         down: I was not tracking the Filter function as well, which
10520         was affecting the results of the cache.
10521
10522 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * attribute.cs: Remove the hack to handle the CharSet property on
10525         StructLayouts. 
10526
10527 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * attribute.cs (DoResolve): More uglyness, we now only try to
10530         resolve the attribute partially, to extract the CharSet
10531         information (only if we are a StructLayout attribute).  Otherwise 
10532
10533         (GetExtraTypeInfo): Add some code to conditionally kill in the
10534         future this.   I am more and more convinced that the .NET
10535         framework has special code to handle the attribute setting on
10536         certain elements.
10537
10538         * expression.cs (IsParamsMethodApplicable): Revert my previous
10539         foreach change here, it was wrong.
10540
10541 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
10542
10543         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
10544         (pp_expr): do not abort on unknown input, just return.
10545         (eval): abort if there are pending chars.
10546
10547         * attribute.cs (Attribute.Resolve): Positional parameters are
10548         optional.  Deal with that case.
10549
10550         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
10551         the Ansi/Unicode/Auto information for the type.
10552
10553         (TypeContainer.DefineType): instantiate the EmitContext here, as
10554         we will be using it during the type definition (to resolve
10555         attributes) and during the emit phase.
10556
10557         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
10558         to pull type information out of the attributes
10559
10560         (Attribute.Resolve): track the constructor builder, and allow for
10561         multiple invocations (structs and classes will use this).
10562
10563         * ecore.cs (MemberLookupFinal): new version with all the
10564         parameters customizable.
10565
10566         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
10567         constructors.  Return if the result value is null (as the error
10568         would have been flagged already by MemberLookupFinal)
10569
10570         Do not allow instances of abstract classes or interfaces to be
10571         created.
10572
10573         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
10574         We have to compare the assembly property here when dealing with
10575         FamANDAssem and Assembly access modifiers, because we might be
10576         creating an assembly from *modules* (that means that we are not
10577         getting TypeBuilders for types defined in other modules that are
10578         part of this assembly).
10579
10580         (Method.Emit): If the method is marked abstract and has a body,
10581         emit an error. 
10582
10583         (TypeContainer.DefineMembers): If both the defined member and the
10584         parent name match are methods, then do not emit any warnings: let
10585         the Method.Define routine take care of flagging warnings.  But if
10586         there is a mismatch (method overrides something else, or method is
10587         overriwritten by something, then emit warning).
10588
10589         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10590         set to null, this means `do not check for the return type on the
10591         signature'. 
10592
10593         (Method.Define): set the return type for the method signature to
10594         null, so that we get methods with the same name and parameters and
10595         different return types.  This is used to flag warning 114 (you are
10596         hiding a method, and you probably want to use the new/override
10597         keywords instead).
10598
10599         * typemanager.cs (MemberLookup): Implemented proper access
10600         control, closing a long standing set of bug reports.  The problem
10601         was that the Framework only has two bits: Public and NonPublic,
10602         and NonPublic includes private and protected methods, but we need
10603         to enforce the FamANDAssem, FamOrAssem and Family. 
10604
10605 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10606
10607         * statement.cs (GotoCase): Return true: Ammounts to giving up
10608         knowledge on whether we return or not, and letting the other case
10609         be responsible for it.
10610
10611 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * driver.cs: Do not load directories for each file processed, only
10614         do it if there is a pattern.
10615
10616         * ecore.cs: Report readonly assigns here as well, as we might have
10617         been resolved only by MemberAccess.
10618
10619         (SimpleName.SimpleNameResolve): Also be useful for LValue
10620         resolution.   We need this to propagate assign to local readonly variables
10621
10622         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10623         do not want to reuse potential criteria memory.
10624
10625         * class.cs (MyEventBuilder): Set reflected_type;
10626
10627         * ecore.cs (Constantify): Added support for constifying bools.
10628
10629         (RootContext.LookupType): Added a cache for values looked up in
10630         the declaration space.
10631
10632         * typemanager.cs (FindMembers): Now is a front-end to
10633         RealFindMembers, and provides a two-level hashtable-based cache to
10634         the request.  
10635
10636         15% performance improvement: from 22.5 to 19.2 seconds.
10637
10638         * expression.cs (IsParamsMethodApplicable): use foreach.
10639         (Invocation.DoResolve): ditto.
10640         (New.DoResolve): ditto.
10641         (ArrayCreation.DoResolve): ditto.
10642
10643         * ecore.cs (FindMostEncompassingType): use foreach.
10644
10645         * delegate.cs (NewDelegate.DoResolve): Use foreach
10646
10647         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10648         (RemoveMethods): use foreach.
10649
10650         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10651         nested foreach statements instead of for, and also break out of
10652         the inner loop once a match is found.
10653
10654         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10655
10656 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10659         we actually unwrap the expression to allow for extra information
10660         to be extracted. 
10661
10662         * expression.cs: Use Shr_Un on unsigned operations. 
10663
10664 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10665
10666         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10667         applicable operators was not being considered correctly. This closes
10668         the bug Miguel reported.
10669
10670 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10671
10672         * attribute.cs: check that the type derives from System.Attribute
10673         and report the correct error in that case (moved the duplicate code to
10674         its own method, too).
10675
10676 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10677
10678         * attribute.cs: lookup attribute type name as the spec says: first the
10679         bare attribute name and then name + "Attribute" (nant compiles with
10680         mcs after this fix).
10681
10682 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10685         Because of the way we parse things, we should try to see if a
10686         UIntConstant can fit in an integer.
10687
10688 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10689
10690         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10691         when we are in an explicit context.
10692
10693         (ConvertReferenceExplicit): When converting from Iface type S to Class
10694         T make sure the rules are implemented as an OR.
10695
10696         * parameter.cs (ParameterType): Make it a property for now although the
10697         purpose really isn't anything immediate.
10698
10699         * expression.cs (Is*Applicable): Do better checking on the parameter type
10700         of a ref/out parameter. The ones from the system assemblies are already 
10701         marked with the correct type so we don't need to do any correction.
10702
10703         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10704         the object type is standard too so include that.
10705
10706 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10707
10708         * ecore.cs (StandardConversionExists): Augment with missing code:
10709         deal with IntConstant, LongConstants and Enumerations.
10710
10711         * assign.cs: Report the error, instead of failing silently
10712
10713         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10714         typecontainer that they are declared, because the
10715         typecontainer/namespace will have the list of using clauses that
10716         need to be applied.
10717
10718         Assembly Attributes were escaping the normal registration
10719         mechanism. 
10720
10721         (EmitCode): Apply attributes within an EmitContext that represents
10722         the container they were declared on.
10723
10724         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10725
10726 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10727
10728         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10729         Revamp completely - make much cleaner as we now operate only
10730         on a set of Types.
10731
10732         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10733         to implement the logic detailed in the spec more correctly.
10734
10735         (UserDefinedConversion): Update accordingly.
10736
10737 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10738
10739         * statement.cs: Return flow analysis information up.
10740
10741         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10742         and the default.
10743
10744         (token): Do not consume an extra character before calling
10745         decimal_digits.
10746
10747 2002-05-06  Piers Haken <piersh@friskit.com>
10748
10749         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10750
10751 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10752
10753         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10754         EmitContext during the instance constructor initializer
10755         resolution, to stop access to instance variables.
10756
10757         This is mandated by the spec, last paragraph of the `constructor
10758         initializers' section. 
10759
10760 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
10761
10762         * cs-parser.jay, class.cs (Accessor): new class used to represent
10763         an accessor (get or set).  In the past we used `null' to represent
10764         a missing accessor.  But this is ambiguous because there was no
10765         way to tell in abstract indexers/properties if one of them was
10766         specified.
10767
10768         Now there is a way of addressing that.
10769
10770         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
10771         instead of FindMembers.
10772
10773         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
10774         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
10775
10776         * attribute.cs: Treat indexers and properties as the same in terms
10777         of applying attributes
10778
10779         * ecore.cs (FindMostEncompassedType): Use statically initialized
10780         EmptyExpressions()s like we do elsewhere to avoid creating useless
10781         objects (and we take this out of the tight loop).
10782
10783         (GetConversionOperators): Move the code to extract the actual
10784         operators to a separate routine to clean things up.
10785
10786 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
10787
10788         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
10789         events are always registered FieldBuilders.
10790
10791         * class.cs (FieldBase): New class shared by Fields 
10792
10793         * delegate.cs: If we are a toplevel delegate, use our full name.
10794         If we are a nested delegate, then only use our tail name.
10795
10796 2002-05-02  Ravi Pratap  <ravi@ximian.com>
10797
10798         * expression.cs (IsApplicable): Ensure that we add the "&" to
10799         ref/out types before comparing it with the type of the argument.
10800
10801         (IsParamsMethodApplicable): Ditto.
10802
10803         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
10804         silly me ;-)
10805
10806         * delegate.cs : Handle the case when we have more than one applicable
10807         method. Flag an error only when we finish checking all.
10808
10809 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
10810
10811         * expression.cs: Add support for boolean static initializers.
10812
10813 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
10814
10815         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
10816
10817         * parameter.cs (ComputeParameterTypes,
10818         ComputeAndDefineParameterTypes): Better error handling: now we
10819         clear the `types' cache if we fail during any of the type lookups.
10820         We also return the status code correctly to our caller
10821
10822         * delegate.cs: If we fail to define a delegate, abort the extra
10823         steps. 
10824
10825         * expression.cs (Binary.ResolveOperator): for
10826         operator==(object,object) and operator !=(object, object) we also
10827         have to verify that there is an implicit conversion from one to
10828         the other.
10829
10830         (ArrayAccess.DoResolve): Array Access can operate on
10831         non-variables. 
10832
10833 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
10834
10835         * assign.cs (CompoundAssign): A new class used as a "flag" that
10836         the assignment actually is happening as part of a compound
10837         assignment operator.
10838
10839         During compound assignment, a few new rules exist to enable things
10840         like:
10841
10842         byte b |= 1 + 2
10843
10844         From the spec:
10845
10846         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
10847         to the type of x) if y is implicitly convertible to the type of x,
10848         and the operator is a builtin operator and the return type of the
10849         operator is explicitly convertible to the type of x. 
10850
10851         * rootcontext.cs: Reset warning level to 2.  4 catches various
10852         "interesting" features in mcs, we must clean this up at some
10853         point, but currently am trying to kill other bugs ;-)
10854
10855         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
10856         in container classes as well.  
10857
10858         * expression.cs (Binary.ResolveOperator): Handle string case
10859         before anything else (as operator overloading does emit an error
10860         before doing anything else).
10861
10862         This code could go away when we move to a table driven model, but
10863         i could not come up with a good plan last night.
10864
10865 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
10866
10867         * typemanager.cs (CSharpName): reimplementation using regex.
10868         * class.cs: added null check for fields in Emit
10869         * rootcontext.cs: set warninglevel to 4
10870
10871 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * typemanager.cs (CSharpName): reimplemented with Lupus
10874         suggestion.
10875
10876 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
10877
10878         * statement.cs (If): correclty implement Resolve, because we were
10879         not catching sem errors in there.  The same process is needed
10880         everywhere else. 
10881         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
10882
10883
10884         (Statement.Warning_DeadCodeFound): Factorize code.
10885         (While): Report dead code here too.
10886
10887         (Statement): Added Resolve virtual method to allow
10888         for resolution split from the emit code.
10889
10890 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * statement.cs (EmitBoolExpression): No longer try to resolve the
10893         expression here.    
10894         (MakeBoolean): New utility function that resolve, implicitly
10895         converts to boolean and tags the expression. 
10896
10897
10898         (If, Do): Implement dead code elimination.
10899         (While): Implement loop inversion
10900
10901         (Do, While, For, If): Resolve the expression prior to calling our
10902         code generation.
10903
10904 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
10905
10906         * class.cs:
10907           - added method Report28 (warning: program has more than one entry point)
10908           - added method IsEntryPoint, implements paragraph 10.1 of the spec
10909           - modified method Method.Define, the part at the end of the method
10910
10911         * rootcontext.cs: added static public Location EntryPointLocation;
10912           
10913         * ../errors/cs0028.cs : Add test case for the above warning.              
10914
10915         * typemanager.cs:
10916           - modified method CSharpName to allow arrays of primitive type to
10917             be printed nicely (e.g. instead of System.Int32[][] it now prints
10918             int[][])
10919           - added method CSharpSignature: returns the signature of a method
10920             in string format to be used in reporting errors, warnings, etc.
10921
10922         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
10923         with String.Empty.
10924
10925 2002-04-26  Ravi Pratap  <ravi@ximian.com>
10926
10927         * delegate.cs (Define): Fix extremely silly bug where I was
10928         setting the type of the 'object' parameter of the BeginInvoke
10929         method to System.IAsyncResult instead of System.Object ;-)
10930
10931 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10932
10933         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
10934         here. 
10935
10936         (Constructor.Emit): return if we fail to initialize the
10937         constructor.  Another door closed!  
10938
10939         * expression.cs (New.DoResolve): Improve error message (from -6 to
10940         1501).  Use DeclaredOnly lookup to find the exact constructor.
10941
10942         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
10943         loop.  This is useful.
10944
10945         * cs-parser.jay: Adjust the default parameters so that destructors
10946         have the proper signature.
10947
10948 2002-04-26  Martin Baulig  <martin@gnome.org>
10949
10950         * driver.cs (LoadAssembly): If `assembly' contains any characters
10951         which are only valid in path names and not in assembly names
10952         (currently slash, backslash and point), use Assembly.LoadFrom ()
10953         instead of Assembly.Load () on the `assembly' (before iteration
10954         over the link_paths).
10955
10956 2002-04-26  Martin Baulig  <martin@gnome.org>
10957
10958         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
10959
10960 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
10961
10962         * class.cs (Property): use the new typemanager.MemberLookup
10963
10964         (TypeContainer.MemberLookup): Implement using the
10965         TypeManager.MemberLookup now. 
10966
10967         * typemanager.cs: Make MemberLookup a function of the TypeManager,
10968         and return MemberInfos, so that these can be used without an
10969         EmitContext (what we had before).
10970
10971 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * expression.cs: Fix the case where the argument to params if the
10974         type of the params.  I omitted handling this before.   Fixed
10975
10976 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * driver.cs: Call BootCorlib_PopulateCoreType
10979
10980         * class.cs (Property.CheckBase): Check for properties only, not
10981         for all members. 
10982
10983         * interface.cs: Temporary hack: try/catch around the
10984         CustomAttributeBuilder, because I am getting an exception that I
10985         do not understand.
10986
10987         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
10988         types whose definitions are required to be there (attributes are
10989         defined before standard types).
10990
10991         Compute definitions as we boot the various types, as they are used
10992         immediately (value_type class will need object_type, but if we do
10993         not initialize object_type, we will pass a null, which will let
10994         the runtime pick the System.Object from the existing corlib, which
10995         is not what we want).
10996
10997 2002-04-22  Patrik Torstensson <totte@labs2.com>
10998
10999         * cs-tokenizer.cs: fixed a number of trim() issues.
11000
11001 2002-04-22  Ravi Pratap  <ravi@ximian.com>
11002
11003         * expression.cs (Argument.Type): Ensure that we return the correct
11004         type when we have out or ref parameters [in which case we 
11005         append a "&"].
11006
11007 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * class.cs (Property, Indexer): Allow extern modifier in there. 
11010
11011         * typemanager.cs (InitBaseTypes): Initializes object_type and
11012         value_type, since those will be used early on during the bootstrap
11013         process to compile corlib.
11014
11015         (InitCoreTypes): Move code from here to InitBaseTypes.
11016
11017 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
11018
11019         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
11020         single-dimension arrays as using the ldlen opcode.  
11021
11022         Daniel Lewis discovered this optimization.  
11023
11024         * typemanager.cs: Add signature for System.Array::get_Length
11025
11026 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11027
11028         * statement.cs: report the error when the foreach does not apply to an
11029         array nor a collection.
11030
11031 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
11032
11033         * expression.cs: Add implicit conversions to the operator ~.
11034
11035         * constant.cs (DecimalConstant.Emit): Emit decimal value.
11036
11037         * typemanager.cs: Locate the decimal constructor.
11038
11039 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11040
11041         * attribute.cs: use the new property of TypeOf.
11042         * expression.cs: added 'get' property around typearg.
11043
11044         These changes fix a build breaker reported by NickD. Is this the
11045         correct way to fix?  If not, please, revert my changes and make it
11046         work :-).
11047
11048 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
11049
11050         * attribute.cs: Add support for typeof in attribute invocations.
11051         I am not sure that this is right though.
11052
11053 2002-04-14  Duncan Mak  <duncan@ximian.com>
11054
11055         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
11056         Binary.Operator.Division case.
11057
11058 2002-04-13  Ravi Pratap  <ravi@ximian.com>
11059
11060         * class.cs (DefineType): Ensure that we do a proper check on
11061         attribute types and also register it with the TypeManager.
11062
11063         (TypeContainer.Targets): The default for attribute types is
11064         AttributeTargets.All.
11065
11066         * attribute.cs (ApplyAttributes): Registering the attribute type
11067         is done elsewhere, not when we discover we have a Usage attribute.
11068
11069 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11070
11071         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
11072         and get rid of is_delegate parameter.
11073
11074         * everywhere : update.
11075
11076 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11077
11078         * cs-parser.jay (compilation_unit): Revamp completely to use
11079         some new ideas that I got from Rhys' grammar to solve the problems
11080         with assembly level attributes.
11081
11082         (outer_declaration): New grammar production.
11083
11084         (attribute_sections): Add.
11085
11086         (opt_attributes): Base on attribute_sections
11087
11088         (namespace_declaration): Allow opt_attributes to tackle the case
11089         when we have assembly level attributes - we are clever in this
11090         regard now ;-)
11091
11092         * attribute.cs (ApplyAttributes): Do not worry about assembly 
11093         attributes in the non-global context.
11094
11095         * rootcontext.cs (AddGlobalAttributes): Go back to using this
11096         instead of SetGlobalAttributes.
11097
11098         * class.cs, rootcontext.cs : Ensure we define and generate 
11099         attribute types before anything else.
11100
11101         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
11102         and flag the new error -20 for the case when the attribute type
11103         does not have valid targets specified. csc does not catch this.
11104
11105         * ../errors/errors.txt : update for error # -20
11106
11107 2002-04-11  Ravi Pratap  <ravi@ximian.com>
11108
11109         * support.cs (InternalParameters.ParameterModifier): Do some null
11110         checking and return sane values.
11111
11112         * class.cs (Method.Define): If we are a PInvoke method, ensure
11113         that we are static and extern. Report error # 601
11114
11115         * ../errors/cs0601.cs : Add test case for the above error.
11116
11117 2002-04-07  Ravi Pratap  <ravi@ximian.com>
11118
11119         * rootcontext.cs (attribute_types): We need to keep type of
11120         all attribute types separately and emit code for them first.
11121
11122         (RegisterAttribute) : Implement.
11123
11124         * class.cs (DefineType): Check if the current Type is a custom
11125         attribute type and register it accordingly.
11126
11127         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
11128         adding the first attribute twice and rename to
11129
11130         (SetGlobalAttributes): this.
11131
11132         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
11133         lookups.
11134
11135         * attribute.cs (ApplyAttributes): Take an additional argument telling us
11136         if we are processing global arguments. Hmm, I am unsure of this.
11137
11138 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11139
11140         * expression.cs: added static array of strings to avoid calling
11141         Enum.ToString () for Operator in Binary. Significant recover of
11142         performance.
11143
11144 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
11145
11146         * class.cs (FindMembers): Allow the Builders of the various
11147         members to be null.  If they are skip them.  This only happens
11148         during the PInvoke declaration.
11149
11150 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
11151
11152         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
11153         failure, so we do not keep going afterwards.
11154
11155         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
11156         wanted to pass `false' as the `is_delegate' argument.  If this is
11157         the case, why not use delegate_type == null to mean `is_delegate =
11158         false' and anything else as is_delegate = true.
11159
11160 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
11161
11162         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
11163         code for the section, not the beginning of the tests.
11164
11165 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
11166
11167         * cfold.cs: Handle operator + (Enum x, Underlying x) 
11168
11169         * expression.cs (Binary): same.  Warn about errors where we have
11170         Enum/Enum in operator + as well.
11171
11172 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
11173
11174         * statement.cs:
11175                 - added support for switch(bool)
11176                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
11177                 - add TableSwitchEmit() to handle table-based switch statements
11178
11179 2002-04-05  Ravi Pratap  <ravi@ximian.com>
11180
11181         * expression.cs (Invocation.OverloadResolve): Factor out code which
11182         does parameter compatibility checking with arguments so that we can 
11183         re-use the code even from Delegate.VerifyApplicability
11184
11185         (VerifyArgumentsCompat): Move above code here.
11186
11187         * delegate.cs (VerifyApplicability): Get rid of duplicate code
11188         and instead make a call to the above method.
11189
11190 2002-03-31  Ravi Pratap  <ravi@ximian.com>
11191
11192         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
11193         We use it to keep track of classes which are attribute types.
11194
11195 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * delegate.cs (Delegate.Define): Correctly define the types in the
11198         presence of fixed and array parameters.
11199
11200         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
11201         doing FindMembers.
11202
11203         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
11204         include NonPublic after the first iteration.
11205
11206         * class.cs (Indexer.CheckBase): Only check if both parents are
11207         non-null. 
11208
11209         * cs-parser.jay (accessor_body): If empty, set to null.
11210
11211         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
11212         same code path here to resolve constants names that we did have in
11213         MemberAccess.DoResolve.  There is too much code duplicated here.
11214
11215 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
11216
11217         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
11218
11219         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
11220         to MakeUnionSet.
11221
11222         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
11223         tokens, numbers and strings.
11224
11225         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
11226         parenthesis.
11227
11228         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
11229         asyncronous parameters and the regular parameters.  
11230
11231         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
11232         specify the target directory.
11233
11234         * expression.cs: (This.DoResolve): Simplify
11235         (As.Emit): Optimize, do not generate IsInst if the expression is
11236         always of the given type.
11237
11238         (Is.DoResolve): Bug fix, we were reporting both always/never for
11239         the is expression.
11240
11241         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
11242         creating too many unnecessary arrays.
11243
11244 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
11245
11246         * class.cs (EmitFieldInitializer): Use Assign expression to assign
11247         fields instead of rolling our own initializer.   Takes care of all
11248         implicit conversions, and drops unnecessary static checks/argument.
11249
11250 2002-03-31  Dick Porter  <dick@ximian.com>
11251
11252         * driver.cs: use the GetDirectories() return values properly, and
11253         use "/" as path separator.
11254
11255 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
11256
11257         * expression.cs (Unary): Optimize - - expr into expr.
11258         (Binary): Optimize a + (-b) into a -b.
11259
11260         * codegen.cs (CodeGen): Made all methods static.
11261
11262 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
11263
11264         * rootcontext.cs: 
11265
11266         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
11267         TypeBuilder property.
11268
11269         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
11270         instead. 
11271
11272         * tree.cs: Removed the various RecordXXXX, and replaced with a
11273         single RecordDecl.  Removed all the accessor methods, and just
11274         left a single access point Type 
11275
11276         * enum.cs: Rename DefineEnum to DefineType.
11277
11278         * decl.cs: New abstract method `DefineType' used to unify the
11279         Defines for Enumerations, Interfaces, TypeContainers and
11280         Delegates.
11281
11282         (FindType): Moved LookupInterfaceOrClass here.  Moved the
11283         LookupBaseClasses method that used to live in class.cs and
11284         interface.cs here, and renamed to FindType.
11285
11286         * delegate.cs: Implement DefineType.  Take advantage of the
11287         refactored pattern for locating the parent builder without taking
11288         the parent_builder argument (which we know does not work if we are
11289         nested, and triggering a toplevel definition).
11290
11291 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
11294         accessibility of a member has changed during override and report
11295         an error if so.
11296
11297         * class.cs (Method.Define, Property.Define): Only complain on
11298         overrides if the method is private, any other accessibility is
11299         fine (and since we just checked the permission is the same, we are
11300         good to go).
11301
11302         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
11303         and elif are processed always.  The other pre-processing
11304         directives are only processed if we are "taking" the path
11305
11306 2002-03-29  Martin Baulig  <martin@gnome.org>
11307
11308         * class.cs (Method.Emit): Only emit symbolic debugging info if the
11309         current location is not Null.
11310
11311         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
11312         a separate method so we can profile it.
11313
11314         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
11315         `span.Seconds' are just seconds, but no minutes or hours.
11316         (MainDriver): Profile the CodeGen.SaveSymbols calls.
11317
11318 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11319
11320         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
11321         Remove the gratuitous set of Final:
11322
11323                                 // If an interface implementation, then we can set Final.
11324                                 if (((flags & MethodAttributes.Abstract) == 0) &&
11325                                     implementing.DeclaringType.IsInterface)
11326                                         flags |= MethodAttributes.Final;
11327
11328         I do not know what I was smoking when I used that.
11329
11330
11331         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
11332         step into fixing the name resolution issues for delegates and
11333         unifying the toplevel name resolution.
11334
11335 2002-03-28  Martin Baulig  <martin@gnome.org>
11336
11337         * class.cs (Method.Emit): If we have a symbol writer, call its
11338         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
11339         tell it about the current method.
11340
11341         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
11342         writer that we're going to emit the first byte of IL code for a new
11343         statement (a new source line).
11344         (EmitContext.EmitTopBlock): If we have a symbol writer, call
11345         EmitContext.Mark() before emitting any code.
11346
11347         * location.cs (SymbolDocument): Return null when we're Null.
11348
11349         * statement.cs (Statement): Moved the `Location loc' variable here.
11350         (Statement.EmitBoolExpression): If we have a symbol writer, call
11351         ec.Mark() before emitting any code to tell it that we're at the
11352         beginning of a new statement.
11353         (StatementExpression): Added `Location' argument to the constructor.
11354         (Block): Added public readonly variable `StartLocation' and public
11355         variable `EndLocation'.  The latter is to be set using SetEndLocation().
11356         (Block): Added constructor which takes a start and end location.
11357         (Block.SetEndLocation): New method. This sets the end location.
11358         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
11359         local variables we create.
11360         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
11361         each statement and do also mark the begin and end of the block.
11362
11363         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
11364         tell it the current lexer.Location, use Location.Null for the end of the
11365         block.
11366         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
11367         current block, set its end location using SetEndLocation().
11368         (statement_expression): StatementExpression constructor now takes the
11369         lexer.Location as additional argument.
11370         (for_statement, declare_local_variables): Likewise.
11371         (declare_local_variables): When creating a new implicit block, use the
11372         new Block constructor and pass it the lexer.Location.
11373
11374 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11375
11376         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
11377         members also on the parent interfaces recursively.
11378
11379 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * report.cs: Use new formats, since Gonzalo finished the missing
11382         bits. 
11383
11384         * expression.cs (Binary.ResolveOperator): added missing operator|
11385         operator& and operator^ for bool/bool.
11386
11387         * cs-parser.jay: CheckDef now takes a Location argument that is
11388         used to report errors more precisly (instead of reporting the end
11389         of a definition, we try to track something which is a lot closer
11390         to the source of the problem).
11391
11392         * cs-tokenizer.cs: Track global token use, so we can properly flag
11393         the use of #define/#undef after the first token has been seen.
11394
11395         Also, rename the reportXXXX to Error_DescriptiveName
11396
11397         * decl.cs (DeclSpace.IsTopLevel): Move property here from
11398         TypeContainer, so that Enum and Interface can use this too.
11399
11400         * class.cs (TypeContainer.LookupInterfaceOrClass,
11401         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
11402         `builder' argument.  Typically this was used to pass the parent
11403         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
11404         the definition).  
11405
11406         The problem is that a nested class could trigger the definition of
11407         a toplevel class, and the builder would be obviously wrong in that
11408         case. 
11409
11410         So we drop this argument, and we compute dynamically the
11411         TypeBuilder/ModuleBuilder (the correct information was available
11412         to us anyways from DeclSpace.Parent)
11413
11414         * interface.cs (Interface.DefineInterface): Drop builder
11415         parameter cleanup like class.cs
11416
11417         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
11418         like class.cs
11419
11420         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
11421         values. 
11422
11423         (Try.Emit): Propagate the returns value from the statement.
11424
11425         (Return.Emit): Even if we are leavning 
11426
11427         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
11428
11429         * modifiers.cs: Fix the computation of MethodAttributes flags.
11430
11431 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
11432
11433         * driver.cs: allow compilation of files that start with '/'.
11434         Add a default case when checking the argument of --target.
11435
11436 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * interface.cs: Implement the same search algorithm for types in
11439         the interface code.
11440
11441         * delegate.cs: Do not allow multiple definition.
11442
11443         * Recovered ChangeLog that got accidentally amputated
11444
11445         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
11446
11447         * rootcontext.cs: Load manually enum to allow core classes to
11448         contain enumerations.
11449
11450         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
11451         Update to new static methods in TypeManager.
11452
11453         * typemanager.cs (GetMethod, GetConstructor): Use our
11454         implementation of FindMembers to find the members, since during
11455         corlib compilation, the types are TypeBuilders and GetMethod and
11456         GetConstructor do not work.
11457
11458         Make all methods in TypeManager static.
11459
11460         (InitCodeHelpers): Split the functionality from
11461         the InitCodeTypes function.
11462
11463         * driver.cs: Call InitCodeHelpers after we have populated the
11464         types. 
11465
11466         * cs-parser.jay (delegate_declaration): we did not used to compute
11467         the delegate name correctly for void delegates.
11468
11469 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
11470
11471         * rootcontext.cs (RootContext): Init the interface_resolve_order
11472         and type_container_resolve_order always.
11473
11474         (ResolveCore, BootstrapCorlib_ResolveClass,
11475         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
11476         compiler when compiling with --nostdlib
11477
11478         * class.cs (TypeContainer.DefineType): Check that our parent is
11479         not null.  This test is most important when we are bootstraping
11480         the core types.
11481
11482         * codegen.cs: Split out the symbol writing code.
11483
11484 2002-03-25  Martin Baulig  <martin@gnome.org>
11485
11486         * driver.cs (-g): Made -g an alias for --debug.
11487
11488 2002-03-24  Martin Baulig  <martin@gnome.org>
11489
11490         * codegen.cs (SymbolWriter): New public variable. Returns the
11491         current symbol writer.
11492         (CodeGen): Added `bool want_debugging_support' argument to the
11493          constructor. If true, tell the ModuleBuild that we want debugging
11494         support and ask it for the ISymbolWriter.
11495         (Save): If we have a symbol writer, call it's Close() method after
11496         saving the assembly.
11497
11498         * driver.c (--debug): New command line argument to create a
11499         debugger information file.
11500
11501         * location.cs (SymbolDocument): New public property. Returns an
11502         ISymbolDocumentWriter object for the current source file or null
11503         if we don't have a symbol writer.
11504
11505 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
11506
11507         * driver.cs (LoadAssembly): Correctly return when all the paths
11508         have been tried and not before.
11509
11510         * statement.cs (Switch.Emit): return the actual coverage for this
11511         statement (returns/not-returns)
11512
11513         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
11514         switch of the statement if we are the last switch section.  That
11515         kills two problems: try/catch problems (we used to emit an empty
11516         nop at the end) and switch statements where all branches would
11517         return. 
11518
11519 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * driver.cs: Add default assemblies (the equivalent to the
11522         Microsoft CSC.RSP file)
11523
11524         * cs-tokenizer.cs: When updating `cols and setting it to zero,
11525         also update tokens_seen and set it to false.
11526
11527         * driver.cs: Implement --recurse for Mike.
11528
11529         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
11530         correctly splitting out the paths.
11531
11532 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * interface.cs (Interface.PopulateProperty): Instead of using
11535         `parent' as the declaration space for the set parameters, use
11536         `this' 
11537
11538         * support.cs (InternalParameters): InternalParameters constructor
11539         takes a DeclSpace instead of a TypeContainer.
11540
11541         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
11542         types are being initialized, load the address of it before calling
11543         the function.  
11544
11545         (New): Provide a mechanism to disable the generation of local
11546         value type temporaries when the caller will be providing us with
11547         an address to store it.
11548
11549         (ArrayCreation.EmitDynamicInitializers): Use it.
11550
11551 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
11552
11553         * expression.cs (Invocation.EmitArguments): Only probe for array
11554         property if there is more than one argument.  Sorry about that.
11555
11556         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
11557         empty param arrays.
11558
11559         * class.cs (Method.LabelParameters): Fix incorrect code path that
11560         prevented the `ParamArrayAttribute' from being applied to the
11561         params attribute.
11562
11563 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
11564
11565         * support.cs (ReflectionParameters): Correctly compute whether the
11566         last argument is a params array.  Fixes the problem with
11567         string.Split ('a')
11568
11569         * typemanager.cs: Make the assemblies array always be non-null
11570         (empty, but non-null)
11571
11572         * tree.cs (RecordDecl): New function that abstracts the recording
11573         of names.  This reports error 101, and provides a pointer to the
11574         previous declaration.  Fixes a crash in the compiler.
11575
11576         * cs-parser.jay (constructor_declaration): Update to new grammar,
11577         and provide a constructor_body that can be empty.
11578
11579 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * driver.cs: Add support for --resources.
11582
11583         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11584         Make all types for the various array helper methods be integer.
11585
11586         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11587         CheckState to ConvCast.
11588
11589         (ConvCast): Now it takes a `checked' state argument, to avoid
11590         depending on the emit context for the conversion, and just using
11591         the resolve time setting.
11592
11593         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11594         instead of Invocation.EmitArguments.  We do not emit the original
11595         arguments, instead we emit those which have been converted to
11596         unsigned int expressions.
11597
11598         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11599
11600         * codegen.cs: ditto.
11601
11602         * expression.cs (LocalVariableReference): Drop the use of the
11603         Store function that depended on the variable index.
11604
11605         * statement.cs (VariableInfo): Drop the `Idx' property from this
11606         class, as this is not taking into account the indexes for
11607         temporaries tat we generate during the execution, getting the
11608         indexes wrong.
11609
11610         * class.cs: First emit class initializers, then call the parent
11611         constructor. 
11612
11613         * expression.cs (Binary): Fix opcode emision.
11614         (UnaryMutator.EmitCode): Support checked code generation
11615
11616         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11617         matches for events for both the Static and Instance scans,
11618         pointing to the same element.   Fix that.
11619
11620 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * rootcontext.cs (ResolveTree): Always set the
11623         interface_resolve_order, because nested interfaces will be calling
11624         into us.
11625
11626         * class.cs (GetInterfaceOrClass): Track the same resolution
11627         process used by TypeManager.LookupType.  This fixes the nested
11628         type lookups in class declarations (separate path from
11629         LookupType). 
11630
11631         (TypeContainer.DefineType): Also define nested interfaces.
11632         (TypeContainer.RegisterOrder): New public function used to
11633         register the order in which child interfaces need to be closed.
11634
11635         Nested interfaces need to be closed after their parents have been
11636         created. 
11637
11638         * interface.cs (InterfaceAttr): Put all the logic for computing
11639         the interface attribute here. 
11640
11641         (DefineInterface): Register our interface order with the
11642         RootContext or with the TypeContainer depending on the case.
11643
11644 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * cs-parser.jay: rework foreach statement to work with the new
11647         changes to the policy on SimpleNames.
11648
11649         * report.cs: support Stacktrace on warnings as well.
11650
11651         * makefile: drop --unsafe and /unsafe from the compile.
11652
11653 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11654
11655         * ecore.cs (StandardConversionExists): Modify to take an Expression
11656         as the first parameter. Ensure we do null -> reference type conversion
11657         checking.
11658
11659         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11660         temporary Expression objects.
11661
11662 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11663
11664         * interface.cs: workaround bug in method overloading resolution
11665         (there is already a bugzilla bug for it).
11666
11667 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11668
11669         We could also solve this problem by having a separate path for
11670         performing type lookups, instead of DoResolve, we could have a
11671         ResolveType entry point, and only participating pieces of the
11672         production (simplename, deref, array) would implement this. 
11673
11674         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11675         signal SimpleName to only resolve type names and not attempt to
11676         resolve anything else.
11677
11678         * expression.cs (Cast): Set the flag.
11679
11680         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11681
11682         * class.cs: Only report 108 if there is no `new' modifier.
11683
11684         * cs-parser.jay: rework foreach statement to work with the new
11685         changes to the policy on SimpleNames.
11686
11687         * report.cs: support Stacktrace on warnings as well.
11688
11689         * makefile: drop --unsafe and /unsafe from the compile.
11690
11691 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11692
11693         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11694         lookups here, instead of doing that at parse time.  This means
11695         that our grammar will not introduce `LocalVariableReferences' as
11696         expressions at this point.  That solves the problem of code like
11697         this:
11698
11699         class X {
11700            static void Main ()
11701            { int X = 1;
11702             { X x = null }}}
11703
11704         This is only half the fix.  The full fix requires parameters to
11705         also be handled in this way.
11706
11707         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11708         makes the use more obvious of the DeclSpace.  The
11709         ec.TypeContainer.TypeBuilder is now only used to pull the
11710         TypeBuilder for it.
11711
11712         My theory is that I can get rid of the TypeBuilder completely from
11713         the EmitContext, and have typecasts where it is used (from
11714         DeclSpace to where it matters).  
11715
11716         The only pending problem is that the code that implements Aliases
11717         is on TypeContainer, and probably should go in DeclSpace.
11718
11719         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11720         lookups here, instead of doing that at parse time.  This means
11721         that our grammar will not introduce `LocalVariableReferences' as
11722         expressions at this point.  That solves the problem of code like
11723         this:
11724
11725         class X {
11726            static void Main ()
11727            { int X = 1;
11728             { X x = null }}}
11729
11730         This is only half the fix.  The full fix requires parameters to
11731         also be handled in this way.
11732
11733         * class.cs (Property.DefineMethod): When implementing an interface
11734         method, set newslot, when implementing an abstract method, do not
11735         set the flag (before we tried never setting it, or always setting
11736         it, which is the difference).
11737         (Indexer.DefineMethod): same.
11738         (Method.DefineMethod): same.
11739
11740         * ecore.cs: Only set the status used flag if we get back a Field.
11741
11742         * attribute.cs: Temporary hack, so Paolo can keep working.
11743
11744 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11745
11746         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11747         the unmanaged type in the case we have a MarshalAs attribute.
11748
11749         (Resolve): Handle the case when we are parsing the special MarshalAs
11750         attribute [we need to store the unmanaged type to use later]
11751
11752         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11753         MarshalAs Attribute.
11754
11755         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11756         on parameters and accordingly set the marshalling info.
11757
11758 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11759
11760         * class.cs: Optimizing slightly by removing redundant code after
11761         we switched to the `NoTypes' return value.
11762         (Property.DefineMethod): use NoTypes here too.
11763
11764         This fixes the bug I introduced in my last batch of changes.
11765
11766 2002-03-05  Ravi Pratap  <ravi@ximian.com>
11767
11768         * tree.cs (RecordEnum): Add. We now keep track of enums too.
11769
11770         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
11771         Enums since those are types too. 
11772
11773         * cs-parser.jay (enum_declaration): Record enums as we parse them.
11774
11775         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
11776         thanks to a call during the lookup process.
11777
11778 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
11779
11780         * statement.cs (Foreach): Lots of work to accomodate a particular
11781         kind of foreach statement that I had not kept in mind.  It is
11782         possible to have foreachs on classes that provide a GetEnumerator
11783         method that return objects that implement the "pattern" for using
11784         a foreach, there is no need to support GetEnumerator
11785         specifically. 
11786
11787         This is needed to compile nant.
11788
11789         * decl.cs: Only report 114 if the member is not `Finalize' and if
11790         the warning level is at least 2.
11791
11792         * class.cs: Moved the compare function from Method to
11793         MethodSignature. 
11794
11795         (MethodSignature.InheritableMemberSignatureCompare): Add new
11796         filter function that is used to extract inheritable methods from a
11797         class. 
11798
11799         (Method.Define): Use the new `inheritable_method_signature_filter'
11800         delegate
11801
11802         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
11803         command. 
11804
11805 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
11806
11807         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
11808
11809         * cs-parser.jay: Add opt_semicolon to the interface declaration.
11810
11811         * expression.cs: Pass location information to
11812         ConvertImplicitStandard. 
11813
11814         * class.cs: Added debugging code to track return values from
11815         interfaces. 
11816
11817 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
11818
11819         * expression.cs (Is.DoResolve): If either side of the `is' is an
11820         interface, do not flag the warning.
11821
11822         * ecore.cs (ImplicitReferenceConversion): We need a separate test
11823         for interfaces
11824
11825         * report.cs: Allow for --fatal to be used with --probe.
11826
11827         * typemanager.cs (NoTypes): Move the definition for the empty Type
11828         array here. 
11829
11830         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
11831         properties. 
11832         (TypeContainer.DefineProxy): New function used to proxy to parent
11833         implementations when implementing interfaces.
11834         (TypeContainer.ParentImplements): used to lookup if our parent
11835         implements a public function that is required by an interface.
11836         (TypeContainer.VerifyPendingMethods): Hook this up.
11837
11838         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
11839         `modules' and `assemblies' arraylists into arrays.  We only grow
11840         these are the very early start up of the program, so this improves
11841         the speedof LookupType (nicely measured).
11842
11843         * expression.cs (MakeByteBlob): Replaced unsafe code with
11844         BitConverter, as suggested by Paolo.
11845
11846         * cfold.cs (ConstantFold.Binary): Special case: perform constant
11847         folding of string concatenation, but if either side is a string,
11848         and the other is not, then return null, and let the runtime use
11849         the concatenation on the string plus the object (using
11850         `Object.ToString'). 
11851
11852 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
11853
11854         Constant Folding has been implemented now.
11855
11856         * expression.cs (Unary.Reduce): Do not throw an exception, catch
11857         the error instead on types that are not supported in one's
11858         complement. 
11859
11860         * constant.cs (Constant and all children): New set of functions to
11861         perform implict and explicit conversions.
11862
11863         * ecore.cs (EnumConstant): Implement the new functions to perform
11864         conversion by proxying to the child expression.
11865
11866         * codegen.cs: (ConstantCheckState): Constant evaluation has its
11867         own separate setting that can not be turned off from the command
11868         line using --unchecked or --checked and is only controlled using
11869         the checked/unchecked statements and expressions.  This setting is
11870         used by the constant folder to flag errors.
11871
11872         * expression.cs (CheckedExpr, UncheckedExpr): Set the
11873         ConstantCheckState as well.   
11874
11875         During Resolve, they also have to flag the state, because the
11876         constant folder runs completely in the Resolve phase.
11877
11878         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
11879         well.
11880
11881 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11882
11883         * cfold.cs: New file, this file contains the constant folder.
11884
11885         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
11886         argument to track whether we are using the resulting address to
11887         load or store a value and provide better error messages. 
11888
11889         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
11890         new AddressOf arguments.
11891
11892         * statement.cs (Foreach.EmitCollectionForeach): Update
11893
11894         * expression.cs (Argument.Emit): Call AddressOf with proper
11895         arguments to track usage.
11896
11897         (New.DoEmit): Call AddressOf with new arguments.
11898
11899         (Unary.Emit): Adjust AddressOf call.
11900
11901 2002-03-01  Ravi Pratap  <ravi@ximian.com>
11902
11903         * cs-parser.jay (member_access): Change the case for pre-defined types
11904         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
11905         this suggestion.
11906
11907         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
11908         a method body.
11909
11910         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
11911         essentially like methods and apply attributes like MethodImplOptions to them too.
11912
11913         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
11914         not being null.
11915
11916         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
11917         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
11918         is the DeclSpace.
11919
11920         * Update code everywhere accordingly.
11921
11922         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
11923
11924         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
11925
11926 2002-02-28  Ravi Pratap  <ravi@ximian.com>
11927
11928         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
11929         try performing lookups against those instead of jumping straight into using
11930         the 'using' clauses.
11931
11932         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
11933
11934         (LookupType): Perform lookups in implicit parents too.
11935
11936         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
11937         sequence as RootContext.LookupType. 
11938
11939         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
11940         the various cases of namespace lookups into this method.
11941
11942 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11943
11944         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
11945         in positional arguments)
11946
11947         * class.cs (Operator): Update the AllowedModifiers to contain
11948         extern. 
11949
11950         * cs-parser.jay: Update operator declaration to allow for the
11951         operator body to be empty.
11952
11953         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
11954         values. 
11955
11956 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
11957
11958         * class.cs (Method.Emit): Label parameters.
11959
11960         * driver.cs: Return 1 or 0 as the program exit code.
11961
11962 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
11963
11964         * expression.cs: Special case the `null' object when trying to
11965         auto-compute the type, as anything can be explicitly converted to
11966         that. 
11967
11968         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
11969         spotting this Paolo.
11970
11971         (Expression.ImplicitNumericConversion): Perform comparissions of
11972         the type using the underlying type in the case of an enumeration
11973         rather than using the enumeration type for the compare.
11974
11975         Cope with the underlying == type case, which is not possible to
11976         catch before. 
11977
11978         (Expression.ConvertNumericExplicit): Perform comparissions of
11979         the type using the underlying type in the case of an enumeration
11980         rather than using the enumeration type for the compare.
11981
11982         * driver.cs: If the user does not supply an extension, assume .exe
11983
11984         * cs-parser.jay (if_statement): Rewrote so that we can track the
11985         location for the if statement.
11986
11987         * expression.cs (Binary.ConstantFold): Only concat strings when
11988         the operation is "+", not everything ;-)
11989
11990         * statement.cs (Statement.EmitBoolExpression): Take a location
11991         argument. 
11992         (If, While, Do): Track location.
11993
11994         * expression.cs (Binary.ResolveOperator): In the object + string
11995         case, I was missing a call to ConvertImplicit
11996
11997 2002-02-25  Ravi Pratap  <ravi@ximian.com>
11998
11999         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
12000         Location arguments. Ensure we use RootContext.LookupType to do our work
12001         and not try to do a direct Type.GetType and ModuleBuilder.GetType
12002
12003         * interface.cs (PopulateMethod): Handle the type of the parameter being
12004         null gracefully.
12005
12006         * expression.cs (Invocation.BetterFunction): Handle the case when we 
12007         have a params method with no fixed arguments and a call is made with no
12008         arguments.
12009
12010 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
12011
12012         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
12013         the verbatim-string-literal
12014
12015         * support.cs (InternalParameters.ParameterModifier): handle null
12016         fixed parameters.
12017         (InternalParameters.ParameterType): ditto.
12018
12019         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
12020         duplicating the name of the variable parameter.
12021         (GetParameterByName): Fix bug where we were not looking up array
12022         paramters if they were the only present (thanks Paolo!).
12023         (GetParameterInfo): We only have an empty set of types if both
12024         fixed and array are set to null.
12025         (GetParameterInfo-idx): Handle FixedParameter == null
12026
12027         * cs-parser.jay: Handle the case where there is no catch
12028         statements (missing null test).
12029
12030 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
12031
12032         * driver.cs (MainDriver): Be conservative on our command line
12033         handling.
12034
12035         Catch DirectoryNotFoundException when calling GetFiles.
12036
12037         (SplitPathAndPattern): Used to split the input specification into
12038         a path and a pattern that we can feed to Directory.GetFiles.
12039
12040 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
12041
12042         * statement.cs (Fixed): Implement the last case of the Fixed
12043         statement (string handling).
12044
12045         * expression.cs (StringPtr): New class used to return a char * to
12046         a string;  Used by the Fixed statement.
12047
12048         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
12049
12050         * expression.cs (Binary.ResolveOperator): Remove redundant
12051         MemberLookup pn parent type.
12052         Optimize union call, we do not need a union if the types are the same.
12053         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
12054         type.
12055
12056         Specialize the use of MemberLookup everywhere, instead of using
12057         the default settings. 
12058
12059         (StackAlloc): Implement stackalloc keyword.
12060
12061         * cs-parser.jay: Add rule to parse stackalloc.
12062
12063         * driver.cs: Handle /h, /help, /?
12064
12065         * expression.cs (MakeByteBlob): Removed the hacks we had in place
12066         before we supported unsafe code.
12067
12068         * makefile: add --unsafe to the self compilation of mcs.
12069
12070 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
12071
12072         * expression.cs (PointerArithmetic): New class that is used to
12073         perform pointer arithmetic.
12074         (Binary.Resolve): Handle pointer arithmetic
12075         Handle pointer comparission.
12076         (ArrayPtr): Utility expression class that is used to take the
12077         address of an array.
12078
12079         (ElementAccess): Implement array access for pointers
12080
12081         * statement.cs (Fixed): Implement fixed statement for arrays, we
12082         are missing one more case before we are done.
12083
12084         * expression.cs (Indirection): Implement EmitAssign and set the
12085         ExprClass to Variable.  This allows pointer dereferences to be
12086         treated as variables, and to have values assigned to them.
12087
12088         * ecore.cs (Expression.StoreFromPtr): New utility function to
12089         store values dereferencing.
12090
12091 2002-02-20  Ravi Pratap  <ravi@ximian.com>
12092
12093         * expression.cs (Binary.ResolveOperator): Ensure that we are
12094         not trying to operate on a void type - this fixes the reported
12095         bug.
12096
12097         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
12098         the parent implementation is sealed.
12099
12100         * ../errors/cs0239.cs : Add.
12101
12102         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
12103
12104         * typemanager.cs (unverifiable_code_type): Corresponds to 
12105         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
12106         which have unsafe code in them.
12107
12108         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
12109         unsafe context.
12110
12111 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
12112
12113         * cs-tokenizer.cs: Add support for @"litreal strings"
12114
12115         Make tokenizer accept pre-processor directives
12116         on any column (remove the old C-like limitation). 
12117
12118         * rootcontext.cs (EmitCode): Emit any global attributes.
12119         (AddGlobalAttributes): Used to keep track of assembly attributes. 
12120
12121         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
12122
12123         * cs-parser.jay: Add support for global attributes.  
12124
12125 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
12126
12127         * expression.cs (Indirection): New helper class.  Unary will
12128         create Indirection classes to be able to implement the
12129         IMemoryLocation interface on it.
12130
12131 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
12132
12133         * cs-parser.jay (fixed_statement): reference the right statement.
12134
12135         * statement.cs (Fixed.Emit): Finish implementing the fixed
12136         statement for the &x case.
12137
12138 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * class.cs (Property.Define, Method.Define): Remove newslot when
12141         `implementing'.  
12142
12143         * modifiers.cs: My use of NewSlot when `Abstract' was set was
12144         wrong.  NewSlot should only be used if the `new' keyword is present.
12145
12146         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
12147         locating our system dir.  Sorry about this.
12148
12149 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12150
12151         * driver.cs (GetSystemDir): Compute correctly the location of our
12152         system assemblies.  I was using the compiler directory instead of
12153         the library directory.
12154
12155 2002-02-13  Ravi Pratap  <ravi@ximian.com>
12156
12157         * expression.cs (BetterFunction): Put back in what Miguel commented out
12158         since it is the correct fix. The problem is elsewhere ;-)
12159
12160         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
12161         parameters of the parms method are themselves compatible or not !
12162
12163         (StandardConversionExists): Fix very dangerous bug where we were forgetting
12164         to check that a class implements an interface before saying that an implicit
12165         conversion was allowed. Use ImplementsInterface to do the checking.
12166
12167 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12168
12169         * class.cs (Method.Define): Track whether we are an explicit
12170         implementation or not.  And only call DefineMethodOverride if we
12171         are an explicit implementation.
12172
12173         (Property.DefineMethod): Ditto.
12174
12175 2002-02-11  Ravi Pratap  <ravi@ximian.com>
12176
12177         * expression.cs (BetterFunction): Catch hideous bug which was
12178          preventing us from detecting ambiguous calls due to implicit casts i.e
12179         cs0121.
12180
12181 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * support.cs (Pair): Remove un-needed method.  I figured why I was
12184         getting the error in cs-parser.jay, the variable in a foreach loop
12185         is readonly, and the compiler does not really treat this as a variable.
12186
12187         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
12188         instead of EQUALS in grammar.  
12189
12190         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
12191
12192         * expression.cs (Unary.DoResolve): Check whether the argument is
12193         managed or not.
12194
12195 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
12196
12197         * support.cs: Api for Pair to set a value.  Despite the fact that
12198         the variables are public the MS C# compiler refuses to compile
12199         code that accesses the field if the variable is part of a foreach
12200         statement. 
12201
12202         * statement.cs (Fixed): Begin implementation of the fixed
12203         statement.
12204
12205         (Block.AddVariable): Return the VariableInfo on success and null
12206         on failure instead of true/false. 
12207
12208         * cs-parser.jay (foreach): Catch errors on variables already
12209         defined (we were ignoring this value before) and properly unwind
12210         the block hierarchy
12211
12212         (fixed_statement): grammar for the fixed statement.
12213
12214 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
12215
12216         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
12217         pointer types to be incretemented.
12218
12219         (SizeOf): Implement.
12220
12221         * cs-parser.jay (pointer_member_access): Implement
12222         expr->IDENTIFIER production.
12223
12224         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
12225         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
12226         on safe contexts.
12227
12228         (Unary): Implement indirection.
12229
12230         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
12231         use in non-unsafe context).
12232
12233         (SimpleName.DoResolve): Check for pointers in field access on safe
12234         contexts. 
12235
12236         (Expression.LoadFromPtr): Factor the load-indirect code in this
12237         function.  This was duplicated in UnboxCast and ParameterReference
12238
12239 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * expression.cs (ComposedCast): report an error if a pointer cast
12242         is used in a safe region.
12243
12244         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
12245         pointer type casts in unsafe context.
12246
12247         * codegen.cs (EmitContext): Set up IsUnsafe.
12248
12249         * cs-parser.jay (non_expression_type): Add productions for pointer
12250         casts. 
12251
12252         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
12253         code.  We should not use force into static mode if the method is
12254         not virtual.  Fixes bug in MIS
12255
12256         * statement.cs (Do.Emit, While.Emit, For.Emit,
12257         Statement.EmitBoolExpression): Add support to Do and While to
12258         propagate infinite loop as `I do return' semantics.
12259
12260         Improve the For case to also test for boolean constants.
12261
12262         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
12263         to the list of attributes we can add.
12264
12265         Remove `EmitContext' argument.
12266
12267         * class.cs (Method.Define): Apply parameter attributes.
12268         (Constructor.Define): Apply parameter attributes.
12269         (MethodCore.LabelParameters): Move here the core of labeling
12270         parameters. 
12271
12272         * support.cs (ReflectionParameters.ParameterModifier,
12273         InternalParameters.ParameterModifier): Use IsByRef on the type and
12274         only return the OUT bit for these parameters instead of in/out/ref
12275         flags.
12276
12277         This is because I miss-understood things.  The ParameterInfo.IsIn
12278         and IsOut represent whether the parameter has the [In] and [Out]
12279         attributes set.  
12280
12281 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
12282
12283         * ecore.cs (FieldExpr.Emit): Release temporaries.
12284
12285         * assign.cs (LocalTemporary.Release): new function.
12286
12287         * codegen.cs (EmitContext.GetTemporaryStorage,
12288         EmitContext.FreeTemporaryStorage): Rework the way we deal with
12289         temporary storage.  Now we can "put back" localbuilders when we
12290         are done with them
12291
12292 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
12293
12294         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
12295         need to make a copy of the variable to generate verifiable code.
12296
12297 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
12298
12299         * driver.cs: Compute dynamically the system directory.
12300
12301         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
12302         Slower, but more generally useful.  Used by the abstract
12303         registering implementation. 
12304
12305         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
12306         the rules for the special rule on Type/instances.  First check if
12307         we have the same name, and if so, try that special static path
12308         rather than the instance path.
12309
12310 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
12311
12312         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
12313         for, while and if.
12314
12315         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
12316         Enum, ValueType, Delegate or Array for non-corlib compiles.
12317
12318         * cs-tokenizer.cs: Catch long identifiers (645)
12319
12320         * typemanager.cs (IndexerPropetyName): Ravi never tested this
12321         piece of code.
12322
12323         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
12324         fix, we were returning too early, so we were not registering
12325         pending methods from abstract classes.
12326
12327         Do not register pending methods if the class is abstract.
12328
12329         * expression.cs (Conditional.DoResolve): Report circular implicit
12330         conversions when we neecd to compute it for conditional
12331         expressions. 
12332
12333         (Is.DoResolve): If the expression is always of the provided type,
12334         flag warning 183.  If the expression can not ever be of the
12335         provided type flag warning 184.
12336
12337         * class.cs: Catch 169 as well.
12338
12339         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
12340         read. 
12341
12342 2002-01-18  Nick Drochak  <ndrochak@gol.com>
12343
12344         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
12345
12346 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
12347
12348         * interface.cs: (PopulateMethod): Check for pointers being defined
12349         only if the unsafe context is active.
12350         (PopulateProperty): ditto.
12351         (PopulateIndexer): ditto.
12352
12353         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
12354         specified.  If pointers are present, make sure that they are
12355         present in an unsafe context.
12356         (Constructor, Constructor.Define): ditto.
12357         (Field, Field.Define): ditto.
12358         (Property, Property.Define): ditto.
12359         (Event, Event.Define): ditto.
12360
12361         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
12362         hashtable if there are classes or structs defined.
12363
12364         * expression.cs (LocalVariableReference.DoResolve): Simplify this
12365         code, as the constant resolution moved.
12366
12367         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
12368         the metadata, so we can flag error 133. 
12369
12370         * decl.cs (MemberCore.UnsafeOK): New function to test that a
12371         pointer is being declared in an unsafe context.
12372
12373 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
12374
12375         * modifiers.cs (Modifiers.Check): Require a Location argument.
12376         Report error 227 for Unsafe use.
12377
12378         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
12379
12380         * statement.cs (For.Emit): If the test is null, then report that
12381         we do `return', as we wont reach anything afterwards.
12382
12383         (Switch.SwitchGoverningType): Track the expression that matched
12384         the conversion.
12385
12386         * driver.cs: Allow negative numbers as an error code to flag.
12387
12388         * cs-parser.jay: Handle 1551.
12389
12390         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
12391
12392 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12393
12394         * cs-parser.jay: Report 1518 (type declaration can only contain
12395         class, struct, interface, enum or delegate)
12396
12397         (switch_label): Report 1523 (keywords `case' or `default' must
12398         preced code)
12399
12400         (opt_switch_sections): Report 1522 (empty switch)
12401
12402         * driver.cs: Report 1515 (response file specified multiple times)
12403         Report 1516 (Source file specified multiple times).
12404
12405         * expression.cs (Argument.Resolve): Signal 1510
12406
12407         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
12408         access not allowed in static code)
12409
12410 2002-01-11  Ravi Pratap  <ravi@ximian.com>
12411
12412         * typemanager.cs (IsPointerType): Utility method which we are going
12413         to need a lot.
12414
12415         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
12416         the object type, so we take care of that.
12417
12418         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
12419
12420         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
12421         added to non-params parameters :-)
12422
12423         * typemanager.cs (CSharpName): Include 'void' type too. 
12424
12425         (void_ptr_type): Include in the set of core types.
12426
12427         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
12428         duplicating code.
12429
12430         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
12431         an unsafe context.
12432
12433         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
12434         completely forgotten about it.
12435
12436 2002-01-10  Ravi Pratap  <ravi@ximian.com>
12437
12438         * cs-parser.jay (pointer_type): Add. This begins our implementation
12439         of parsing rules for unsafe code.
12440
12441         (unsafe_statement): Implement.
12442
12443         (embedded_statement): Modify to include the above.
12444
12445         * statement.cs (Unsafe): Implement new class for unsafe blocks.
12446
12447         * codegen.cs (EmitContext.InUnsafe): Add. This determines
12448         if the current context is an unsafe one.
12449
12450         * cs-parser.jay (local_variable_pointer_type): Since local variable types
12451         are handled differently, we need separate rules for them.
12452
12453         (local_variable_declaration): Update to use local_variable_pointer_type
12454         to allow variable declarations of unmanaged pointer types.
12455
12456         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
12457         in unsafe contexts.
12458
12459         * ../errors/cs0214.cs : Add.
12460
12461 2002-01-16  Nick Drochak  <ndrochak@gol.com>
12462
12463         * makefile: remove 'response' file when cleaning.
12464
12465 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12466
12467         * cs-parser.jay: Report 1524.
12468
12469 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
12470
12471         * typemanager.cs (RegisterMethod): drop checking if we have
12472         registered this from here
12473
12474 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
12475
12476         * class.cs (Method.EmitDestructor): Implement calling our base
12477         destructor. 
12478
12479         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
12480         value of InFinally.
12481
12482         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
12483         this routine and will wrap the call in a try/catch block.  Deal
12484         with the case.
12485
12486 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
12487
12488         * ecore.cs (Expression.MemberLookup): instead of taking a
12489         parameter `same_type' that was used to tell whether we could
12490         access private members we compute our containing type from the
12491         EmitContext.
12492
12493         (FieldExpr): Added partial support for volatile fields.  This does
12494         not work for volatile fields exposed from assemblies, as I can not
12495         figure out how to extract the modreq from it.
12496
12497         Updated all the source files to use this.
12498
12499         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
12500         because it is referenced by MemberLookup very often. 
12501
12502 2002-01-09  Ravi Pratap  <ravi@ximian.com>
12503
12504         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
12505         TypeBuilder.GetCustomAttributes to retrieve what we need.
12506
12507         Get rid of redundant default_member_attr_type as this is the same as
12508         default_member_type which already exists.
12509
12510         * interface.cs, attribute.cs : Update accordingly.
12511
12512 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * typemanager.cs: Enable IndexerPropertyName again.  It does not
12515         work for TYpeBuilders though.  Ravi, can you please fix this?
12516
12517         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
12518
12519         * expression.cs (Argument.Emit): Handle the case of ref objects
12520         being passed to ref functions;  
12521
12522         (ParameterReference.EmitLoad): Loads the content of the pointer
12523         without dereferencing.
12524
12525 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * cs-tokenizer.cs: Implemented the pre-processing expressions.
12528
12529 2002-01-08  Ravi Pratap  <ravi@ximian.com>
12530
12531         * class.cs (Indexer.DefineMethod): Incorporate the interface
12532         type in the name of the method if we are doing explicit interface
12533         implementation.
12534
12535         * expression.cs (ConversionExists): Remove as it is completely obsolete.
12536
12537         (BetterConversion): Fix extremely trivial bug where we were referring to
12538         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
12539         again !
12540
12541         * ../errors/bug16.cs : Add although we have fixed it.
12542
12543 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12544
12545         * expression.cs (BaseIndexer): Begin implementation.
12546
12547         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
12548
12549         * cs-parser.jay (indexer_declarator): Use qualified_identifier
12550         production directly to remove a shift/reduce, and implement
12551         explicit interface implementation.
12552
12553         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
12554         after a floating point suffix.
12555
12556         * expression.cs (DoNumericPromotions): Improved the conversion for
12557         uint/uint.  If we have a constant, we avoid doing a typecast to a
12558         larger type.
12559
12560         * class.cs (Indexer): Implement explicit interface implementation
12561         for indexers.
12562
12563 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
12564
12565         * class.cs: make the default instance constructor public and hidebysig.
12566
12567 2001-01-03  Ravi Pratap  <ravi@ximian.com>
12568
12569         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
12570         so we can call it from elsewhere.
12571
12572         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
12573         we emit it internally if the class has a defined indexer; otherwise the user
12574         emits it by decorating the class definition with the DefaultMemberAttribute.
12575
12576         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
12577         attribute is not used on a type which defines an indexer.
12578
12579         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12580         character when we skip whitespace.
12581
12582         * ../errors/cs0646.cs : Add.
12583
12584 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12585
12586         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12587         again. 
12588
12589         * makefile: Add practical target `mcs3.exe' which builds the third
12590         generation compiler. 
12591
12592         * expression.cs (New): Fix structures constructor calling.
12593
12594         * class.cs (Property, Method, Indexer): Emit Final flag on the
12595         method if we are an interface implementation and we are not
12596         abstract. 
12597
12598         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12599         whether this property is referencing a `base' method.
12600
12601         * expression.cs (Invocation.EmitCall): take an extra argument:
12602         is_base, this is used to determine whether the `call' or
12603         `callvirt' opcode should be used.
12604
12605
12606         * delegate.cs: update EmitCall.
12607
12608         * class.cs (Method.Define): Set NewSlot for the cases where we are
12609         not implementing an interface method.
12610
12611         (Property.Define): ditto.
12612
12613 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12614
12615         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12616         'r'.  Allows mcs to parse itself fully.
12617
12618 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12619
12620         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12621         of the number of initializers that require the InitializeArray method.
12622
12623         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12624         update the above field where necessary.
12625
12626         (MakeByteBlob): Update accordingly.
12627
12628         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12629         greater than 2.
12630
12631         (EmitDynamicInitializers): Update in accordance with the new optimization.
12632
12633         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12634         same OpCode applies.
12635
12636         * cs-parser.jay : Fix some glaring errors I introduced.
12637
12638 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12639
12640         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12641         so that we can check for name clashes there too.
12642
12643         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12644         for interface indexers.
12645
12646         * interfaces.cs (Define): Emit the default member attribute.
12647
12648         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12649         variable was being referred to while setting the value ;-)
12650
12651 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12652
12653         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12654         byte-by-byte information when we know the data is zero.
12655
12656         Make the block always a multiple of 4, because
12657         DefineInitializedData has a bug.
12658
12659         * assign.cs: Fix, we should assign from the temporary, not from
12660         the source. 
12661
12662         * expression.cs (MakeByteBlob): Fix my incorrect code.
12663
12664 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * typemanager.cs (EnumToUnderlying): This function is used to get
12667         the underlying type from an enumeration, because it does not
12668         always work. 
12669
12670         * constant.cs: Use the I4_S form for values between -128 and 127.
12671
12672         * statement.cs (Block.LookupLabel): Looks up a label.
12673         (Block): Drop support for labeled blocks.
12674
12675         (LabeledStatement): New kind of statement that represents a label
12676         only.
12677
12678         (Goto): Finally implement this bad boy.
12679
12680         * cs-parser.jay: Update to reflect new mechanism to implement
12681         labels.
12682
12683 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * codegen.cs (EmitContext.This): a codegen property that keeps the
12686         a single instance of this instead of creating many different this
12687         instances. 
12688
12689         * delegate.cs (Delegate.DoResolve): Update to use the property;
12690
12691         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12692
12693         * expression.cs (BaseAccess.DoResolve): Ditto.
12694
12695 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12696
12697         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12698         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12699
12700         (InitCoreTypes): Update accordingly.
12701
12702         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12703         so we can quickly store the state.
12704
12705         (ApplyAttributes): Set the correct implementation flags
12706         for InternalCall methods.
12707
12708 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * expression.cs (EmitCall): if a method is not virtual, then do
12711         not use callvirt on it.
12712
12713         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12714         user defined stuff) requires the use of stobj, which takes an
12715         address on the stack instead of an array and an index.  So emit
12716         the Ldelema operation for it.
12717
12718         (EmitStoreOpcode): Use stobj for valuetypes.
12719
12720         (UnaryMutator.EmitCode): Use the right 1 value depending on
12721         whether we are dealing with int64/uint64, float or doubles.
12722
12723         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12724         constructors that I implemented last night.
12725
12726         (Constructor.IsDefault): Fix to work properly for static
12727         constructors.
12728
12729         * cs-parser.jay (CheckDef): report method signature errors.
12730         Update error number 103 to be 132.
12731
12732         * decl.cs: New AdditionResult enumeration value: MethodExists.
12733         Although we do this check for methods later on in the semantic
12734         analysis, catching repeated default constructors is so easy that
12735         we catch these here. 
12736
12737         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12738         promotions code.
12739
12740         (ParameterReference.EmitAssign, Emit): handle
12741         bools as bytes.
12742
12743         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12744         (ArrayAccess.EmitStoreOpcode): ditto.
12745
12746         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12747
12748         * expression.cs (MakeByteBlob): Complete all the missing types
12749         (uint, short, ushort, byte, sbyte)
12750
12751         * class.cs: Only init instance field initializers on instance
12752         constructors. 
12753
12754         Rename `constructors' to instance_constructors. 
12755
12756         (TypeContainer.AddConstructor): Only add constructors to the list
12757         if it is not static.
12758
12759         Make sure that we handle default_static_constructor independently
12760         everywhere where we handle instance_constructors
12761
12762 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * class.cs: Do not lookup or create a base initializer for a
12765         static constructor.
12766
12767         (ConstructorInitializer.Resolve): use the proper type to lookup
12768         for constructors.
12769
12770         * cs-parser.jay: Report error 1585 (modifiers between type and name).
12771
12772         * enum.cs, interface.cs: Remove CloseType, this is taken care by
12773         in DeclSpace. 
12774
12775         * decl.cs: CloseType is now an virtual method, the default
12776         implementation just closes this type.
12777
12778 2001-12-28  Ravi Pratap  <ravi@ximian.com>
12779
12780         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
12781         to PreserveSig by default. Also emit HideBySig on such methods.
12782
12783         Basically, set the defaults to standard values.
12784
12785         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
12786         argument, if candidate is better, it can't be worse than the best !
12787
12788         (Invocation): Re-write bits to differentiate between methods being
12789         applicable in their expanded form and their normal form - for params
12790         methods of course.
12791
12792         Get rid of use_standard everywhere as only standard conversions are allowed
12793         in overload resolution. 
12794
12795         More spec conformance.
12796
12797 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12798
12799         * driver.cs: Add --timestamp, to see where the compiler spends
12800         most of its time.
12801
12802         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
12803         `this' in static code.
12804
12805         (SimpleName.DoResolve): Implement in terms of a helper function
12806         that allows static-references to be passed upstream to
12807         MemberAccess.
12808
12809         (Expression.ResolveWithSimpleName): Resolve specially simple
12810         names when called by MemberAccess to implement the special
12811         semantics. 
12812
12813         (Expression.ImplicitReferenceConversion): Handle conversions from
12814         Null to reference types before others, as Null's type is
12815         System.Object. 
12816
12817         * expression.cs (Invocation.EmitCall): Handle the special case of
12818         calling methods declared on a reference type from a ValueType
12819         (Base classes System.Object and System.Enum)
12820
12821         (MemberAccess.Resolve): Only perform lookups on Enumerations if
12822         the left hand side is a TypeExpr, not on every enumeration. 
12823
12824         (Binary.Resolve): If types are reference types, then do a cast to
12825         object on operators != and == of both arguments.
12826
12827         * typemanager.cs (FindMembers): Extract instance and static
12828         members if requested.
12829
12830         * interface.cs (PopulateProperty): Use void_type instead of null
12831         as the return type for the setter method.
12832
12833         (PopulateIndexer): ditto.
12834
12835 2001-12-27  Ravi Pratap  <ravi@ximian.com>
12836
12837         * support.cs (ReflectionParameters): Fix minor bug where we
12838         were examining the wrong parameter for the ParamArray attribute.
12839
12840         Cope with requests for the type of the parameter at position
12841         greater than the params parameter's. We now return the element
12842         type of the params array as that makes more sense.
12843
12844         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
12845         accordingly as we no longer have to extract the element type
12846         ourselves.
12847
12848         (Invocation.OverloadResolve): Update.
12849
12850 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12851
12852         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
12853         against IEnumerator, test whether the return value is a descendant
12854         of the IEnumerator interface.
12855
12856         * class.cs (Indexer.Define): Use an auxiliary method to implement
12857         the other bits of the method definition.  Begin support for
12858         explicit interface implementation.
12859
12860         (Property.DefineMethod): Use TypeManager.void_type instead of null
12861         for an empty return value.
12862
12863 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
12866         dealing with a FieldExpr which is composed of a FieldBuilder, in
12867         the code path we did extract the constant, but we should have
12868         obtained the underlying value to be able to cast it (otherwise we
12869         end up in an infinite loop, this is what Ravi was running into).
12870
12871         (ArrayCreation.UpdateIndices): Arrays might be empty.
12872
12873         (MemberAccess.ResolveMemberAccess): Add support for section
12874         14.5.4.1 that deals with the special case of E.I when E is a type
12875         and something else, that I can be a reference to a static member.
12876
12877         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
12878         handle a particular array type to create byte blobs, it is just
12879         something we dont generate byteblobs for.
12880
12881         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
12882         arguments. 
12883
12884         * location.cs (Push): remove the key from the hashtable that we
12885         are about to add.   This happens for empty files.
12886
12887         * driver.cs: Dispose files after we have parsed them.
12888
12889         (tokenize): new function that only runs the tokenizer on its
12890         input, for speed testing.
12891
12892 2001-12-26  Ravi Pratap  <ravi@ximian.com>
12893
12894         * class.cs (Event.Define): Define the private field only if there
12895         are no accessors defined.
12896
12897         * expression.cs (ResolveMemberAccess): If there is no associated
12898         field with the event, that means we have an event defined with its
12899         own accessors and we should flag error cs0070 since transforming
12900         ourselves into a field is not valid in that case.
12901
12902         * ecore.cs (SimpleName.DoResolve): Same as above.
12903
12904         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
12905         and charset to sane values.
12906
12907 2001-12-25  Ravi Pratap  <ravi@ximian.com>
12908
12909         * assign.cs (DoResolve): Perform check on events only if they 
12910         are being accessed outside the declaring type.
12911
12912         * cs-parser.jay (event_declarations): Update rules to correctly
12913         set the type of the implicit parameter etc.
12914
12915         (add_accessor, remove_accessor): Set current local parameters.
12916
12917         * expression.cs (Binary): For delegate addition and subtraction,
12918         cast the return value from the method into the appropriate delegate
12919         type.
12920
12921 2001-12-24  Ravi Pratap  <ravi@ximian.com>
12922
12923         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
12924         of these as the workaround is unnecessary.
12925
12926         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
12927         delegate data - none of that is needed at all.
12928
12929         Re-write bits to extract the instance expression and the delegate method
12930         correctly.
12931
12932         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
12933         on delegates too.
12934
12935         * attribute.cs (ApplyAttributes): New method to take care of common tasks
12936         of attaching attributes instead of duplicating code everywhere.
12937
12938         * everywhere : Update code to do attribute emission using the above method.
12939
12940 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * expression.cs (IsParamsMethodApplicable): if there are not
12943         parameters, return immediately.
12944
12945         * ecore.cs: The 0 literal can be implicity converted to an enum
12946         type. 
12947
12948         (SimpleName.DoResolve): First lookup the type, then lookup the
12949         members. 
12950
12951         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
12952         want to get its address.  If the InstanceExpression is not
12953         addressable, store the result in a temporary variable, then get
12954         the address of it.
12955
12956         * codegen.cs: Only display 219 errors on warning level or above. 
12957
12958         * expression.cs (ArrayAccess): Make it implement the
12959         IMemoryLocation interface.
12960
12961         (Binary.DoResolve): handle the operator == (object a, object b)
12962         and operator != (object a, object b) without incurring into a
12963         BoxedCast (because 5 != o should never be performed).
12964
12965         Handle binary enumerator operators.
12966
12967         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
12968         value type, otherwise use Ldelem_ref.
12969
12970         Use precomputed names;
12971
12972         (AddressOf): Implement address of
12973
12974         * cs-parser.jay (labeled_statement): Fix recursive block
12975         addition by reworking the production.
12976
12977         * expression.cs (New.DoEmit): New has a special case:
12978                 
12979                  If we are dealing with a ValueType, we have a few
12980                  situations to deal with:
12981                 
12982                     * The target of New is a ValueType variable, that is
12983                       easy, we just pass this as the variable reference
12984                 
12985                     * The target of New is being passed as an argument,
12986                       to a boxing operation or a function that takes a
12987                       ValueType.
12988                 
12989                       In this case, we need to create a temporary variable
12990                       that is the argument of New.
12991
12992
12993 2001-12-23  Ravi Pratap  <ravi@ximian.com>
12994
12995         * rootcontext.cs (LookupType): Check that current_type is not null before
12996         going about looking at nested types.
12997
12998         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
12999         not implement the IAssignMethod interface any more.
13000
13001         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
13002         where we tranform them into FieldExprs if they are being resolved from within
13003         the declaring type.
13004
13005         * ecore.cs (SimpleName.DoResolve): Do the same here.
13006
13007         * assign.cs (DoResolve, Emit): Clean up code considerably. 
13008
13009         * ../errors/bug10.cs : Add.
13010
13011         * ../errors/cs0070.cs : Add.
13012
13013         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
13014
13015         * assign.cs : Get rid of EventIsLocal everywhere.
13016
13017 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
13018
13019         * ecore.cs (ConvertIntLiteral): finished the implementation.
13020
13021         * statement.cs (SwitchLabel): Convert the value we are using as a
13022         key before looking up the table.
13023
13024 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13025
13026         * codegen.cs (EmitTopBlock): Require a Location argument now.
13027
13028         * cs-parser.jay (constructor_declarator): We need to setup
13029         current_local_parameters before we parse the
13030         opt_constructor_initializer, to allow the variables to be bound
13031         to the constructor arguments.
13032
13033         * rootcontext.cs (LookupType): First lookup nested classes in our
13034         class and our parents before we go looking outside our class.
13035
13036         * expression.cs (ConstantFold): Extract/debox the values at the
13037         beginnning. 
13038
13039         * rootcontext.cs (EmitCode): Resolve the constants first before we
13040         resolve the types.  This is not really needed, but it helps debugging.
13041
13042         * statement.cs: report location.
13043
13044         * cs-parser.jay: pass location to throw statement.
13045
13046         * driver.cs: Small bug fix.
13047
13048         * report.cs: Updated format to be 4-zero filled digits.
13049
13050 2001-12-22  Ravi Pratap  <ravi@ximian.com>
13051
13052         * expression.cs (CheckIndices): Fix minor bug where the wrong
13053         variable was being referred to ;-)
13054
13055         (DoEmit): Do not call EmitStaticInitializers when the 
13056         underlying type is System.Object.
13057
13058 2001-12-21  Ravi Pratap  <ravi@ximian.com>
13059
13060         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
13061         and do the usual workaround for SRE.
13062
13063         * class.cs (MyEventBuilder.EventType): New member to get at the type
13064         of the event, quickly.
13065
13066         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
13067
13068         * assign.cs (Assign.DoResolve): Handle the case when the target
13069         is an EventExpr and perform the necessary checks.
13070
13071         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
13072         interface.
13073
13074         (SimpleName.MemberStaticCheck): Include check for EventExpr.
13075
13076         (EventExpr): Set the type in the constructor itself since we 
13077         are meant to be born fully resolved.
13078
13079         (EventExpr.Define): Revert code I wrote earlier.
13080                 
13081         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
13082         instance expression is null. The instance expression is a This in that case
13083         or a null, depending on whether it is a static method or not.
13084
13085         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
13086         refers to more than one method.
13087
13088         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
13089         and accordingly flag errors.
13090
13091 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13092
13093         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
13094
13095 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13096
13097         * location.cs (ToString): Provide useful rutine.
13098
13099 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
13102         objects, return the actual integral boxed.
13103
13104         * statement.cs (SwitchLabel): define an ILLabel for each
13105         SwitchLabel. 
13106
13107         (Switch.CheckSwitch): If the value is a Literal, extract
13108         the underlying literal.
13109
13110         Also in the unused hashtable we had, add the SwitchLabel so we can
13111         quickly look this value up.
13112
13113         * constant.cs: Implement a bunch of new constants.  Rewrite
13114         Literal based on this.  Made changes everywhere to adapt to this.
13115
13116         * expression.cs (Expression.MakeByteBlob): Optimize routine by
13117         dereferencing array only once, and also copes with enumrations.
13118
13119         bytes are two bytes wide, not one.
13120
13121         (Cast): Perform constant conversions.
13122
13123         * ecore.cs (TryImplicitIntConversion): Return literals instead of
13124         wrappers to the literals here.
13125
13126         * expression.cs (DoNumericPromotions): long literals can converted
13127         to ulong implicity (this is taken care of elsewhere, but I was
13128         missing this spot).
13129
13130         * ecore.cs (Expression.Literalize): Make the return type Literal,
13131         to improve type checking.
13132
13133         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
13134
13135 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13136
13137         * literal.cs: Revert code from ravi that checked the bounds.  The
13138         bounds are sane by the definition of the type itself. 
13139
13140         * typemanager.cs: Fix implementation of ImplementsInterface.  We
13141         need to actually look up in our parent hierarchy for interfaces
13142         implemented. 
13143
13144         * const.cs: Use the underlying type for enumerations
13145
13146         * delegate.cs: Compute the basename for the delegate creation,
13147         that should fix the delegate test case, and restore the correct
13148         Type Lookup semantics in rootcontext
13149
13150         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
13151         referencing a nested type with the Reflection API is using the "+"
13152         sign. 
13153
13154         * cs-parser.jay: Do not require EOF token at the end.
13155
13156 2001-12-20  Ravi Pratap  <ravi@ximian.com>
13157
13158         * rootcontext.cs (LookupType): Concatenate type names with
13159         a '.' instead of a '+' The test suite passes again.
13160
13161         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
13162         field of the enumeration.
13163
13164         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
13165         the case when the member is an EventExpr.
13166
13167         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
13168         static has an associated instance expression.
13169
13170         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
13171
13172         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
13173
13174         * class.cs (Event.Define): Register event and perform appropriate checks
13175         for error #111.
13176
13177         We define the Add and Remove methods even if the use provides none because
13178         in that case, we provide default implementations ourselves.
13179
13180         Define a private field of the type of the event. This is done by the CSC compiler
13181         and we should be doing it too ;-)
13182
13183         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
13184         More methods we use in code we generate.
13185
13186         (multicast_delegate_type, delegate_type): Two separate types since the distinction
13187         is important.
13188
13189         (InitCoreTypes): Update accordingly for the above.
13190
13191         * class.cs (Event.Emit): Generate code for default accessors that we provide
13192
13193         (EmitDefaultMethod): Do the job in the above.
13194
13195         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
13196         appropriate place.
13197
13198 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
13201         builders even if we were missing one.
13202
13203         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
13204         pass the Basename as our class name instead of the Name.  The
13205         basename will be correctly composed for us.
13206
13207         * parameter.cs (Paramters): Now takes a Location argument.
13208
13209         * decl.cs (DeclSpace.LookupType): Removed convenience function and
13210         make all the code call directly LookupType in RootContext and take
13211         this chance to pass the Location information everywhere.
13212
13213         * Everywhere: pass Location information.
13214
13215 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
13216
13217         * class.cs (Constructor.Define): Updated way of detecting the
13218         length of the parameters.
13219
13220         (TypeContainer.DefineType): Use basename as the type name for
13221         nested types.
13222
13223         (TypeContainer.Define): Do not recursively define types here, as
13224         definition is taken care in order by the RootContext.
13225
13226         * tree.cs: Keep track of namespaces in a per-file basis.
13227
13228         * parameter.cs (Parameter.ComputeSignature): Update to use
13229         DeclSpace. 
13230
13231         (Parameters.GetSignature): ditto.
13232
13233         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
13234         instead of a TypeContainer.
13235
13236         (Interface.SemanticAnalysis): Use `this' instead of our parent to
13237         resolve names.  Because we need to be resolve in our context, not
13238         our parents.
13239
13240         * driver.cs: Implement response files.
13241
13242         * class.cs (TypeContainer.DefineType): If we are defined, do not
13243         redefine ourselves.
13244
13245         (Event.Emit): Emit the code for add/remove handlers.
13246         (Event.Define): Save the MethodBuilders for add/remove.
13247
13248         * typemanager.cs: Use pair here too.
13249
13250         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
13251         DictionaryEntry requires the first argument to be non-null.  
13252
13253         (enum_declaration): Compute full name for registering the
13254         enumeration.
13255
13256         (delegate_declaration): Instead of using
13257         formal_parameter_list, use opt_formal_parameter_list as the list
13258         can be empty.
13259
13260         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
13261         (EventParsing): New property that controls whether `add' and
13262         `remove' are returned as tokens or identifiers (for events);
13263
13264 2001-12-19  Ravi Pratap  <ravi@ximian.com>
13265
13266         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
13267         use MyEventBuilder only and let it wrap the real builder for us.
13268
13269         (MyEventBuilder): Revamp constructor etc.
13270
13271         Implement all operations that we perform on EventBuilder in precisely the same
13272         way here too.
13273
13274         (FindMembers): Update to use the EventBuilder member.
13275
13276         (Event.Emit): Update accordingly.
13277
13278 2001-12-18  Ravi Pratap  <ravi@ximian.com>
13279
13280         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
13281         by calling the appropriate methods.
13282
13283         (GetCustomAttributes): Make stubs as they cannot possibly do anything
13284         useful.
13285
13286         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
13287
13288 2001-12-17  Ravi Pratap  <ravi@ximian.com>
13289
13290         * delegate.cs (Delegate.Populate): Check that the return type
13291         and various parameters types are indeed accessible.
13292
13293         * class.cs (Constructor.Define): Same here.
13294
13295         (Field.Define): Ditto.
13296
13297         (Event.Define): Ditto.
13298
13299         (Operator.Define): Check that the underlying Method defined itself
13300         correctly - so it's MethodBuilder should not be null.
13301
13302         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
13303         expression happens to be null.
13304
13305         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
13306         members but as of now we don't seem to be able to do anything really useful with it.
13307
13308         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
13309         not the EventBuilder.
13310
13311 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
13312
13313         * cs-tokenizer.cs: Add support for defines.
13314         Add support for #if, #elif, #else, #endif
13315
13316         (eval_var): evaluates a variable.
13317         (eval): stubbed for evaluating functions.
13318
13319         * cs-parser.jay: Pass the defines information
13320
13321         * driver.cs: Add --define command line option.
13322
13323         * decl.cs: Move MemberCore here.
13324
13325         Make it the base class for DeclSpace.  This allows us to catch and
13326         report 108 and 109 for everything now.
13327
13328         * class.cs (TypeContainer.Define): Extract all the members
13329         before populating and emit the warning 108 (new keyword required
13330         to override) instead of having each member implement this.
13331
13332         (MemberCore.Define): New abstract method, we will be using this in
13333         the warning reporting engine in Populate.
13334
13335         (Operator.Define): Adjust to new MemberCore protocol. 
13336
13337         * const.cs (Const): This does not derive from Expression, it is a
13338         temporary object we use to create fields, it is a MemberCore. 
13339
13340         * class.cs (Method.Define): Allow the entry point to be in a
13341         specific class.
13342
13343         * driver.cs: Rewrite the argument handler to clean it up a bit.
13344
13345         * rootcontext.cs: Made it just an auxiliary namespace feature by
13346         making everything static.
13347
13348         * driver.cs: Adapt code to use RootContext type name instead of
13349         instance variable.
13350
13351         * delegate.cs: Remove RootContext argument.
13352
13353         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
13354         argument. 
13355
13356         * class.cs (Event.Define): The lookup can fail.
13357
13358         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
13359
13360         * expression.cs: Resolve the this instance before invoking the code.
13361
13362 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
13363
13364         * cs-parser.jay: Add a production in element_access that allows
13365         the thing to become a "type" reference.  This way we can parse
13366         things like "(string [])" as a type.
13367
13368         Note that this still does not handle the more complex rules of
13369         casts. 
13370
13371
13372         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
13373
13374         * ecore.cs: (CopyNewMethods): new utility function used to
13375         assemble the list of methods from running FindMembers.
13376
13377         (MemberLookup): Rework FindMembers so that 
13378
13379 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * class.cs (TypeContainer): Remove Delegates who fail to be
13382         defined.
13383
13384         * delegate.cs (Populate): Verify that we dont get null return
13385         values.   TODO: Check for AsAccessible.
13386
13387         * cs-parser.jay: Use basename to emit error 574 (destructor should
13388         have the same name as container class), not the full name.
13389
13390         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
13391         possible representation.  
13392
13393         Also implements integer type suffixes U and L.
13394
13395 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * expression.cs (ArrayCreation.DoResolve): We need to do the
13398         argument resolution *always*.
13399
13400         * decl.cs: Make this hold the namespace.  Hold the root context as
13401         well.
13402         (LookupType): Move here.
13403
13404         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
13405
13406         * location.cs (Row, Name): Fixed the code, it was always returning
13407         references to the first file.
13408
13409         * interface.cs: Register properties defined through interfaces.
13410
13411         * driver.cs: Add support for globbing on the command line
13412
13413         * class.cs (Field): Make it derive from MemberCore as well.
13414         (Event): ditto.
13415
13416 2001-12-15  Ravi Pratap  <ravi@ximian.com>
13417
13418         * class.cs (Event::Define): Check that the type of the event is a delegate
13419         type else flag error #66.
13420
13421         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
13422         same.
13423
13424         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
13425         values of EntryPoint, CharSet etc etc.
13426
13427         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
13428
13429         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
13430         be null and we should ignore this. I am not sure if this is really clean. Apparently,
13431         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
13432         which needs this to do its work.
13433
13434         * ../errors/cs0066.cs : Add.
13435
13436 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
13437
13438         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
13439         helper functions.
13440
13441         * class.cs: (MethodSignature.MethodSignature): Removed hack that
13442         clears out the parameters field.
13443         (MemberSignatureCompare): Cleanup
13444
13445         (MemberCore): New base class used to share code between MethodCore
13446         and Property.
13447
13448         (RegisterRequiredImplementations) BindingFlags.Public requires
13449         either BindingFlags.Instace or Static.  Use instance here.
13450
13451         (Property): Refactored code to cope better with the full spec.
13452
13453         * parameter.cs (GetParameterInfo): Return an empty array instead
13454         of null on error.
13455
13456         * class.cs (Property): Abstract or extern properties have no bodies.
13457
13458         * parameter.cs (GetParameterInfo): return a zero-sized array.
13459
13460         * class.cs (TypeContainer.MethodModifiersValid): Move all the
13461         method modifier validation to the typecontainer so we can reuse
13462         this on properties.
13463
13464         (MethodCore.ParameterTypes): return an empty sized array of types.
13465
13466         (Property.Define): Test property modifier validity.
13467
13468         Add tests for sealed/override too.
13469
13470         (Method.Emit): abstract or extern methods have no bodies.
13471
13472 2001-12-14  Ravi Pratap  <ravi@ximian.com>
13473
13474         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
13475         thing.
13476
13477         (Method::Define, ::Emit): Modify accordingly.
13478
13479         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
13480
13481         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
13482
13483         * makefile: Pass in /unsafe.
13484
13485 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
13486
13487         * class.cs (MakeKey): Kill routine.
13488
13489         * class.cs (TypeContainer.Define): Correctly define explicit
13490         method implementations (they require the full interface name plus
13491         the method name).
13492
13493         * typemanager.cs: Deply the PtrHashtable here and stop using the
13494         lame keys.  Things work so much better.
13495
13496         This of course broke everyone who depended on `RegisterMethod' to
13497         do the `test for existance' test.  This has to be done elsewhere.
13498
13499         * support.cs (PtrHashtable): A hashtable that avoid comparing with
13500         the object stupid Equals method (because, that like fails all over
13501         the place).  We still do not use it.
13502
13503         * class.cs (TypeContainer.SetRequiredInterface,
13504         TypeContainer.RequireMethods): Killed these two routines and moved
13505         all the functionality to RegisterRequiredImplementations.
13506
13507         (TypeContainer.RegisterRequiredImplementations): This routine now
13508         registers all the implementations required in an array for the
13509         interfaces and abstract methods.  We use an array of structures
13510         which can be computed ahead of time to reduce memory usage and we
13511         also assume that lookups are cheap as most classes will not
13512         implement too many interfaces.
13513
13514         We also avoid creating too many MethodSignatures.
13515
13516         (TypeContainer.IsInterfaceMethod): Update and optionally does not
13517         clear the "pending" bit if we find that there are problems with
13518         the declaration.
13519
13520         (TypeContainer.VerifyPendingMethods): Update to report errors of
13521         methods that look like implementations but are not.
13522
13523         (TypeContainer.Define): Add support for explicit interface method
13524         implementation. 
13525
13526 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * typemanager.cs: Keep track of the parameters here instead of
13529         being a feature of the TypeContainer.
13530
13531         * class.cs: Drop the registration of parameters here, as
13532         InterfaceMethods are also interface declarations.
13533
13534         * delegate.cs: Register methods with the TypeManager not only with
13535         the TypeContainer.  This code was buggy.
13536
13537         * interface.cs: Full registation here.
13538
13539 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
13540
13541         * expression.cs: Remove reducer for binary expressions, it can not
13542         be done this way.
13543
13544         * const.cs: Put here the code that used to go into constant.cs
13545
13546         * constant.cs: Put here the code for constants, this is a new base
13547         class for Literals.
13548
13549         * literal.cs: Make Literal derive from Constant.
13550
13551 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * statement.cs (Return.Emit): Report error 157 if the user
13554         attempts to return from a finally block.
13555
13556         (Return.Emit): Instead of emitting a return, jump to the end of
13557         the function.
13558
13559         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
13560         LocalBuilder to store the result of the function.  ReturnLabel is
13561         the target where we jump.
13562
13563
13564 2001-12-09  Radek Doulik  <rodo@ximian.com>
13565
13566         * cs-parser.jay: remember alias in current namespace
13567
13568         * ecore.cs (SimpleName::DoResolve): use aliases for types or
13569         namespaces
13570
13571         * class.cs (LookupAlias): lookup alias in my_namespace
13572
13573         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
13574         aliases hashtable
13575         (LookupAlias): lookup alias in this and if needed in parent
13576         namespaces
13577
13578 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13579
13580         * support.cs: 
13581
13582         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13583         making things static.  I need this to avoid passing the
13584         TypeContainer when calling ParameterType.
13585
13586         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13587         that did string manipulation to compute the type and then call
13588         GetType.  Use Parameter.ParameterType instead.
13589
13590         * cs-tokenizer.cs: Consume the suffix for floating values.
13591
13592         * expression.cs (ParameterReference): figure out whether this is a
13593         reference parameter or not.  Kill an extra variable by computing
13594         the arg_idx during emission.
13595
13596         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13597         function that returns whether a parameter is an out/ref value or not.
13598
13599         (Parameter.ParameterType): The type of the parameter (base,
13600         without ref/out applied).
13601
13602         (Parameter.Resolve): Perform resolution here.
13603         (Parameter.ExternalType): The full type (with ref/out applied).
13604
13605         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13606         support for expressions on the using statement.
13607
13608 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * statement.cs (Using.EmitLocalVariableDecls): Split the
13611         localvariable handling of the using statement.
13612
13613         (Block.EmitMeta): Keep track of variable count across blocks.  We
13614         were reusing slots on separate branches of blocks.
13615
13616         (Try.Emit): Emit the general code block, we were not emitting it. 
13617
13618         Check the type of the declaration to be an IDisposable or
13619         something that can be implicity converted to it. 
13620
13621         Emit conversions if required.
13622
13623         * ecore.cs (EmptyExpression): New utility class.
13624         (Expression.ImplicitConversionExists): New utility function.
13625
13626 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13627
13628         * statement.cs (Using): Implement.
13629
13630         * expression.cs (LocalVariableReference): Support read only variables.
13631
13632         * statement.cs: Remove the explicit emit for the Leave opcode.
13633         (VariableInfo): Add a readonly field.
13634
13635 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * ecore.cs (ConvCast): new class used to encapsulate the various
13638         explicit integer conversions that works in both checked and
13639         unchecked contexts.
13640
13641         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13642         properly generate the overflow opcodes.
13643
13644 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13645
13646         * statement.cs: The correct type for the EmptyExpression is the
13647         element_type, not the variable type.  Ravi pointed this out.
13648
13649 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13650
13651         * class.cs (Method::Define): Handle PInvoke methods specially
13652         by using DefinePInvokeMethod instead of the usual one.
13653
13654         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13655         above to do the task of extracting information and defining the method.
13656
13657 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13658
13659         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13660         of the condition for string type.
13661
13662         (Emit): Move that here. 
13663
13664         (ArrayCreation::CheckIndices): Keep string literals in their expression
13665         form.
13666
13667         (EmitDynamicInitializers): Handle strings appropriately.
13668
13669 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13670
13671         * codegen.cs (EmitContext): Replace multiple variables with a
13672         single pointer to the current Switch statement.
13673
13674         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13675         EmitContext.
13676
13677 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * statement.cs 
13680
13681         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13682         default'.
13683
13684         (Foreach.Emit): Foreach on arrays was not setting
13685         up the loop variables (for break/continue).
13686
13687         (GotoCase): Semi-implented.
13688
13689 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13690
13691         * attribute.cs (CheckAttribute): Handle system attributes by using
13692         Attribute.GetAttributes to examine information we need.
13693
13694         (GetValidPlaces): Same here.
13695
13696         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13697
13698         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13699
13700         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13701
13702         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13703
13704         (Method::Emit): Handle the case when we are a PInvoke method.
13705
13706 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13707
13708         * expression.cs: Use ResolveWithSimpleName on compound names.
13709
13710 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13711
13712         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13713         before trying to reduce it.
13714
13715         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13716
13717         * constant.cs (LookupConstantValue): Implement.
13718
13719         (EmitConstant): Use the above in emitting the constant.
13720
13721         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13722         that are user-defined by doing a LookupConstantValue on them.
13723
13724         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13725         too, like above.
13726
13727 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13728
13729         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13730
13731         (BaseAccess.DoResolve): Implement.
13732
13733         (MemberAccess.DoResolve): Split this routine into a
13734         ResolveMemberAccess routine that can be used independently
13735
13736 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13737
13738         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13739         As that share bits of the implementation.  Is returns a boolean,
13740         while As returns the Type that is being probed.
13741
13742 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13743
13744         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13745         instead of a Literal - much easier.
13746
13747         (EnumInTransit): Remove - utterly useless :-)
13748
13749         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13750
13751         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13752
13753         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13754         chain when we have no associated expression.
13755
13756 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13757
13758         * constant.cs (Define): Use Location while reporting the errror.
13759
13760         Also emit a warning when 'new' is used and there is no inherited
13761         member to hide.
13762
13763         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
13764         populated.
13765
13766         (LookupEnumValue): Implement to lookup an enum member's value and define it
13767         if necessary.
13768
13769         (Populate): Re-write accordingly to use the above routine.
13770
13771 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
13772
13773         * expression.cs (This): Fix prototype for DoResolveLValue to
13774         override the base class DoResolveLValue.
13775
13776         * cs-parser.cs: Report errors cs574 and cs575 (destructor
13777         declarations) 
13778
13779         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
13780         (we need to load the address of the field here).  This fixes
13781         test-22. 
13782
13783         (FieldExpr.DoResolveLValue): Call the DoResolve
13784         function to initialize the Instance expression.
13785
13786         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
13787         correctly the GetEnumerator operation on a value type.
13788
13789         * cs-parser.jay: Add more simple parsing error catches.
13790
13791         * statement.cs (Switch): Add support for string switches.
13792         Handle null specially.
13793
13794         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
13795
13796 2001-11-28  Ravi Pratap  <ravi@ximian.com>
13797
13798         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
13799
13800         (declare_local_constant): New helper function.
13801
13802         * statement.cs (AddConstant): Keep a separate record of constants
13803
13804         (IsConstant): Implement to determine if a variable is a constant.
13805
13806         (GetConstantExpression): Implement.
13807
13808         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
13809
13810         * statement.cs (IsVariableDefined): Re-write.
13811
13812 2001-11-27  Ravi Pratap  <ravi@ximian.com>
13813
13814         * class.cs (TypeContainer::FindMembers): Look for constants
13815         in the case when we are looking for MemberTypes.Field
13816
13817         * expression.cs (MemberAccess::DoResolve): Check that in the
13818         case we are a FieldExpr and a Literal, we are not being accessed
13819         by an instance reference.
13820
13821         * cs-parser.jay (local_constant_declaration): Implement.
13822
13823         (declaration_statement): Implement for constant declarations.
13824
13825 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
13826
13827         * statement.cs (Switch): Catch double defaults.
13828
13829         (Switch): More work on the switch() statement
13830         implementation.  It works for integral values now, need to finish
13831         string support.
13832
13833
13834 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13835
13836         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
13837         integer literals into other integer literals.  To be used by
13838         switch. 
13839
13840 2001-11-24  Ravi Pratap  <ravi@ximian.com>
13841
13842         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
13843         some memory.
13844
13845         (EmitDynamicInitializers): Cope with the above since we extract data
13846         directly from ArrayData now.
13847
13848         (ExpectInitializers): Keep track of whether initializers are mandatory
13849         or not.
13850
13851         (Bounds): Make it a hashtable to prevent the same dimension being 
13852         recorded for every element in that dimension.
13853
13854         (EmitDynamicInitializers): Fix bug which prevented the Set array method
13855         from being found.
13856
13857         Also fix bug which was causing the indices to be emitted in the reverse
13858         order.
13859
13860 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * expression.cs (ArrayCreation): Implement the bits that Ravi left
13863         unfinished.  They do not work, because the underlying code is
13864         sloppy.
13865
13866 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13867
13868         * cs-parser.jay: Remove bogus fixme.
13869
13870         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
13871         on Switch statement.
13872
13873 2001-11-23  Ravi Pratap  <ravi@ximian.com>
13874
13875         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
13876         the same. 
13877
13878         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
13879         parameter. Apparently, any expression is allowed. 
13880
13881         (ValidateInitializers): Update accordingly.
13882
13883         (CheckIndices): Fix some tricky bugs thanks to recursion.
13884
13885         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
13886         I was being completely brain-dead.
13887
13888         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
13889         and re-write acordingly.
13890
13891         (DelegateInvocation): Re-write accordingly.
13892
13893         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
13894
13895         (MakeByteBlob): Handle types more correctly.
13896
13897         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
13898         initialization from expressions but it is incomplete because I am a complete
13899         Dodo :-|
13900
13901 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * statement.cs (If.Emit): Fix a bug that generated incorrect code
13904         on If.  Basically, we have to return `true' (ie, we do return to
13905         our caller) only if both branches of the if return.
13906
13907         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
13908         short-circuit operators, handle them as short circuit operators. 
13909
13910         (Cast.DoResolve): Resolve type.
13911         (Cast.Cast): Take an expression as the target type.
13912
13913         * cs-parser.jay (cast_expression): Remove old hack that only
13914         allowed a limited set of types to be handled.  Now we take a
13915         unary_expression and we resolve to a type during semantic
13916         analysis.
13917
13918         Use the grammar productions from Rhys to handle casts (this is
13919         not complete like Rhys syntax yet, we fail to handle that corner
13920         case that C# has regarding (-x), but we will get there.
13921
13922 2001-11-22  Ravi Pratap  <ravi@ximian.com>
13923
13924         * class.cs (EmitFieldInitializer): Take care of the case when we have a
13925         field which is an array type.
13926
13927         * cs-parser.jay (declare_local_variables): Support array initialization too.
13928
13929         * typemanager.cs (MakeKey): Implement.
13930
13931         (everywhere): Use the above appropriately.
13932
13933         * cs-parser.jay (for_statement): Update for array initialization while
13934         declaring variables.
13935
13936         * ecore.cs : The error message was correct, it's the variable's names that
13937         were misleading ;-) Make the code more readable.
13938
13939         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
13940         the correct type etc.
13941
13942         (ConvertExplicit): Handle Enum types by examining the underlying type.
13943
13944 2001-11-21  Ravi Pratap  <ravi@ximian.com>
13945
13946         * parameter.cs (GetCallingConvention): Always return
13947         CallingConventions.Standard for now.
13948
13949 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13950
13951         * expression.cs (Binary.ResolveOperator): Update the values of `l'
13952         and `r' after calling DoNumericPromotions.
13953
13954         * ecore.cs: Fix error message (the types were in the wrong order).
13955
13956         * statement.cs (Foreach.ProbeCollectionType): Need to pass
13957         BindingFlags.Instance as well 
13958
13959         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
13960         implicit int literal conversion in an empty cast so that we
13961         propagate the right type upstream.
13962
13963         (UnboxCast): new class used to unbox value types.
13964         (Expression.ConvertExplicit): Add explicit type conversions done
13965         by unboxing.
13966
13967         (Expression.ImplicitNumericConversion): Oops, forgot to test for
13968         the target type before applying the implicit LongLiterals to ULong
13969         literal cast.
13970
13971 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
13972
13973         * cs-parser.jay (for_statement): Reworked the way For works: now
13974         we declare manually any variables that are introduced in
13975         for_initializer to solve the problem of having out-of-band code
13976         emition (that is what got for broken).
13977
13978         (declaration_statement): Perform the actual variable declaration
13979         that used to be done in local_variable_declaration here.
13980
13981         (local_variable_declaration): Do not declare anything, just pass
13982         the information on a DictionaryEntry
13983
13984 2001-11-20  Ravi Pratap  <ravi@ximian.com>
13985
13986         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
13987         re-write of the logic to now make it recursive.
13988
13989         (UpdateIndices): Re-write accordingly.
13990
13991         Store element data in a separate ArrayData list in the above methods.
13992
13993         (MakeByteBlob): Implement to dump the array data into a byte array.
13994
13995 2001-11-19  Ravi Pratap  <ravi@ximian.com>
13996
13997         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
13998         into CheckIndices.
13999
14000         * constant.cs (Define): Implement.
14001
14002         (EmitConstant): Re-write fully.
14003
14004         Pass in location info.
14005
14006         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
14007         respectively.
14008
14009         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
14010         DictionaryEntry since we need location info too.
14011
14012         (constant_declaration): Update accordingly.
14013
14014         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
14015         code into another method : UpdateIndices.
14016
14017 2001-11-18  Ravi Pratap  <ravi@ximian.com>
14018
14019         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
14020         some type checking etc.
14021
14022 2001-11-17  Ravi Pratap  <ravi@ximian.com>
14023
14024         * expression.cs (ArrayCreation::ValidateInitializers): Implement
14025         bits to provide dimension info if the user skips doing that.
14026
14027         Update second constructor to store the rank correctly.
14028
14029 2001-11-16  Ravi Pratap  <ravi@ximian.com>
14030
14031         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
14032         and try to implement.
14033
14034         * ../errors/cs0150.cs : Add.
14035
14036         * ../errors/cs0178.cs : Add.
14037
14038 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
14039
14040         * statement.cs: Implement foreach on multi-dimensional arrays. 
14041
14042         * parameter.cs (Parameters.GetParameterByName): Also lookup the
14043         name of the params argument.
14044
14045         * expression.cs: Use EmitStoreOpcode to get the right opcode while
14046         initializing the array.
14047
14048         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
14049         we can use this elsewhere.
14050
14051         * statement.cs: Finish implementation of foreach for single
14052         dimension arrays.
14053
14054         * cs-parser.jay: Use an out-of-band stack to pass information
14055         around, I wonder why I need this.
14056
14057         foreach_block: Make the new foreach_block the current_block.
14058
14059         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
14060         function used to return a static Parameters structure.  Used for
14061         empty parameters, as those are created very frequently.
14062
14063         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
14064
14065 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14066
14067         * interface.cs : Default modifier is private, not public. The
14068         make verify test passes again.
14069
14070 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14071
14072         * support.cs (ReflectionParameters): Fix logic to determine
14073         whether the last parameter is a params one. Test 9 passes again.
14074
14075         * delegate.cs (Populate): Register the builders we define with
14076         RegisterParameterForBuilder. Test 19 passes again.
14077
14078         * cs-parser.jay (property_declaration): Reference $6 instead
14079         of $$ to get at the location.
14080
14081         (indexer_declaration): Similar stuff.
14082
14083         (attribute): Ditto.
14084
14085         * class.cs (Property): Register parameters for the Get and Set methods
14086         if they exist. Test 23 passes again.
14087
14088         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
14089         call to EmitArguments as we are sure there aren't any params arguments. 
14090         Test 32 passes again.
14091
14092         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
14093         IndexOutOfRangeException. 
14094
14095         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
14096         Test 33 now passes again.
14097
14098 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
14101         broke a bunch of things.  Will have to come up with a better way
14102         of tracking locations.
14103
14104         * statement.cs: Implemented foreach for single dimension arrays.
14105
14106 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
14109         an error.  This removes the lookup from the critical path.
14110
14111         * cs-parser.jay: Removed use of temporary_loc, which is completely
14112         broken. 
14113
14114 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * support.cs (ReflectionParameters.ParameterModifier): Report
14117         whether the argument is a PARAMS argument or not.
14118
14119         * class.cs: Set the attribute `ParamArrayAttribute' on the
14120         parameter argument.
14121
14122         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
14123         and cons_param_array_attribute (ConstructorInfo for
14124         ParamArrayAttribute)., 
14125
14126         * codegen.cs: Emit the return using the `Return' statement, that
14127         way we can report the error correctly for missing return values. 
14128
14129         * class.cs (Method.Emit): Clean up.
14130
14131         * expression.cs (Argument.Resolve): Take another argument: the
14132         location where this argument is used.  Notice that this is not
14133         part of the "Argument" class as to reduce the size of the
14134         structure (we know the approximate location anyways).
14135
14136         Test if the argument is a variable-reference, if not, then
14137         complain with a 206.
14138
14139         (Argument.Emit): Emit addresses of variables.
14140
14141         (Argument.FullDesc): Simplify.
14142
14143         (Invocation.DoResolve): Update for Argument.Resolve.
14144
14145         (ElementAccess.DoResolve): ditto.
14146
14147         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
14148         method should be virtual, as this method is always virtual.
14149
14150         (NewDelegate.DoResolve): Update for Argument.Resolve.
14151
14152         * class.cs (ConstructorInitializer.DoResolve): ditto.
14153
14154         * attribute.cs (Attribute.Resolve): ditto.
14155
14156 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
14157
14158         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
14159
14160         * expression.cs (ParameterReference): Drop IStackStorage and implement
14161         IAssignMethod instead. 
14162
14163         (LocalVariableReference): ditto.
14164
14165         * ecore.cs (FieldExpr): Drop IStackStorage and implement
14166         IAssignMethod instead. 
14167
14168 2001-11-13  Miguel de Icaza <miguel@ximian.com>
14169
14170         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
14171         enumerations that are used in heavily used structures derive from
14172         byte in a laughable and pathetic attempt to reduce memory usage.
14173         This is the kind of pre-optimzations that you should not do at
14174         home without adult supervision.
14175
14176         * expression.cs (UnaryMutator): New class, used to handle ++ and
14177         -- separatedly from the other unary operators.  Cleans up the
14178         code, and kills the ExpressionStatement dependency in Unary.
14179
14180         (Unary): Removed `method' and `Arguments' from this class, making
14181         it smaller, and moving it all to SimpleCall, so I can reuse this
14182         code in other locations and avoid creating a lot of transient data
14183         strucutres when not required.
14184
14185         * cs-parser.jay: Adjust for new changes.
14186
14187 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * enum.cs (Enum.Populate): If there is a failure during
14190         definition, return
14191
14192         * cs-parser.jay (opt_enum_base): we used to catch type errors
14193         here, but this is really incorrect.  The type error should be
14194         catched during semantic analysis.
14195
14196 2001-12-11  Ravi Pratap  <ravi@ximian.com>
14197
14198         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
14199         current_local_parameters as expected since I, in my stupidity, had forgotten
14200         to do this :-)
14201
14202         * attribute.cs (GetValidPlaces): Fix stupid bug.
14203
14204         * class.cs (Method::Emit): Perform check on applicability of attributes.
14205
14206         (Constructor::Emit): Ditto.
14207
14208         (Field::Emit): Ditto.
14209
14210         (Field.Location): Store location information.
14211
14212         (Property, Event, Indexer, Operator): Ditto.
14213
14214         * cs-parser.jay (field_declaration): Pass in location for each field.
14215
14216         * ../errors/cs0592.cs : Add.
14217
14218 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14219
14220         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
14221
14222         (InitCoreTypes): Update accordingly.
14223
14224         (RegisterAttrType, LookupAttr): Implement.
14225
14226         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
14227         info about the same.
14228
14229         (Resolve): Update to populate the above as necessary.
14230
14231         (Error592): Helper.
14232
14233         (GetValidPlaces): Helper to the above.
14234
14235         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
14236
14237         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
14238
14239 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14240
14241         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
14242
14243         * ../errors/cs0617.cs : Add.
14244
14245 2001-11-11  Ravi Pratap  <ravi@ximian.com>
14246
14247         * enum.cs (Emit): Rename to Populate to be more consistent with what
14248         we expect it to do and when exactly it is called.
14249
14250         * class.cs, rootcontext.cs : Update accordingly.
14251
14252         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
14253         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
14254
14255         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
14256
14257         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
14258         of a fieldinfo using the above, when dealing with a FieldBuilder.
14259
14260 2001-11-10  Ravi Pratap  <ravi@ximian.com>
14261
14262         * ../errors/cs0031.cs : Add.
14263
14264         * ../errors/cs1008.cs : Add.
14265
14266         * ../errrors/cs0543.cs : Add.
14267
14268         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
14269         enum type.
14270
14271         (FindMembers): Implement.
14272
14273         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
14274         enums and delegates too.
14275
14276         (enum_types): Rename to builder_to_enum.
14277
14278         (delegate_types): Rename to builder_to_delegate.
14279
14280         * delegate.cs (FindMembers): Implement.
14281
14282 2001-11-09  Ravi Pratap  <ravi@ximian.com>
14283
14284         * typemanager.cs (IsEnumType): Implement.
14285
14286         * enum.cs (Emit): Re-write parts to account for the underlying type
14287         better and perform checking etc.
14288
14289         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
14290         of the underlying type.
14291
14292         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
14293         value
14294
14295         * enum.cs (error31): Helper to report error #31.
14296
14297         * cs-parser.jay (enum_declaration): Store location of each member too.
14298
14299         * enum.cs (member_to_location): New hashtable. 
14300
14301         (AddEnumMember): Update location hashtable.
14302
14303         (Emit): Use the location of each member while reporting errors.
14304
14305 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * cs-parser.jay: A for_initializer if is a
14308         local_variable_declaration really ammount to have an implicit
14309         block with the variable declaration and no initializer for for.
14310
14311         * statement.cs (For.Emit): Cope with null initializers.
14312
14313         This fixes the infinite loop on for initializers.
14314
14315 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
14316
14317         * enum.cs: More cleanup.
14318
14319         * ecore.cs: Remove dead code.
14320
14321         * class.cs (Property.Emit): More simplification.
14322         (Event.Emit): ditto.
14323
14324         Reworked to have less levels of indentation.
14325
14326 2001-11-08  Ravi Pratap  <ravi@ximian.com>
14327
14328         * class.cs (Property): Emit attributes.
14329
14330         (Field): Ditto.
14331
14332         (Event): Ditto.
14333
14334         (Indexer): Ditto.
14335
14336         (Operator): Ditto.
14337
14338         * enum.cs (Emit): Ditto.
14339
14340         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
14341         Enums too.
14342
14343         * class.cs (Field, Event, etc.): Move attribute generation into the
14344         Emit method everywhere.
14345
14346         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
14347         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
14348         as we had no way of defining nested enums !
14349
14350         * rootcontext.cs : Adjust code accordingly.
14351
14352         * typemanager.cs (AddEnumType): To keep track of enum types separately.
14353
14354 2001-11-07  Ravi Pratap  <ravi@ximian.com>
14355
14356         * expression.cs (EvalConstantExpression): Move into ecore.cs
14357
14358         * enum.cs (Enum): Rename some members and make them public and readonly
14359         according to our convention.
14360
14361         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
14362         nothing else.
14363
14364         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
14365
14366         (Enum::Emit): Write a simple version for now which doesn't try to compute
14367         expressions. I shall modify this to be more robust in just a while.
14368
14369         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
14370
14371         (TypeContainer::CloseType): Create the Enum types too.
14372
14373         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
14374
14375         * expression.cs (EvalConstantExpression): Get rid of completely.
14376
14377         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
14378         user-defined values and other cases.
14379
14380         (IsValidEnumLiteral): Helper function.
14381
14382         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
14383         out there in the case we had a literal FieldExpr.
14384
14385         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
14386
14387         (Literalize): Revamp a bit to take two arguments.
14388
14389         (EnumLiteral): New class which derives from Literal to wrap enum literals.
14390
14391 2001-11-06  Ravi Pratap  <ravi@ximian.com>
14392
14393         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
14394
14395         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
14396
14397         (Resolve): Use the above to ensure we have proper initializers.
14398
14399 2001-11-05  Ravi Pratap  <ravi@ximian.com>
14400
14401         * expression.cs (Expression::EvalConstantExpression): New method to 
14402         evaluate constant expressions.
14403
14404         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
14405
14406 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
14409         in an array.
14410
14411         (Binary.ResolveOperator): Handle operator != (object a, object b)
14412         and operator == (object a, object b);
14413
14414         (Binary.DoNumericPromotions): Indicate whether the numeric
14415         promotion was possible.
14416
14417         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
14418         Implement.  
14419
14420         Made the ArrayAccess implement interface IAssignMethod instead of
14421         IStackStore as the order in which arguments are passed reflects
14422         this.
14423
14424         * assign.cs: Instead of using expr.ExprClass to select the way of
14425         assinging, probe for the IStackStore/IAssignMethod interfaces.
14426
14427         * typemanager.cs: Load InitializeArray definition.
14428
14429         * rootcontext.cs (RootContext.MakeStaticData): Used to define
14430         static data that can be used to initialize arrays. 
14431
14432 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * expression.cs: Handle operator== and operator!= for booleans.
14435
14436         (Conditioal.Reduce): Implement reducer for the ?: operator.
14437
14438         (Conditional.Resolve): Implement dead code elimination.
14439
14440         (Binary.Resolve): Catch string literals and return a new
14441         concatenated string.
14442
14443         (Unary.Reduce): Implement reduction of unary expressions.
14444
14445         * ecore.cs: Split out the expression core handling here.
14446
14447         (Expression.Reduce): New method used to perform constant folding
14448         and CSE.  This is needed to support constant-expressions. 
14449
14450         * statement.cs (Statement.EmitBoolExpression): Pass true and false
14451         targets, and optimize for !x.
14452
14453 2001-11-04  Ravi Pratap  <ravi@ximian.com>
14454
14455         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
14456         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
14457         set custom atttributes.
14458
14459         * literal.cs (Literal::GetValue): New abstract method to return the actual
14460         value of the literal, cast as an object.
14461
14462         (*Literal): Implement GetValue method.
14463
14464         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
14465         expressions to the arraylist but objects of type Argument.
14466
14467         * class.cs (TypeContainer::Emit): Emit our attributes too.
14468
14469         (Method::Emit, Constructor::Emit): Ditto.
14470
14471         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
14472         to be ignoring earlier.
14473
14474 2001-11-03  Ravi Pratap  <ravi@ximian.com>
14475
14476         * attribute.cs (AttributeSection::Define): Implement to do the business
14477         of constructing a CustomAttributeBuilder.
14478
14479         (Attribute): New trivial class. Increases readability of code.  
14480
14481         * cs-parser.jay : Update accordingly.
14482
14483         (positional_argument_list, named_argument_list, named_argument): New rules
14484
14485         (attribute_arguments): Use the above so that we are more correct.
14486
14487 2001-11-02  Ravi Pratap  <ravi@ximian.com>
14488
14489         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
14490         to perform all checks for a method with a params parameter.
14491
14492         (Invocation::OverloadResolve): Update to use the above method and therefore
14493         cope correctly with params method invocations.
14494
14495         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
14496         params too.
14497
14498         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
14499         constructors in our parent too because we can't afford to miss out on 
14500         protected ones ;-)
14501
14502         * attribute.cs (AttributeSection): New name for the class Attribute
14503
14504         Other trivial changes to improve readability.
14505
14506         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
14507         use the new class names.
14508
14509 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14510
14511         * class.cs (Method::Define): Complete definition for params types too
14512
14513         (Indexer::Define): Ditto.
14514
14515         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
14516         Cope everywhere with a request for info about the array parameter.
14517
14518 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14519
14520         * tree.cs (RecordNamespace): Fix up to check for the correct key.
14521
14522         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
14523         local_variable_type to extract the string corresponding to the type.
14524
14525         (local_variable_type): Fixup the action to use the new helper method.
14526
14527         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
14528         go.
14529
14530         * expression.cs : Clean out code which uses the above.
14531
14532 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14533
14534         * typemanager.cs (RegisterMethod): Check if we already have an existing key
14535         and bale out if necessary by returning a false.
14536
14537         (RegisterProperty): Ditto.
14538
14539         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
14540         and print out appropriate error messages.
14541
14542         * interface.cs (everywhere): Ditto.
14543
14544         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
14545         location to constructor.
14546
14547         * class.cs (Property, Event, Indexer): Update accordingly.
14548
14549         * ../errors/cs111.cs : Added.
14550
14551         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
14552         of a method, as laid down by the spec.
14553
14554         (Invocation::OverloadResolve): Use the above method.
14555
14556 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14557
14558         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
14559         now take a TypeContainer and a Parameters object.
14560
14561         (ParameterData): Modify return type of ParameterModifier method to be 
14562         Parameter.Modifier and not a string.
14563
14564         (ReflectionParameters, InternalParameters): Update accordingly.
14565
14566         * expression.cs (Argument::GetParameterModifier): Same here.
14567
14568         * support.cs (InternalParameters::ParameterType): Find a better way of determining
14569         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
14570         symbol in it at all so maybe this is only for now.
14571
14572 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14573
14574         * support.cs (InternalParameters): Constructor now takes an extra argument 
14575         which is the actual Parameters class.
14576
14577         (ParameterDesc): Update to provide info on ref/out modifiers.
14578
14579         * class.cs (everywhere): Update call to InternalParameters to pass in
14580         the second argument too.
14581
14582         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14583         to return the modifier info [ref/out etc]
14584
14585         (InternalParameters, ReflectionParameters): Implement the above.
14586
14587         * expression.cs (Argument::ParameterModifier): Similar function to return
14588         info about the argument's modifiers.
14589
14590         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14591         too.
14592
14593         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14594         a new SetFormalParameters object which we pass to InternalParameters.
14595
14596 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14597
14598         * expression.cs (NewArray): Merge into the ArrayCreation class.
14599
14600 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14601
14602         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14603         NewUserdefinedArray into one as there wasn't much of a use in having
14604         two separate ones.
14605
14606         * expression.cs (Argument): Change field's name to ArgType from Type.
14607
14608         (Type): New readonly property which returns the proper type, taking into 
14609         account ref/out modifiers.
14610
14611         (everywhere): Adjust code accordingly for the above.
14612
14613         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14614         whether we are emitting for a ref or out parameter.
14615
14616         * expression.cs (Argument::Emit): Use the above field to set the state.
14617
14618         (LocalVariableReference::Emit): Update to honour the flag and emit the
14619         right stuff.
14620
14621         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14622
14623         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14624
14625         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14626
14627         (ReflectionParameters, InternalParameters): Implement the above method.
14628
14629         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14630         reporting errors.
14631
14632         (Invocation::FullMethodDesc): Ditto. 
14633
14634 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * cs-parser.jay: Add extra production for the second form of array
14637         creation. 
14638
14639         * expression.cs (ArrayCreation): Update to reflect the above
14640         change. 
14641
14642         * Small changes to prepare for Array initialization.
14643
14644 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * typemanager.cs (ImplementsInterface): interface might be null;
14647         Deal with this problem;
14648
14649         Also, we do store negative hits on the cache (null values), so use
14650         this instead of calling t.GetInterfaces on the type everytime.
14651
14652 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14653
14654         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14655
14656         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14657         split functionality out into different classes.
14658
14659         (New::FormArrayType): Move into NewBuiltinArray.
14660
14661         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14662         quite useless.
14663
14664         (NewBuiltinArray): New class to handle creation of built-in arrays.
14665
14666         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14667         account creation of one-dimensional arrays.
14668
14669         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14670
14671         (NewUserdefinedArray::DoResolve): Implement.
14672
14673         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14674
14675         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14676         we maintain inside the TypeManager. This is necessary to perform lookups on the
14677         module builder.
14678
14679         (LookupType): Update to perform GetType on the module builders too.     
14680
14681         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14682
14683         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14684
14685 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14686
14687         * expression.cs (New::DoResolve): Implement guts of array creation.
14688
14689         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14690
14691 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * expression.cs: Fix bug I introduced lsat night that broke
14694         Delegates. 
14695
14696         (Expression.Resolve): Report a 246 error (can not resolve name)
14697         if we find a SimpleName in the stream.
14698
14699         (Expression.ResolveLValue): Ditto.
14700
14701         (Expression.ResolveWithSimpleName): This function is a variant of
14702         ResolveName, this one allows SimpleNames to be returned without a
14703         warning.  The only consumer of SimpleNames is MemberAccess
14704
14705 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14706
14707         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14708         might arrive here.  I have my doubts that this is correct.
14709
14710         * statement.cs (Lock): Implement lock statement.
14711
14712         * cs-parser.jay: Small fixes to support `lock' and `using'
14713
14714         * cs-tokenizer.cs: Remove extra space
14715
14716         * driver.cs: New flag --checked, allows to turn on integer math
14717         checking. 
14718
14719         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14720         Threading.Monitor.Exit 
14721
14722 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14725         Expression Class to be IndexerAccess.
14726
14727         Notice that Indexer::DoResolve sets the eclass to Value.
14728
14729 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * class.cs (TypeContainer::Emit): Emit code for indexers.
14732
14733         * assign.cs (IAssignMethod): New interface implemented by Indexers
14734         and Properties for handling assignment.
14735
14736         (Assign::Emit): Simplify and reuse code. 
14737
14738         * expression.cs (IndexerAccess, PropertyExpr): Implement
14739         IAssignMethod, clean up old code. 
14740
14741 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14742
14743         * typemanager.cs (ImplementsInterface): New method to determine if a type
14744         implements a given interface. Provides a nice cache too.
14745
14746         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14747         method.
14748
14749         (ConvertReferenceExplicit): Ditto.
14750
14751         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14752         various methods, with correct names etc.
14753
14754         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14755         Operator.UnaryNegation.
14756
14757         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14758         we have a unary plus or minus operator.
14759
14760         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
14761         UnaryMinus.
14762
14763         * everywhere : update accordingly.
14764
14765         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
14766         respectively.
14767
14768         * class.cs (Method::Define): For the case where we are implementing a method
14769         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
14770         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
14771
14772 2001-10-21  Ravi Pratap  <ravi@ximian.com>
14773
14774         * interface.cs (FindMembers): Implement to work around S.R.E
14775         lameness.
14776
14777         * typemanager.cs (IsInterfaceType): Implement.
14778
14779         (FindMembers): Update to handle interface types too.
14780
14781         * expression.cs (ImplicitReferenceConversion): Re-write bits which
14782         use IsAssignableFrom as that is not correct - it doesn't work.
14783
14784         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
14785         and accordingly override EmitStatement.
14786
14787         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
14788         using the correct logic :-)
14789
14790 2001-10-19  Ravi Pratap  <ravi@ximian.com>
14791
14792         * ../errors/cs-11.cs : Add to demonstrate error -11 
14793
14794 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
14795
14796         * assign.cs (Assign::Resolve): Resolve right hand side first, and
14797         then pass this as a hint to ResolveLValue.
14798
14799         * expression.cs (FieldExpr): Add Location information
14800
14801         (FieldExpr::LValueResolve): Report assignment to readonly
14802         variable. 
14803
14804         (Expression::ExprClassFromMemberInfo): Pass location information.
14805
14806         (Expression::ResolveLValue): Add new method that resolves an
14807         LValue. 
14808
14809         (Expression::DoResolveLValue): Default invocation calls
14810         DoResolve. 
14811
14812         (Indexers): New class used to keep track of indexers in a given
14813         Type. 
14814
14815         (IStackStore): Renamed from LValue, as it did not really describe
14816         what this did.  Also ResolveLValue is gone from this interface and
14817         now is part of Expression.
14818
14819         (ElementAccess): Depending on the element access type
14820
14821         * typemanager.cs: Add `indexer_name_type' as a Core type
14822         (System.Runtime.CompilerServices.IndexerNameAttribute)
14823
14824         * statement.cs (Goto): Take a location.
14825
14826 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14827
14828         * delegate.cs (Delegate::VerifyDelegate): New method to verify
14829         if two delegates are compatible.
14830
14831         (NewDelegate::DoResolve): Update to take care of the case when
14832         we instantiate a delegate from another delegate.
14833
14834         * typemanager.cs (FindMembers): Don't even try to look up members
14835         of Delegate types for now.
14836
14837 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14838
14839         * delegate.cs (NewDelegate): New class to take care of delegate
14840         instantiation.
14841
14842         * expression.cs (New): Split the delegate related code out into 
14843         the NewDelegate class.
14844
14845         * delegate.cs (DelegateInvocation): New class to handle delegate 
14846         invocation.
14847
14848         * expression.cs (Invocation): Split out delegate related code into
14849         the DelegateInvocation class.
14850
14851 2001-10-17  Ravi Pratap  <ravi@ximian.com>
14852
14853         * expression.cs (New::DoResolve): Implement delegate creation fully
14854         and according to the spec.
14855
14856         (New::DoEmit): Update to handle delegates differently.
14857
14858         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
14859         because of which we were printing out arguments in reverse order !
14860
14861         * delegate.cs (VerifyMethod): Implement to check if the given method
14862         matches the delegate.
14863
14864         (FullDelegateDesc): Implement.
14865
14866         (VerifyApplicability): Implement.
14867
14868         * expression.cs (Invocation::DoResolve): Update to accordingly handle
14869         delegate invocations too.
14870
14871         (Invocation::Emit): Ditto.
14872
14873         * ../errors/cs1593.cs : Added.
14874
14875         * ../errors/cs1594.cs : Added.
14876
14877         * delegate.cs (InstanceExpression, TargetMethod): New properties.
14878
14879 2001-10-16  Ravi Pratap  <ravi@ximian.com>
14880
14881         * typemanager.cs (intptr_type): Core type for System.IntPtr
14882
14883         (InitCoreTypes): Update for the same.
14884
14885         (iasyncresult_type, asynccallback_type): Ditto.
14886
14887         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
14888         correct.
14889
14890         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
14891         too.
14892
14893         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
14894         the builders for the 4 members of a delegate type :-)
14895
14896         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
14897         type.
14898
14899         * expression.cs (New::DoResolve): Implement guts for delegate creation.
14900
14901         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
14902
14903 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * statement.cs (Break::Emit): Implement.   
14906         (Continue::Emit): Implement.
14907
14908         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14909         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14910         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14911         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
14912         end loop
14913
14914         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
14915         properties that track the label for the current loop (begin of the
14916         loop and end of the loop).
14917
14918 2001-10-15  Ravi Pratap  <ravi@ximian.com>
14919
14920         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
14921         use of emitting anything at all.
14922
14923         * class.cs, rootcontext.cs : Get rid of calls to the same.
14924
14925         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
14926
14927         (Populate): Define the constructor correctly and set the implementation
14928         attributes.
14929
14930         * typemanager.cs (delegate_types): New hashtable to hold delegates that
14931         have been defined.
14932
14933         (AddDelegateType): Implement.
14934
14935         (IsDelegateType): Implement helper method.
14936
14937         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
14938
14939         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
14940         and accordingly handle it.
14941
14942         * delegate.cs (Populate): Take TypeContainer argument.
14943         Implement bits to define the Invoke method. However, I still haven't figured out
14944         how to take care of the native int bit :-(
14945
14946         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
14947         Qualify the name of the delegate, not its return type !
14948
14949         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
14950         conversion.
14951
14952         (StandardConversionExists): Checking for array types turns out to be recursive.
14953
14954         (ConvertReferenceExplicit): Implement array conversion.
14955
14956         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
14957
14958 2001-10-12  Ravi Pratap  <ravi@ximian.com>
14959
14960         * cs-parser.jay (delegate_declaration): Store the fully qualified
14961         name as it is a type declaration.
14962
14963         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
14964         readonly.
14965
14966         (DefineDelegate): Renamed from Define. Does the same thing essentially,
14967         as TypeContainer::DefineType.
14968
14969         (Populate): Method in which all the definition of the various methods (Invoke)
14970         etc is done.
14971
14972         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
14973         see.
14974
14975         (CloseDelegate): Finally creates the delegate.
14976
14977         * class.cs (TypeContainer::DefineType): Update to define delegates.
14978         (Populate, Emit and CloseType): Do the same thing here too.
14979
14980         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
14981         delegates in all these operations.
14982
14983 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * expression.cs: LocalTemporary: a new expression used to
14986         reference a temporary that has been created.
14987
14988         * assign.cs: Handle PropertyAccess back here, so that we can
14989         provide the proper semantic access to properties.
14990
14991         * expression.cs (Expression::ConvertReferenceExplicit): Implement
14992         a few more explicit conversions. 
14993
14994         * modifiers.cs: `NEW' modifier maps to HideBySig.
14995
14996         * expression.cs (PropertyExpr): Make this into an
14997         ExpressionStatement, and support the EmitStatement code path. 
14998
14999         Perform get/set error checking, clean up the interface.
15000
15001         * assign.cs: recognize PropertyExprs as targets, and if so, turn
15002         them into toplevel access objects.
15003
15004 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
15005
15006         * expression.cs: PropertyExpr::PropertyExpr: use work around the
15007         SRE.
15008
15009         * typemanager.cs: Keep track here of our PropertyBuilders again to
15010         work around lameness in SRE.
15011
15012 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
15013
15014         * expression.cs (LValue::LValueResolve): New method in the
15015         interface, used to perform a second resolution pass for LValues. 
15016
15017         (This::DoResolve): Catch the use of this in static methods.
15018
15019         (This::LValueResolve): Implement.
15020
15021         (This::Store): Remove warning, assigning to `this' in structures
15022         is 
15023
15024         (Invocation::Emit): Deal with invocation of
15025         methods on value types.  We need to pass the address to structure
15026         methods rather than the object itself.  (The equivalent code to
15027         emit "this" for structures leaves the entire structure on the
15028         stack instead of a pointer to it). 
15029
15030         (ParameterReference::DoResolve): Compute the real index for the
15031         argument based on whether the method takes or not a `this' pointer
15032         (ie, the method is static).
15033
15034         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
15035         value types returned from functions when we need to invoke a
15036         method on the sturcture.
15037
15038
15039 2001-10-11  Ravi Pratap  <ravi@ximian.com>
15040
15041         * class.cs (TypeContainer::DefineType): Method to actually do the business of
15042         defining the type in the Modulebuilder or Typebuilder. This is to take
15043         care of nested types which need to be defined on the TypeBuilder using
15044         DefineNestedMethod.
15045
15046         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
15047         methods in RootContext, only ported to be part of TypeContainer.
15048
15049         (TypeContainer::GetInterfaceOrClass): Ditto.
15050
15051         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
15052
15053         * interface.cs (Interface::DefineInterface): New method. Does exactly
15054         what RootContext.CreateInterface did earlier, only it takes care of nested types 
15055         too.
15056
15057         (Interface::GetInterfaces): Move from RootContext here and port.
15058
15059         (Interface::GetInterfaceByName): Same here.
15060
15061         * rootcontext.cs (ResolveTree): Re-write.
15062
15063         (PopulateTypes): Re-write.
15064
15065         * class.cs (TypeContainer::Populate): Populate nested types too.
15066         (TypeContainer::Emit): Emit nested members too.
15067
15068         * typemanager.cs (AddUserType): Do not make use of the FullName property,
15069         instead just use the name argument passed in as it is already fully
15070         qualified.
15071
15072         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
15073         to TypeContainer mapping to see if a type is user-defined.
15074
15075         * class.cs (TypeContainer::CloseType): Implement. 
15076
15077         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
15078         the default constructor.
15079
15080         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
15081         twice.
15082
15083         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
15084
15085         * interface.cs (CloseType): Create the type here.
15086
15087         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
15088         the hierarchy.
15089
15090         Remove all the methods which are now in TypeContainer.
15091
15092 2001-10-10  Ravi Pratap  <ravi@ximian.com>
15093
15094         * delegate.cs (Define): Re-write bits to define the delegate
15095         correctly.
15096
15097 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
15100
15101         * expression.cs (ImplicitReferenceConversion): handle null as well
15102         as a source to convert to any reference type.
15103
15104         * statement.cs (Return): Perform any implicit conversions to
15105         expected return type.  
15106
15107         Validate use of return statement.  
15108
15109         * codegen.cs (EmitContext): Pass the expected return type here.
15110
15111         * class.cs (Method, Constructor, Property): Pass expected return
15112         type to EmitContext.
15113
15114 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
15115
15116         * expression.cs: Make DoResolve take an EmitContext instead of a
15117         TypeContainer.
15118
15119         Replaced `l' and `location' for `loc', for consistency.
15120
15121         (Error, Warning): Remove unneeded Tc argument.
15122
15123         * assign.cs, literal.cs, constant.cs: Update to new calling
15124         convention. 
15125
15126         * codegen.cs: EmitContext now contains a flag indicating whether
15127         code is being generated in a static method or not.
15128
15129         * cs-parser.jay: DecomposeQI, new function that replaces the old
15130         QualifiedIdentifier.  Now we always decompose the assembled
15131         strings from qualified_identifier productions into a group of
15132         memberaccesses.
15133
15134 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * rootcontext.cs: Deal with field-less struct types correctly now
15137         by passing the size option to Define Type.
15138
15139         * class.cs: Removed hack that created one static field. 
15140
15141 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * statement.cs: Moved most of the code generation here. 
15144
15145 2001-10-09  Ravi Pratap  <ravi@ximian.com>
15146
15147         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
15148         seem very right.
15149
15150         (ElementAccess): Remove useless bits for now - keep checks as the spec
15151         says.
15152
15153 2001-10-08  Ravi Pratap  <ravi@ximian.com>
15154
15155         * expression.cs (ElementAccess::DoResolve): Remove my crap code
15156         and start performing checks according to the spec.
15157
15158 2001-10-07  Ravi Pratap  <ravi@ximian.com>
15159
15160         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
15161         rank_specifiers instead.
15162
15163         (rank_specifiers): Change the order in which the rank specifiers are stored
15164
15165         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
15166
15167         * expression.cs (ElementAccess): Implement the LValue interface too.
15168
15169 2001-10-06  Ravi Pratap  <ravi@ximian.com>
15170
15171         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
15172         except that user defined conversions are not included.
15173
15174         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
15175         perform the conversion of the return type, if necessary.
15176
15177         (New::DoResolve): Check whether we are creating an array or an object
15178         and accordingly do the needful.
15179
15180         (New::Emit): Same here.
15181
15182         (New::DoResolve): Implement guts of array creation.
15183
15184         (New::FormLookupType): Helper function.
15185
15186 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15187
15188         * codegen.cs: Removed most of the code generation here, and move the
15189         corresponding code generation bits to the statement classes. 
15190
15191         Added support for try/catch/finalize and throw.
15192
15193         * cs-parser.jay: Added support for try/catch/finalize.
15194
15195         * class.cs: Catch static methods having the flags override,
15196         virtual or abstract.
15197
15198         * expression.cs (UserCast): This user cast was not really doing
15199         what it was supposed to do.  Which is to be born in fully resolved
15200         state.  Parts of the resolution were being performed at Emit time! 
15201
15202         Fixed this code.
15203
15204 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * expression.cs: Implicity convert the result from UserCast.
15207
15208 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15209
15210         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
15211         prevented it from working correctly. 
15212
15213         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
15214         merely ConvertImplicit.
15215
15216 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15217
15218         * typemanager.cs: Make the LookupTypeContainer function static,
15219         and not per-instance.  
15220
15221         * class.cs: Make static FindMembers (the one that takes a Type
15222         argument). 
15223
15224         * codegen.cs: Add EmitForeach here.
15225
15226         * cs-parser.jay: Make foreach a toplevel object instead of the
15227         inline expansion, as we need to perform semantic analysis on it. 
15228
15229 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15230
15231         * expression.cs (Expression::ImplicitUserConversion): Rename to
15232         UserDefinedConversion.
15233
15234         (Expression::UserDefinedConversion): Take an extra argument specifying 
15235         whether we look for explicit user conversions too.
15236
15237         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
15238
15239         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
15240
15241         (ExplicitUserConversion): Make it a call to UserDefinedConversion
15242         with the appropriate arguments.
15243
15244         * cs-parser.jay (cast_expression): Record location too.
15245
15246         * expression.cs (Cast): Record location info.
15247
15248         (Expression::ConvertExplicit): Take location argument.
15249
15250         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
15251         to determine if we are doing explicit conversions.
15252
15253         (UserCast::Emit): Update accordingly.
15254
15255         (Expression::ConvertExplicit): Report an error if everything fails.
15256
15257         * ../errors/cs0030.cs : Add.
15258
15259 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * modifiers.cs: If the ABSTRACT keyword is present, also set the
15262         virtual and newslot bits. 
15263
15264         * class.cs (TypeContainer::RegisterRequiredImplementations):
15265         Record methods we need.
15266
15267         (TypeContainer::MakeKey): Helper function to make keys for
15268         MethodBases, since the Methodbase key is useless.
15269
15270         (TypeContainer::Populate): Call RegisterRequiredImplementations
15271         before defining the methods.   
15272
15273         Create a mapping for method_builders_to_methods ahead of time
15274         instead of inside a tight loop.
15275
15276         (::RequireMethods):  Accept an object as the data to set into the
15277         hashtable so we can report interface vs abstract method mismatch.
15278
15279 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * report.cs: Make all of it static.
15282
15283         * rootcontext.cs: Drop object_type and value_type computations, as
15284         we have those in the TypeManager anyways.
15285
15286         Drop report instance variable too, now it is a global.
15287
15288         * driver.cs: Use try/catch on command line handling.
15289
15290         Add --probe option to debug the error reporting system with a test
15291         suite. 
15292
15293         * report.cs: Add support for exiting program when a probe
15294         condition is reached.
15295
15296 2001-10-03  Ravi Pratap  <ravi@ximian.com>
15297
15298         * expression.cs (Binary::DoNumericPromotions): Fix the case when
15299         we do a forcible conversion regardless of type, to check if 
15300         ForceConversion returns a null.
15301
15302         (Binary::error19): Use location to report error.
15303
15304         (Unary::error23): Use location here too.
15305
15306         * ../errors/cs0019.cs : Check in.
15307
15308         * ../errors/cs0023.cs : Check in.
15309
15310         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
15311         case of a non-null MethodInfo object with a length of 0 !
15312
15313         (Binary::ResolveOperator): Flag error if overload resolution fails to find
15314         an applicable member - according to the spec :-)
15315         Also fix logic to find members in base types.
15316
15317         (Unary::ResolveOperator): Same here.
15318
15319         (Unary::report23): Change name to error23 and make first argument a TypeContainer
15320         as I was getting thoroughly confused between this and error19 :-)
15321
15322         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
15323         (::FindMostEncompassedType): Implement.
15324         (::FindMostEncompassingType): Implement.
15325         (::StandardConversionExists): Implement.
15326
15327         (UserImplicitCast): Re-vamp. We now need info about most specific
15328         source and target types so that we can do the necessary conversions.
15329
15330         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
15331         mathematical union with no duplicates.
15332
15333 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15334
15335         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
15336         in order from base classes to child classes, so that we can in
15337         child classes look up in our parent for method names and
15338         attributes (required for handling abstract, virtual, new, override
15339         constructs: we need to instrospect our base class, and if we dont
15340         populate the classes in order, the introspection might be
15341         incorrect.  For example, a method could query its parent before
15342         the parent has any methods and would determine that the parent has
15343         no abstract methods (while it could have had them)).
15344
15345         (RootContext::CreateType): Record the order in which we define the
15346         classes.
15347
15348 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * class.cs (TypeContainer::Populate): Also method definitions can
15351         fail now, keep track of this.
15352
15353         (TypeContainer::FindMembers): Implement support for
15354         DeclaredOnly/noDeclaredOnly flag.
15355
15356         (Constructor::Emit) Return the ConstructorBuilder.
15357
15358         (Method::Emit) Return the MethodBuilder. 
15359         Check for abstract or virtual methods to be public.
15360
15361         * rootcontext.cs (RootContext::CreateType): Register all the
15362         abstract methods required for the class to be complete and the
15363         interface methods that must be implemented. 
15364
15365         * cs-parser.jay: Report error 501 (method requires body if it is
15366         not marked abstract or extern).
15367
15368         * expression.cs (TypeOf::Emit): Implement.
15369
15370         * typemanager.cs: runtime_handle_type, new global type.
15371
15372         * class.cs (Property::Emit): Generate code for properties.
15373
15374 2001-10-02  Ravi Pratap  <ravi@ximian.com>
15375
15376         * expression.cs (Unary::ResolveOperator): Find operators on base type
15377         too - we now conform exactly to the spec.
15378
15379         (Binary::ResolveOperator): Same here.
15380
15381         * class.cs (Operator::Define): Fix minor quirk in the tests.
15382
15383         * ../errors/cs0215.cs : Added.
15384
15385         * ../errors/cs0556.cs : Added.
15386
15387         * ../errors/cs0555.cs : Added.
15388
15389 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15390
15391         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
15392         single integer which is really efficient
15393
15394 2001-10-01  Ravi Pratap  <ravi@ximian.com>
15395
15396         *  expression.cs (Expression::ImplicitUserConversion): Use location
15397         even in the case when we are examining True operators.
15398  
15399         * class.cs (Operator::Define): Perform extensive checks to conform
15400         with the rules for operator overloading in the spec.
15401
15402         * expression.cs (Expression::ImplicitReferenceConversion): Implement
15403         some of the other conversions mentioned in the spec.
15404
15405         * typemanager.cs (array_type): New static member for the System.Array built-in
15406         type.
15407
15408         (cloneable_interface): For System.ICloneable interface.
15409
15410         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
15411         we start resolving the tree and populating types.
15412
15413         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
15414  
15415 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15416
15417         * expression.cs (Expression::ExprClassFromMemberInfo,
15418         Expression::Literalize): Create literal expressions from
15419         FieldInfos which are literals.
15420
15421         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
15422         type casts, because they were wrong.  The test suite in tests
15423         caught these ones.
15424
15425         (ImplicitNumericConversion): ushort to ulong requires a widening
15426         cast. 
15427
15428         Int32 constant to long requires widening cast as well.
15429
15430         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
15431         for integers because the type on the stack is not i4.
15432
15433 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
15434
15435         * expression.cs (report118): require location argument. 
15436
15437         * parameter.cs: Do not dereference potential null value.
15438
15439         * class.cs: Catch methods that lack the `new' keyword when
15440         overriding a name.  Report warnings when `new' is used without
15441         anything being there to override.
15442
15443         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
15444
15445         * class.cs: Only add constructor to hashtable if it is non-null
15446         (as now constructors can fail on define).
15447
15448         (TypeManager, Class, Struct): Take location arguments.
15449
15450         Catch field instance initialization in structs as errors.
15451
15452         accepting_filter: a new filter for FindMembers that is static so
15453         that we dont create an instance per invocation.
15454
15455         (Constructor::Define): Catch errors where a struct constructor is
15456         parameterless 
15457
15458         * cs-parser.jay: Pass location information for various new
15459         constructs. 
15460
15461         * delegate.cs (Delegate): take a location argument.
15462
15463         * driver.cs: Do not call EmitCode if there were problesm in the
15464         Definition of the types, as many Builders wont be there. 
15465
15466         * decl.cs (Decl::Decl): Require a location argument.
15467
15468         * cs-tokenizer.cs: Handle properly hex constants that can not fit
15469         into integers, and find the most appropiate integer for it.
15470
15471         * literal.cs: Implement ULongLiteral.
15472
15473         * rootcontext.cs: Provide better information about the location of
15474         failure when CreateType fails.
15475
15476 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
15477
15478         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
15479         as well.
15480
15481         * expression.cs (Binary::CheckShiftArguments): Add missing type
15482         computation.
15483         (Binary::ResolveOperator): Add type to the logical and and logical
15484         or, Bitwise And/Or and Exclusive Or code paths, it was missing
15485         before.
15486
15487         (Binary::DoNumericPromotions): In the case where either argument
15488         is ulong (and most signed types combined with ulong cause an
15489         error) perform implicit integer constant conversions as well.
15490
15491 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15492
15493         * expression.cs (UserImplicitCast): Method should always be
15494         non-null. 
15495         (Invocation::BetterConversion): Simplified test for IntLiteral.
15496
15497         (Expression::ImplicitNumericConversion): Split this routine out.
15498         Put the code that performs implicit constant integer conversions
15499         here. 
15500
15501         (Expression::Resolve): Become a wrapper around DoResolve so we can
15502         check eclass and type being set after resolve.
15503
15504         (Invocation::Badness): Remove this dead function
15505
15506         (Binary::ResolveOperator): Do not compute the expensive argumnets
15507         unless we have a union for it.
15508
15509         (Probe::Emit): Is needs to do an isinst and then
15510         compare against null.
15511
15512         (::CanConvert): Added Location argument.  If the Location argument
15513         is null (Location.Null), then we do not report errors.  This is
15514         used by the `probe' mechanism of the Explicit conversion.  We do
15515         not want to generate an error for something that the user
15516         explicitly requested to be casted.  But the pipeline for an
15517         explicit cast first tests for potential implicit casts.
15518
15519         So for now, if the Location is null, it means `Probe only' to
15520         avoid adding another argument.   Might have to revise this
15521         strategy later.
15522
15523         (ClassCast): New class used to type cast objects into arbitrary
15524         classes (used in Explicit Reference Conversions).
15525
15526         Implement `as' as well.
15527
15528         Reverted all the patches from Ravi below: they were broken:
15529
15530                 * The use of `level' as a mechanism to stop recursive
15531                   invocations is wrong.  That was there just to catch the
15532                   bug with a strack trace but not as a way of addressing
15533                   the problem.
15534
15535                   To fix the problem we have to *understand* what is going
15536                   on and the interactions and come up with a plan, not
15537                   just get things going.
15538
15539                 * The use of the type conversion cache that I proposed
15540                   last night had an open topic: How does this work across
15541                   protection domains.  A user defined conversion might not
15542                   be public in the location where we are applying the
15543                   conversion, a different conversion might be selected
15544                   (ie, private A->B (better) but public B->A (worse),
15545                   inside A, A->B applies, but outside it, B->A will
15546                   apply).
15547
15548                 * On top of that (ie, even if the above is solved),
15549                   conversions in a cache need to be abstract.  Ie, `To
15550                   convert from an Int to a Short use an OpcodeCast', not
15551                   `To convert from an Int to a Short use the OpcodeCast on
15552                   the variable 5' (which is what this patch was doing).
15553
15554 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15555
15556         * expression.cs (Invocation::ConversionExists): Re-write to use
15557         the conversion cache
15558
15559         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
15560         cache all conversions done, not just user-defined ones.
15561
15562         (Invocation::BetterConversion): The real culprit. Use ConversionExists
15563         to determine if a conversion exists instead of acutually trying to 
15564         perform the conversion. It's faster too.
15565
15566         (Expression::ConvertExplicit): Modify to use ConversionExists to check
15567         and only then attempt the implicit conversion.
15568
15569 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15570
15571         * expression.cs (ConvertImplicit): Use a cache for conversions
15572         already found. Check level of recursion and bail out if necessary.
15573
15574 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15575
15576         * typemanager.cs (string_concat_string_string, string_concat_object_object):
15577         Export standard methods that we expect for string operations.
15578
15579         * statement.cs (Block::UsageWarning): Track usage of variables and
15580         report the errors for not used variables.
15581
15582         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15583         operator. 
15584
15585 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * codegen.cs: remove unnneded code 
15588
15589         * expression.cs: Removed BuiltinTypeAccess class
15590
15591         Fix the order in which implicit conversions are
15592         done.  
15593
15594         The previous fixed dropped support for boxed conversions (adding a
15595         test to the test suite now)
15596
15597         (UserImplicitCast::CanConvert): Remove test for source being null,
15598         that code is broken.  We should not feed a null to begin with, if
15599         we do, then we should track the bug where the problem originates
15600         and not try to cover it up here.
15601
15602         Return a resolved expression of type UserImplicitCast on success
15603         rather than true/false.  Ravi: this is what I was talking about,
15604         the pattern is to use a static method as a "constructor" for
15605         objects. 
15606
15607         Also, do not create arguments until the very last minute,
15608         otherwise we always create the arguments even for lookups that
15609         will never be performed. 
15610
15611         (UserImplicitCast::Resolve): Eliminate, objects of type
15612         UserImplicitCast are born in a fully resolved state. 
15613
15614         * typemanager.cs (InitCoreTypes): Init also value_type
15615         (System.ValueType). 
15616
15617         * expression.cs (Cast::Resolve): First resolve the child expression.
15618
15619         (LValue): Add new method AddressOf to be used by
15620         the `&' operator.  
15621
15622         Change the argument of Store to take an EmitContext instead of an
15623         ILGenerator, because things like FieldExpr need to be able to call
15624         their children expression to generate the instance code. 
15625
15626         (Expression::Error, Expression::Warning): Sugar functions for
15627         reporting errors.
15628
15629         (Expression::MemberLookup): Accept a TypeContainer instead of a
15630         Report as the first argument.
15631
15632         (Expression::ResolvePrimary): Killed.  I still want to improve
15633         this as currently the code is just not right.
15634
15635         (Expression::ResolveMemberAccess): Simplify, but it is still
15636         wrong. 
15637
15638         (Unary::Resolve): Catch errors in AddressOf operators.
15639
15640         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15641         index to a byte for the short-version, or the compiler will choose
15642         the wrong Emit call, which generates the wrong data.
15643
15644         (ParameterReference::Emit, ::Store): same.
15645
15646         (FieldExpr::AddressOf): Implement.
15647
15648         * typemanager.cs: TypeManager: made public variable instead of
15649         property.
15650
15651         * driver.cs: document --fatal.
15652
15653         * report.cs (ErrorMessage, WarningMessage): new names for the old
15654         Error and Warning classes.
15655
15656         * cs-parser.jay (member_access): Turn built-in access to types
15657         into a normal simplename
15658
15659 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15660
15661         * expression.cs (Invocation::BetterConversion): Fix to cope
15662         with q being null, since this was introducing a bug.
15663
15664         * expression.cs (ConvertImplicit): Do built-in conversions first.
15665
15666 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15667
15668         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15669
15670 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15671
15672         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15673         I had introduced long ago (what's new ?).
15674
15675         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15676         the work of all the checking. 
15677         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15678         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15679
15680         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15681         that is the right way. 
15682
15683         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15684         overloading resolution. Use everywhere instead of cutting and pasting code.
15685
15686         (Binary::ResolveOperator): Use MakeUnionSet.
15687
15688         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15689         we have to convert to bool types. Not complete yet.
15690
15691 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * typemanager.cs (TypeManager::CSharpName): support ushort.
15694
15695         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15696         to provide an expression that performsn an implicit constant int
15697         conversion (section 6.1.6).
15698         (Expression::ConvertImplicitRequired): Reworked to include
15699         implicit constant expression conversions.
15700
15701         (Expression::ConvertNumericExplicit): Finished.
15702
15703         (Invocation::Emit): If InstanceExpression is null, then it means
15704         that we perform a call on this.
15705
15706 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * expression.cs (Unary::Emit): Remove some dead code.
15709         (Probe): Implement Resolve and Emit for `is'.
15710         (Expression::ConvertImplicitRequired): Attempt to do constant
15711         expression conversions here.  Maybe should be moved to
15712         ConvertImplicit, but I am not sure.
15713         (Expression::ImplicitLongConstantConversionPossible,
15714         Expression::ImplicitIntConstantConversionPossible): New functions
15715         that tell whether is it possible to apply an implicit constant
15716         expression conversion.
15717
15718         (ConvertNumericExplicit): Started work on explicit numeric
15719         conversions.
15720
15721         * cs-parser.jay: Update operator constants.
15722
15723         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15724         (Parameters::GetSignature): Hook up VerifyArgs here.
15725         (Parameters::VerifyArgs): Verifies that no two arguments have the
15726         same name. 
15727
15728         * class.cs (Operator): Update the operator names to reflect the
15729         ones that the spec expects (as we are just stringizing the
15730         operator names).
15731
15732         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15733         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15734         previous usage did only work for our methods.
15735         (Expression::ConvertImplicit): Handle decimal implicit numeric
15736         conversions as well.
15737         (Expression::InternalTypeConstructor): Used to invoke constructors
15738         on internal types for default promotions.
15739
15740         (Unary::Emit): Implement special handling for the pre/post
15741         increment/decrement for overloaded operators, as they need to have
15742         the same semantics as the other operators.
15743
15744         (Binary::ResolveOperator): ditto.
15745         (Invocation::ConversionExists): ditto.
15746         (UserImplicitCast::Resolve): ditto.
15747
15748 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15749
15750         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15751         operator, return after emitting body. Regression tests pass again !
15752
15753         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15754         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15755         (Invocation::OverloadResolve): Ditto.
15756         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15757
15758         * everywhere : update calls to the above methods accordingly.
15759
15760 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * assign.cs (Assign): Make it inherit from ExpressionStatement.
15763
15764         * expression.cs (ExpressionStatement): New base class used for
15765         expressions that can appear in statements, so that we can provide
15766         an alternate path to generate expression that do not leave a value
15767         on the stack.
15768
15769         (Expression::Emit, and all the derivatives): We no longer return
15770         whether a value is left on the stack or not.  Every expression
15771         after being emitted leaves a single value on the stack.
15772
15773         * codegen.cs (EmitContext::EmitStatementExpression): Use the
15774         facilties of ExpressionStatement if possible.
15775
15776         * cs-parser.jay: Update statement_expression.
15777
15778 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * driver.cs: Change the wording of message
15781
15782 2001-09-25  Ravi Pratap  <ravi@ximian.com>
15783
15784         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
15785         the type of the expression to the return type of the method if
15786         we have an overloaded operator match ! The regression tests pass again !
15787         (Unary::ResolveOperator): Ditto.
15788
15789         * expression.cs (Invocation::ConversionExists): Correct the member lookup
15790         to find "op_Implicit", not "implicit" ;-)
15791         (UserImplicitCast): New class to take care of user-defined implicit conversions.
15792         (ConvertImplicit, ForceConversion): Take TypeContainer argument
15793
15794         * everywhere : Correct calls to the above accordingly.
15795
15796         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
15797         (ConvertImplicit): Do user-defined conversion if it exists.
15798
15799 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
15800
15801         * assign.cs: track location.
15802         (Resolve): Use implicit conversions on assignment.
15803
15804         * literal.cs: Oops.  Not good, Emit of short access values should
15805         pass (Bytes) or the wrong argument will be selected.
15806
15807         * expression.cs (Unary::Emit): Emit code for -expr.
15808
15809         (Unary::ResolveOperator): Handle `Substract' for non-constants
15810         (substract from zero from the non-constants).
15811         Deal with Doubles as well. 
15812
15813         (Expression::ConvertImplicitRequired): New routine that reports an
15814         error if no implicit conversion exists. 
15815
15816         (Invocation::OverloadResolve): Store the converted implicit
15817         expressions if we make them
15818
15819 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15820
15821         * class.cs (ConstructorInitializer): Take a Location argument.
15822         (ConstructorBaseInitializer): Same here.
15823         (ConstructorThisInitializer): Same here.
15824
15825         * cs-parser.jay : Update all calls accordingly.
15826
15827         * expression.cs (Unary, Binary, New): Take location argument.
15828         Update accordingly everywhere.
15829
15830         * cs-parser.jay : Update all calls to the above to take a location
15831         argument.
15832
15833         * class.cs : Ditto.
15834
15835 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15836
15837         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
15838         (Invocation::BetterConversion): Same here
15839         (Invocation::ConversionExists): Ditto.
15840
15841         (Invocation::ConversionExists): Implement.
15842
15843 2001-09-22  Ravi Pratap  <ravi@ximian.com>
15844
15845         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
15846         Also take an additional TypeContainer argument.
15847
15848         * All over : Pass in TypeContainer as argument to OverloadResolve.
15849
15850         * typemanager.cs (CSharpName): Update to check for the string type and return
15851         that too.
15852
15853         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
15854         a given method.
15855
15856 2001-09-21  Ravi Pratap  <ravi@ximian.com>
15857
15858         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
15859         (Invocation::BetterFunction): Implement.
15860         (Invocation::BetterConversion): Implement.
15861         (Invocation::ConversionExists): Skeleton, no implementation yet.
15862
15863         Okay, things work fine !
15864
15865 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
15866
15867         * typemanager.cs: declare and load enum_type, delegate_type and
15868         void_type. 
15869
15870         * expression.cs (Expression::Emit): Now emit returns a value that
15871         tells whether a value is left on the stack or not.  This strategy
15872         might be reveted tomorrow with a mechanism that would address
15873         multiple assignments.
15874         (Expression::report118): Utility routine to report mismatches on
15875         the ExprClass.
15876
15877         (Unary::Report23): Report impossible type/operator combination
15878         utility function.
15879
15880         (Unary::IsIncrementableNumber): Whether the type can be
15881         incremented or decremented with add.
15882         (Unary::ResolveOperator): Also allow enumerations to be bitwise
15883         complemented. 
15884         (Unary::ResolveOperator): Implement ++, !, ~,
15885
15886         (Invocation::Emit): Deal with new Emit convetion.
15887
15888         * All Expression derivatives: Updated their Emit method to return
15889         whether they leave values on the stack or not.
15890
15891         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
15892         stack for expressions that are statements. 
15893
15894 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * expression.cs (LValue): New interface.  Must be implemented by
15897         LValue objects.
15898         (LocalVariableReference, ParameterReference, FieldExpr): Implement
15899         LValue interface.
15900
15901         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
15902         interface for generating code, simplifies the code.
15903
15904 2001-09-20  Ravi Pratap  <ravi@ximian.com>
15905
15906         * expression.cs (everywhere): Comment out return statements in ::Resolve
15907         methods to avoid the warnings.
15908
15909 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15910
15911         * driver.cs (parse): Report error 2001 if we can not open the
15912         source file.
15913
15914         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
15915         not resolve it.
15916
15917         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
15918         object. 
15919
15920         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
15921         otherwise nested blocks end up with the same index.
15922
15923         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
15924
15925         * expression.cs:  Instead of having FIXMEs in the Resolve
15926         functions, throw exceptions so it is obvious that we are facing a
15927         bug. 
15928
15929         * cs-parser.jay (invocation_expression): Pass Location information.
15930
15931         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
15932         Use a basename for those routines because .NET does not like paths
15933         on them. 
15934
15935         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
15936         already defined.
15937
15938 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
15939
15940         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
15941         are loading the correct data types (throws an exception if not).
15942         (TypeManager::InitCoreTypes): Use CoreLookupType
15943
15944         * expression.cs (Unary::ResolveOperator): return the child
15945         expression for expressions which are just +expr.
15946         (Unary::ResolveOperator): Return negative literals for -LITERAL
15947         expressions (otherwise they are Unary {Literal}).
15948         (Invocation::Badness): Take into account `Implicit constant
15949         expression conversions'.
15950
15951         * literal.cs (LongLiteral): Implement long literal class.
15952         (IntLiteral): export the `Value' of the intliteral. 
15953
15954 2001-09-19  Ravi Pratap  <ravi@ximian.com>
15955
15956         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
15957
15958         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
15959         instead of 'Operator'
15960
15961         * expression.cs (Binary::ResolveOperator): Update accordingly.
15962         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
15963         and 'Minus'
15964
15965         * cs-parser.jay (unary_expression): Update to use the new names.
15966
15967         * gen-treedump.cs (GetUnary): Same here.
15968
15969         * expression.cs (Unary::Resolve): Implement.
15970         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
15971         operators are found instead of making noise ;-)
15972         (Unary::ResolveOperator): New method to do precisely the same thing which
15973         Binary::ResolveOperator does for Binary expressions.
15974         (Unary.method, .Arguments): Add.
15975         (Unary::OperName): Implement.   
15976         (Unary::ForceConversion): Copy and Paste !
15977
15978         * class.cs (Operator::Define): Fix a small bug for the case when we have 
15979         a unary operator.
15980
15981         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
15982         for the inbuilt operators. Only overloading works for now ;-)
15983
15984 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
15985
15986         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
15987         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
15988
15989         * expression.cs (This::Emit): Implement. 
15990         (This::Resolve): Implement.
15991         (TypeOf:Resolve): Implement.
15992         (Expression::ResolveSimpleName): Add an implicit this to instance
15993         field references. 
15994         (MemberAccess::Resolve): Deal with Parameters and Fields. 
15995         Bind instance variable to Field expressions.
15996         (FieldExpr::Instance): New field used to track the expression that
15997         represents the object instance.
15998         (FieldExpr::Resolve): Track potential errors from MemberLookup not
15999         binding 
16000         (FieldExpr::Emit): Implement.
16001
16002         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
16003         the last instruction contains a return opcode to avoid generating
16004         the last `ret' instruction (this generates correct code, and it is
16005         nice to pass the peverify output).
16006
16007         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
16008         initializer for static and instance variables.
16009         (Constructor::Emit): Allow initializer to be null in the case of
16010         static constructors.  Only emit initializer for instance
16011         constructors. 
16012
16013         (TypeContainer::FindMembers): Return a null array if there are no
16014         matches.
16015
16016         Also fix the code for the MemberTypes.Method branch, as it was not
16017         scanning that for operators (or tried to access null variables before).
16018
16019         * assign.cs (Assign::Emit): Handle instance and static fields. 
16020
16021         * TODO: Updated.
16022
16023         * driver.cs: Stop compilation if there are parse errors.
16024
16025         * cs-parser.jay (constructor_declaration): Provide default base
16026         initializer for non-static constructors.
16027         (constructor_declarator): Do not provide a default base
16028         initializers if none was specified.
16029         Catch the fact that constructors should not have parameters.
16030
16031         * class.cs: Do not emit parent class initializers for static
16032         constructors, that should be flagged as an error.
16033
16034 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16035
16036         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
16037         Move back code into TypeContainer::Populate.
16038
16039 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16040
16041         * class.cs (TypeContainer::AddConstructor): Fix the check to
16042         compare against Name, not Basename. 
16043         (Operator::OpType): Change Plus and Minus to Add and Subtract.
16044
16045         * cs-parser.jay : Update accordingly.
16046
16047         * class.cs (TypeContainer::FindMembers): For the case where we are searching
16048         for methods, don't forget to look into the operators too.
16049         (RegisterMethodBuilder): Helper method to take care of this for
16050         methods, constructors and operators.
16051         (Operator::Define): Completely revamp.
16052         (Operator.OperatorMethod, MethodName): New fields.
16053         (TypeContainer::Populate): Move the registering of builders into
16054         RegisterMethodBuilder.
16055         (Operator::Emit): Re-write.
16056
16057         * expression.cs (Binary::Emit): Comment out code path to emit method
16058         invocation stuff for the case when we have a user defined operator. I am
16059         just not able to get it right !
16060
16061 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16062
16063         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
16064         argument. 
16065
16066         (Expression::MemberLookup): Provide a version that allows to
16067         specify the MemberTypes and BindingFlags. 
16068
16069         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
16070         so it was not fetching variable information from outer blocks.
16071
16072         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
16073         Beforefieldinit as it was buggy.
16074
16075         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
16076         that Ravi put here.  
16077
16078         * class.cs (Constructor::Emit): Only emit if block is not null.
16079         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
16080         deal with this by semantically definining it as if the user had
16081         done it.
16082
16083         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
16084         constructors as we now "emit" them at a higher level.
16085
16086         (TypeContainer::DefineDefaultConstructor): Used to define the
16087         default constructors if none was provided.
16088
16089         (ConstructorInitializer): Add methods Resolve and Emit. 
16090
16091         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
16092
16093 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16094
16095         * class.cs (TypeContainer::EmitDefaultConstructor): Register
16096         the default constructor builder with our hashtable for methodbuilders
16097         to methodcores.
16098
16099         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
16100         and argument_count is 0 in which case we have a match.
16101         (Binary::ResolveOperator): More null checking and miscellaneous coding
16102         style cleanup.
16103
16104 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16105
16106         * rootcontext.cs (IsNameSpace): Compare against null.
16107
16108         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
16109
16110         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
16111         and Unary::Operator.
16112
16113         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
16114         accordingly.
16115
16116         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
16117         we have overloaded operators.
16118         (Binary::ResolveOperator): Implement the part which does the operator overload
16119         resolution.
16120
16121         * class.cs (Operator::Emit): Implement.
16122         (TypeContainer::Emit): Emit the operators we have too.
16123
16124         * expression.cs (Binary::Emit): Update to emit the appropriate code for
16125         the case when we have a user-defined operator.
16126
16127 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16128
16129         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
16130
16131 2001-09-16  Ravi Pratap  <ravi@ximian.com>
16132
16133         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
16134         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
16135         (Constructor::Emit): Implement.
16136         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
16137         if we have no work to do. 
16138         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
16139         Emit method.
16140
16141         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
16142         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
16143
16144         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
16145         of parent.parent.
16146
16147 2001-09-15  Ravi Pratap  <ravi@ximian.com>
16148
16149         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
16150         in the source.
16151         (Tree::RecordNamespace): Method to do what the name says ;-)
16152         (Tree::Namespaces): Property to get at the namespaces hashtable.
16153
16154         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
16155         keep track.
16156
16157         * rootcontext.cs (IsNamespace): Fixed it :-)
16158
16159 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16160
16161         * class.cs (TypeContainer::FindMembers): Add support for
16162         constructors. 
16163         (MethodCore): New class that encapsulates both the shared aspects
16164         of a Constructor and a Method.  
16165         (Method, Constructor): Factored pieces into MethodCore.
16166
16167         * driver.cs: Added --fatal which makes errors throw exceptions.
16168         Load System assembly as well as part of the standard library.
16169
16170         * report.cs: Allow throwing exceptions on errors for debugging.
16171
16172         * modifiers.cs: Do not use `parent', instead use the real type
16173         container to evaluate permission settings.
16174
16175         * class.cs: Put Ravi's patch back in.  He is right, and we will
16176         have to cope with the
16177
16178 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16179
16180         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
16181         FamORAssem, not FamANDAssem.
16182
16183 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * driver.cs: Added --parse option that only parses its input files
16186         and terminates.
16187
16188         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
16189         incorrect.  IsTopLevel is not used to tell whether an object is
16190         root_types or not (that can be achieved by testing this ==
16191         root_types).  But to see if this is a top-level *class* (not
16192         necessarly our "toplevel" container). 
16193
16194 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16195
16196         * enum.cs (Enum::Define): Modify to call the Lookup method on the
16197         parent instead of a direct call to GetType.
16198
16199 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16200
16201         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
16202         Modifiers.TypeAttr. This should just be a call to that method.
16203
16204         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
16205         object so that we can determine if we are top-level or not.
16206
16207         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
16208         TypeContainer too.
16209
16210         * enum.cs (Enum::Define): Ditto.
16211
16212         * modifiers.cs (FieldAttr): Re-write.
16213
16214         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
16215         (TypeContainer::HaveStaticConstructor): New property to provide access
16216         to precisely that info.
16217
16218         * modifiers.cs (MethodAttr): Re-write.
16219         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
16220
16221         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
16222         of top-level types as claimed.
16223
16224 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * expression.cs (MemberLookup): Fruitless attempt to lookup
16227         constructors.  Maybe I need to emit default constructors?  That
16228         might be it (currently .NET emits this for me automatically).
16229         (Invocation::OverloadResolve): Cope with Arguments == null.
16230         (Invocation::EmitArguments): new function, shared by the new
16231         constructor and us.
16232         (Invocation::Emit): Handle static and instance methods.  Emit
16233         proper call instruction for virtual or non-virtual invocations.
16234         (New::Emit): Implement.
16235         (New::Resolve): Implement.
16236         (MemberAccess:Resolve): Implement.
16237         (MethodGroupExpr::InstanceExpression): used conforming to the spec
16238         to track instances.
16239         (FieldExpr::Resolve): Set type.
16240
16241         * support.cs: Handle empty arguments.
16242                 
16243         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
16244         SimpleLookup): Auxiliary routines to help parse a qualifier
16245         identifier.  
16246
16247         Update qualifier_identifier rule.
16248
16249         * codegen.cs: Removed debugging messages.
16250
16251         * class.cs: Make this a global thing, this acts just as a "key" to
16252         objects that we might have around.
16253
16254         (Populate): Only initialize method_builders_to_methods once.
16255
16256         * expression.cs (PropertyExpr): Initialize type from the
16257         PropertyType. 
16258
16259         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
16260         Resolve pattern.  Attempt to implicitly convert value to boolean.
16261         Emit code.
16262
16263         * expression.cs: Set the type for the int32/int32 argument case.
16264         (Binary::ResolveOperator): Set the return type to boolean for
16265         comparission operators
16266
16267         * typemanager.cs: Remove debugging print code.
16268
16269         (Invocation::Resolve): resolve type.
16270
16271         * class.cs: Allocate a MemberInfo of the correct size, as the code
16272         elsewhere depends on the test to reflect the correct contents.
16273
16274         (Method::) Keep track of parameters, due to System.Reflection holes
16275
16276         (TypeContainer::Populate): Keep track of MethodBuilders to Method
16277         mapping here.
16278
16279         (TypeContainer::FindMembers): Use ArrayList and then copy an array
16280         of the exact size and return that.
16281
16282         (Class::LookupMethodByBuilder): New function that maps
16283         MethodBuilders to its methods.  Required to locate the information
16284         on methods because System.Reflection bit us again.
16285
16286         * support.cs: New file, contains an interface ParameterData and
16287         two implementations: ReflectionParameters and InternalParameters
16288         used to access Parameter information.  We will need to grow this
16289         as required.
16290
16291         * expression.cs (Invocation::GetParameterData): implement a cache
16292         and a wrapper around the ParameterData creation for methods. 
16293         (Invocation::OverloadResolve): Use new code.
16294
16295 2001-09-13  Ravi Pratap  <ravi@ximian.com>
16296
16297         * class.cs (TypeContainer::EmitField): Remove and move into 
16298         (Field::Define): here and modify accordingly.
16299         (Field.FieldBuilder): New member.
16300         (TypeContainer::Populate): Update accordingly.
16301         (TypeContainer::FindMembers): Implement.
16302
16303 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16304
16305         * statement.cs: (VariableInfo::VariableType): New field to be
16306         initialized with the full type once it is resolved. 
16307
16308 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
16309
16310         * parameter.cs (GetParameterInfo): Use a type cache to compute
16311         things only once, and to reuse this information
16312
16313         * expression.cs (LocalVariableReference::Emit): Implement.
16314         (OpcodeCast::Emit): fix.
16315
16316         (ParameterReference::Resolve): Implement.
16317         (ParameterReference::Emit): Implement.
16318
16319         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
16320         that are expressions need to stay as Expressions.
16321
16322         * typemanager.cs (CSharpName): Returns the C# name of a type if
16323         possible. 
16324
16325         * expression.cs (Expression::ConvertImplicit): New function that
16326         implements implicit type conversions.
16327
16328         (Expression::ImplicitReferenceConversion): Implements implicit
16329         reference conversions.
16330
16331         (EmptyCast): New type for transparent casts.
16332
16333         (OpcodeCast): New type for casts of types that are performed with
16334         a sequence of bytecodes.
16335
16336         (BoxedCast): New type used for casting value types into reference
16337         types.  Emits a box opcode.
16338
16339         (Binary::DoNumericPromotions): Implements numeric promotions of
16340         and computation of the Binary::Type.
16341
16342         (Binary::EmitBranchable): Optimization.
16343
16344         (Binary::Emit): Implement code emission for expressions.
16345
16346         * typemanager.cs (TypeManager): Added two new core types: sbyte
16347         and byte.
16348
16349 2001-09-12  Ravi Pratap  <ravi@ximian.com>
16350
16351         * class.cs (TypeContainer::FindMembers): Method which does exactly
16352         what Type.FindMembers does, only we don't have to use reflection. No
16353         implementation yet.
16354
16355         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
16356         typecontainer objects as we need to get at them.
16357         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
16358
16359         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
16360         typecontainer object.
16361
16362         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
16363         of just a Report object.
16364
16365 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16366
16367         * class.cs (Event::Define): Go back to using the prefixes "add_" and
16368         "remove_"
16369         (TypeContainer::Populate): Now define the delegates of the type too.
16370         (TypeContainer.Delegates): Property to access the list of delegates defined
16371         in the type.
16372
16373         * delegates.cs (Delegate::Define): Implement partially.
16374
16375         * modifiers.cs (TypeAttr): Handle more flags.
16376
16377 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16378
16379         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
16380         and not <=
16381         (Operator::Define): Re-write logic to get types by using the LookupType method
16382         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
16383         (Indexer::Define): Ditto.
16384         (Event::Define): Ditto.
16385         (Property::Define): Ditto.
16386
16387 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16388
16389         * class.cs (TypeContainer::Populate): Now define operators too. 
16390         (TypeContainer.Operators): New property to access the list of operators
16391         in a type.
16392         (Operator.OperatorMethodBuilder): New member to hold the method builder
16393         for the operator we are defining.
16394         (Operator::Define): Implement.
16395
16396 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16397
16398         * class.cs (Event::Define): Make the prefixes of the accessor methods
16399         addOn_ and removeOn_ 
16400
16401         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
16402         of the location being passed in too. Ideally, this should go later since all
16403         error reporting should be done through the Report object.
16404
16405         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
16406         (Populate): Iterate thru the indexers we have and define them too.
16407         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
16408         for the get and set accessors.
16409         (Indexer::Define): Implement.
16410
16411 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
16412
16413         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
16414         my previous implementation, did not work.
16415
16416         * typemanager.cs: Add a couple of missing types (the longs).
16417
16418         * literal.cs: Use TypeManager.bool_type instead of getting it.
16419
16420         * expression.cs (EventExpr): New kind of expressions.
16421         (Expressio::ExprClassFromMemberInfo): finish
16422
16423 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * assign.cs: Emit stores to static fields differently.
16426
16427 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16428
16429         * Merge in changes and adjust code to tackle conflicts. Backed out my
16430         code in Assign::Resolve ;-) 
16431
16432 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16433
16434         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
16435         instead Report.Error and also pass in the location.
16436         (CSharpParser::Lexer): New readonly property to return the reference
16437         to the Tokenizer object.
16438         (declare_local_variables): Use Report.Error with location instead of plain 
16439         old error.
16440         (CheckDef): Ditto.
16441
16442         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
16443         (Operator.CheckBinaryOperator): Ditto.
16444
16445         * cs-parser.jay (operator_declarator): Update accordingly.
16446
16447         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
16448         (CheckBinaryOperator): Same here.
16449
16450         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
16451         on the name without any prefixes of namespace names etc. This is because we
16452         already might have something already fully qualified like 
16453         'System.Console.WriteLine'
16454
16455         * assign.cs (Resolve): Begin implementation. Stuck ;-)
16456
16457 2001-09-07  Ravi Pratap  <ravi@ximian.com>
16458
16459         * cs-tokenizer.cs (location): Return a string which also contains
16460         the file name.
16461
16462         * expression.cs (ElementAccess): New class for expressions of the
16463         type 'element access.'
16464         (BaseAccess): New class for expressions of the type 'base access.'
16465         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
16466         respectively.
16467
16468         * cs-parser.jay (element_access): Implement action.
16469         (base_access): Implement actions.
16470         (checked_expression, unchecked_expression): Implement.
16471
16472         * cs-parser.jay (local_variable_type): Correct and implement.
16473         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
16474
16475         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
16476
16477         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
16478         name and the specifiers.
16479
16480         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
16481
16482         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
16483         making them all public ;-)
16484
16485         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
16486         class anyways.
16487
16488 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
16491         PropertyExprs.
16492         (FieldExpr, PropertyExprs): New resolved expressions.
16493         (SimpleName::MemberStaticCheck): Perform static checks for access
16494         to non-static fields on static methods. Maybe this should be
16495         generalized for MemberAccesses. 
16496         (SimpleName::ResolveSimpleName): More work on simple name
16497         resolution. 
16498
16499         * cs-parser.jay (primary_expression/qualified_identifier): track
16500         the parameter index.
16501
16502         * codegen.cs (CodeGen::Save): Catch save exception, report error.
16503         (EmitContext::EmitBoolExpression): Chain to expression generation
16504         instead of temporary hack.
16505         (::EmitStatementExpression): Put generic expression code generation.
16506
16507         * assign.cs (Assign::Emit): Implement variable assignments to
16508         local variables, parameters and fields.
16509
16510 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * statement.cs (Block::GetVariableInfo): New method, returns the
16513         VariableInfo for a variable name in a block.
16514         (Block::GetVariableType): Implement in terms of GetVariableInfo
16515
16516         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
16517         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
16518
16519 2001-09-06  Ravi Pratap  <ravi@ximian.com>
16520
16521         * cs-parser.jay (operator_declaration): Continue on my quest : update
16522         to take attributes argument.
16523         (event_declaration): Ditto.
16524         (enum_declaration): Ditto.
16525         (indexer_declaration): Ditto.
16526
16527         * class.cs (Operator::Operator): Update constructor accordingly.
16528         (Event::Event): Ditto.
16529
16530         * delegate.cs (Delegate::Delegate): Same here.
16531
16532         * enum.cs (Enum::Enum): Same here.
16533
16534 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16535
16536         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
16537
16538         * ../tests/cs0658.cs : New file to demonstrate error 0658.
16539
16540         * attribute.cs (Attributes): New class to encapsulate all attributes which were
16541         being passed around as an arraylist.
16542         (Attributes::AddAttribute): Method to add attribute sections.
16543
16544         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
16545         (struct_declaration): Update accordingly.
16546         (constant_declaration): Update.
16547         (field_declaration): Update.
16548         (method_header): Update.
16549         (fixed_parameter): Update.
16550         (parameter_array): Ditto.
16551         (property_declaration): Ditto.
16552         (destructor_declaration): Ditto.
16553
16554         * class.cs (Struct::Struct): Update constructors accordingly.
16555         (Class::Class): Ditto.
16556         (Field::Field): Ditto.
16557         (Method::Method): Ditto.
16558         (Property::Property): Ditto.
16559         (TypeContainer::OptAttribute): update property's return type.
16560
16561         * interface.cs (Interface.opt_attributes): New member.
16562         (Interface::Interface): Update to take the extra Attributes argument.
16563
16564         * parameter.cs (Parameter::Parameter): Ditto.
16565
16566         * constant.cs (Constant::Constant): Ditto.
16567
16568         * interface.cs (InterfaceMemberBase): New OptAttributes field.
16569         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
16570         the attributes as a parameter.
16571         (InterfaceProperty): Update constructor call.
16572         (InterfaceEvent): Ditto.
16573         (InterfaceMethod): Ditto.
16574         (InterfaceIndexer): Ditto.
16575
16576         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
16577         pass the attributes too.
16578         (interface_event_declaration): Ditto.
16579         (interface_property_declaration): Ditto.
16580         (interface_method_declaration): Ditto.
16581         (interface_declaration): Ditto.
16582
16583 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * class.cs (Method::Define): Track the "static Main" definition to
16586         create an entry point. 
16587
16588         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16589         EntryPoint if we find it. 
16590
16591         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16592         (EmitContext::ig): Make this variable public.
16593
16594         * driver.cs: Make the default output file be the first file name
16595         with the .exe extension.  
16596
16597         Detect empty compilations
16598
16599         Handle various kinds of output targets.  Handle --target and
16600         rename -t to --dumper.
16601
16602         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16603         methods inherited from Expression return now an Expression.  This
16604         will is used during the tree rewriting as we resolve them during
16605         semantic analysis.
16606
16607         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16608         the spec.  Missing entirely is the information about
16609         accessability of elements of it.
16610
16611         (Expression::ExprClassFromMemberInfo): New constructor for
16612         Expressions that creates a fully initialized Expression based on
16613         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16614         a Type.
16615
16616         (Invocation::Resolve): Begin implementing resolution of invocations.
16617
16618         * literal.cs (StringLiteral):  Implement Emit.
16619
16620 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16621
16622         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16623         member.
16624
16625 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16626
16627         * cs-parser.jay (attribute_arguments): Implement actions.
16628         (attribute): Fix bug in production. Implement action.
16629         (attribute_list): Implement.
16630         (attribute_target): Implement.
16631         (attribute_target_specifier, opt_target_specifier): Implement
16632         (CheckAttributeTarget): New method to check if the attribute target
16633         is valid.
16634         (attribute_section): Implement.
16635         (opt_attributes): Implement.
16636
16637         * attribute.cs : New file to handle attributes.
16638         (Attribute): Class to hold attribute info.
16639
16640         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16641         (attribute_section): Modify production to use 2 different rules to 
16642         achieve the same thing. 1 s/r conflict down !
16643         Clean out commented, useless, non-reducing dimension_separator rules.
16644
16645         * class.cs (TypeContainer.attributes): New member to hold list
16646         of attributes for a type.
16647         (Struct::Struct): Modify to take one more argument, the attribute list.
16648         (Class::Class): Ditto.
16649         (Field::Field): Ditto.
16650         (Method::Method): Ditto.
16651         (Property::Property): Ditto.
16652
16653         * cs-parser.jay (struct_declaration): Update constructor call to
16654         pass in the attributes too.
16655         (class_declaration): Ditto.
16656         (constant_declaration): Ditto.
16657         (field_declaration): Ditto.
16658         (method_header): Ditto.
16659         (fixed_parameter): Ditto.
16660         (parameter_array): Ditto.
16661         (property_declaration): Ditto.
16662
16663         * constant.cs (Constant::Constant): Update constructor similarly.
16664         Use System.Collections.
16665
16666         * parameter.cs (Parameter::Parameter): Update as above.
16667
16668 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16669
16670         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16671         (TypeContainer.delegates): New member to hold list of delegates.
16672
16673         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16674         this time as I seem to be on crack ;-)
16675
16676 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16677
16678         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16679         tell whether an identifier represents a namespace.
16680
16681         * expression.cs (NamespaceExpr): A namespace expression, used only
16682         temporarly during expression resolution.
16683         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16684         utility functions to resolve names on expressions.
16685
16686 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16687
16688         * codegen.cs: Add hook for StatementExpressions. 
16689
16690         * class.cs: Fix inverted test for static flag in methods.
16691
16692 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16693
16694         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16695         to make it coincide with MS' number.
16696         (Operator::CheckBinaryOperator): Ditto.
16697
16698         * ../errors/errors.txt : Remove error numbers added earlier.
16699
16700         * ../errors/cs1019.cs : Test case for error # 1019
16701
16702         * ../errros/cs1020.cs : Test case for error # 1020
16703
16704         * cs-parser.jay : Clean out commented cruft.
16705         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16706         used anywhere - non-reducing rule.
16707         (namespace_declarations): Non-reducing rule - comment out.
16708
16709         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16710         with TypeContainer::AddEnum.
16711
16712         * delegate.cs : New file for delegate handling classes.
16713         (Delegate): Class for declaring delegates.
16714
16715         * makefile : Update.
16716
16717         * cs-parser.jay (delegate_declaration): Implement.
16718
16719 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16720
16721         * class.cs (Event::Define): Implement.
16722         (Event.EventBuilder): New member.
16723
16724         * class.cs (TypeContainer::Populate): Update to define all enums and events
16725         we have.
16726         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16727         readonly fields for all these cases ?
16728
16729 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16730
16731         * class.cs (Property): Revamp to use the convention of making fields readonly.
16732         Accordingly modify code elsewhere.
16733
16734         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16735         the Define method of the Property class.
16736
16737         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16738         trivial bug.
16739         (TypeContainer::Populate): Update to define all the properties we have. Also
16740         define all enumerations.
16741
16742         * enum.cs (Define): Implement.
16743
16744 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16745
16746         * cs-parser.jay (overloadable_operator): The semantic value is an
16747         enum of the Operator class.
16748         (operator_declarator): Implement actions.
16749         (operator_declaration): Implement.
16750
16751         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16752         validity of definitions.
16753         (Operator::CheckBinaryOperator): Static method to check for binary operators
16754         (TypeContainer::AddOperator): New method to add an operator to a type.
16755
16756         * cs-parser.jay (indexer_declaration): Added line to actually call the
16757         AddIndexer method so it gets added ;-)
16758
16759         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
16760         already taken care of by the MS compiler ?  
16761
16762 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16763
16764         * class.cs (Operator): New class for operator declarations.
16765         (Operator::OpType): Enum for the various operators.
16766
16767 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16768
16769         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
16770         ostensibly handle this in semantic analysis.
16771
16772         * cs-parser.jay (general_catch_clause): Comment out
16773         (specific_catch_clauses, specific_catch_clause): Ditto.
16774         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
16775         (catch_args, opt_catch_args): New productions.
16776         (catch_clause): Rewrite to use the new productions above
16777         (catch_clauses): Modify accordingly.
16778         (opt_catch_clauses): New production to use in try_statement
16779         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
16780         and re-write the code in the actions to extract the specific and
16781         general catch clauses by being a little smart ;-)
16782
16783         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
16784         Hooray, try and catch statements parse fine !
16785
16786 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16787
16788         * statement.cs (Block::GetVariableType): Fix logic to extract the type
16789         string from the hashtable of variables.
16790
16791         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
16792         I end up making that mistake ;-)
16793         (catch_clauses): Fixed gross error which made Key and Value of the 
16794         DictionaryEntry the same : $1 !!
16795
16796 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16797
16798         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
16799
16800         * cs-parser.jay (event_declaration): Correct to remove the semicolon
16801         when the add and remove accessors are specified. 
16802
16803 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16804
16805         * cs-parser.jay (IndexerDeclaration): New helper class to hold
16806         information about indexer_declarator.
16807         (indexer_declarator): Implement actions.
16808         (parsing_indexer): New local boolean used to keep track of whether
16809         we are parsing indexers or properties. This is necessary because 
16810         implicit_parameters come into picture even for the get accessor in the 
16811         case of an indexer.
16812         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
16813
16814         * class.cs (Indexer): New class for indexer declarations.
16815         (TypeContainer::AddIndexer): New method to add an indexer to a type.
16816         (TypeContainer::indexers): New member to hold list of indexers for the
16817         type.
16818
16819 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16820
16821         * cs-parser.jay (add_accessor_declaration): Implement action.
16822         (remove_accessor_declaration): Implement action.
16823         (event_accessors_declaration): Implement
16824         (variable_declarators): swap statements for first rule - trivial.
16825
16826         * class.cs (Event): New class to hold information about event
16827         declarations.
16828         (TypeContainer::AddEvent): New method to add an event to a type
16829         (TypeContainer::events): New member to hold list of events.
16830
16831         * cs-parser.jay (event_declaration): Implement actions.
16832
16833 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16834
16835         * cs-parser.jay (dim_separators): Implement. Make it a string
16836         concatenating all the commas together, just as they appear.
16837         (opt_dim_separators): Modify accordingly
16838         (rank_specifiers): Update accordingly. Basically do the same
16839         thing - instead, collect the brackets here.
16840         (opt_rank_sepcifiers): Modify accordingly.
16841         (array_type): Modify to actually return the complete type string
16842         instead of ignoring the rank_specifiers.
16843         (expression_list): Implement to collect the expressions
16844         (variable_initializer): Implement. We make it a list of expressions
16845         essentially so that we can handle the array_initializer case neatly too.
16846         (variable_initializer_list): Implement.
16847         (array_initializer): Make it a list of variable_initializers
16848         (opt_array_initializer): Modify accordingly.
16849
16850         * expression.cs (New::NType): Add enumeration to help us
16851         keep track of whether we have an object/delegate creation
16852         or an array creation.
16853         (New:NewType, New::Rank, New::Indices, New::Initializers): New
16854         members to hold data about array creation.
16855         (New:New): Modify to update NewType
16856         (New:New): New Overloaded contructor for the array creation
16857         case.
16858
16859         * cs-parser.jay (array_creation_expression): Implement to call
16860         the overloaded New constructor.
16861
16862 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
16863
16864         * class.cs (TypeContainer::Constructors): Return member
16865         constructors instead of returning null.
16866
16867 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
16868
16869         * typemanager.cs (InitCoreTypes): Initialize the various core
16870         types after we have populated the type manager with the user
16871         defined types (this distinction will be important later while
16872         compiling corlib.dll)
16873
16874         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
16875         on Expression Classification.  Now all expressions have a method
16876         `Resolve' and a method `Emit'.
16877
16878         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
16879         generation from working.     Also add some temporary debugging
16880         code. 
16881
16882 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * codegen.cs: Lots of code generation pieces.  This is only the
16885         beginning, will continue tomorrow with more touches of polish.  We
16886         handle the fundamentals of if, while, do, for, return.  Others are
16887         trickier and I need to start working on invocations soon.
16888
16889         * gen-treedump.cs: Bug fix, use s.Increment here instead of
16890         s.InitStatement. 
16891
16892         * codegen.cs (EmitContext): New struct, used during code
16893         emission to keep a context.   Most of the code generation will be
16894         here. 
16895
16896         * cs-parser.jay: Add embedded blocks to the list of statements of
16897         this block.  So code generation proceeds in a top down fashion.
16898
16899 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * statement.cs: Add support for multiple child blocks.
16902
16903 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * codegen.cs (EmitCode): New function, will emit the code for a
16906         Block of code given a TypeContainer and its ILGenerator. 
16907
16908         * statement.cs (Block): Standard public readonly optimization.
16909         (Block::Block constructors): Link children. 
16910         (Block::Child): Child Linker.
16911         (Block::EmitVariables): Emits IL variable declarations.
16912
16913         * class.cs: Drop support for MethodGroups here, delay until
16914         Semantic Analysis.
16915         (Method::): Applied the same simplification that I did before, and
16916         move from Properties to public readonly fields.
16917         (Method::ParameterTypes): Returns the parameter types for the
16918         function, and implements a cache that will be useful later when I
16919         do error checking and the semantic analysis on the methods is
16920         performed.
16921         (Constructor::GetCallingConvention): Renamed from CallingConvetion
16922         and made a method, optional argument tells whether this is a class
16923         or a structure to apply the `has-this' bit.
16924         (Method::GetCallingConvention): Implement, returns the calling
16925         convention. 
16926         (Method::Define): Defines the type, a second pass is performed
16927         later to populate the methods.
16928
16929         (Constructor::ParameterTypes): implement a cache similar to the
16930         one on Method::ParameterTypes, useful later when we do semantic
16931         analysis. 
16932
16933         (TypeContainer::EmitMethod):  New method.  Emits methods.
16934
16935         * expression.cs: Removed MethodGroup class from here.
16936
16937         * parameter.cs (Parameters::GetCallingConvention): new method.
16938
16939 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
16940
16941         * class.cs (TypeContainer::Populate): Drop RootContext from the
16942         argument. 
16943
16944         (Constructor::CallingConvention): Returns the calling convention.
16945         (Constructor::ParameterTypes): Returns the constructor parameter
16946         types. 
16947
16948         (TypeContainer::AddConstructor): Keep track of default constructor
16949         and the default static constructor.
16950
16951         (Constructor::) Another class that starts using `public readonly'
16952         instead of properties. 
16953
16954         (Constructor::IsDefault): Whether this is a default constructor. 
16955
16956         (Field::) use readonly public fields instead of properties also.
16957
16958         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
16959         track of static constructors;  If none is used, turn on
16960         BeforeFieldInit in the TypeAttributes. 
16961
16962         * cs-parser.jay (opt_argument_list): now the return can be null
16963         for the cases where there are no arguments. 
16964
16965         (constructor_declarator): If there is no implicit `base' or
16966         `this', then invoke the default parent constructor. 
16967
16968         * modifiers.cs (MethodAttr): New static function maps a set of
16969         modifiers flags into a MethodAttributes enum
16970         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
16971         MethodAttr, TypeAttr to represent the various mappings where the
16972         modifiers are used.
16973         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
16974
16975 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
16976
16977         * parameter.cs (GetParameterInfo): Fix bug where there would be no
16978         method arguments.
16979
16980         * interface.cs (PopulateIndexer): Implemented the code generator
16981         for interface indexers.
16982
16983 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
16984
16985         * interface.cs (InterfaceMemberBase): Now we track the new status
16986         here.  
16987
16988         (PopulateProperty): Implement property population.  Woohoo!  Got
16989         Methods and Properties going today. 
16990
16991         Removed all the properties for interfaces, and replaced them with
16992         `public readonly' fields. 
16993
16994 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
16995
16996         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
16997         initialize their hashtables/arraylists only when they are needed
16998         instead of doing this always.
16999
17000         * parameter.cs: Handle refs and out parameters.
17001
17002         * cs-parser.jay: Use an ArrayList to construct the arguments
17003         instead of the ParameterCollection, and then cast that to a
17004         Parameter[] array.
17005
17006         * parameter.cs: Drop the use of ParameterCollection and use
17007         instead arrays of Parameters.
17008
17009         (GetParameterInfo): Use the Type, not the Name when resolving
17010         types. 
17011
17012 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
17013
17014         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
17015         and instead use public readonly fields.
17016
17017         * class.cs: Put back walking code for type containers.
17018
17019 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * class.cs (MakeConstant): Code to define constants.
17022
17023         * rootcontext.cs (LookupType): New function.  Used to locate types 
17024
17025
17026 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
17027
17028         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
17029         this System.Reflection code is.  Kudos to Microsoft
17030
17031         * typemanager.cs: Implement a type cache and avoid loading all
17032         types at boot time.  Wrap in LookupType the internals.  This made
17033         the compiler so much faster.  Wow.  I rule!
17034
17035         * driver.cs: Make sure we always load mscorlib first (for
17036         debugging purposes, nothing really important).
17037
17038         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
17039         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
17040
17041         * rootcontext.cs: Lookup types on their namespace;  Lookup types
17042         on namespaces that have been imported using the `using' keyword.
17043
17044         * class.cs (TypeContainer::TypeAttr): Virtualize.
17045         (Class::TypeAttr): Return attributes suitable for this bad boy.
17046         (Struct::TypeAttr): ditto.
17047         Handle nested classes.
17048         (TypeContainer::) Remove all the type visiting code, it is now
17049         replaced with the rootcontext.cs code
17050
17051         * rootcontext.cs (GetClassBases): Added support for structs. 
17052
17053 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
17054
17055         * interface.cs, statement.cs, class.cs, parameter.cs,
17056         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
17057         Drop use of TypeRefs, and use strings instead.
17058
17059 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
17060
17061         * rootcontext.cs: 
17062
17063         * class.cs (Struct::Struct): set the SEALED flags after
17064         checking the modifiers.
17065         (TypeContainer::TypeAttr): new property, returns the
17066         TypeAttributes for a class.  
17067
17068         * cs-parser.jay (type_list): Oops, list production was creating a
17069         new list of base types.
17070
17071         * rootcontext.cs (StdLib): New property.
17072         (GetInterfaceTypeByName): returns an interface by type name, and
17073         encapsulates error handling here.
17074         (GetInterfaces): simplified.
17075         (ResolveTree): Encapsulated all the tree resolution here.
17076         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
17077         types. 
17078
17079         * driver.cs: Add support for --nostdlib, to avoid loading the
17080         default assemblies.
17081         (Main): Do not put tree resolution here. 
17082
17083         * rootcontext.cs: Beginning of the class resolution.
17084
17085 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * rootcontext.cs: Provide better error reporting. 
17088
17089         * cs-parser.jay (interface_base): set our $$ to be interfaces.
17090
17091         * rootcontext.cs (CreateInterface): Handle the case where there
17092         are no parent interfaces.
17093
17094         (CloseTypes): Routine to flush types at the end.
17095         (CreateInterface): Track types.
17096         (GetInterfaces): Returns an array of Types from the list of
17097         defined interfaces.
17098
17099         * typemanager.c (AddUserType): Mechanism to track user types (puts
17100         the type on the global type hash, and allows us to close it at the
17101         end). 
17102
17103 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
17106         RecordInterface instead.
17107
17108         * cs-parser.jay: Updated to reflect changes above.
17109
17110         * decl.cs (Definition): Keep track of the TypeBuilder type that
17111         represents this type here.  Not sure we will use it in the long
17112         run, but wont hurt for now.
17113
17114         * driver.cs: Smaller changes to accomodate the new code.
17115
17116         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
17117         when done. 
17118
17119         * rootcontext.cs (CreateInterface):  New method, used to create
17120         the System.TypeBuilder type for interfaces.
17121         (ResolveInterfaces): new entry point to resolve the interface
17122         hierarchy. 
17123         (CodeGen): Property, used to keep track of the code generator.
17124
17125 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * cs-parser.jay: Add a second production for delegate_declaration
17128         with `VOID'.
17129
17130         (enum_body): Put an opt_comma here instead of putting it on
17131         enum_body or enum_member_declarations so we can handle trailing
17132         commas on enumeration members.  Gets rid of a shift/reduce.
17133
17134         (type_list): Need a COMMA in the middle.
17135
17136         (indexer_declaration): Tell tokenizer to recognize get/set
17137
17138         * Remove old targets.
17139
17140         * Re-add the parser target.
17141
17142 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17143
17144         * cs-parser.jay: Add precendence rules for a number of operators
17145         ot reduce the number of shift/reduce conflicts in the grammar.
17146
17147 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
17148
17149         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
17150         and put it here.
17151
17152         Get rid of old crufty code.
17153
17154         * rootcontext.cs: Use this to keep track of the parsed
17155         representation and the defined types available to the program. 
17156
17157         * gen-treedump.cs: adjust for new convention.
17158
17159         * type.cs: Split out the type manager, and the assembly builder
17160         from here. 
17161
17162         * typemanager.cs: the type manager will live here now.
17163
17164         * cil-codegen.cs: And the code generator here. 
17165
17166 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
17167
17168         * makefile: Fixed up for easy making.
17169
17170 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17171
17172         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
17173         the 
17174
17175         (unary_expression): Expand pre_increment_expression and
17176         post_decrement_expression to reduce a shift/reduce.
17177
17178 2001-07-11  Simon Cozens
17179
17180         * cs-tokenizer.cs: Hex numbers should begin with a 0.
17181
17182         Improve allow_keyword_as_indent name.
17183
17184 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
17185
17186         * Adjustments for Beta2. 
17187
17188 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
17189
17190         * decl.cs: Added `Define' abstract method.
17191         (InTransit): new property, used to catch recursive definitions. 
17192
17193         * interface.cs: Implement `Define'. 
17194
17195         * modifiers.cs: Map Modifiers.constants to
17196         System.Reflection.TypeAttribute flags.
17197
17198         * class.cs: Keep track of types and user-defined types.
17199         (BuilderInit): New method for creating an assembly
17200         (ResolveType): New function to launch the resolution process, only
17201         used by interfaces for now.
17202
17203         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
17204         that are inserted into the name space. 
17205
17206 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
17207
17208         * ARGH.  I have screwed up my tree so many times due to the use of
17209         rsync rather than using CVS.  Going to fix this at once. 
17210
17211         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
17212         load types.
17213
17214 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
17215
17216         * Experiment successful: Use System.Type rather that our own
17217         version of Type.  
17218
17219 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * cs-parser.jay: Removed nsAliases from here.
17222
17223         Use new namespaces, handle `using XXX;' 
17224
17225         * namespace.cs: Reimplemented namespace handling, use a recursive
17226         definition of the class.  Now we can keep track of using clauses
17227         and catch invalid using clauses.
17228
17229 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
17230
17231         * gen-treedump.cs: Adapted for all the renaming.
17232
17233         * expression.cs (Expression): this class now has a Type property
17234         which returns an expression Type.
17235
17236         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
17237         `Type', as this has a different meaning now in the base
17238
17239 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * interface.cs, class.cs: Removed from all the sources the
17242         references to signature computation, as we can not do method
17243         signature computation during the parsing time, as we are not
17244         trying to solve at that point distinguishing:
17245
17246         class X {
17247                 void a (Blah x) {}
17248                 void a (NS.Blah x) {}
17249         }
17250
17251         Which depending on the context might be valid or not, as we do not
17252         know if Blah is the same thing as NS.Blah at that point.
17253
17254         * Redid everything so the code uses TypeRefs now instead of
17255         Types.  TypeRefs are just temporary type placeholders, that need
17256         to be resolved.  They initially have a pointer to a string and the
17257         current scope in which they are used.  This is used later by the
17258         compiler to resolve the reference to an actual Type. 
17259
17260         * DeclSpace is no longer a CIR.Type, and neither are
17261         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
17262         are all DeclSpaces, but no Types. 
17263
17264         * type.cs (TypeRefManager): This implements the TypeRef manager,
17265         which keeps track of all the types that need to be resolved after
17266         the parsing has finished. 
17267
17268 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * ARGH.  We are going to have to store `foreach' as a class rather
17271         than resolving it, as we need to verify error 1579 after name
17272         resolution.   *OR* we could keep a flag that says `This request to
17273         IEnumerator comes from a foreach statement' which we can then use
17274         to generate the error.
17275
17276 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * class.cs (TypeContainer.AddMethod): we now add methods to the
17279         MethodGroup instead of the method hashtable.  
17280
17281         * expression.cs: Add MethodGroup abstraction, which gets us one
17282         step closer to the specification in the way we handle method
17283         declarations.  
17284
17285         * cs-parser.jay (primary_expression): qualified_identifier now
17286         tried to match up an identifier to a local variable reference or
17287         to a parameter reference.
17288
17289         current_local_parameters is now a parser global variable that
17290         points to the current parameters for the block, used during name
17291         lookup.
17292
17293         (property_declaration): Now creates an implicit `value' argument to
17294         the set accessor.
17295
17296 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
17297
17298         * parameter.cs: Do not use `param' arguments as part of the
17299         signature, per the spec.
17300
17301 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
17302
17303         * decl.cs: Base class for classes, structs and interfaces.  This
17304         is the "Declaration Space" 
17305
17306         * cs-parser.jay: Use CheckDef for checking declaration errors
17307         instead of having one on each function.
17308
17309         * class.cs: Factor out some code for handling error handling in
17310         accordance to the "Declarations" section in the "Basic Concepts"
17311         chapter in the ECMA C# spec.
17312
17313         * interface.cs: Make all interface member classes derive from
17314         InterfaceMemberBase.
17315
17316 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
17317
17318         * Many things: all interfaces are parsed and generated in
17319         gen-treedump.  Support for member variables, constructors,
17320         destructors, properties, constants is there.
17321
17322         Beginning of the IL backend, but very little done, just there for
17323         testing purposes. 
17324
17325 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
17326
17327         * cs-parser.jay: Fix labeled statement.
17328
17329         * cs-tokenizer.cs (escape): Escape " and ' always.
17330         ref_line, ref_name: keep track of the line/filename as instructed
17331         by #line by the compiler.
17332         Parse #line.
17333
17334 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
17335
17336         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
17337         to match the values in System.CodeDOM.
17338
17339         Divid renamed to Divide.
17340
17341         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
17342         statements. 
17343         (Statements.set): remove.
17344
17345         * System.CodeDOM/CodeCatchClause.cs: always have a valid
17346         statements. 
17347
17348         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
17349         falseStatements always have valid values. 
17350
17351         * cs-parser.jay: Use System.CodeDOM now.
17352