* Makefile: Run "make run-test" or "make run-test-ondotnet" to
[mono.git] / mcs / mcs / ChangeLog
1 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2
3         * class.cs (EventField.ApplyAttributeBuilder): Fix error\r
4         test cs1667-5.cs.\r
5 \r
6 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7
8         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.\r
9 \r
10         * pending.cs (PendingImplementation): Grab only interfaces.\r
11 \r
12 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13
14         * statement.cs (ForeachHelperMethods): Add location member and\r
15         error 202 detection.\r
16 \r
17 2004-11-19  Raja R Harinath  <rharinath@novell.com>
18
19         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
20         automatically handled by executable.make.
21         (PROGRAM): Make profile-specific.
22
23 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
24
25         * expression.cs (DoResolveBase): Fixed wrong warning for out\r
26         variables.\r
27 \r
28 2004-11-18  Martin Baulig  <martin@ximian.com>
29
30         Merged latest changes into gmcs.  Please keep this comment in
31         here, it makes it easier for me to see what changed in MCS since
32         the last time I merged.
33
34 2004-11-17  Raja R Harinath  <rharinath@novell.com>
35
36         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
37         (TypeHandle.GetMemberCache): New.
38         (TypeHandle.TypeHandle): Update.
39         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
40         (TypeManager.LookupParentInterfacesCache):
41         Rename from LookupInterfaceCache.  Optimize slightly.
42         (TypeManager.MemberLookup_FindMembers): Update.
43         * decl.cs (MemberCache.MemberCache): Set Container to null in the
44         multi-type variant.
45         (AddCacheContents): Rename from AddHashtable.
46         * class.cs (TypeContainer.parent_container): Remove.
47         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
48         (TypeContainer.DoDefineMembers): Don't initialize it.
49         Update to name changes.
50         
51 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
52
53         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
54         that factors the code to check access modifiers on override.  
55
56         (PropertyBase): Use the code here.
57
58         Patch from Lluis S'anchez, fixes bug #69361.
59
60 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
61
62         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
63         routine that is used to report the use of a captured variable
64         whose address has been taken.
65
66         There are two checks: one when variables are being captured and
67         the other check is when the address of a variable is taken. 
68         
69         (because an anonymous methods might be resolved before *or* after
70         the address has been taken) and 
71
72         * expression.cs (Conditional.DoResolve): Remove the special
73         casing that Martin added to trueExpr and falseExpr being both
74         NullLiteral.  We get the right behavior now just by introducing
75         the null_type into the compiler. 
76
77         * convert.cs (ExplicitConversion): Change the code to use
78         null_type instead of testing `expr is NullLiteral'.
79         (ImplicitConversionStandard): use null_type too.
80         (ImplicitReferenceConversionExists): use null_type too.
81         (ImplicitReferenceConversion): use null_type too.
82
83         * literal.cs: The type of `NullLiteral' is now null_type instead
84         of object_type. 
85         (Resolve): Set the type here.
86
87         * typemanager.cs: Introduce null_type.
88
89 2004-11-17  Martin Baulig  <martin@ximian.com>
90
91         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
92         direction, like FindMembers() does.  Fixes #69546, testcase is in
93         test-315.cs.    
94
95 2004-11-16  Martin Baulig  <martin@ximian.com>
96
97         This is based on a patch from Marek Safar, see bug #69082.
98         Fixes bugs #63705 and #67130.
99
100         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
101         method; create a MemberCache for an interface type and cache the
102         result.
103
104         * decl.cs (IMemberContainer.ParentContainer): Removed.
105         (IMemberContainer.ParentCache): New property.
106         (MemberCache.SetupCacheForInterface): Removed.
107         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
108         to create a cache for an interface's "parent".
109
110         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
111         interfaces too.
112
113 2004-11-16  Martin Baulig  <martin@ximian.com>
114
115         Merged back from gmcs; these changes already went into gmcs a
116         couple of weeks ago.
117
118         * typemanager.cs
119         (TypeManager.AddUserType): Removed the `ifaces' argument.
120         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
121         `TypeExpr []'.
122         (TypeManager.AddUserInterface): Removed.
123         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
124         `TypeExpr []'.
125         (TypeManager.GetInterfaces): Likewise.
126         (TypeManager.GetExplicitInterfaces): Likewise.
127
128         * ecore.cs (TypeExpr.GetInterfaces): Removed.
129
130         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
131         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
132
133 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
134
135         * statement.cs: Avoid adding bools to a hashtable.
136
137 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
138
139         * expression.cs (Invocation.OverloadResolve): Flag error if we are
140         calling an unsafe method from a safe location.
141
142 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
143
144         Fix #69167
145         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
146
147 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
148
149         * namespace.cs (VerifyUsing): use GetPartialName instead of
150         ToString. 
151
152 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
153
154         * statement.cs (Return.Resolve): Fix regression in typo: if
155         `in_exc', we have to request a NeedReturnLabel, this was a typo
156         introduced in the anonymous method check-in.  Fixes #69131.
157
158         * Indexers were using the ShortName when defining themselves,
159         causing a regression in the compiler bootstrap when applying the
160         patch from 2004-11-02 (first part), now they use their full name
161         and the bug is gone.
162
163 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
164
165         * driver.cs: Strip the path from the names of embedded resources. Fixes
166         #68519.
167
168 2004-11-04  Raja R Harinath  <rharinath@novell.com>
169
170         Fix error message regression: cs0104-2.cs.
171         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
172         (AliasEntry.Resolve): Update.
173         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
174         'silent' flag.
175         (RootContext.LookupType): Update.
176
177 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
178
179         * cs-parser.jay: Add support for handling accessor modifiers
180         * class: Add support port accessor modifiers and error checking,
181         define PropertyMethod.Define as virtual (not abstract anymore)
182         * ecore.cs: Add checking for proeprties access with access modifiers
183         * iterators.cs: Modify Accessor constructor call based in the modified
184         constructor
185 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
186
187         * expression.cs (StringConcat): Handle being called twice,
188         as when we have a concat in a field init with more than two
189         ctors in the class
190
191 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
192
193         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
194         special case explicit implementations, we should always produce
195         the .property or .event declaration.
196         
197         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
198         since it will not return correct data if people use this
199         unresolved in the presence of using statements (see test-313).
200
201         * class.cs (MethodData.Define): If we are an explicit interface
202         implementation, set the method name to the full name of the
203         interface plus the name of the method.  
204
205         Notice that using the method.MethodName.GetFullName() does not
206         work, as it will only contain the name as declared on the source
207         file (it can be a shorthand in the presence of using statements)
208         and not the fully qualifed type name, for example:
209
210         using System;
211
212         class D : ICloneable {
213                 object ICloneable.Clone ()  {
214                 }
215         }
216
217         Would produce a method called `ICloneable.Clone' instead of
218         `System.ICloneable.Clone'.
219
220         * namespace.cs (Alias.Resolve): Use GetPartialName.
221         
222 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
223
224         * cs-parser.jay: Add error 1055 report.
225
226 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
227
228         * assign.cs (Assign.DoResolve): Only do the transform of
229         assignment into a New if the types are compatible, if not, fall
230         through and let the implicit code deal with the errors and with
231         the necessary conversions. 
232
233 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
234
235         * cs-parser.jay: Add error 1031 report.
236
237         * cs-tokenizer.cs: Add location for error 1038.
238
239 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
240
241         * cs-parser.jay: Add error 1016 report.
242
243 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
244
245         * cs-parser.jay: Add errors 1575,1611 report.
246
247 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
248
249         * cs-parser.jay: Add error 1001 report.
250
251 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
252
253         Fix #68850
254         * attribute.cs (GetMarshal): Add method argument for
255         caller identification.
256
257         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
258         agument for GetMarshal and RuntimeMissingSupport.
259
260 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
261
262         * attribute.cs (ExtractSecurityPermissionSet): Removed
263         TypeManager.code_access_permission_type.
264
265         * typemanager.cs: Removed TypeManager.code_access_permission_type.
266
267 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
268
269         * expression.cs (LocalVariableReference.DoResolveLValue): Check
270         for obsolete use of a variable here.   Fixes regression on errors
271         cs0619-25 and cs0619-26.
272
273 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
274
275         Fix #62358, implemented security attribute encoding.
276
277         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
278         Tests permitted SecurityAction for assembly or other types.
279         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
280         data from SecurityPermissionAttribute to PermisionSet class.
281
282         * class.cs (ApplyAttributeBuilder): Added special handling
283         for System.Security.Permissions.SecurityAttribute based types.
284
285         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
286         special handling for System.Security.Permissions.SecurityAttribute
287         based types.
288
289         * enum.cs (ApplyAttributeBuilder): Added special handling
290         for System.Security.Permissions.SecurityAttribute based types.
291
292         * parameter.cs (ApplyAttributeBuilder): Added special handling
293         for System.Security.Permissions.SecurityAttribute based types.
294
295         * rootcontext.cs: Next 2 core types.
296
297         * typemanager.cs (TypeManager.security_permission_attr_type):
298         Built in type for the SecurityPermission Attribute.
299         (code_access_permission_type): Build in type.
300
301 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
302
303         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
304         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
305         all of this information into
306         EmitContext.EmitCapturedVariableInstance.
307         
308         * codegen.cs (EmitCapturedVariableInstance): move here the
309         funcionality of emitting an ldarg.0 in the presence of a
310         remapping.   This centralizes the instance emit code.
311
312         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
313         then emit a load of this: it means that we have reached the
314         topmost ScopeInfo: the one that contains the pointer to the
315         instance of the class hosting the anonymous method.
316
317         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
318         captures to the topmost CaptureContext.
319
320 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
321
322         * expression.cs (LocalVariableReference): Move the knowledge about
323         the iterators into codegen's EmitCapturedVariableInstance.
324
325 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
326
327         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
328         all code paths return a value from an anonymous method (it is the
329         same as the 161 error, but for anonymous methods).
330
331 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
332
333         The introduction of anonymous methods in the compiler changed
334         various ways of doing things in the compiler.  The most
335         significant one is the hard split between the resolution phase
336         and the emission phases of the compiler.
337
338         For instance, routines that referenced local variables no
339         longer can safely create temporary variables during the
340         resolution phase: they must do so from the emission phase,
341         since the variable might have been "captured", hence access to
342         it can not be done with the local-variable operations from the runtime.
343         
344         * statement.cs 
345
346         (Block.Flags): New flag `IsTopLevel' to indicate that this block
347         is a toplevel block.
348
349         (ToplevelBlock): A new kind of Block, these are the blocks that
350         are created by the parser for all toplevel method bodies.  These
351         include methods, accessors and anonymous methods.
352
353         These contain some extra information not found in regular blocks:
354         A pointer to an optional CaptureContext (for tracking captured
355         local variables and parameters).  A pointer to the parent
356         ToplevelBlock.
357         
358         (Return.Resolve): Catch missmatches when returning a value from an
359         anonymous method (error 1662).
360         Invoke NeedReturnLabel from the Resolve phase instead of the emit
361         phase.
362
363         (Break.Resolve): ditto.
364
365         (SwitchLabel): instead of defining the labels during the
366         resolution phase, we now turned the public ILLabel and ILLabelCode
367         labels into methods called GetILLabelCode() and GetILLabel() that
368         only define the label during the Emit phase.
369
370         (GotoCase): Track the SwitchLabel instead of the computed label
371         (its contained therein).  Emit the code by using
372         SwitchLabel.GetILLabelCode ().
373
374         (LocalInfo.Flags.Captured): A new flag has been introduce to track
375         whether the Local has been captured or not.
376
377         (LocalInfo.IsCaptured): New property, used to tell whether the
378         local has been captured.
379         
380         * anonymous.cs: Vastly updated to contain the anonymous method
381         support.
382
383         The main classes here are: CaptureContext which tracks any
384         captured information for a toplevel block and ScopeInfo used to
385         track the activation frames for various local variables.   
386
387         Each toplevel block has an optional capture context associated
388         with it.  When a method contains an anonymous method both the
389         toplevel method and the anonymous method will create a capture
390         context.   When variables or parameters are captured, they are
391         recorded on the CaptureContext that owns them, for example:
392
393         void Demo () {
394              int a;
395              MyDelegate d = delegate {
396                  a = 1;
397              }
398         }
399
400         Here `a' will be recorded as captured on the toplevel
401         CapturedContext, the inner captured context will not have anything
402         (it will only have data if local variables or parameters from it
403         are captured in a nested anonymous method.
404
405         The ScopeInfo is used to track the activation frames for local
406         variables, for example:
407
408         for (int i = 0; i < 10; i++)
409                 for (int j = 0; j < 10; j++){
410                    MyDelegate d = delegate {
411                         call (i, j);
412                    }
413                 }
414
415         At runtime this captures a single captured variable `i', but it
416         captures 10 different versions of the variable `j'.  The variable
417         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
418         recorded on a child.  
419
420         The toplevel ScopeInfo will also track information like the `this'
421         pointer if instance variables were referenced (this is necessary
422         as the anonymous method lives inside a nested class in the host
423         type of the method). 
424
425         (AnonymousMethod): Expanded to track the Toplevel, implement
426         `AnonymousMethod.Compatible' to tell whether an anonymous method
427         can be converted to a target delegate type. 
428
429         The routine now also produces the anonymous method content
430
431         (AnonymousDelegate): A helper class that derives from
432         DelegateCreation, this is used to generate the code necessary to
433         produce the delegate for the anonymous method that was created. 
434
435         * assign.cs: API adjustments for new changes in
436         Convert.ImplicitStandardConversionExists.
437
438         * class.cs: Adjustments to cope with the fact that now toplevel
439         blocks are of type `ToplevelBlock'. 
440
441         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
442         insteda of standard blocks.
443
444         Flag errors if params arguments are passed to anonymous methods.
445
446         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
447         `CurrentAnonymousMethod' which points to the current Anonymous
448         Method.  The variable points to the AnonymousMethod class that
449         holds the code being compiled.  It is set in the new EmitContext
450         created for the anonymous method.
451
452         (EmitContext.Phase): Introduce a variable and an enumeration to
453         assist in enforcing some rules about when and where we are allowed
454         to invoke certain methods (EmitContext.NeedsReturnLabel is the
455         only one that enfonces this right now).
456
457         (EmitContext.HaveCaptureInfo): new helper method that returns
458         whether we have a CapturedContext initialized.
459
460         (EmitContext.CaptureVariable): New method used to register that a
461         LocalInfo must be flagged for capturing. 
462
463         (EmitContext.CapturedParameter): New method used to register that a
464         parameters must be flagged for capturing. 
465         
466         (EmitContext.CapturedField): New method used to register that a
467         field must be flagged for capturing. 
468
469         (EmitContext.HaveCapturedVariables,
470         EmitContext.HaveCapturedFields): Return whether there are captured
471         variables or fields. 
472
473         (EmitContext.EmitMethodHostInstance): This is used to emit the
474         instance for the anonymous method.  The instance might be null
475         (static methods), this (for anonymous methods that capture nothing
476         and happen to live side-by-side with the current method body) or a
477         more complicated expression if the method has a CaptureContext.
478
479         (EmitContext.EmitTopBlock): Routine that drives the emission of
480         code: it will first resolve the top block, then emit any metadata
481         and then emit the code.  The split is done so that we can extract
482         any anonymous methods and flag any captured variables/parameters.
483         
484         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
485         during this phase, the ILGenerator should not be used as labels
486         and local variables declared here might not be accessible to any
487         code that is part of an anonymous method.  
488
489         Exceptions to this include the temporary variables that are
490         created by some statements internally for holding temporary
491         variables. 
492         
493         (EmitContext.EmitMeta): New routine, in charge of emitting all the
494         metadata for a cb
495
496         (EmitContext.TemporaryReturn): This method is typically called
497         from the Emit phase, and its the only place where we allow the
498         ReturnLabel to be defined other than the EmitMeta.  The reason is
499         that otherwise we would have to duplicate a lot of logic in the
500         Resolve phases of various methods that today is on the Emit
501         phase. 
502
503         (EmitContext.NeedReturnLabel): This no longer creates the label,
504         as the ILGenerator is not valid during the resolve phase.
505
506         (EmitContext.EmitThis): Extended the knowledge in this class to
507         work in anonymous methods in addition to iterators. 
508
509         (EmitContext.EmitCapturedVariableInstance): This emits whatever
510         code is necessary on the stack to access the instance to a local
511         variable (the variable will be accessed as a field).
512
513         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
514         EmitContext.EmitAddressOfParameter): Routines to support
515         parameters (not completed at this point). 
516         
517         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
518         will also remove the parameters.
519
520         * convert.cs (Convert): Define a `ConstantEC' which points to a
521         null.  This is just to prefity some code that uses
522         ImplicitStandardConversion code and do not have an EmitContext
523         handy.
524
525         The idea is to flag explicitly that at that point in time, it is
526         known that the conversion will not trigger the delegate checking
527         code in implicit conversions (which requires a valid
528         EmitContext). 
529
530         Everywhere: pass new EmitContext parameter since
531         ImplicitStandardConversionExists now requires it to check for
532         anonymous method conversions. 
533
534         (Convert.ImplicitStandardConversionExists): If the type of an
535         expression is the anonymous_method_type, and the type is a
536         delegate, we invoke the AnonymousMethod.Compatible method to check
537         whether an implicit conversion is possible. 
538
539         (Convert.ImplicitConversionStandard): Only do implicit method
540         group conversions if the language level is not ISO_1.
541
542         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
543         MethodInfo for the Invoke method.  used by Delegate and
544         AnonymousDelegate.
545
546         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
547         method conversions if the target type is a delegate.
548
549         Removed extra debugging nops.
550
551         (LocalVariableReference): Turn the `local_info' into a public
552         field. 
553
554         Add `prepared' field, the same hack used for FieldExprs to cope
555         with composed assignments, as Local variables do not necessarily
556         operate purely on the stack as they used to: they can be captured
557         fields. 
558
559         Add `temp' for a temporary result, like fields.
560
561         Refactor DoResolve and DoResolveLValue into DoResolveBase.
562
563         It now copes with Local variables that are captured and emits the
564         proper instance variable to load it from a field in the captured
565         case. 
566
567         (ParameterReference.DoResolveBase): During the resolve phase,
568         capture parameters if we are in an anonymous method.
569
570         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
571         anonymous method, use the EmitContext helper routines to emit the
572         parameter reference.
573
574         * iterators.cs: Set RemapToProxy to true/false during the
575         EmitDispose class.
576
577         * parameters.cs (GetParameterByName): New helper method. 
578
579         * typemanager.cs (anonymous_method_type) a new type that
580         represents an anonyous method.  This is always an internal type,
581         used as a fencepost to test against the anonymous-methodness of an
582         expression. 
583         
584 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
585
586         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
587         561 report.
588         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
589
590 2004-10-18  Martin Baulig  <martin@ximian.com>
591
592         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
593         `Type' directly, but call ResolveType() on it.
594         (Catch.Resolve): Likewise.
595         (Foreach.Resolve): Likewise.
596
597 2004-10-18  Martin Baulig  <martin@ximian.com>
598
599         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
600         `Type' directly, but call ResolveType() on it.
601         (Probe.DoResolve): Likewise.
602         (ArrayCreation.LookupType): Likewise.
603         (TypeOf.DoResolve): Likewise.
604         (SizeOf.DoResolve): Likewise.
605
606 2004-10-18  Martin Baulig  <martin@ximian.com>
607
608         * expression.cs (Invocation.BetterFunction): Put back
609         TypeManager.TypeToCoreType().
610
611 2004-10-18  Raja R Harinath  <rharinath@novell.com>
612
613         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
614         the ResolveType.
615
616 2004-10-18  Martin Baulig  <martin@ximian.com>
617
618         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
619         `Type' directly, but call ResolveType() on it.
620
621 2004-10-18  Martin Baulig  <martin@ximian.com>
622
623         * class.cs (FieldMember.Define): Don't access the TypeExpr's
624         `Type' directly, but call ResolveType() on it.
625         (MemberBase.DoDefine): Likewise.
626
627         * expression.cs (New.DoResolve): Don't access the TypeExpr's
628         `Type' directly, but call ResolveType() on it.
629         (ComposedCast.DoResolveAsTypeStep): Likewise.
630
631         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
632         `Type' directly, but call ResolveType() on it.
633
634 2004-10-17  John Luke  <john.luke@gmail.com>
635
636         * class.cs (Operator.GetSignatureForError): use CSharpName
637
638         * parameter.cs (Parameter.GetSignatureForError): Returns
639         correct name even if was not defined.
640
641 2004-10-13  Raja R Harinath  <rharinath@novell.com>
642
643         Fix #65816.
644         * class.cs (TypeContainer.EmitContext): New property.
645         (DefineNestedTypes): Create an emitcontext for each part.
646         (MethodCore.DoDefineParameters): Use container's emitcontext.
647         Pass type array to InternalParameters.
648         (MemberBase.DoDefine): Use container's emitcontext.
649         (FieldMember.Define): Likewise.
650         (Event.Define): Likewise.
651         (SetMethod.GetParameterInfo): Change argument to EmitContext.
652         Pass type array to InternalParameters.
653         (SetIndexerMethod.GetParameterInfo): Likewise.
654         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
655         * delegate.cs (Define): Pass emitcontext to
656         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
657         array to InternalParameters.
658         * expression.cs (ParameterReference.DoResolveBase): Pass
659         emitcontext to GetParameterInfo.
660         (ComposedCast.DoResolveAsTypeStep): Remove check on
661         ec.ResolvingTypeTree.
662         * parameter.cs (Parameter.Resolve): Change argument to
663         EmitContext.  Use ResolveAsTypeTerminal.
664         (Parameter.GetSignature): Change argument to EmitContext.
665         (Parameters.ComputeSignature): Likewise.
666         (Parameters.ComputeParameterTypes): Likewise.
667         (Parameters.GetParameterInfo): Likewise.
668         (Parameters.ComputeAndDefineParameterTypes): Likewise.
669         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
670         * support.cs (InternalParameters..ctor): Remove variant that takes
671         a DeclSpace.
672         * typemanager.cs (system_intptr_expr): New.
673         (InitExpressionTypes): Initialize it.
674
675 2004-10-12  Chris Toshok  <toshok@ximian.com>
676
677         * cs-parser.jay: fix location for try_statement and catch_clause.
678
679 2004-10-11  Martin Baulig  <martin@ximian.com>
680
681         * report.cs: Don't make --fatal abort on warnings, we have
682         -warnaserror for that.
683
684 2004-10-07  Raja R Harinath  <rharinath@novell.com>
685
686         More DeclSpace.ResolveType avoidance.
687         * decl.cs (MemberCore.InUnsafe): New property.
688         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
689         with newly created EmitContext.
690         (FieldMember.Define): Likewise.
691         * delegate.cs (Delegate.Define): Likewise.
692         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
693         only if normal name-lookup fails.
694         (TypeExpr.DoResolve): Enable error-checking.
695         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
696         (SizeOf.DoResolve): Likewise.
697         (ComposedCast.DoResolveAsTypeStep): Likewise.
698         (StackAlloc.DoResolve): Likewise.
699         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
700         (Block.Unsafe): New property.
701         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
702         (Unsafe): Set 'unsafe' flag of contained block.
703         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
704         (Fixed.Resolve): Likewise.
705         (Catch.Resolve): Likewise.
706         (Using.ResolveLocalVariableDecls): Likewise.
707         (Foreach.Resolve): Likewise.
708
709 2004-10-05  John Luke <john.luke@gmail.com>
710
711         * cs-parser.jay: add location to error CS0175
712
713 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
714
715         * ecore.cs (Expression.Constantity): Add support for turning null
716         into a constant.
717
718         * const.cs (Const.Define): Allow constants to be reference types
719         as long as the value is Null.
720
721 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
722
723         * namespace.cs (NamespaceEntry.Using): No matter which warning
724         level is set, check if this namespace name has already been added.
725
726 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
727
728         * expression.cs: reftype [!=]= null should always use br[true,false].
729         # 67410
730
731 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
732
733         Fix #67108
734         * attribute.cs: Enum conversion moved to 
735         GetAttributeArgumentExpression to be applied to the all
736         expressions.
737
738 2004-10-01  Raja R Harinath  <rharinath@novell.com>
739
740         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
741         * class.c (TypeContainer.DefineType): Flag error if
742         base types aren't accessible due to access permissions.
743         * decl.cs (DeclSpace.ResolveType): Move logic to
744         Expression.ResolveAsTypeTerminal.
745         (DeclSpace.ResolveTypeExpr): Thin layer over
746         Expression.ResolveAsTypeTerminal.
747         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
748         Refactor code into NestedAccess.  Use it.
749         (DeclSpace.NestedAccess): New.
750         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
751         argument to silence errors.  Check access permissions.
752         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
753         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
754         (Cast.DoResolve): Likewise.
755         (New.DoResolve): Likewise.
756         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
757         (TypeOf.DoResolve): Likewise.
758
759         * expression.cs (Invocation.BetterConversion): Return the Type of
760         the better conversion.  Implement section 14.4.2.3 more faithfully.
761         (Invocation.BetterFunction): Make boolean.  Make correspondence to
762         section 14.4.2.2 explicit.
763         (Invocation.OverloadResolve): Update.
764         (Invocation): Remove is_base field.
765         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
766         (Invocation.Emit): Likewise.
767
768 2004-09-27  Raja R Harinath  <rharinath@novell.com>
769
770         * README: Update to changes.
771
772 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
773
774         * cs-parser.jay: Reverted 642 warning fix.
775
776 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
777
778         Fix bug #66615
779         * decl.cs (FindMemberWithSameName): Indexer can have more than
780         1 argument.
781
782 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
783
784         * expression.cs (LocalVariableReference.DoResolveLValue):
785         Do not report warning 219 for out values.
786         (EmptyExpression.Null): New member to avoid extra allocations.
787
788 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
789
790         * cs-parser.jay: Fix wrong warning 642 report.
791
792         * cs-tokenizer.cs (CheckNextToken): New helper;
793         Inspect next character if is same as expected.
794
795 2004-09-23  Martin Baulig  <martin@ximian.com>
796
797         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
798         (Convert.ImplicitReferenceConversionExists): Likewise.
799
800 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
801
802         * class.cs (Operator.Define): Add error 448 and 559 report.
803
804 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
805
806         * class.cs (MemberBase.IsTypePermitted): New protected
807         method for checking error CS0610.
808
809 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
810
811         * class.cs (TypeContainer.HasExplicitLayout): New property
812         Returns whether container has StructLayout attribute set Explicit.
813         (FieldMember): New abstract class for consts and fields.
814         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
815         (Field): Reuse FieldMember.
816
817         * const.cs (Const): Reuse FieldMember.
818
819         * rootcontext.cs: EmitConstants call moved to class.
820
821 2004-09-22  Martin Baulig  <martin@ximian.com>
822
823         Thanks to Peter Sestoft for this bug report.
824
825         * expression.cs (Conditional): If both the `trueExpr' and the
826         `falseExpr' is a NullLiteral, return a NullLiteral.
827
828 2004-09-22  Martin Baulig  <martin@ximian.com>
829
830         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
831         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
832         for the "get_Current" call.
833
834 2004-09-22  Martin Baulig  <martin@ximian.com>
835
836         Marek and me just fixed one of our oldest bugs: #28562 :-)
837
838         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
839
840         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
841         we're an EnumConstant, just return that.
842         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
843         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
844         to get the value which'll actually be written into the attribute.
845         However, we have to use GetValue() to access the attribute's value
846         in the compiler.        
847
848 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
849
850         * constant.cs (Constant.IsNegative): New abstract property
851         IsNegative.
852
853         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
854         (StackAlloc.DoResolve): Reused IsNegative.
855
856 2004-09-21  Martin Baulig  <martin@ximian.com>
857
858         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
859         if we're used in an iterator, we may be called from different
860         methods.
861
862         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
863         we actually have an exception block.
864
865 2004-09-20  John Luke <jluke@cfl.rr.com>
866
867         * class.cs, cs-parser.jay: Improve the error report for 1520:
868         report the actual line where the error happens, not where the
869         class was declared.
870
871         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
872         Pass location information that was available elsewhere.
873
874 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
875
876         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
877         runtime to delay sign assemblies.
878
879 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
880
881         * cs-parser.jay: Do not report the stack trace, this is barely
882         used nowadays.
883
884 2004-08-22  John Luke  <john.luke@gmail.com>
885  
886         * driver.cs : check that a resource id is not already used
887         before adding it, report CS1508 if it is, bug #63637
888
889 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
890
891         * ecore.cs: Removed dead code.
892
893 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
894
895         * class.cs: Do not report warning CS0067 on the interfaces.
896
897 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
898
899         * cs-parser.jay: Add error 504 report.
900
901 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
902
903         * rootcontext.cs: WarningLevel is 4 by default now.
904
905         * statement.cs (Fixed.Resolve): Do not null
906         VariableInfo.
907
908 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
909
910         Fixed bug #55780
911         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
912         deep search when property is not virtual.
913         (PropertyExpr.ResolveAccessors): Make one call for both
914         accessors.
915
916 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
917
918         Fixed bug #65766
919         * statement.cs: Error 152 report constains also location.
920
921 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
922
923         Fixed bug #65766
924         * const.cs: Explicitly set constant as static.
925
926 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
927
928         Fixed bug #64226
929         * cs-parser.jay: Add error 1017 report.
930
931 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
932
933         Fixed bug #59980, #64224
934         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
935
936         * typemanager.cs (IsSpecialMethod): Simplified
937
938 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
939
940         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
941         condition with better params.
942
943 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
944
945         Fixed bug #65238
946         * attribute.cs (Resolve): Property has to have both
947         accessors.
948
949 2004-09-14  Martin Baulig  <martin@ximian.com>
950
951         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
952
953 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
954
955         Fixed bug #61902
956         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
957         called and is obsolete then this member suppress message
958         when call is inside next [Obsolete] method or type.
959
960         * expression.cs: Use TestObsoleteMethodUsage member.
961
962 2004-09-14  Martin Baulig  <martin@ximian.com>
963
964         * cs-parser.jay: Sync a bit with the GMCS version.
965
966 2004-09-14  Martin Baulig  <martin@ximian.com>
967
968         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
969         (CSharpParser.yacc_verbose_flag): New public field.
970
971         * genericparser.cs: Removed.
972
973 2004-09-14  Raja R Harinath  <rharinath@novell.com>
974
975         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
976
977 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
978
979         * class.cs (MethodCore.CheckBase): Fix bug #65757.
980
981 2004-09-10  Martin Baulig  <martin@ximian.com>
982
983         Backported my MemberName changes from GMCS into MCS.
984
985         - we are now using a special `MemberName' class instead of using
986         strings; in GMCS, the `MemberName' also contains the type
987         arguments.
988
989         - changed the grammar rules a bit:
990           * the old `member_name' is now a `namespace_or_type_name':
991             The rule is that we use `namespace_or_type_name' everywhere
992             where we expect either a "member name" (GetEnumerator) or a
993             "member name" with an explicit interface name
994             (IEnumerable.GetEnumerator).
995             In GMCS, the explicit interface name may include type arguments
996             (IEnumerable<T>.GetEnumerator).
997           * we use `member_name' instead of just `IDENTIFIER' for
998             "member names":
999             The rule is that we use `member_name' wherever a member may
1000             have type parameters in GMCS.       
1001
1002         * decl.cs (MemberName): New public class.
1003         (MemberCore.MemberName): New public readonly field.
1004         (MemberCore.ctor): Take a `MemberName' argument, not a string.
1005         (DeclSpace): Likewise.
1006
1007         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
1008         * enum.cs (Enum.ctor): Likewise.
1009
1010         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
1011         MemberName.     
1012         (AliasEntry.ctor): Take a MemberName, not an Expression.
1013         (AliasEntry.UsingAlias): Likewise.
1014
1015         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
1016         (IMethodData.MemberName): Changed type from string to MemberName.
1017         (MemberBase.ExplicitInterfaceName): Likewise.
1018         (AbstractPropertyEventMethod.SetupName): Make this private.
1019         (AbstractPropertyEventMethod.ctor): Added `string prefix'
1020         argument; compute the member name here.
1021         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
1022         on the `member.MemberName' and the `prefix'.
1023
1024         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
1025         not `type_name'.
1026         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
1027         thus, we get a `MemberName' instead of a `string'.  These
1028         declarations may have type parameters in GMCS.
1029         (interface_method_declaration, delegate_declaration): Likewise.
1030         (class_declaration, interface_declaration): Likewise.
1031         (method_header): Use `namespace_or_type_name' instead of
1032         `member_name'.  We may be an explicit interface implementation.
1033         (property_declaration, event_declaration): Likewise.
1034         (member_name): This is now just an `IDENTIFIER', not a
1035         `namespace_or_type_name'.
1036         (type_name, interface_type): Removed.
1037         (namespace_or_type_name): Return a MemberName, not an Expression.
1038         (primary_expression): Use `member_name' instead of `IDENTIFIER';
1039         call GetTypeExpression() on the MemberName to get an expression.
1040         (IndexerDeclaration.interface_type): Changed type from string to
1041         MemberName.
1042         (MakeName): Operate on MemberName's instead of string's.
1043
1044 2004-09-13  Raja R Harinath  <rharinath@novell.com>
1045
1046         Fix bug #55770.
1047         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
1048         (NamespaceEntry.Lookup): Add new argument to flag if we want the
1049         lookup to avoid symbols introduced by 'using'.
1050         * rootcontext.cs (NamespaceLookup): Update.
1051
1052 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
1053
1054         * class.cs (TypeContainer.DoDefineMembers): Do not call
1055         DefineDefaultConstructor for static classes.
1056
1057 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
1058
1059         * attribute.cs (Attribute.Resolve): Add error 653 report.
1060
1061         * class.cs (Class.ApplyAttributeBuilder): Add error 641
1062         report.
1063         (Method.ApplyAttributeBuilder): Add error 685 report.
1064         (Operator.Define): Add error 564 report.
1065
1066         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
1067
1068         * expression.cs (Invocation.DoResolve): Add error
1069         245 and 250 report.
1070
1071         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
1072         error 674 report.
1073
1074 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * class.cs (ConstructorInitializer.Resolve):
1077         Wrong error number (515->516).
1078
1079 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1080
1081         * class.cs (Indexer.Define): Add error 631 report.
1082
1083 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1084
1085         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
1086
1087 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1088
1089         * expression.cs (Probe.DoResolve): Add error CS0241 report.
1090
1091 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
1092
1093         * cs-parser.jay: Added error CS0241 report.
1094
1095 2004-09-10  Raja R Harinath  <rharinath@novell.com>
1096
1097         * cs-parser.jay (fixed_statement): Introduce a scope for the
1098         declaration in the 'fixed' statement.
1099
1100 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1101
1102         * cs-parser.jay: Added CS0230 error report.
1103
1104 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1105
1106         * cs-parser.jay: Added errors CS0231 and CS0257 report.
1107
1108 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1109
1110         * expression.cs (Argument.Resolve): Added error CS0192 and
1111         CS0199 report.
1112
1113 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1114
1115         C# 2.0 #pragma warning feature
1116
1117         * cs-tokenizer.cs (PreProcessPragma): New method; 
1118         Handles #pragma directive.
1119
1120         * report.cs (WarningRegions): New class; Support
1121         class for #pragma warning directive. It tests whether
1122         warning is enabled for a given line.
1123
1124 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
1125
1126         * const.cs: Add more descriptive error report, tahnks to
1127         Sebastien. 
1128
1129 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
1132
1133 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
1134
1135         * expression.cs: Apply patch from Ben: Remove dead code from
1136         ArrayCreation, and remove the TurnintoConstant call in const.cs,
1137         as that code just threw an exception anwyays.
1138
1139         * const.cs: Remove the call to the turnintoconstant, for details
1140         see bug: #63144
1141         
1142         * literal.cs: The type of the null-literal is the null type;  So
1143         we use a placeholder type (literal.cs:System.Null, defined here)
1144         for it.
1145
1146         * expression.cs (Conditional.DoResolve): Remove some old code that
1147         is no longer needed, conversions have been fixed.
1148
1149         (ArrayCreationExpression.DoResolve): Return false if we fail to
1150         resolve the inner expression.
1151
1152 2004-09-07  Raja R Harinath  <rharinath@novell.com>
1153
1154         Fix test-290.cs.
1155         * cs-parser.jay (delegate_declaration): Record a delegate
1156         declaration as a type declaration.
1157         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
1158
1159 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
1160
1161         * parameter.cs: Do not crash if the type can not be resolved. 
1162
1163         * expression.cs: Report errors with unsafe pointers, fixes #64896
1164
1165 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
1166
1167         * expression.cs: Pointer arith always needs to do a conv.i
1168         if the operand is a long. fix 65320
1169
1170 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1171
1172         Fixed cs0619-37.cs, cs0619-38.cs
1173
1174         * enum.cs (GetObsoleteAttribute): Removed.
1175
1176         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
1177         on Enum member is double staged. The first is tested member
1178         and then enum.
1179
1180 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1181
1182         Fixed #56986, #63631, #65231
1183
1184         * class.cs: (TypeContainer.AddToMemberContainer): New method,
1185         adds member to name container.
1186         (TypeContainer.AddToTypeContainer): New method, adds type to
1187         name container.
1188         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
1189         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
1190         AddOperator): Simplified by reusing AddToMemberContainer.
1191         (TypeContainer.UserDefinedStaticConstructor): Changed to property
1192         instead of field.
1193         (Method.CheckForDuplications): Fixed implementation to test all
1194         possibilities.
1195         (MemberBase): Detection whether member is explicit interface
1196         implementation is now in constructor.
1197         (MemberBase.UpdateMemberName): Handles IndexerName.
1198         (Accessor): Changed to keep also location information.
1199         (AbstractPropertyEventMethod): Is derived from MemberCore.
1200         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
1201         will be emited or not.
1202         (PropertyBase.AreAccessorsDuplicateImplementation):
1203         Tests whether accessors are not in collision with some method.
1204         (Operator): Is derived from MethodCore to simplify common
1205         operations.
1206
1207         * decl.cs (Flags.TestMethodDuplication): Test for duplication
1208         must be performed.
1209         (DeclSpace.AddToContainer): Adds the member to defined_names
1210         table. It tests for duplications and enclosing name conflicts.
1211
1212         * enum.cs (EnumMember): Clean up to reuse the base structures
1213
1214 2004-09-03  Martin Baulig  <martin@ximian.com>
1215
1216         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
1217         into TypeContainer, to make partial classes work again.
1218
1219 2004-09-03  Martin Baulig  <martin@ximian.com>
1220
1221         * rootcontext.cs (RootContext.V2): Removed.
1222
1223 2004-03-23  Martin Baulig  <martin@ximian.com>
1224
1225         * expression.cs (Invocation.OverloadResolve): Added `bool
1226         may_fail' argument and use it instead of the Location.IsNull() hack.
1227
1228 2004-09-03  Martin Baulig  <martin@ximian.com>
1229
1230         Merged latest changes into gmcs.  Please keep this comment in
1231         here, it makes it easier for me to see what changed in MCS since
1232         the last time I merged.
1233
1234 2004-09-03  Raja R Harinath  <rharinath@novell.com>
1235
1236         Fix #61128.
1237         * expression.cs (BetterConversion): Don't allow either conversion 
1238         to be null.  Remove redundant implicit conversion test when 'q ==
1239         null' -- when this function is invoked, we already know that the
1240         implicit conversion exists.
1241         (BetterFunction): Assume that 'best' is non-null.  Remove
1242         redundant reimplementation of IsApplicable when 'best' is null.
1243         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
1244         number of arguments.
1245         (IsAncestralType): Extract from OverloadResolve.
1246         (OverloadResolve): Make robust to the MethodGroupExpr being
1247         unsorted.  Implement all the logic of Section 14.5.5.1, and
1248         support overloading of methods from multiple applicable types.
1249         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
1250
1251         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
1252         (RealError, Warning): Append type of report to related symbol.
1253
1254 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
1255
1256         * enum.cs: Fixed CLS-Compliance checks for enum members.
1257         Error tests cs3008-8.cs, cs3014-8.cs
1258
1259 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1260
1261         Fixed bug #62342, #63102
1262         * class.cs: ImplementIndexer uses member.IsExplicitImpl
1263         like ImplementMethod.
1264
1265 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1266
1267         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1268         Fixed bug #65170.
1269
1270 2004-09-02  Martin Baulig  <martin@ximian.com>
1271
1272         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
1273         TypeManager.GetArgumentTypes() rather than calling GetParameters()
1274         on the MethodBase.
1275
1276 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
1277
1278         C# 2.0 Static classes implemented
1279
1280         * class.cs (TypeContainer): instance_constructors,
1281         initialized_fields, initialized_static_fields,
1282         default_constructor, base_inteface_types are protected to be
1283         accessible from StaticClass.
1284         (TypeContainer.DefineDefaultConstructor): New virtual method
1285         for custom default constructor generating
1286         (StaticClass): New class to handle "Static classes" feature.
1287
1288         * cs-parser.jay: Handle static keyword on class like instance
1289         of StaticClass.
1290
1291         * driver.cs: Added "/langversion" command line switch with two
1292         options (iso-1, default).
1293
1294 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
1295
1296         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
1297
1298 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
1299
1300         * delegate.cs: Style.
1301
1302 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
1303
1304         * delegate.cs: Add seperate instance expr field for miguel.
1305
1306 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1307
1308         * PointerArithmetic (Resolve): make sure we are not doing
1309         pointer arith on void*. Also, make sure we are resolved
1310         by not setting eclass until resolve.
1311
1312         All callers: Make sure that PointerArithmetic gets resolved.
1313
1314 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1315
1316         * ArrayCreation (LookupType): If the type does not resolve 
1317         to an array, give an error.
1318
1319 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
1320
1321         * statement.cs (Try.Resolve): Fixed bug #64222
1322
1323 2004-08-27  Martin Baulig  <martin@ximian.com>
1324
1325         * class.cs
1326         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
1327         crash here.     
1328
1329 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1330
1331         * ecore.cs (Constantify): Get underlying type via
1332         System.Enum.GetUnderlyingType to avoid StackOverflow on the
1333         Windows in special cases.
1334
1335 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1336
1337         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
1338         for obtaining also private methods.
1339         (GetRemoveMethod): Used GetRemoveMethod (true)
1340         for obtaining also private methods.
1341
1342 2004-08-24  Martin Baulig  <martin@ximian.com>
1343
1344         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
1345         MethodAttributes.HideBySig for operators.
1346
1347 2004-08-23  Martin Baulig  <martin@ximian.com>
1348
1349         Back to the old error reporting system :-)
1350
1351         * report.cs (Message): Removed.
1352         (Report.MessageData, ErrorData, WarningData): Removed.
1353         (Report.Error, Warning): Back to the old system.
1354
1355 2004-08-23  Martin Baulig  <martin@ximian.com>
1356
1357         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
1358
1359         * class.cs (TypeContainer.ParentContainer): New public virtual
1360         method; replaces the explicit interface implementation.
1361         (ClassPart.ParentContainer): Override.
1362
1363 2004-08-23  Martin Baulig  <martin@ximian.com>
1364
1365         * statement.cs (Switch): Added support for constant switches; see
1366         #59428 or test-285.cs.
1367
1368 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1369
1370         Fixed bug #62740.
1371         * statement.cs (GetEnumeratorFilter): Removed useless
1372         logic because C# specs is strict. GetEnumerator must be
1373         public.
1374
1375 2004-08-22  Martin Baulig  <martin@ximian.com>
1376
1377         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1378         a switch and may break, reset the barrier.  Fixes #59867.
1379
1380 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
1381
1382         CLS-Compliance speed up (~5% for corlib)
1383
1384         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
1385         New method. Tests container for CLS-Compliant names
1386
1387         * class.cs (TypeContainer.VerifyClsName): New method.
1388         Checks whether container name is CLS Compliant.
1389         (Constructor): Implements IMethodData.
1390
1391         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
1392         low-case table for CLS Compliance test.
1393         (MemberCache.VerifyClsParameterConflict): New method.
1394         Checks method parameters for CS3006 error.
1395
1396         * enum.cs (EnumMember): Is derived from MemberCore.
1397         (Enum.VerifyClsName): Optimized for better performance.
1398
1399 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1400
1401         * report.cs: Renamed Error_T to Error and changed all
1402         references.
1403
1404 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
1405
1406         * class.cs (TypeContainer.IndexerArrayList): New inner class
1407         container for indexers.
1408         (TypeContainer.DefaultIndexerName): New constant for default
1409         indexer name. Replaced all "Item" with this constant.
1410         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
1411
1412         * typemanager.cs (TypeManager.default_member_ctor): Cache here
1413         DefaultMemberAttribute constructor.
1414
1415 2004-08-05  Martin Baulig  <martin@ximian.com>
1416
1417         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1418         Fix bug #59429.
1419
1420 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
1421
1422         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
1423         multi platforms problem.
1424
1425         * compiler.csproj: Included shared files.
1426
1427 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1428
1429         Fix bug 60333, 55971 in the more general way
1430         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1431         Added arg_type argument for constant conversion.
1432         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
1433
1434 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1435
1436         Fix bug #59760
1437         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
1438         OperatorArrayList, MethodCoreArrayList for typecontainer
1439         containers. Changed class member types to these new types.
1440         (MethodArrayList.DefineMembers): Added test for CS0659.
1441
1442 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
1443
1444         * cfold.cs: Synchronize the folding with the code in expression.cs
1445         Binary.DoNumericPromotions for uint operands.
1446
1447         * attribute.cs: Revert patch from Raja, it introduced a regression
1448         while building Blam-1.2.1 (hard to isolate a test case).
1449
1450 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
1451
1452         Fix for #55382
1453         * class.cs:
1454         (TypeContainer.Define): Renamed to DefineContainerMembers because of
1455         name collision.
1456         (MethodCore.parent_method): New member. The method we're overriding
1457         if this is an override method.
1458         (MethodCore.CheckBase): Moved from Method class and made common.
1459         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
1460         private.
1461         (MethodCore.CheckForDuplications): New abstract method. For custom
1462         member duplication search in a container
1463         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
1464         method and its return type.
1465         (Event.conflict_symbol): New member. Symbol with same name in the
1466         parent class.
1467
1468         * decl.cs:
1469         (MemberCache.FindMemberWithSameName): New method. The method
1470         is looking for conflict with inherited symbols.
1471
1472 2004-08-04  Martin Baulig  <martin@ximian.com>
1473
1474         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
1475
1476         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
1477
1478 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1479
1480         * report.cs (Message): New enum for better error, warning reference in
1481         the code.
1482         (MessageData): New inner abstract class. It generally handles printing of
1483         error and warning messages.
1484         Removed unused Error, Warning, Message methods.
1485
1486 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1487
1488         Fix for cs0592-8.cs test
1489         * attribute.cs
1490         (Attributable.ValidAttributeTargets): Made public.
1491         (Attribute.ExplicitTarget): New member for explicit target value.
1492         (Attribute.CheckTargets): Now we translate explicit attribute
1493         target to Target here.
1494
1495 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
1496
1497         * ecore.cs (MethodGroupExpr): new IsBase property.
1498
1499         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
1500
1501         * delegate.cs (DelegateCreation): store a MethodGroupExpr
1502         rather than an instance expr.
1503
1504         (DelegateCreation.Emit): Use the method group rather than
1505         the instance expression. Also, if you have base.Foo as the
1506         method for a delegate, make sure to emit ldftn, not ldftnvirt.
1507
1508         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
1509
1510         (NewDelegate.DoResolve): Only check for the existance of Invoke
1511         if the method is going to be needed. Use MethodGroupExpr.
1512
1513         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
1514
1515         * expression.cs: For pointer arith., make sure to use
1516         the size of the type, not the size of the pointer to
1517         the type.
1518
1519 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
1520
1521         Fix for #60722
1522         * class.cs (Class): Added error CS0502 test.
1523
1524 2004-08-03  John Luke  <jluke@cfl.rr.com>
1525             Raja R Harinath  <rharinath@novell.com>
1526
1527         Fix for #60997.
1528         * attribute.cs (Attribute.complained_before): New flag.
1529         (Attribute.ResolveType, Attribute.Resolve),
1530         (Attribute.DefinePInvokeMethod): Set it.
1531         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
1532         
1533 2004-08-03  Martin Baulig  <martin@ximian.com>
1534
1535         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
1536         use a user-defined operator; we still need to do numeric
1537         promotions in case one argument is a builtin type and the other
1538         one has an implicit conversion to that type.  Fixes #62322.
1539
1540 2004-08-02  Martin Baulig  <martin@ximian.com>
1541
1542         * statement.cs (LocalInfo.Flags): Added `IsThis'.
1543         (LocalInfo.IsThis): New public property.
1544         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
1545
1546 2004-08-01  Martin Baulig  <martin@ximian.com>
1547
1548         * class.cs (TypeContainer.GetClassBases): Don't set the default
1549         here since we may get called from GetPartialBases().
1550         (TypeContainer.DefineType): If GetClassBases() didn't return a
1551         parent, use the default one.
1552
1553 2004-07-30  Duncan Mak  <duncan@ximian.com>
1554
1555         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
1556
1557 2004-07-30  Martin Baulig  <martin@ximian.com>
1558
1559         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
1560
1561         * class.cs (SourceMethod): New public class, derive from the
1562         symbol writer's ISourceMethod.
1563         (Method): Use the new symbol writer API.
1564
1565         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
1566         as argument and use the new symbol writer.
1567
1568         * location.cs
1569         (SourceFile): Implement the symbol writer's ISourceFile.
1570         (Location.SymbolDocument): Removed.
1571         (Location.SourceFile): New public property.
1572
1573         * symbolwriter.cs: Use the new symbol writer API.
1574
1575 2004-07-30  Raja R Harinath  <rharinath@novell.com>
1576
1577         * Makefile (install-local): Remove.  Functionality moved to
1578         executable.make.
1579
1580 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
1581
1582         * Makefile: Install mcs.exe.config file together with mcs.exe.
1583         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
1584         correct runtime version.
1585         
1586 2004-07-25  Martin Baulig  <martin@ximian.com>
1587
1588         * class.cs
1589         (TypeContainer.RegisterOrder): Removed, this was unused.
1590         (TypeContainer, interface_order): Removed.
1591         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
1592         TypeContainer as argument since we can also be called with a
1593         `PartialContainer' for a partial class/struct/interface.
1594         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
1595         of checking whether we're an `Interface' - we could be a
1596         `PartialContainer'.
1597         (PartialContainer.Register): Override; call
1598         AddClass()/AddStruct()/AddInterface() on our parent.
1599
1600         * cs-parser.jay (interface_member_declaration): Add things to the
1601         `current_container', not the `current_class'.
1602
1603         * rootcontext.cs (RegisterOrder): The overloaded version which
1604         takes an `Interface' was unused, removed.
1605
1606         * typemanager.cs (TypeManager.LookupInterface): Return a
1607         `TypeContainer', not an `Interface'.
1608         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
1609         contain a `PartialContainer' for an interface, so check it's
1610         `Kind' to figure out what it is.
1611
1612 2004-07-25  Martin Baulig  <martin@ximian.com>
1613
1614         * class.cs (Class.DefaultTypeAttributes): New public constant.
1615         (Struct.DefaultTypeAttributes): Likewise.
1616         (Interface.DefaultTypeAttributes): Likewise.
1617         (PartialContainer.TypeAttr): Override this and add the
1618         DefaultTypeAttributes.
1619
1620 2004-07-25  Martin Baulig  <martin@ximian.com>
1621
1622         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
1623         we can just use the `Parent' field instead.
1624
1625 2004-07-25  Martin Baulig  <martin@ximian.com>
1626
1627         * class.cs (TypeContainer.Emit): Renamed to EmitType().
1628
1629 2004-07-25  Martin Baulig  <martin@ximian.com>
1630
1631         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
1632         our parts before defining any methods.
1633         (TypeContainer.VerifyImplements): Make this virtual.
1634         (ClassPart.VerifyImplements): Override and call VerifyImplements()
1635         on our PartialContainer.
1636
1637 2004-07-25  Martin Baulig  <martin@ximian.com>
1638
1639         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
1640
1641         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
1642         argument, we can just use the `Parent' field instead.
1643
1644         * class.cs
1645         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
1646         (MemberBase.DoDefine): Likewise.
1647
1648 2004-07-24  Martin Baulig  <martin@ximian.com>
1649
1650         * decl.cs (MemberCore.Parent): New public field.
1651         (DeclSpace.Parent): Moved to MemberCore.
1652
1653         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
1654         (MemberBase.ctor): Added TypeContainer argument, pass it to our
1655         parent's .ctor.
1656         (FieldBase, Field, Operator): Likewise.
1657         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
1658         (EventField, Event): Likewise.
1659
1660 2004-07-23  Martin Baulig  <martin@ximian.com>
1661
1662         * class.cs (PartialContainer): New public class.
1663         (ClassPart): New public class.
1664         (TypeContainer): Added support for partial classes.
1665         (TypeContainer.GetClassBases): Splitted some of the functionality
1666         out into GetNormalBases() and GetPartialBases().
1667
1668         * cs-tokenizer.cs (Token.PARTIAL): New token.
1669         (Tokenizer.consume_identifier): Added some hacks to recognize
1670         `partial', but only if it's immediately followed by `class',
1671         `struct' or `interface'.
1672
1673         * cs-parser.jay: Added support for partial clases.
1674
1675 2004-07-23  Martin Baulig  <martin@ximian.com>
1676
1677         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
1678         a `DeclSpace' and also made it readonly.
1679         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
1680         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
1681         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
1682
1683         * cs-parser.jay: Pass the `current_class', not the
1684         `current_container' (at the moment, this is still the same thing)
1685         to a new Method, Property, Event, Indexer or Constructor.
1686
1687 2004-07-23  Martin Baulig  <martin@ximian.com>
1688
1689         * cs-parser.jay (CSharpParser): Added a new `current_class' field
1690         and removed the `current_interface' one.
1691         (struct_declaration, class_declaration, interface_declaration):
1692         Set `current_class' to the newly created class/struct/interface;
1693         set their `Bases' and call Register() before parsing their body.
1694
1695 2004-07-23  Martin Baulig  <martin@ximian.com>
1696
1697         * class.cs (Kind): New public enum.
1698         (TypeContainer): Made this class abstract.
1699         (TypeContainer.Kind): New public readonly field.
1700         (TypeContainer.CheckDef): New public method; moved here from
1701         cs-parser.jay.
1702         (TypeContainer.Register): New public abstract method.
1703         (TypeContainer.GetPendingImplementations): New public abstract
1704         method.
1705         (TypeContainer.GetClassBases): Removed the `is_class' and
1706         `is_iface' parameters.
1707         (TypeContainer.DefineNestedTypes): Formerly known as
1708         DoDefineType().
1709         (ClassOrStruct): Made this class abstract.
1710
1711         * tree.cs (RootTypes): New public type. 
1712
1713 2004-07-20  Martin Baulig  <martin@ximian.com>
1714
1715         * tree.cs (Tree.RecordNamespace): Removed.
1716         (Tree.Namespaces): Removed.
1717
1718         * rootcontext.cs (RootContext.IsNamespace): Removed.
1719
1720         * cs-parser.jay (namespace_declaration): Just create a new
1721         NamespaceEntry here.
1722
1723 2004-07-20  Martin Baulig  <martin@ximian.com>
1724
1725         * statement.cs (ExceptionStatement): New abstract class.  This is
1726         now used as a base class for everyone who's using `finally'.
1727         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
1728         our local variables before using them.
1729
1730         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
1731         virtual method.  This is used by Yield.Resolve() to "steal" an
1732         outer block's `finally' clauses.
1733         (FlowBranchingException): The .ctor now takes an ExceptionStatement
1734         argument.
1735
1736         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
1737         version which takes an ExceptionStatement.  This version must be
1738         used to create exception branchings.
1739
1740         * iterator.cs
1741         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
1742         (Iterator.EmitMoveNext): Added exception support; protect the
1743         block with a `fault' clause, properly handle 'finally' clauses.
1744         (Iterator.EmitDispose): Run all the `finally' clauses here.
1745
1746 2004-07-20  Martin Baulig  <martin@ximian.com>
1747
1748         * iterator.cs: This is the first of a set of changes in the
1749         iterator code.  Match the spec more closely: if we're an
1750         IEnumerable, then GetEnumerator() must be called.  The first time
1751         GetEnumerator() is called, it returns the current instance; all
1752         subsequent invocations (if any) must create a copy.
1753
1754 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
1755
1756         * expression.cs: Resolve the constant expression before returning
1757         it. 
1758
1759 2004-07-19  Martin Baulig  <martin@ximian.com>
1760
1761         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
1762         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
1763         the return type of the new EmitContext.
1764
1765 2004-07-18  Martin Baulig  <martin@ximian.com>
1766
1767         * class.cs (Property.Define): Fix iterators.
1768
1769         * iterators.cs (Iterator.Define): Moved the
1770         `container.AddInterator (this)' call here from the .ctor; only do
1771         it if we resolved successfully.
1772
1773 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
1774
1775         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
1776         `true' for preprocessing directives that we parse.  The return
1777         value indicates whether we should return to regular tokenizing or
1778         not, not whether it was parsed successfully.
1779
1780         In the past if we were in: #if false ... #line #endif, we would
1781         resume parsing after `#line'.  See bug 61604.
1782
1783         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
1784         building: IsEnumType should return true only for enums, not for
1785         enums or System.Enum itself.  This fixes #61593.
1786
1787         Likely what happened is that corlib was wrong: mcs depended on
1788         this bug in some places.  The bug got fixed, we had to add the
1789         hack, which caused bug 61593.
1790
1791         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
1792         that was a workaround for the older conditions.
1793
1794 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
1795
1796         * assign.cs: IAssignMethod has a new interface, as documented
1797         inline. All assignment code now uses this new api.
1798
1799         * ecore.cs, expression.cs: All classes which implement
1800         IAssignMethod now use the new interface.
1801
1802         * expression.cs (Invocation): add a hack to EmitCall so that
1803         IndexerAccess can be the target of a compound assignment without
1804         evaluating its arguments twice.
1805
1806         * statement.cs: Handle changes in Invocation api.
1807
1808 2004-07-16  Martin Baulig  <martin@ximian.com>
1809
1810         * iterators.cs: Rewrote this.  We're now using one single Proxy
1811         class for both the IEnumerable and the IEnumerator interface and
1812         `Iterator' derives from Class so we can use the high-level API.
1813
1814         * class.cs (TypeContainer.AddIterator): New method.
1815         (TypeContainer.DoDefineType): New protected virtual method, which
1816         is called from DefineType().
1817         (TypeContainer.DoDefineMembers): Call DefineType() and
1818         DefineMembers() on all our iterators.
1819         (TypeContainer.Emit): Call Emit() on all our iterators.
1820         (TypeContainer.CloseType): Call CloseType() on all our iterators.
1821
1822         * codegen.cs (EmitContext.CurrentIterator): New public field.
1823
1824 2004-07-15  Martin Baulig  <martin@ximian.com>
1825
1826         * typemanager.cs
1827         (TypeManager.not_supported_exception_type): New type.   
1828
1829 2004-07-14  Martin Baulig  <martin@ximian.com>
1830
1831         * iterators.cs: Use real error numbers.
1832
1833 2004-07-14  Martin Baulig  <martin@ximian.com>
1834
1835         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
1836         requires this to be a System.Collection.IEnumerable and not a
1837         class implementing that interface.
1838         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
1839
1840 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
1841
1842         * class.cs: Fixed previous fix, it broke some error tests.
1843
1844 2004-07-12  Martin Baulig  <martin@ximian.com>
1845
1846         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
1847         Fixes #61293.
1848
1849 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
1850
1851         * assign.cs (LocalTemporary): Add new argument: is_address,If
1852         `is_address' is true, then the value that we store is the address
1853         to the real value, and not the value itself.
1854         
1855         * ecore.cs (PropertyExpr): use the new local temporary
1856         stuff to allow us to handle X.Y += z (where X is a struct)
1857
1858 2004-07-08  Martin Baulig  <martin@ximian.com>
1859
1860         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
1861         not always return, just like we're doing in Using.Resolve().
1862
1863 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
1864
1865         * cs-parser.jay (fixed_statement): flag this as Pinned.
1866
1867 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
1868
1869         * typemanager.cs (TypeManager): Removed MakePinned method, this
1870         mechanism is replaced with the .NET 2.x compatible mechanism of
1871         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1872
1873         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1874         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1875         `IsFixed' property which has a different meaning.
1876
1877 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1878
1879         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1880         visible from inside a nested class, not just the names of the
1881         immediately enclosing class.
1882         Fix for bug #60730.
1883
1884 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1885
1886         * expression.cs (BetterConversion): Remove buggy special-case
1887         handling of "implicit constant expression conversions".  At this
1888         point, we already know that the conversion is possible -- we're
1889         only checking to see which is better.
1890
1891 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1892
1893         * cs-parser.jay: Added error CS0210 test.
1894
1895 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1896
1897         * cs-parser.jay: Added error CS0134 test.
1898
1899 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1900
1901         Fix bug #52507
1902         * cs-parser.jay: Added error CS0145 test.
1903
1904 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1905
1906         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1907
1908 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1909         
1910         * expression.cs (StackAlloc.Resolve): The argument may not
1911         be a constant; deal with this case.
1912         
1913 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1914
1915         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1916         GetIndexerAttributeValue.
1917         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1918
1919         * class.cs (Indexer.Define): Added error tests for CS0415,
1920         CS0609.
1921
1922 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1923
1924         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1925         property code.
1926
1927 2004-06-23  Martin Baulig  <martin@ximian.com>
1928
1929         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1930         neither return nor throw, reset the barrier as well.  Fixes #60457.
1931
1932 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1933
1934         * class.cs : EventAttributes is now set to None by default.
1935           This fixes bug #60459.
1936
1937 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1938
1939         Fix bug #60219
1940         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1941         Don't throw exception but return null (it's sufficient now).
1942
1943 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1944
1945         * typemanager.cs (GetArgumentTypes): Faster implementation.
1946
1947 2004-06-18  Martin Baulig  <martin@ximian.com>
1948
1949         * attribute.cs (Attribute.Resolve): Check whether we're an
1950         EmptyCast which a Constant child.  Fixes #60333.
1951
1952 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1953
1954         * statement.cs (EmitCollectionForeach): Account for the fact that
1955         not all valuetypes are in areas which we can take the address of.
1956         For these variables, we store to a temporary variable. Also, make
1957         sure that we dont emit a `callvirt' on a valuetype method.
1958
1959 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1960
1961         * expression.cs (StackAlloc.DoReSolve): Added test for
1962         negative parameter (CS0247).
1963
1964 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1965
1966         Fix bug #59792
1967         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1968
1969 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1970
1971         Fix bug #59781
1972         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1973         ulong.
1974
1975 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1976
1977         Fix bug #58254 & cs1555.cs, cs1556.cs
1978         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1979
1980 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1981
1982         * cs-parser.jay: Added error CS1669 test for indexers.
1983
1984 2004-06-11  Martin Baulig  <martin@ximian.com>
1985
1986         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1987         call this twice: for params and varargs methods.
1988
1989 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1990
1991         * class.cs:
1992         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1993
1994 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1995
1996         * attribute.cs (Attribute.GetValidTargets): Made public.
1997
1998         * class.cs: 
1999         (AbstractPropertyEventMethod): New class for better code sharing.
2000         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
2001         CS1667 report.
2002         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
2003
2004 2004-06-11  Raja R Harinath  <rharinath@novell.com>
2005
2006         Fix bug #59477.
2007         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
2008         that the call to Resolve is part of a MemberAccess.
2009         (Expression.Resolve): Use it for SimpleName resolution.
2010         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
2011         Add 'intermediate' boolean argument.
2012         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
2013         error message when the SimpleName can be resolved ambiguously
2014         between an expression and a type.
2015         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
2016         public.
2017         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
2018         call on the left-side.
2019
2020 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
2021
2022         * class.cs:
2023         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
2024
2025 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
2026
2027         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
2028
2029 2004-06-11  Martin Baulig  <martin@ximian.com>
2030
2031         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
2032         varargs methods if applicable.
2033
2034 2004-06-11  Martin Baulig  <martin@ximian.com>
2035
2036         * expression.cs (Invocation.EmitCall): Don't use
2037         `method.CallingConvention == CallingConventions.VarArgs' since the
2038         method could also have `CallingConventions.HasThis'.
2039
2040 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
2041
2042         * class.cs (Event.GetSignatureForError): Implemented.
2043         Fixed crash in error test cs3010.cs
2044
2045 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
2046
2047         * cs-tokenizer.cs: Change the way we track __arglist to be
2048         consistent with the other keywords.
2049
2050 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
2051
2052         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
2053         tomorrow.
2054
2055 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
2056
2057         * codegen.cs: Check that all referenced assemblies have a strongname
2058         before strongnaming the compiled assembly. If not report error CS1577.
2059         Fix bug #56563. Patch by Jackson Harper.
2060         * typemanager.cs: Added a method to return all referenced assemblies.
2061         Fix bug #56563. Patch by Jackson Harper.
2062
2063 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
2064
2065         * class.cs:
2066         (Method.ApplyAttributeBuilder): Moved and added conditional
2067         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
2068
2069         * delegate.cs:
2070         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
2071
2072 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
2073
2074         Fixed #59640
2075         * class.cs: (EventField.attribute_targets): Changed default target.
2076
2077 2004-06-08  Martin Baulig  <martin@ximian.com>
2078
2079         * expression.cs (Invocation.EmitCall): Enable varargs methods.
2080
2081 2004-06-08  Martin Baulig  <martin@ximian.com>
2082
2083         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
2084
2085 2004-06-07  Martin Baulig  <martin@ximian.com>
2086
2087         Added support for varargs methods.
2088
2089         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
2090         keyword.
2091
2092         * cs-parser.jay: Added support for `__arglist'.
2093
2094         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
2095
2096         * expression.cs (Argument.AType): Added `ArgList'.
2097         (Invocation): Added support for varargs methods.
2098         (ArglistAccess): New public class.
2099         (Arglist): New public class.
2100
2101         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
2102
2103         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
2104         a method's top-level block if the method has varargs.
2105
2106         * support.cs (ReflectionParameters, InternalParameters): Added
2107         support for varargs methods.    
2108
2109 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
2110
2111         * class.cs: Provide location in indexer error report.
2112
2113         * driver.cs: Use standard names.
2114
2115         * namespace.cs: Catch the use of using after a namespace has been
2116         declared also on using aliases.
2117
2118 2004-06-03  Raja R Harinath  <rharinath@novell.com>
2119
2120         Bug #50820.
2121         * typemanager.cs (closure_private_ok, closure_invocation_type)
2122         (closure_qualifier_type, closure_invocation_assembly)
2123         (FilterWithClosure): Move to ...
2124         (Closure): New internal nested class.
2125         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
2126         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
2127         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
2128         (MemberLookup, MemberLookupFailed): Use it.
2129         * expression.cs (New.DoResolve): Treat the lookup for the
2130         constructor as being qualified by the 'new'ed type.
2131         (Indexers.GetIndexersForTypeOrInterface): Update.
2132
2133 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
2134
2135         * attribute.cs
2136         (GetConditionalAttributeValue): New method. Returns
2137         condition of ConditionalAttribute.
2138         (SearchMulti): New method.  Returns all attributes of type 't'.
2139         Use it when attribute is AllowMultiple = true.
2140         (IsConditionalMethodExcluded): New method.
2141
2142         * class.cs
2143         (Method.IsExcluded): Implemented. Returns true if method has conditional
2144         attribute and the conditions is not defined (method is excluded).
2145         (IMethodData): Extended interface for ConditionalAttribute support.
2146         (PropertyMethod.IsExcluded): Implemented.
2147
2148         * decl.cs
2149         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
2150
2151         * expression.cs
2152         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
2153         on the method.
2154
2155 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2156
2157         * expression.cs (ArrayCreationExpression): Make this just an
2158         `expression'. It can't be a statement, so the code here was
2159         dead.
2160
2161 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
2162
2163         Fixed #59072
2164         * typemanager.cs (GetFullNameSignature): New method for
2165         MethodBase types.
2166
2167 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
2168
2169         Fixed #56452
2170         * class.cs (MemberBase.GetSignatureForError): New virtual method.
2171         Use this method when MethodBuilder is null.
2172         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
2173         Added test for error CS0626 (MONO reports error for this situation).
2174         (IMethodData.GetSignatureForError): Extended interface.
2175
2176 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
2177
2178         * attribute.cs
2179         (AttributeTester.GetObsoleteAttribute): Returns instance of
2180         ObsoleteAttribute when type is obsolete.
2181
2182         * class.cs
2183         (TypeContainer.VerifyObsoleteAttribute): Override.
2184         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
2185         (MethodCode.VerifyObsoleteAttribute): Override.
2186         (MemberBase.VerifyObsoleteAttribute): Override.
2187
2188         * decl.cs
2189         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
2190         and report proper error.
2191
2192         *delegate.cs
2193         Delegate.VerifyObsoleteAttribute): Override.
2194
2195         * ecore.cs
2196         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
2197         and report proper error.
2198         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
2199
2200         * enum.cs
2201         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
2202         and enum member.
2203
2204         * expression.cs
2205         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
2206         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
2207         Added test for ObsoleteAttribute.
2208
2209         * statement.cs
2210         (Catch): Derived from Statement.
2211
2212 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
2213  
2214         Fixed bug #59071 & cs0160.cs
2215  
2216         * statement.cs (Try.Resolve): Check here whether order of catch
2217         clauses matches their dependencies.
2218
2219 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
2220
2221         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
2222         caused a regression: #59343.  Referencing nested classes from an
2223         assembly stopped working.
2224
2225 2004-05-31  Martin Baulig  <martin@ximian.com>
2226
2227         MCS is now frozen for beta 2.
2228
2229 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2230
2231         * convert.cs: add a trivial cache for overload operator resolution.
2232
2233 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2234
2235         * decl.cs: If possible, use lookuptypedirect here. We can only do
2236         this if there is no `.' after the namespace. Avoids using
2237         LookupType, which does lots of slow processing.
2238         (FindNestedType) New method, does what it says :-).
2239         * namespace.cs: use LookupTypeDirect.
2240         * rootcontext.cs: use membercache, if possible.
2241         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
2242
2243 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2244
2245         * expression.cs:
2246         According to the spec, 
2247
2248         In a member access of the form E.I, if E is a single identifier,
2249         and if the meaning of E as a simple-name (§7.5.2) is a constant,
2250         field, property, localvariable, or parameter with the same type as
2251         the meaning of E as a type-name (§3.8), then both possible
2252         meanings of E are permitted.
2253
2254         We did not check that E as a simple-name had the same type as E as
2255         a type name.
2256
2257         This trivial check gives us 5-7% on bootstrap time.
2258
2259 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2260
2261         * expression.cs (Invocation.OverloadResolve): Avoid the
2262         use of hashtables and boxing here by allocating on demand.
2263
2264 2004-05-30  Martin Baulig  <martin@ximian.com>
2265
2266         * rootcontext.cs (RootContext.LookupType): Don't cache things if
2267         we're doing a silent lookup.  Don't try to lookup nested types in
2268         TypeManager.object_type (thanks to Ben Maurer).
2269
2270 2004-05-30  Martin Baulig  <martin@ximian.com>
2271
2272         Committing a patch from Ben Maurer.
2273
2274         * rootcontext.cs (RootContext.LookupType): Cache negative results.
2275
2276 2004-05-29  Martin Baulig  <martin@ximian.com>
2277
2278         * class.cs (IMethodData.ShouldIgnore): New method.
2279
2280         * typemanager.cs (TypeManager.MethodFlags): Don't take a
2281         `Location' argument, we don't need it anywhere.  Use
2282         `IMethodData.ShouldIgnore ()' instead of
2283         `MethodData.GetMethodFlags ()'.
2284         (TypeManager.AddMethod): Removed.
2285         (TypeManager.AddMethod2): Renamed to AddMethod.
2286
2287 2004-05-29  Martin Baulig  <martin@ximian.com>
2288
2289         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
2290
2291         * convert.cs (Convert.ImplicitReferenceConversion): If we're
2292         converting from a class type S to an interface type and we already
2293         have an object on the stack, don't box it again.  Fixes #52578.
2294
2295 2004-05-29  Martin Baulig  <martin@ximian.com>
2296
2297         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
2298         Added support for `params' parameters.  Fixes #59267.
2299
2300 2004-05-29  Martin Baulig  <martin@ximian.com>
2301
2302         * literal.cs (NullPointer): Provide a private .ctor which sets
2303         `type' to TypeManager.object_type.  Fixes #59048.
2304
2305 2004-05-29  Martin Baulig  <martin@ximian.com>
2306
2307         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
2308         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
2309
2310         * ecore.cs (EventExpr.instance_expr): Make the field private.
2311
2312 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
2313
2314         Fixed bug #50080 & cs0214-2.cs
2315         * expression.cs (Cast.DoResolve): Check unsafe context here.
2316         
2317         * statement.cs (Resolve.DoResolve): Likewise.
2318
2319 2004-05-26  Martin Baulig  <martin@ximian.com>
2320
2321         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
2322
2323         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
2324         (RootContext.LookupType): Pass down the `silent' flag.
2325
2326 2004-05-25  Martin Baulig  <martin@ximian.com>
2327
2328         * expression.cs
2329         (MethodGroupExpr.IdenticalTypeName): New public property.
2330         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
2331         expression actually refers to a type.
2332
2333 2004-05-25  Martin Baulig  <martin@ximian.com>
2334
2335         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
2336         for #56176 and made it actually work.
2337
2338 2004-05-25  Martin Baulig  <martin@ximian.com>
2339
2340         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
2341         (FieldExpr, PropertyExpr): Override and implement
2342         CacheTemporaries.  Fixes #52279.
2343
2344 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
2345
2346         * location.cs: In the new compiler listing a file twice is a
2347         warning, not an error.
2348
2349 2004-05-24  Martin Baulig  <martin@ximian.com>
2350
2351         * enum.cs (Enum.DefineType): For the `BaseType' to be a
2352         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
2353
2354 2004-05-24  Martin Baulig  <martin@ximian.com>
2355
2356         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
2357         walking the `using' list.  Fixes #53921.
2358
2359 2004-05-24  Martin Baulig  <martin@ximian.com>
2360
2361         * const.cs (Const.LookupConstantValue): Added support for
2362         EmptyCast's; fixes #55251.
2363
2364 2004-05-24  Martin Baulig  <martin@ximian.com>
2365
2366         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
2367         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
2368         which does the CS0135 check.  The reason is that we first need to
2369         check whether the variable actually exists.
2370
2371 2004-05-24  Martin Baulig  <martin@ximian.com>
2372
2373         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
2374         than RootContext.LookupType() to find the explicit interface
2375         type.  Fixes #58584.
2376
2377 2004-05-24  Raja R Harinath  <rharinath@novell.com>
2378
2379         * Makefile: Simplify.  Use executable.make.
2380         * mcs.exe.sources: New file.  List of sources of mcs.exe.
2381
2382 2004-05-24  Anders Carlsson  <andersca@gnome.org>
2383
2384         * decl.cs:
2385         * enum.cs:
2386         Use the invariant culture when doing String.Compare for CLS case
2387         sensitivity.
2388         
2389 2004-05-23  Martin Baulig  <martin@ximian.com>
2390
2391         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
2392         don't have any dots.  Fixes #52622, added cs0246-8.cs.
2393
2394         * namespace.cs (NamespaceEntry.Lookup): Likewise.
2395         
2396 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2397
2398         * class.cs (MemberBase.Define): Reuse MemberType member for 
2399         resolved type. Other methods can use it too.
2400
2401 2004-05-23  Martin Baulig  <martin@ximian.com>
2402
2403         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
2404         the variable also exists in the current block (otherwise, we need
2405         to report a CS0103).  Fixes #58670.
2406
2407 2004-05-23  Martin Baulig  <martin@ximian.com>
2408
2409         * flowanalysis.cs (Reachability.Reachable): Compute this
2410         on-the-fly rather than storing it as a field.
2411
2412 2004-05-23  Martin Baulig  <martin@ximian.com>
2413
2414         * flowanalysis.cs (Reachability.And): Manually compute the
2415         resulting `barrier' from the reachability.      
2416        
2417 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
2418
2419         Fix bug #57835
2420         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
2421         instance of ObsoleteAttribute when symbol is obsolete.
2422
2423         * class.cs
2424         (IMethodData): Extended interface for ObsoleteAttribute support.
2425
2426 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2427
2428         * attribute.cs: Fix bug #55970
2429
2430 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
2431
2432         Fix bug #52705
2433         * attribute.cs
2434         (GetObsoleteAttribute): New method. Creates the instance of
2435         ObsoleteAttribute.
2436         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
2437         ObsoleteAttribute when member is obsolete.
2438         (AttributeTester.Report_ObsoleteMessage): Common method for
2439         Obsolete error/warning reporting.
2440
2441         * class.cs
2442         (TypeContainer.base_classs_type): New member for storing parent type.
2443
2444         * decl.cs
2445         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
2446         for this MemberCore.
2447
2448 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2449
2450         * attribute.cs, const.cs: Fix bug #58590
2451
2452 2004-05-21  Martin Baulig  <martin@ximian.com>
2453
2454         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
2455         out parameters if the end of the method is unreachable.  Fixes
2456         #58098. 
2457
2458 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2459
2460         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
2461         Hari was right, why extra method.
2462
2463 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
2464
2465         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
2466
2467 2004-05-20  Martin Baulig  <martin@ximian.com>
2468
2469         Merged this back from gmcs to keep the differences to a minumum.
2470
2471         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
2472         instead of a Declspace.
2473         (Attribute.ResolveType): Likewise.
2474         (Attributes.Search): Likewise.
2475         (Attributes.Contains): Likewise.
2476         (Attributes.GetClsCompliantAttribute): Likewise.
2477
2478         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
2479         argument.
2480         (MethodData.ApplyAttributes): Take an EmitContext instead of a
2481         DeclSpace.
2482
2483 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
2484
2485         Fix bug #58688 (MCS does not report error when the same attribute
2486         is assigned twice)
2487
2488         * attribute.cs (Attribute.Emit): Distinction between null and default.
2489
2490 2004-05-19  Raja R Harinath  <rharinath@novell.com>
2491
2492         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
2493         of a top-level attribute without an attribute target.
2494         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
2495         Make non-static.
2496         (Attribute.Conditional_GetConditionName), 
2497         (Attribute.Obsolete_GetObsoleteMessage): Update.
2498         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
2499         part of ScanForIndexerName.
2500         (Attribute.CanIgnoreInvalidAttribute): New function.
2501         (Attribute.ScanForIndexerName): Move to ...
2502         (Attributes.ScanForIndexerName): ... here.
2503         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
2504         (Attributes.Search): New internal variant that can choose not to
2505         complain if types aren't resolved.  The original signature now
2506         complains.
2507         (Attributes.GetClsCompliantAttribute): Use internal variant, with
2508         complaints suppressed.
2509         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
2510         only if it not useful.
2511         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
2512         top-level for attributes that are shared between the assembly
2513         and a top-level class.
2514         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
2515         * class.cs: Update to reflect changes.
2516         (DefineIndexers): Fuse loops.
2517         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
2518         a couple more variants of attribute names.
2519
2520 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
2521
2522         Fix bug #52585 (Implemented explicit attribute declaration)
2523
2524         * attribute.cs:
2525         (Attributable.ValidAttributeTargets): New abstract method. It gets
2526         list of valid attribute targets for explicit target declaration.
2527         (Attribute.Target): It holds target itself.
2528         (AttributeSection): Removed.
2529         (Attribute.CheckTargets): New method. It checks whether attribute
2530         target is valid for the current element.
2531
2532         * class.cs:
2533         (EventProperty): New class. For events that are declared like
2534         property (with add and remove accessors).
2535         (EventField): New class. For events that are declared like field.
2536         class.cs
2537
2538         * cs-parser.jay: Implemented explicit attribute target declaration.
2539
2540         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
2541         Override ValidAttributeTargets.
2542
2543         * parameter.cs:
2544         (ReturnParameter): Class for applying custom attributes on 
2545         the return type.
2546         (ParameterAtribute): New class. Class for applying custom
2547         attributes on the parameter type.
2548
2549 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
2550
2551         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
2552         definitions. 
2553
2554         (Method): Allow UNSAFE here.
2555
2556         * modifiers.cs: Support unsafe reporting.
2557
2558 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
2559
2560         * decl.cs: Fix bug #58478.
2561
2562 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2563
2564         * statement.cs: When checking for unreachable code on an EmptyStatement,
2565         set the location. Fixes bug #58488.
2566
2567 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
2568
2569         * driver.cs: Add -pkg handling.
2570
2571         From Gonzalo: UseShelLExecute=false
2572
2573 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
2574
2575         * attribute.cs:
2576         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
2577         for attribute.
2578         (Attribute.IsClsCompliaceRequired): Moved to base for better
2579         accesibility.
2580         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
2581         when attribute is AttributeUsageAttribute.
2582         (Attribute.GetValidTargets): Simplified.
2583         (Attribute.GetAttributeUsage): New method returns AttributeUsage
2584         attribute for this type.
2585         (Attribute.ApplyAttributes): Method renamed to Emit and make
2586         non-static.
2587         (GlobalAttributeSection): New class for special handling of global
2588         attributes (assembly, module).
2589         (AttributeSection.Emit): New method.
2590
2591         * class.cs: Implemented Attributable abstract methods.
2592         (MethodCore.LabelParameters): Moved to Parameter class.
2593         (Accessor): Is back simple class.
2594         (PropertyMethod): Implemented Attributable abstract class.
2595         (DelegateMethod): Implemented Attributable abstract class.
2596         (Event): New constructor for disctintion between normal Event
2597         and Event with accessors.
2598
2599         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
2600
2601         * codegen.cs, const.cs, decl.cs, delegate.cs:
2602         (CommonAssemblyModulClass): Implemented Attributable abstract class
2603         and simplified.
2604
2605         * enum.cs: Implement IAttributeSupport interface.
2606         (EnumMember): New class for emum members. Implemented Attributable
2607         abstract class
2608
2609         * parameter.cs:
2610         (ParameterBase): Is abstract.
2611         (ReturnParameter): New class for easier [return:] attribute handling.
2612
2613         * typemanager.cs: Removed builder_to_attr.
2614
2615 2004-05-11  Raja R Harinath  <rharinath@novell.com>
2616
2617         Fix bug #57151.
2618         * attribute.cs (Attribute.GetPositionalValue): New function.
2619         * class.cs (TypeContainer.VerifyMembers): New function.
2620         (TypeContainer.Emit): Use it.
2621         (ClassOrStruct): New base class for Class and Struct.
2622         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
2623         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
2624         class.
2625         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
2626         then each non-static field should have a FieldOffset attribute.
2627         Otherwise, none of the fields should have a FieldOffset attribute.
2628         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
2629         and FieldOffset attributes.
2630         * typemanager.cs (TypeManager.struct_layout_attribute_type)
2631         (TypeManager.field_offset_attribute_type): New core types.
2632         (TypeManager.InitCoreTypes): Initialize them.
2633
2634 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
2635
2636         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
2637         Return correct type.
2638         From bug #58270.
2639
2640 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
2641
2642         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
2643         be implicitly converted to ulong.
2644         
2645         * expression.cs: The logic for allowing operator &, | and ^ worked
2646         was wrong, it worked before because we did not report an error in
2647         an else branch.  Fixes 57895.
2648
2649         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
2650         allow volatile fields to be reference types.
2651
2652 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
2653
2654         * driver.cs: Add support for /debug-
2655
2656 2004-05-07  Raja R Harinath  <rharinath@novell.com>
2657
2658         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
2659         Add a 'complain' parameter to silence errors.
2660         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
2661         silently overlooked type-resolutions.
2662         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
2663         to reflect changes.
2664         (Attributes.Search): New function.
2665         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
2666         (Attributes.GetAttributeFullName): Remove hack.
2667         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
2668         Update to reflect changes.
2669         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2670         Use Attributes.Search instead of nested loops.
2671
2672 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
2673
2674         * decl.cs:
2675         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
2676         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
2677         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
2678
2679         * report.cs: (Report.Warning): Renamed to Warning_T because of
2680         parameter collision.
2681
2682 2004-05-05  Raja R Harinath  <rharinath@novell.com>
2683
2684         * expression.cs (MemberAccess.ResolveMemberAccess):
2685         Exit with non-zero status after Report.Error.
2686         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
2687         Likewise.
2688         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
2689
2690 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2691
2692         * support.cs: Don't hang when the file is empty.
2693
2694 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2695
2696         * support.cs: In SeekableStreamReader, compute the preamble size of the
2697           underlying stream. Position changes should take into account that initial
2698           count of bytes.
2699
2700 2004-05-03  Todd Berman  <tberman@sevenl.net>
2701
2702         * driver.cs: remove unused GetSysVersion function.
2703
2704 2004-05-03  Todd Berman  <tberman@sevenl.net>
2705
2706         * driver.cs: Remove the hack from saturday, as well as the hack
2707         from jackson (LoadAssemblyFromGac), also adds the CWD to the
2708         link_paths to get that bit proper.
2709
2710 2004-05-01  Todd Berman  <tberman@sevenl.net>
2711
2712         * driver.cs: Try a LoadFrom before a Load, this checks the current
2713         path. This is currently a bug in mono that is be fixed, however, this
2714         provides a workaround for now. This will be removed when the bug
2715         is fixed.
2716
2717 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
2718
2719         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2720         incomplete key pairs (#57941).
2721
2722 2004-05-01  Todd Berman  <tberman@sevenl.net>
2723
2724         * driver.cs: Remove '.' from path_chars, now System.* loads properly
2725         from the GAC
2726
2727 2004-04-30  Jackson Harper  <jackson@ximian.com>
2728
2729         * codegen.cs: Open keys readonly.
2730         
2731 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2732
2733         * typemanager.cs: don't report cyclic struct layout when a struct
2734         contains 2 or more fields of the same type. Failed for Pango.AttrShape
2735         which has 2 Pango.Rectangle fields.
2736
2737 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2738
2739         * expression.cs: Handle IntPtr comparisons with IL code
2740         rather than a method call.
2741
2742 2004-04-29  Martin Baulig  <martin@ximian.com>
2743
2744         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
2745         the list of PropertyInfo's in class hierarchy and find the
2746         accessor.  Fixes #56013.
2747
2748 2004-04-29  Martin Baulig  <martin@ximian.com>
2749
2750         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2751
2752 2004-04-29  Martin Baulig  <martin@ximian.com>
2753
2754         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2755
2756         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2757
2758 2004-04-29  Martin Baulig  <martin@ximian.com>
2759
2760         * class.cs (ConstructorInitializer.Resolve): Check whether the
2761         parent .ctor is accessible.  Fixes #52146.
2762
2763 2004-04-29  Martin Baulig  <martin@ximian.com>
2764
2765         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2766
2767         * statement.cs (Using.EmitLocalVariableDecls): Use
2768         TypeManager.idisposable_type, not typeof (IDisposable).
2769         (Foreach.EmitCollectionForeach): Added support for valuetypes.
2770
2771 2004-04-29  Martin Baulig  <martin@ximian.com>
2772
2773         * class.cs (Event.Define): Don't emit the field and don't set
2774         RTSpecialName and SpecialName for events on interfaces.  Fixes
2775         #57703. 
2776
2777 2004-04-29  Raja R Harinath  <rharinath@novell.com>
2778
2779         Refactor Attribute.ApplyAttributes.
2780         * attribute.cs (Attributable): New base class for objects that can
2781         have Attributes applied on them.
2782         (Attribute): Make AttributeUsage fields public.
2783         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
2784         (Attribute.IsInternalCall): New property.
2785         (Attribute.UsageAttr): Convert to a public read-only property.
2786         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
2787         (Attribute.ResolveType, Attribute.Resolve)
2788         (Attribute.ScanForIndexerName): Update to reflect changes.
2789         (Attribute.CheckAttributeTarget): Re-format.
2790         (Attribute.ApplyAttributes): Refactor, to various
2791         Attributable.ApplyAttributeBuilder methods.
2792         * decl.cs (MemberCore): Make Attributable.
2793         * class.cs (Accessor): Make Attributable.
2794         (MethodData.ApplyAttributes): Use proper attribute types, not
2795         attribute names.
2796         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
2797         (TypeContainer.ApplyAttributeBuilder)
2798         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
2799         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
2800         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
2801         (Operator.ApplyAttributeBuilder): New factored-out methods.
2802         * const.cs (Const.ApplyAttributeBuilder): Likewise.
2803         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
2804         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
2805         * parameter.cs (ParameterBase): New Attributable base class
2806         that can also represent Return types.
2807         (Parameter): Update to the changes.
2808
2809 2004-04-29  Jackson Harper  <jackson@ximian.com>
2810
2811         * driver.cs: Prefer the corlib system version when looking for
2812         assemblies in the GAC. This is still a hack, but its a better hack
2813         now.
2814         
2815 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
2816
2817         * decl.cs, enum.cs: Improved error 3005 reporting.
2818   
2819         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
2820         (related_symbols): New private member for list of symbols
2821         related to reported error/warning.
2822         
2823         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2824
2825 2004-04-29  Martin Baulig  <martin@ximian.com>
2826
2827         * ecore.cs (Expression.Constantify): If we're an enum and
2828         TypeManager.TypeToCoreType() doesn't give us another type, use
2829         t.UnderlyingSystemType.  Fixes #56178.  
2830
2831 2004-04-29  Martin Baulig  <martin@ximian.com>
2832
2833         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
2834         interfaces and for each interface, only add members directly
2835         declared in that interface.  Fixes #53255.
2836
2837 2004-04-28  Martin Baulig  <martin@ximian.com>
2838
2839         * expression.cs (ConditionalLogicalOperator): Use a temporary
2840         variable for `left' to avoid that we evaluate it more than once;
2841         bug #52588.
2842
2843 2004-04-28  Martin Baulig  <martin@ximian.com>
2844
2845         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
2846         `void[]' (CS1547).
2847
2848 2004-04-28  Martin Baulig  <martin@ximian.com>
2849
2850         * statement.cs (LocalInfo.Resolve): Check whether the type is not
2851         void (CS1547).
2852
2853         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
2854         whether the type is not void (CS1547).
2855
2856 2004-04-28  Martin Baulig  <martin@ximian.com>
2857
2858         * expression.cs (Unary.DoResolveLValue): Override this and report
2859         CS0131 for anything but Operator.Indirection.
2860
2861 2004-04-28  Martin Baulig  <martin@ximian.com>
2862
2863         Committing a patch from Ben Maurer; see bug #50820.
2864
2865         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2866         check for classes.
2867
2868         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2869         classes.        
2870
2871 2004-04-28  Martin Baulig  <martin@ximian.com>
2872
2873         Committing a patch from Ben Maurer; see bug #50820.
2874
2875         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2876         check for classes.
2877
2878         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2879         classes.        
2880
2881 2004-04-28  Martin Baulig  <martin@ximian.com>
2882
2883         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
2884         (Block.AddLabel): Call DoLookupLabel() to only search in the
2885         current block.
2886
2887 2004-04-28  Martin Baulig  <martin@ximian.com>
2888
2889         * cfold.cs (ConstantFold.BinaryFold): Added special support for
2890         comparing StringConstants and NullLiterals in Equality and Inequality.
2891
2892 2004-04-28  Jackson Harper  <jackson@ximian.com>
2893
2894         * driver.cs: Attempt to load referenced assemblies from the
2895         GAC. This is the quick and dirty version of this method that
2896         doesnt take into account versions and just takes the first
2897         canidate found. Will be good enough for now as we will not have more
2898         then one version installed into the GAC until I update this method.
2899
2900 2004-04-28  Martin Baulig  <martin@ximian.com>
2901
2902         * typemanager.cs (TypeManager.CheckStructCycles): New public
2903         static method to check for cycles in the struct layout.
2904
2905         * rootcontext.cs (RootContext.PopulateTypes): Call
2906         TypeManager.CheckStructCycles() for each TypeContainer.
2907         [Note: We only need to visit each type once.]
2908
2909 2004-04-28  Martin Baulig  <martin@ximian.com>
2910
2911         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
2912
2913         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
2914         success and added `out object value'.  Use a `bool resolved' field
2915         to check whether we've already been called rather than
2916         `ConstantValue != null' since this breaks for NullLiterals.
2917
2918 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2919
2920         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
2921         setting of this flag, since the 'set' method may be non-public.
2922
2923 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2924
2925         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
2926         check on current_vector.Block.
2927
2928 2004-04-27  Martin Baulig  <martin@ximian.com>
2929
2930         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
2931         a field initializer.  Fixes #56459.
2932
2933 2004-04-27  Martin Baulig  <martin@ximian.com>
2934
2935         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
2936         we're not attempting to use an indexer.  Fixes #52154.
2937
2938 2004-04-27  Martin Baulig  <martin@ximian.com>
2939
2940         * statement.cs (Return): Don't create a return label if we don't
2941         need it; reverts my change from January 20th.  Thanks to Ben
2942         Maurer for this.
2943
2944 2004-04-27  Martin Baulig  <martin@ximian.com>
2945
2946         According to the spec, `goto' can only leave a nested scope, but
2947         never enter it.
2948
2949         * statement.cs (Block.LookupLabel): Only lookup in the current
2950         block, don't recurse into parent or child blocks.
2951         (Block.AddLabel): Check in parent and child blocks, report
2952         CS0140/CS0158 if we find a duplicate.
2953         (Block): Removed this indexer for label lookups.
2954         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2955         this already does the error reporting for us.
2956
2957         * flowanalysis.cs
2958         (FlowBranching.UsageVector.Block): New public variable; may be null.
2959         (FlowBranching.CreateSibling): Added `Block' argument.
2960         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2961         label for the target of a `goto' and check whether we're not
2962         leaving a `finally'.
2963
2964 2004-04-27  Martin Baulig  <martin@ximian.com>
2965
2966         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2967         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2968         just for returns).
2969
2970 2004-04-27  Martin Baulig  <martin@ximian.com>
2971
2972         * statement.cs (Block.AddLabel): Also check for implicit blocks
2973         and added a CS0158 check.
2974
2975 2004-04-27  Martin Baulig  <martin@ximian.com>
2976
2977         * flowanalysis.cs (FlowBranchingLoop): New class.
2978         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2979         UsageVector's instead of an ArrayList.
2980         (FlowBranching.Label): Likewise.
2981         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2982         (FlowBranching.AddBreakVector): New method.
2983
2984 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2985
2986         * attribute.cs: Small regression fix: only convert the type if we
2987         the type is different, fixes System.Drawing build.
2988
2989 2004-04-27  Martin Baulig  <martin@ximian.com>
2990
2991         * attribute.cs (Attribute.Resolve): If we have a constant value
2992         for a named field or property, implicity convert it to the correct
2993         type.
2994
2995 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2996
2997         * statement.cs (Block.Block): Implicit blocks share
2998         'child_variable_names' fields with parent blocks.
2999         (Block.AddChildVariableNames): Remove.
3000         (Block.AddVariable): Mark variable as "used by a child block" in
3001         every surrounding block.
3002         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
3003         been used in a child block, complain about violation of "Invariant
3004         meaning in blocks" rule.
3005         * cs-parser.jay (declare_local_variables): Don't use
3006         AddChildVariableNames.
3007         (foreach_statement): Don't create an implicit block: 'foreach'
3008         introduces a scope.
3009
3010 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
3011
3012         * convert.cs (ImplicitNumericConversion): 0 is also positive when
3013         converting from 0L to ulong.  Fixes 57522.
3014
3015 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
3016
3017         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
3018         derived class hides via 'new' keyword field from base class (test-242.cs).
3019         TODO: Handle this in the more general way.
3020         
3021         * class.cs (CheckBase): Ditto.
3022
3023 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
3024
3025         * decl.cs (caching_flags): New member for storing cached values
3026         as bit flags.
3027         (MemberCore.Flags): New enum where bit flags for caching_flags
3028         are defined.
3029         (MemberCore.cls_compliance): Moved to caching_flags.
3030         (DeclSpace.Created): Moved to caching_flags.
3031
3032         * class.cs: Use caching_flags instead of DeclSpace.Created
3033         
3034 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
3035
3036         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
3037         if we are only a derived class, not a nested class.
3038
3039         * typemanager.cs: Same as above, but do this at the MemberLookup
3040         level (used by field and methods, properties are handled in
3041         PropertyExpr).   Allow for the qualified access if we are a nested
3042         method. 
3043
3044 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
3045
3046         * class.cs: Refactoring.
3047         (IMethodData): New inteface; Holds links to parent members
3048         to avoid member duplication (reduced memory allocation).
3049         (Method): Implemented IMethodData interface.
3050         (PropertyBase): New inner classes for get/set methods.
3051         (PropertyBase.PropertyMethod): Implemented IMethodData interface
3052         (Event): New inner classes for add/remove methods.
3053         (Event.DelegateMethod): Implemented IMethodData interface.
3054
3055         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
3056         EmitContext (related to class.cs refactoring).
3057
3058 2004-04-21  Raja R Harinath  <rharinath@novell.com>
3059
3060         * delegate.cs (Delegate.VerifyApplicability): If the number of
3061         arguments are the same as the number of parameters, first try to
3062         verify applicability ignoring  any 'params' modifier on the last
3063         parameter.
3064         Fixes #56442.
3065
3066 2004-04-16  Raja R Harinath  <rharinath@novell.com>
3067
3068         * class.cs (TypeContainer.AddIndexer): Use
3069         'ExplicitInterfaceName' to determine if interface name was
3070         explicitly specified.  'InterfaceType' is not initialized at this time.
3071         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
3072         Indexers array is already in the required order.  Initialize
3073         'IndexerName' only if there are normal indexers.
3074         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
3075         (TypeContainer.Emit): Emit DefaultMember attribute only if
3076         IndexerName is initialized.
3077         Fixes #56300.
3078
3079 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
3080
3081         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
3082         Fixes #57007
3083
3084 2004-04-15  Raja R Harinath  <rharinath@novell.com>
3085
3086         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
3087         attributes.
3088         Fix for #56456.
3089
3090         * attribute.cs (Attribute.Resolve): Check for duplicate named
3091         attributes.
3092         Fix for #56463.
3093
3094 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
3095
3096         * iterators.cs (MarkYield): track whether we are in an exception,
3097         and generate code accordingly.  Use a temporary value to store the
3098         result for our state.
3099
3100         I had ignored a bit the interaction of try/catch with iterators
3101         since their behavior was not entirely obvious, but now it is
3102         possible to verify that our behavior is the same as MS .NET 2.0
3103
3104         Fixes 54814
3105
3106 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
3107
3108         * iterators.cs: Avoid creating temporaries if there is no work to
3109         do. 
3110
3111         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
3112         Enumerations, use TypeManager.EnumToUnderlying and call
3113         recursively. 
3114
3115         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
3116         bug #57013
3117
3118         (This.Emit): Use EmitContext.EmitThis to emit our
3119         instance variable.
3120
3121         (This.EmitAssign): Ditto.
3122
3123         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
3124         codepaths, we will move all the functionality into
3125         Mono.CSharp.This 
3126
3127         (FieldExpr.EmitAssign): Ditto.
3128
3129         This fixes several hidden bugs that I uncovered while doing a code
3130         review of this today.
3131
3132         * codegen.cs (EmitThis): reworked so the semantics are more clear
3133         and also support value types "this" instances.
3134
3135         * iterators.cs: Changed so that for iterators in value types, we
3136         do not pass the value type as a parameter.  
3137
3138         Initialization of the enumerator helpers is now done in the caller
3139         instead of passing the parameters to the constructors and having
3140         the constructor set the fields.
3141
3142         The fields have now `assembly' visibility instead of private.
3143
3144 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
3145
3146         * expression.cs (Argument.Resolve): Check if fields passed as ref
3147         or out are contained in a MarshalByRefObject.
3148
3149         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
3150         another compiler type.
3151
3152 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3153
3154         * class.cs (Indexer.Define): use the new name checking method.
3155         Also, return false on an error.
3156         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
3157         (is_identifier_[start/part]_character): make static.
3158
3159 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
3160
3161         * expression.cs (Binary.ResolveOperator): Do no append strings
3162         twice: since we can be invoked more than once (array evaluation)
3163         on the same concatenation, take care of this here.  Based on a fix
3164         from Ben (bug #56454)
3165
3166 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3167
3168         * codegen.cs: Fix another case where CS1548 must be reported (when 
3169         delay-sign isn't specified and no private is available #56564). Fix
3170         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
3171         error when MCS is used on the MS runtime and we need to delay-sign 
3172         (which seems unsupported by AssemblyBuilder - see #56621).
3173
3174 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
3175
3176         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
3177         (TypeManager.ComputeNamespaces): Faster implementation for
3178         Microsoft runtime.
3179
3180         * compiler.csproj: Updated AssemblyName to mcs.
3181
3182 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
3183
3184         * rootcontext.cs: Add new types to the boot resolution.
3185
3186         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
3187         MulticastDelegate is not allowed.
3188
3189         * typemanager.cs: Add new types to lookup: System.TypedReference
3190         and ArgIterator.
3191
3192         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
3193         check for TypedReference or ArgIterator, they are not allowed. 
3194
3195         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
3196         makes us properly catch 1510 in some conditions (see bug 56016 for
3197         details). 
3198
3199 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
3200
3201         * CryptoConvert.cs: update from corlib version
3202         with endian fixes.
3203
3204 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
3205
3206         * class.cs (Indexer.Define): Check indexername declaration
3207
3208 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
3209
3210         * attribute.cs (IsClsCompliant): Fixed problem with handling
3211         all three states (compliant, not-compliant, undetected).
3212
3213 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
3214
3215         * attribute.cs (Attribute): Location is now public.
3216         (Resolve): Store resolved arguments (pos_values) in attribute class.
3217         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
3218         (GetClsCompliantAttributeValue): New method that gets
3219         CLSCompliantAttribute value.
3220         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
3221         if exists else null.
3222         (AttributeTester): New class for CLS-Compliant verification routines.
3223
3224         * class.cs (Emit): Add CLS-Compliant verification.
3225         (Method.GetSignatureForError): Implemented.
3226         (Constructor.GetSignatureForError): Implemented
3227         (Constructor.HasCompliantArgs): Returns if constructor has
3228         CLS-Compliant arguments.
3229         (Constructor.Emit): Override.
3230         (Construcor.IsIdentifierClsCompliant): New method; For constructors
3231         is needed to test only parameters.
3232         (FieldBase.GetSignatureForError): Implemented.
3233         (TypeContainer): New member for storing base interfaces.
3234         (TypeContainer.FindMembers): Search in base interfaces too.
3235
3236         * codegen.cs (GetClsComplianceAttribute): New method that gets
3237         assembly or module CLSCompliantAttribute value.
3238         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
3239         for assembly.
3240         (ModuleClass.Emit): Add error 3012 test.
3241
3242         * const.cs (Emit): Override and call base for CLS-Compliant tests.
3243
3244         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
3245         state for all decl types.
3246         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
3247         if CLS-Compliant tests are required.
3248         (IsClsCompliaceRequired): New method. Analyze whether code
3249         must be CLS-Compliant.
3250         (IsExposedFromAssembly): New method. Returns true when MemberCore
3251         is exposed from assembly.
3252         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
3253         value or gets cached value.
3254         (HasClsCompliantAttribute): New method. Returns true if MemberCore
3255         is explicitly marked with CLSCompliantAttribute.
3256         (IsIdentifierClsCompliant): New abstract method. This method is
3257         used to testing error 3005.
3258         (IsIdentifierAndParamClsCompliant): New method. Common helper method
3259         for identifier and parameters CLS-Compliant testing.
3260         (VerifyClsCompliance): New method. The main virtual method for
3261         CLS-Compliant verifications.
3262         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
3263         null. I don't know why is null (too many public members !).
3264         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
3265         and get value of first CLSCompliantAttribute that found.
3266
3267         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
3268         (VerifyClsCompliance): Override and add extra tests.
3269
3270         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
3271         clscheck- disable CLS-Compliant verification event if assembly is has
3272         CLSCompliantAttribute(true).
3273
3274         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
3275         ApllyAttribute is now called in emit section as in the other cases.
3276         Possible future Emit integration.
3277         (IsIdentifierClsCompliant): New override.
3278         (VerifyClsCompliance): New override.
3279         (GetEnumeratorName): Returns full enum name.
3280
3281         * parameter.cs (GetSignatureForError): Implemented.
3282
3283         * report.cs (WarningData): New struct for Warning message information.
3284         (LocationOfPreviousError): New method.
3285         (Warning): New method. Reports warning based on the warning table.
3286         (Error_T): New method. Reports error based on the error table.
3287
3288         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
3289         verifications are done here.
3290
3291         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
3292
3293         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
3294         CLSCompliantAttribute.
3295         (all_imported_types): New member holds all imported types from other
3296         assemblies.
3297         (LoadAllImportedTypes): New method fills static table with exported types
3298         from all referenced assemblies.
3299         (Modules): New property returns all assembly modules.
3300
3301 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
3304         throwing a parser error.
3305
3306         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
3307         which removes the hardcoded get_/set_ prefixes for properties, as
3308         IL allows for the properties to be named something else.  
3309
3310         Bug #56013
3311
3312         * expression.cs: Do not override operand before we know if it is
3313         non-null.  Fix 56207
3314
3315 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3316
3317         * typemanager.cs: support for pinned variables.
3318
3319 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3320
3321         * decl.cs, typemanager.cs: Avoid using an arraylist
3322         as a buffer if there is only one result set.
3323
3324 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3325
3326         * expression.cs: Make sure you cant call a static method
3327         with an instance expression, bug #56174.
3328
3329 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
3330
3331         * class.cs (IsDuplicateImplementation): Improve error reporting to
3332         flag 663 (method only differs in parameter modifier).
3333
3334         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
3335         in preprocessor directives.
3336
3337         * location.cs (LookupFile): Allow for the empty path.
3338
3339         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
3340         better approach for some of that patch, but its failing with the
3341         CharSet enumeration.  For now try/catch will do.
3342
3343         * typemanager.cs: Do not crash if a struct does not have fields.
3344         Fixes 56150.
3345
3346 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3347
3348         * expression.cs: cs0213, cant fix a fixed expression.
3349         fixes 50231.
3350
3351 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3352
3353         * cs-parser.jay: detect invalid embeded statements gracefully.
3354         bug #51113.
3355
3356 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3357
3358         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
3359         As a regex:
3360         s/
3361         the invocation type may not be a subclass of the tye of the item/
3362         The type of the item must be a subclass of the invocation item.
3363         /g
3364
3365         Fixes bug #50820.
3366
3367 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
3368
3369         * attribute.cs: Added methods to get a string and a bool from an
3370         attribute. Required to information from AssemblyKeyFileAttribute,
3371         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
3372         * codegen.cs: Modified AssemblyName creation to include support for
3373         strongnames. Catch additional exceptions to report them as CS1548.
3374         * compiler.csproj: Updated include CryptoConvert.cs.
3375         * compiler.csproj.user: Removed file - user specific configuration.
3376         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
3377         Mono.Security assembly. The original class is maintained and tested in
3378         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
3379         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
3380         like CSC 8.0 (C# v2) supports.
3381         * Makefile: Added CryptoConvert.cs to mcs sources.
3382         * rootcontext.cs: Added new options for strongnames.
3383
3384 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
3385
3386         * driver.cs: For --expect-error, report error code `2'
3387         if the program compiled with no errors, error code `1' if
3388         it compiled with an error other than the one expected.
3389
3390 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
3391
3392         * compiler.csproj: Updated for Visual Studio .NET 2003.
3393         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
3394         * compiler.sln: Updated for Visual Studio .NET 2003.
3395
3396 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
3397
3398         * expression.cs: Fix bug #47234. We basically need to apply the
3399         rule that we prefer the conversion of null to a reference type
3400         when faced with a conversion to 'object' (csc behaviour).
3401
3402 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3403
3404         * statement.cs: Shorter form for foreach, eliminates
3405         a local variable. r=Martin.
3406
3407 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3408
3409         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
3410         checks if we can use brtrue/brfalse to test for 0.
3411         * expression.cs: use the above in the test for using brtrue/brfalse.
3412         cleanup code a bit.
3413
3414 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3415
3416         * expression.cs: Rewrite string concat stuff. Benefits:
3417
3418         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
3419         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
3420         rather than a concat chain.
3421
3422         * typemanager.cs: Add lookups for more concat overloads.
3423
3424 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3425
3426         * expression.cs: Emit shorter il code for array init.
3427
3428         newarr
3429         dup
3430         // set 1
3431
3432         // set 2
3433
3434         newarr
3435         stloc.x
3436
3437         ldloc.x
3438         // set 1
3439
3440         ldloc.x
3441         // set 2
3442
3443 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
3444
3445         * statement.cs: Before, two switch blocks would be merged if the
3446         total size of the blocks (end_item - begin_item + 1) was less than
3447         two times the combined sizes of the blocks.
3448
3449         Now, it will only merge if after the merge at least half of the
3450         slots are filled.
3451
3452         fixes 55885.
3453
3454 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
3455
3456         * class.cs : csc build fix for GetMethods(). See bug #52503.
3457
3458 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
3459
3460         * expression.cs: Make sure fp comparisons work with NaN.
3461         This fixes bug #54303. Mig approved this patch a long
3462         time ago, but we were not able to test b/c the runtime
3463         had a related bug.
3464
3465 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
3466
3467         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
3468
3469 2004-03-19  Martin Baulig  <martin@ximian.com>
3470
3471         * class.cs (MemberCore.IsDuplicateImplementation): Report the
3472         error here and not in our caller.
3473
3474 2004-03-19  Martin Baulig  <martin@ximian.com>
3475
3476         * interface.cs: Completely killed this file.
3477         (Interface): We're now a TypeContainer and live in class.cs.
3478
3479         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
3480         argument; we're now also called for interfaces.
3481         (TypeContainer.DefineMembers): Allow this method being called
3482         multiple times.
3483         (TypeContainer.GetMethods): New public method; formerly known as
3484         Interface.GetMethod().  This is used by PendingImplementation.
3485         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
3486         it's now private and non-static.
3487         (Interface): Moved this here; it's now implemented similar to
3488         Class and Struct.
3489         (Method, Property, Event, Indexer): Added `bool is_interface'
3490         argument to their .ctor's.
3491         (MemberBase.IsInterface): New public field.
3492
3493         * cs-parser.jay: Create normal Method, Property, Event, Indexer
3494         instances instead of InterfaceMethod, InterfaceProperty, etc.
3495         (opt_interface_base): Removed; we now use `opt_class_base' instead.
3496         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
3497
3498 2004-03-19  Martin Baulig  <martin@ximian.com>
3499
3500         * class.cs (MethodCore.IsDuplicateImplementation): New private
3501         method which does the CS0111 checking.
3502         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
3503         Use IsDuplicateImplementation().
3504
3505 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
3506
3507         * decl.cs (FindMemberToOverride): New method to find the correct
3508         method or property to override in the base class.
3509         * class.cs
3510             - Make Method/Property use the above method to find the
3511               version in the base class.
3512             - Remove the InheritableMemberSignatureCompare as it is now
3513               dead code.
3514
3515         This patch makes large code bases much faster to compile, as it is
3516         O(n) rather than O(n^2) to do this validation.
3517
3518         Also, it fixes bug 52458 which is that nested classes are not
3519         taken into account when finding the base class member.
3520
3521         Reviewed/Approved by Martin.
3522
3523 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
3524
3525         * interface.cs: In all interface classes removed redundant
3526         member initialization.
3527
3528 2004-03-16  Martin Baulig  <martin@ximian.com>
3529
3530         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
3531
3532 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
3533
3534         * decl.cs (DefineTypeAndParents): New helper method to define a
3535         type's containers before the type itself is defined;  This is a
3536         bug exposed by the recent changes to Windows.Forms when an
3537         implemented interface was defined inside a class that had not been
3538         built yet.   
3539
3540         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
3541
3542         (Check): Loop correctly to report errors modifiers
3543         (UNSAFE was not in the loop, since it was the same as TOP).
3544
3545         * interface.cs: Every interface member now takes a ModFlags,
3546         instead of a "is_new" bool, which we set on the base MemberCore. 
3547
3548         Every place where we called "UnsafeOk" in the interface, now we
3549         call the proper member (InterfaceMethod.UnsafeOK) instead to get
3550         the unsafe settings from the member declaration instead of the
3551         container interface. 
3552
3553         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
3554
3555         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
3556         `set_indexer_name' to the pending bits (one per type).
3557
3558         We fixed a bug today that was picking the wrong method to
3559         override, since for properties the existing InterfaceMethod code
3560         basically ignored the method name.  Now we make sure that the
3561         method name is one of the valid indexer names.
3562
3563 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
3564  
3565         * support.cs (SeekableStreamReader): Keep track of stream byte
3566         positions and don't mix them with character offsets to the buffer.
3567
3568         Patch from Gustavo Giráldez
3569
3570 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
3571
3572         * interface.cs (InterfaceSetGetBase): Removed double member
3573         initialization, base class does it as well.
3574
3575 2004-03-13  Martin Baulig  <martin@ximian.com>
3576
3577         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
3578         when compiling corlib.
3579
3580 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
3581
3582         * convert.cs (ExplicitConversion): We were reporting an error on
3583         certain conversions (object_type source to a value type, when the
3584         expression was `null') before we had a chance to pass it through
3585         the user defined conversions.
3586
3587         * driver.cs: Replace / and \ in resource specifications to dots.
3588         Fixes 50752
3589
3590         * class.cs: Add check for duplicate operators.  Fixes 52477
3591
3592 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
3593
3594         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
3595         that are in the middle of the statements, not only at the end.
3596         Fixes #54987
3597
3598         * class.cs (TypeContainer.AddField): No longer set the
3599         `HaveStaticConstructor' flag, now we call it
3600         `UserDefineStaticConstructor' to diferentiate the slightly
3601         semantic difference.
3602
3603         The situation is that we were not adding BeforeFieldInit (from
3604         Modifiers.TypeAttr) to classes that could have it.
3605         BeforeFieldInit should be set to classes that have no static
3606         constructor. 
3607
3608         See:
3609
3610         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
3611
3612         And most importantly Zoltan's comment:
3613
3614         http://bugzilla.ximian.com/show_bug.cgi?id=44229
3615
3616         "I think beforefieldinit means 'it's ok to initialize the type sometime 
3617          before its static fields are used', i.e. initialization does not need
3618          to be triggered by the first access to the type. Setting this flag
3619          helps the JIT to compile better code, since it can run the static
3620          constructor at JIT time, and does not need to generate code to call it
3621          (possibly lots of times) at runtime. Unfortunately, mcs does not set
3622          this flag for lots of classes like String. 
3623          
3624          csc sets this flag if the type does not have an explicit static 
3625          constructor. The reasoning seems to be that if there are only static
3626          initalizers for a type, and no static constructor, then the programmer
3627          does not care when this initialization happens, so beforefieldinit
3628          can be used.
3629          
3630          This bug prevents the AOT compiler from being usable, since it 
3631          generates so many calls to mono_runtime_class_init that the AOT code
3632          is much slower than the JITted code. The JITted code is faster, 
3633          because it does not generate these calls if the vtable is type is
3634          already initialized, which is true in the majority of cases. But the
3635          AOT compiler can't do this."
3636
3637 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
3638
3639         * class.cs (MethodData.Emit): Refactor the code so symbolic
3640         information is generated for destructors;  For some reasons we
3641         were taking a code path that did not generate symbolic information
3642         before. 
3643
3644 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3645
3646         * class.cs: Create a Constructor.CheckBase method that
3647         takes care of all validation type code. The method
3648         contains some code that was moved from Define.
3649
3650         It also includes new code that checks for duplicate ctors.
3651         This fixes bug #55148.
3652
3653 2004-03-09  Joshua Tauberer <tauberer@for.net>
3654
3655         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
3656         a { ... }-style array creation invokes EmitStaticInitializers
3657         which is not good for reference-type arrays.  String, decimal
3658         and now null constants (NullCast) are not counted toward
3659         static initializers.
3660
3661 2004-03-05  Martin Baulig  <martin@ximian.com>
3662
3663         * location.cs (SourceFile.HasLineDirective): New public field;
3664         specifies whether the file contains or is referenced by a "#line"
3665         directive.
3666         (Location.DefineSymbolDocuments): Ignore source files which
3667         either contain or are referenced by a "#line" directive.        
3668
3669 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
3670
3671         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
3672         direct access to our parent, so check the method inline there.
3673
3674 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3675
3676         * expression.cs (Invocation.EmitCall): Miguel's last commit
3677         caused a regression. If you had:
3678
3679             T t = null;
3680             t.Foo ();
3681
3682         In Foo the implict this would be null.
3683
3684 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
3685
3686         * expression.cs (Invocation.EmitCall): If the method is not
3687         virtual, do not emit a CallVirt to it, use Call.
3688
3689         * typemanager.cs (GetFullNameSignature): Improve the method to
3690         cope with ".ctor" and replace it with the type name.
3691
3692         * class.cs (ConstructorInitializer.Resolve): Now the method takes
3693         as an argument the ConstructorBuilder where it is being defined,
3694         to catch the recursive constructor invocations.
3695
3696 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
3697
3698         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
3699         routines to check if a type is an enumerable/enumerator allow
3700         classes that implement the IEnumerable or IEnumerator interfaces.
3701
3702         * class.cs (Property, Operator): Implement IIteratorContainer, and
3703         implement SetYields.
3704
3705         (Property.Define): Do the block swapping for get_methods in the
3706         context of iterators.   We need to check if Properties also
3707         include indexers or not.
3708
3709         (Operator): Assign the Block before invoking the
3710         OperatorMethod.Define, so we can trigger the Iterator code
3711         replacement. 
3712
3713         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3714         Property and Operator classes are not created when we parse the
3715         declarator but until we have the block completed, so we use a
3716         singleton SimpleIteratorContainer.Simple to flag whether the
3717         SetYields has been invoked.
3718
3719         We propagate this setting then to the Property or the Operator to
3720         allow the `yield' to function.
3721
3722 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3723
3724         * codegen.cs: Implemented attribute support for modules.
3725         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3726         Assembly/Module functionality.
3727
3728         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3729         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3730         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3731
3732 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3733
3734         * interface.cs (FindMembers): The operation is performed on all base
3735         interfaces and not only on the first. It is required for future CLS Compliance patch.
3736
3737 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3738
3739         * statement.cs, codegen.cs:
3740         This patch deals with patterns such as:
3741
3742         public class List : IEnumerable {
3743
3744                 public MyEnumerator GetEnumerator () {
3745                         return new MyEnumerator(this);
3746                 }
3747
3748                 IEnumerator IEnumerable.GetEnumerator () {
3749                         ...
3750                 }
3751                 
3752                 public struct MyEnumerator : IEnumerator {
3753                         ...
3754                 }
3755         }
3756
3757         Before, there were a few things we did wrong:
3758         1) we would emit callvirt on a struct, which is illegal
3759         2) we emited ldarg when we needed to emit ldarga
3760         3) we would mistakenly call the interface methods on an enumerator
3761         type that derived from IEnumerator and was in another assembly. For example:
3762
3763         public class MyEnumerator : IEnumerator
3764
3765         Would have the interface methods called, even if there were public impls of the
3766         method. In a struct, this lead to invalid IL code.
3767
3768 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3769
3770         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3771           renamed to Emit.
3772
3773         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3774
3775 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3776
3777         * cs-parser.jay: Fix small regression: we were not testing V2
3778         compiler features correctly.
3779
3780         * interface.cs: If the emit context is null, then create one
3781
3782 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3783
3784         * decl.cs (GetSignatureForError): New virtual method to get full name
3785           for error messages.
3786
3787         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3788           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3789
3790         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3791           Duplicated members and code in these classes has been removed.
3792           Better encapsulation in these classes.
3793
3794 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3795
3796         * assign.cs (Assign.DoResolve): When dealing with compound
3797         assignments, there is a new rule in ECMA C# 2.4 (might have been
3798         there before, but it is documented here) that states that in:
3799
3800         a op= b;
3801
3802         If b is of type int, and the `op' is a shift-operator, then the
3803         above is evaluated as:
3804
3805         a = (int) a op b 
3806
3807         * expression.cs (Binary.ResolveOperator): Instead of testing for
3808         int/uint/long/ulong, try to implicitly convert to any of those
3809         types and use that in pointer arithmetic.
3810
3811         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3812         method to print information for from the type, not from the
3813         null-method we were given.
3814
3815 2004-02-01  Duncan Mak  <duncan@ximian.com>
3816
3817         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3818         parsing for cmd, fixes bug #53694.
3819
3820 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3821
3822         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3823         in the member name duplication tests. Property and operator name duplication
3824         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3825
3826 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3827
3828         * interface.cs (PopulateMethod): Fixed crash when interface method
3829         returns not existing type (error test cs0246-3.cs).
3830
3831 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3832
3833         * cs-parser.jay (interface_accessors): Re-write actions to also
3834         store attributes attached to get and set methods. Fix spelling
3835         while at it.
3836
3837         (inteface_property_declaration): Modify accordingly.
3838
3839         (InterfaceAccessorInfo): New helper class to store information to pass
3840         around between rules that use interface_accessors.
3841
3842         * interface.cs (Emit): Apply attributes on the get and set
3843         accessors of properties and indexers too.
3844
3845         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3846         right MethodBuilder when applying attributes to the get and set accessors.
3847
3848 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3849
3850         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3851
3852 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3853
3854         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3855
3856 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3857
3858         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3859         changes that treat `yield' specially when present before `break'
3860         or `return' tokens.
3861
3862         * cs-tokenizer.cs: yield is no longer a keyword.
3863
3864 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3865
3866         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3867         setting for default constructors.
3868         For default constructors are almost every time set wrong Modifier. The
3869         generated IL code has been alright. But inside mcs this values was
3870         wrong and this was reason why several of my CLS Compliance tests
3871         failed.
3872
3873 2004-01-22  Martin Baulig  <martin@ximian.com>
3874
3875         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3876         not a QualifiedIdentifier.  This is what `type_name_expression'
3877         was previously doing.
3878         (type_name_expression): Removed; the code is now in
3879         `namespace_or_type_name'.
3880         (qualified_identifier): Removed, use `namespace_or_type_name'
3881         instead.
3882         (QualifiedIdentifier): Removed this class.      
3883
3884 2004-01-22  Martin Baulig  <martin@ximian.com>
3885
3886         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3887         not a string as alias name.
3888
3889 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3890
3891         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3892         #52730 bug, and instead compute correctly the need to use a
3893         temporary variable when requesting an address based on the
3894         static/instace modified of the field and the constructor.
3895  
3896 2004-01-21  Martin Baulig  <martin@ximian.com>
3897
3898         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3899         class and namespace before looking up aliases.  Fixes #52517.
3900
3901 2004-01-21  Martin Baulig  <martin@ximian.com>
3902
3903         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3904         assinged in a 'try'; fixes exception4.cs.
3905
3906 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3907         * class.cs : Implemented parameter-less constructor for TypeContainer
3908
3909         * decl.cs: Attributes are now stored here. New property OptAttributes
3910
3911         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3912
3913         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3914
3915 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3916
3917         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3918           (CSharpSignature): New method for indexer and property signature.
3919
3920 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3921
3922         * pending.cs (IsVirtualFilter): Faster implementation.
3923
3924 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3925
3926         * typemanager.cs: Avoid inclusion of same assembly more than once.
3927
3928 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3929
3930         * cs-parser.jay: Fixed problem where the last assembly attribute
3931           has been applied also to following declaration (class, struct, etc.)
3932           
3933 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3934
3935         * class.cs: Added error CS0538, CS0539 reporting.
3936         Fixed crash on Microsoft runtime when field type is void.
3937
3938         * cs-parser.jay: Added error CS0537 reporting.
3939
3940         * pending.cs: Added error CS0535 reporting.
3941         Improved error report for errors CS0536, CS0534.
3942
3943 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3944
3945         Merge a few bits from the Anonymous Method MCS tree.
3946
3947         * statement.cs (ToplevelBlock): New class for toplevel methods,
3948         will hold anonymous methods, lifted variables.
3949
3950         * cs-parser.jay: Create toplevel blocks for delegates and for
3951         regular blocks of code. 
3952
3953 2004-01-20  Martin Baulig  <martin@ximian.com>
3954
3955         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3956         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3957         and `NeedExplicitReturn'; added `IsLastStatement'.
3958         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3959         have a `ReturnLabel' or we're not unreachable.
3960
3961         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3962         child's reachability; don't just override ours with it.  Fixes
3963         #58058 (lluis's example).
3964         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3965         InFinally(), InLoop(), InSwitch() and
3966         BreakCrossesTryCatchBoundary() methods.
3967
3968         * statement.cs (Return): Do all error checking in Resolve().
3969         Unless we are the last statement in a top-level block, always
3970         create a return label and jump to it.
3971         (Break, Continue): Do all error checking in Resolve(); also make
3972         sure we aren't leaving a `finally'.
3973         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3974         statement in a top-level block.
3975         (Block.Flags): Added `IsDestructor'.
3976         (Block.IsDestructor): New public property.
3977
3978 2004-01-20  Martin Baulig  <martin@ximian.com>
3979
3980         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3981
3982 2004-01-20  Martin Baulig  <martin@ximian.com>
3983
3984         * statement.cs (Statement.ResolveUnreachable): New public method.
3985         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3986         (Block.Resolve): Resolve unreachable statements.
3987
3988 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3989
3990         * expression.cs: We need to fix the case where we do
3991         not have a temp variable here.
3992
3993         * assign.cs: Only expression compound assignments need
3994         temporary variables.
3995
3996 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3997
3998         * flowanalysis.cs: Reduce memory allocation in a few ways:
3999           - A block with no variables should not allocate a bit
4000             vector for itself.
4001           - A method with no out parameters does not need any tracking
4002             for assignment of the parameters, so we need not allocate
4003             any data for it.
4004           - The arrays:
4005                 public readonly Type[] VariableTypes;
4006                 public readonly string[] VariableNames;
4007             Are redundant. The data is already stored in the variable
4008             map, so we need not allocate another array for it.
4009           - We need to add alot of checks for if (params | locals) == null
4010             due to the first two changes.
4011
4012 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
4013
4014         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
4015         implement IMemoryLocation, we store a copy on a local variable and
4016         take the address of it.  Patch from Benjamin Jemlich
4017
4018         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
4019         to use a special "type_name_expression" rule which reduces the
4020         number of "QualifiedIdentifier" classes created, and instead
4021         directly creates MemberAccess expressions.
4022
4023 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
4024
4025         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
4026         that fixes #52853.  Null literal assignment to ValueType
4027
4028         * class.cs (MethodData.Emit): Instead of checking the name of the
4029         method to determine if its a destructor, create a new derived
4030         class from Method called Destructor, and test for that.  
4031
4032         * cs-parser.jay: Create a Destructor object instead of a Method.  
4033
4034         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
4035
4036         Fixes: 52933
4037
4038 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
4039
4040         * expression.cs (Binary.ResolveOperator): Perform an implicit
4041         conversion from MethodGroups to their delegate types on the
4042         Addition operation.
4043
4044         * delegate.cs: Introduce a new class DelegateCreation that is the
4045         base class for `NewDelegate' and `ImplicitDelegateCreation',
4046         factor some code in here.
4047
4048         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
4049         conversion from MethodGroups to compatible delegate types. 
4050
4051         * ecore.cs (Expression.Resolve): Do not flag error 654
4052         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
4053         we allow conversions from MethodGroups to delegate types now.
4054
4055         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
4056         assignments in v2 either.
4057
4058 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
4059
4060         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
4061         static read-only fields in ctors.
4062
4063         Applied patch from Benjamin Jemlich 
4064
4065         * expression.cs (UnaryMutator): Avoid leaking local variables. 
4066
4067 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
4068
4069         * cs-tokenizer.cs (IsCastToken): Allow the various native types
4070         here to return true, as they can be used like this:
4071
4072                 (XXX) int.MEMBER ()
4073
4074         Fixed 49836 and all the other dups
4075
4076 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
4077
4078         * driver.cs: Implement /win32res and /win32icon.
4079
4080 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
4081
4082         * cs-parser.jay: Add a rule to improve error handling for the
4083         common mistake of placing modifiers after the type.
4084
4085 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
4086
4087         * cs-parser.jay (interface_event_declaration): Catch
4088         initialization of events on interfaces, and report cs0068
4089
4090         * cs-parser.jay (interface_event_declaration): Catch
4091         initialization of events. 
4092
4093         * ecore.cs: Better report missing constructors.
4094
4095         * expression.cs (Binary.ResolveOperator): My previous bug fix had
4096         the error reporting done in the wrong place.  Fix.
4097
4098         * expression.cs (Binary.ResolveOperator): Catch the 
4099         operator + (E x, E y) error earlier, and later allow for implicit
4100         conversions in operator +/- (E e, U x) from U to the underlying
4101         type of E.
4102
4103         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
4104         52596, if the container class is abstract, the default constructor
4105         is protected otherwise its public (before, we were always public).
4106
4107         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
4108         fixed statement.
4109
4110         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
4111         Jemlich that fixes bug #52597, MCS was generating invalid code for
4112         idisposable structs.   Thanks to Ben for following up with this
4113         bug as well.
4114
4115 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
4116
4117         * driver.cs: Allow assemblies without code to be generated, fixes
4118         52230.
4119
4120 2004-01-07  Nick Drochak <ndrochak@gol.com>
4121
4122         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
4123
4124 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
4125
4126         * cs-parser.jay: Add rules to improve error reporting if fields or
4127         methods are declared at the namespace level (error 116)
4128
4129         * Add rules to catch event add/remove
4130
4131 2004-01-04  David Sheldon <dave-mono@earth.li>
4132
4133   * expression.cs: Added matching ")" to error message for 
4134   CS0077
4135
4136 2004-01-03 Todd Berman <tberman@gentoo.org>
4137
4138         * ecore.cs, attribute.cs:
4139         Applying fix from #52429.
4140
4141 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4142
4143         * ecore.cs, expression.cs, statement.cs:
4144         Total rewrite of how we handle branching. We
4145         now handle complex boolean expressions with fewer
4146         jumps. As well if (x == 0) no longer emits a ceq.
4147
4148         if (x is Foo) is much faster now, because we generate
4149         better code.
4150
4151         Overall, we get a pretty big improvement on our benchmark
4152         tests. The code we generate is smaller and more readable.
4153
4154         I did a full two-stage bootstrap. The patch was reviewed
4155         by Martin and Miguel.
4156
4157 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4158
4159         * cs-parser.jay: Make primary_expression not take a QI.
4160         we dont need this because the member_access rule covers
4161         us here. So we replace the rule with just IDENTIFIER.
4162
4163         This has two good effects. First, we remove a s/r conflict.
4164         Second, we allocate many fewer QualifiedIdentifier objects.
4165
4166 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4167
4168         * attribute.cs: Handle MarshalAs attributes as pseudo, and
4169         set the correct information via SRE. This prevents
4170         hanging on the MS runtime. Fixes #29374.
4171
4172 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
4173
4174         * convert.cs: correctly handle conversions to value types
4175         from Enum and ValueType as unboxing conversions.
4176
4177         Fixes bug #52569. Patch by Benjamin Jemlich.
4178
4179 2004-01-02  Ravi Pratap  <ravi@ximian.com>
4180
4181         * expression.cs (BetterConversion): Prefer int -> uint
4182         over int -> ulong (csc's behaviour). This fixed bug #52046.
4183
4184 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4185
4186         * decl.cs (MemberCache.FindMembers): now returns a
4187         MemberInfo [].
4188
4189         * typemanager.cs: In general, go with with ^^.
4190         (CopyNewMethods): take an IList.
4191         (RealMemberLookup): Only allocate an arraylist
4192         if we copy from two sets of methods.
4193
4194         This change basically does two things:
4195         1) Fewer array lists allocated due to CopyNewMethods.
4196         2) the explicit cast in MemberList costed ALOT.
4197
4198 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
4199
4200         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
4201         a hashtable to avoid needless string allocations when an identifier is
4202         used more than once (the common case).
4203
4204 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
4205
4206         * pending.cs: MS's TypeBuilder.GetInterfaces ()
4207         is broken, it will not return anything. So, we
4208         have to use the information we have in mcs to
4209         do the task.
4210
4211         * typemanager.cs: Add a cache for GetInterfaces,
4212         since this will now be used more often (due to ^^)
4213
4214         (GetExplicitInterfaces) New method that gets the
4215         declared, not effective, interfaces on a type
4216         builder (eg, if you have interface IFoo, interface
4217         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
4218         { IBar }.
4219
4220         This patch makes MCS able to bootstrap itself on
4221         Windows again.
4222
4223 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
4224
4225         * expression.cs: Remove the Nop's that Miguel put
4226         in by mistake.
4227
4228 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4229
4230         * report.cs, codegen.cs: Give the real stack trace to
4231         the error when an exception is thrown.
4232
4233 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4234
4235         * decl.cs: only allocate hashtables for ifaces if 
4236         it is an iface!
4237
4238 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4239
4240         * expression.cs: fix the error from cs0121-2.cs
4241         (a parent interface has two child interfaces that
4242         have a function with the same name and 0 params
4243         and the function is called through the parent).
4244
4245 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4246
4247         * class.cs, rootcontext.cs, typmanager.cs: do not
4248         leak pointers.
4249
4250 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4251
4252         * codegen.cs: remove stack for the ec flow branching.
4253         It is already a linked list, so no need.
4254
4255 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
4256
4257         * Makefile: Allow custom profiler here.
4258
4259 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4260
4261         * typemanager.cs (LookupType):
4262           - Use a static char [], because split takes
4263             a param array for args, so it was allocating
4264             every time.
4265           - Do not store true in a hashtable, it boxes.
4266
4267 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4268
4269         * flowanalysis.cs: bytify common enums.
4270
4271 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4272
4273         * modifiers.cs: Add a new set of flags for the
4274         flags allowed on explicit interface impls.
4275         * cs-parser.jay: catch the use of modifiers in
4276         interfaces correctly.
4277         * class.cs: catch private void IFoo.Blah ().
4278
4279         All related to bug #50572.
4280
4281 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4282
4283         * decl.cs: Rewrite the consistant accessability checking.
4284         Accessability is not linear, it must be implemented in
4285         a tableish way. Fixes #49704.
4286
4287 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4288
4289         * expression.cs: Handle negation in a checked context.
4290         We must use subtraction from zero. Fixes #38674.
4291
4292 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4293
4294         * class.cs: Ignore static void main in DLLs.
4295         * rootcontext.cs: Handle the target type here,
4296         since we are have to access it from class.cs
4297         * driver.cs: account for the above.
4298
4299 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4300
4301         * report.cs: Give line numbers and files if available.
4302
4303 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
4304
4305         * driver.cs: Implement /addmodule.
4306
4307         * typemanager.cs:  Change 'modules' field so it now contains Modules not
4308         ModuleBuilders.
4309
4310 2003-12-20  Martin Baulig  <martin@ximian.com>
4311
4312         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
4313         (FieldBase.IsAssigned): Removed this field.
4314         (FieldBase.SetAssigned): New public method.
4315         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
4316
4317 2003-12-20  Martin Baulig  <martin@ximian.com>
4318
4319         * expression.cs (LocalVariableReference.DoResolve): Don't set
4320         `vi.Used' if we're called from DoResolveLValue().
4321
4322         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
4323         returns the usage vector it just merged into the current one -
4324         pass this one to UsageWarning().
4325         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
4326         of the `EmitContext', don't call this recursively on our children.
4327
4328 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
4329
4330         * driver.cs: Implement /target:module.
4331
4332 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
4333
4334         * support.cs (CharArrayHashtable): New helper class.
4335
4336         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
4337         char arrays, not strings, so we can avoid creating a string in
4338         consume_identifier if the identifier is a keyword.
4339
4340 2003-12-16  Martin Baulig  <martin@ximian.com>
4341
4342         * statement.cs (LocalInfo.Assigned): Removed this property.
4343         (LocalInfo.Flags): Removed `Assigned'.
4344         (LocalInfo.IsAssigned): New public method; takes the EmitContext
4345         and uses flow analysis.
4346         (Block.UsageWarning): Made this method private.
4347         (Block.Resolve): Call UsageWarning() if appropriate.
4348
4349         * expression.cs (LocalVariableReference.DoResolve): Always set
4350         LocalInfo.Used here.
4351
4352 2003-12-13  Martin Baulig  <martin@ximian.com>
4353
4354         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
4355         any value here; we're now using flow analysis to figure out
4356         whether a statement/block returns a value.
4357
4358 2003-12-13  Martin Baulig  <martin@ximian.com>
4359
4360         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
4361         working again.
4362         (FlowBranching.MergeFinally): Don't call
4363         `branching.CheckOutParameters()' here, this is called in
4364         MergeTopBlock().
4365         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
4366         when adding the `finally' vector.       
4367
4368 2003-12-13  Martin Baulig  <martin@ximian.com>
4369
4370         * flowanalysis.cs
4371         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
4372         actually work and also fix #48962.
4373
4374 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
4375
4376         * decl.cs: Do not check System.Object for nested types,
4377         since we know it does not have any. Big bang for buck:
4378
4379         BEFORE:
4380            Run 1:   8.35 seconds
4381            Run 2:   8.32 seconds
4382            corlib:  17.99 seconds
4383         AFTER:
4384            Run 1:   8.17 seconds
4385            Run 2:   8.17 seconds
4386            corlib:  17.39 seconds
4387
4388 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
4389
4390         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
4391         time we are returning 0 members, so we save alot here.
4392
4393 2003-12-11  Martin Baulig  <martin@ximian.com>
4394
4395         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
4396         `MergeChild()', also just take the `FlowBranching' as argument;
4397         call Merge() on it and return the result.
4398         (FlowBranching.Merge): We don't need to do anything if we just
4399         have one sibling.
4400
4401 2003-12-11  Martin Baulig  <martin@ximian.com>
4402
4403         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
4404         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
4405         Maurer for this idea.
4406
4407 2003-12-11  Martin Baulig  <martin@ximian.com>
4408
4409         * flowanalysis.cs (MergeResult): This class is now gone; we now
4410         use the `UsageVector' for this.  The reason for this is that if a
4411         branching just has one sibling, we don't need to "merge" them at
4412         all - that's the next step to do.
4413         (FlowBranching.Merge): We now return a `UsageVector' instead of a
4414         `MergeResult'.
4415
4416 2003-12-11  Martin Baulig  <martin@ximian.com>
4417
4418         Reworked flow analyis and made it more precise and bug-free.  The
4419         most important change is that we're now using a special `Reachability'
4420         class instead of having "magic" meanings of `FlowReturns'.  I'll
4421         do some more cleanups and optimizations and also add some more
4422         documentation this week.
4423
4424         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
4425         largely reworked this class.
4426         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
4427         the new `Reachability' class instead of having "magic" values here.
4428         (FlowBranching): We're now using an instance of `Reachability'
4429         instead of having separate `Returns', `Breaks' etc. fields.
4430
4431         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
4432         based on flow analysis; ignore the return value of block.Emit ().
4433
4434 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
4435
4436         * driver.cs typemanager.cs: Find the mono extensions to corlib even
4437         if they are private.
4438
4439 2003-12-09  Martin Baulig  <martin@ximian.com>
4440
4441         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
4442         call them directly on the UsageVector.
4443
4444 2003-12-09  Martin Baulig  <martin@ximian.com>
4445
4446         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
4447         Changed return type from `FlowReturns' to `Reachability'.
4448
4449 2003-12-09  Martin Baulig  <martin@ximian.com>
4450
4451         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
4452         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
4453         `Reachable' fields with a single `Reachability' one.
4454
4455 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4456
4457         * class.cs (FindMembers): Remove foreach's.
4458
4459         Bootstrap times:
4460
4461         BEFORE
4462                 Run 1:   8.74 seconds
4463                 Run 2:   8.71 seconds
4464
4465         AFTER
4466                 Run 1:   8.64 seconds
4467                 Run 2:   8.58 seconds
4468
4469
4470 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4471
4472         * cs-parser.jay:
4473         * gen-treedump.cs:
4474         * statement.cs:
4475         This patch does a few things:
4476                 1. EmptyStatement is now a singleton, so it is never reallocated.
4477                 2. All blah is EmptyStatement constructs have been changed to
4478                    blah == EmptyStatement.Value, which is much faster and valid
4479                    now that EmptyStatement is a singleton.
4480                 3. When resolving a block, rather than allocating a new array for
4481                    the non-empty statements, empty statements are replaced with
4482                    EmptyStatement.Value
4483                 4. Some recursive functions have been made non-recursive.
4484         Mainly the performance impact is from (3), however (1) and (2) are needed for
4485         this to work. (4) does not make a big difference in normal situations, however
4486         it makes the profile look saner.
4487
4488         Bootstrap times:
4489
4490         BEFORE
4491         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4492         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4493         Total memory allocated: 56397 KB
4494
4495         AFTER
4496         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
4497         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
4498         Total memory allocated: 55666 KB
4499
4500 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4501
4502         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
4503         than the hashtable in a hashtable version
4504
4505         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
4506         we always end up concating a string. This results in a huge perf
4507         loss, because many strings have to be tracked by the GC. In this
4508         patch, we first use a hashtable that works with two keys, so that
4509         the strings do not need to be concat'ed.
4510
4511         Bootstrap times:
4512         BEFORE
4513                 Run 1:   8.74 seconds
4514                 Run 2:   8.71 seconds
4515
4516         AFTER
4517                 Run 1:   8.65 seconds
4518                 Run 2:   8.56 seconds
4519
4520 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4521
4522         * Makefile: Add a new target `do-time' that does a quick and simple
4523         profile, leaving easy to parse output.
4524
4525 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
4526
4527         * codegen.cs (Init): Create the dynamic assembly with 
4528         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
4529
4530 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4531
4532         * support.cs: Make the PtrHashtable use only one
4533         instance of its comparer.
4534
4535 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
4536
4537         * typemanager.cs: Fix lookup of GetNamespaces.
4538
4539 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
4540
4541         * expression.cs: Removed redundant line.
4542
4543         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
4544         ArrayLists, use for loops with bounds.  
4545
4546         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
4547         arraylist.
4548
4549         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
4550         arraylists, use for loop with bounds.
4551
4552         The above three changes give us a 0.071 second performance
4553         improvement out of 3.294 seconds down to 3.223.  On my machine
4554         the above changes reduced the memory usage by 1,387 KB during
4555         compiler bootstrap.
4556
4557         * cs-parser.jay (QualifiedIdentifier): New class used to represent
4558         QualifiedIdentifiers.  Before we created a new string through
4559         concatenation, and mostly later on, the result would be
4560         manipulated by DecomposeQI through string manipulation.
4561
4562         This reduced the compiler memory usage for bootstrapping from
4563         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
4564         compile times in 0.05 seconds.
4565
4566 2003-11-28  Dick Porter  <dick@ximian.com>
4567
4568         * support.cs: Do string compares with the Invariant culture.
4569
4570         * rootcontext.cs: 
4571         * gen-treedump.cs: 
4572         * expression.cs: 
4573         * driver.cs: 
4574         * decl.cs: 
4575         * codegen.cs: 
4576         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
4577         the comparison is done with the Invariant culture.
4578
4579 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
4580
4581         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
4582         GetEnumerator method.
4583
4584         (ProbeCollectionType): Iterate starting at the most specific type
4585         upwards looking for a GetEnumerator
4586
4587         * expression.cs: Shift count can be up to 31 for int/uint and 63
4588         for long/ulong.
4589
4590 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
4591
4592         * statement.cs (Block.LookupLabel): Also look for the label on the
4593         children blocks.  Use a hash table to keep track of visited
4594         nodes. 
4595
4596         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
4597         we actually did transform the other operand, otherwise fall back
4598         to the common codepath that casts to long.
4599
4600         * cs-tokenizer.cs: Use the same code pattern as the int case.
4601         Maybe I should do the parsing myself, and avoid depending on the
4602         Parse routines to get this done.
4603
4604 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
4605
4606         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4607         which fixes bug 51347.  This time test it.
4608
4609         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
4610         attributes for example can not tell the difference between these.
4611         The difference was only a syntax feature of the language. 
4612
4613         * attribute.cs: Apply attributes to delegates.
4614
4615         * delegate.cs: Call the apply attributes method.
4616
4617 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
4618
4619         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
4620         comparing 0 vs Byte.MinValue, not the value
4621
4622         (ImplicitConversionRequired): When reporting a conversion error,
4623         use error 31 to print out the constant error instead of the
4624         simpler 29.
4625
4626         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4627         which fixes bug 51347.
4628
4629 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
4630
4631         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
4632         which fixes the -warnaserror command line option.
4633
4634 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
4635
4636         * cfold.cs (DoNumericPromotions): During constant folding of
4637         additions on UIntConstant, special case intconstants with
4638         IntConstants like we do on the expression binary operator. 
4639
4640 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
4641
4642         * convert.cs (ImplicitReferenceConversion): We were missing a case
4643         (System.Enum are not value types or class types, so we need to
4644         classify them separatedly).
4645
4646         * driver.cs: We do not support error 2007.
4647
4648 2003-11-12 Jackson Harper <jackson@ximian.com>
4649
4650         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
4651         system directory. Also use the full file name so users can
4652         libraries names mscorlib-o-tron.dll in a non system dir.
4653
4654 2003-11-10  Martin Baulig  <martin@ximian.com>
4655
4656         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
4657         (TypeManager.InitCoreTypes): Initialize them here, but instead of
4658         calling `ResolveType()' on them, directly assign their `Type'.
4659
4660 2003-11-08  Martin Baulig  <martin@ximian.com>
4661
4662         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
4663         return value and the `out parent' parameter.
4664         (TypeContainer.DefineType): Moved the CS0644 check into
4665         GetClassBases().  Don't pass the interface types to the
4666         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
4667         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
4668
4669         * ecore.cs (TypeExpr.IsAttribute): New property.
4670         (TypeExpr.GetInterfaces): New method.
4671
4672         * interface.cs (Interface.GetInterfaceTypeByName): Return a
4673         TypeExpr instead of a Type.
4674         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
4675         (Interface.DefineType): Don't pass the interface types to the
4676         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
4677         them later and then call `TypeBulider.AddInterfaceImplementation()'.
4678
4679         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
4680         instead of a `Type[]'.
4681         (TypeManager.RegisterBuilder): Likewise.
4682         (TypeManager.AddUserInterface): Likewise.
4683         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
4684         `Type[]' and also return a `TypeExpr[]'.
4685         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
4686
4687 2003-11-08  Martin Baulig  <martin@ximian.com>
4688
4689         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
4690         Expression.     
4691
4692 2003-11-08  Martin Baulig  <martin@ximian.com>
4693
4694         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
4695         TypeManager.ResolveExpressionTypes().
4696
4697         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
4698         instead of an Expression.
4699         (TypeExpr): This is now an abstract base class for `TypeExpression'.
4700         (TypeExpression): New public class; formerly known as `TypeExpr'.
4701
4702         * expression.cs (ComposedCast): Derive from TypeExpr.
4703
4704         * typemanager.cs (TypeManager.system_*_expr): These are now
4705         TypExpr's instead of Expression's.
4706         (TypeManager.ResolveExpressionTypes): New public static function;
4707         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
4708         of them.        
4709
4710 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
4711
4712         * expression.cs (New.DoResolve): Do not dereference value that
4713         might be a null return.
4714
4715         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4716         sure that the constant value has the right type.  Fixes an
4717         unreported bug, similar to 50425.
4718
4719         * const.cs (Const.LookupConstantValue): Call
4720         ImplicitStandardConversionExists before doing a conversion to
4721         avoid havng the TypeManager.ChangeType do conversions.
4722
4723         Reduced the number of casts used
4724
4725         (Const.ChangeType): New routine to enable reuse of the constant
4726         type changing code from statement.
4727
4728         * typemanager.cs (ChangeType): Move common initialization to
4729         static global variables.
4730
4731         Fixes #50425.
4732
4733         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4734         every value type to go through, even if it was void.  Fix that. 
4735
4736         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4737         character of the define, and the is_identifier_part_character for
4738         the rest of the string.
4739
4740 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4741
4742         * expression.cs (UnaryMutator.EmitCode): When I updated
4743         LocalVariableReference.DoResolve, I overdid it, and dropped an
4744         optimization done on local variable references.
4745
4746 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4747
4748         * ecore.cs: Convert the return from Ldlen into an int.
4749
4750 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4751
4752         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4753         the accessibility, this is a special case for toplevel non-public
4754         classes (internal for instance).
4755
4756 2003-10-20  Nick Drochak <ndrochak@gol.com>
4757
4758         * ecore.cs: Fix typo and build.  Needed another right paren.
4759
4760 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4761
4762         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4763         `internal' case regular and protected, but not allowing protected
4764         to be evaluated later.  Bug 49840
4765
4766 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4767
4768         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4769         to kb.Nlast, and not the kb.nFirst to isolate the switch
4770         statement.
4771
4772         Extract the underlying type, so enumerations of long/ulong are
4773         treated like long/ulong.
4774
4775 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4776
4777         * expression.cs (New): Overload the meaning of RequestedType to
4778         track the possible creation of the NewDelegate type, since
4779         DoResolve is invoked more than once for new constructors on field
4780         initialization.
4781
4782         See bugs: #48800 and #37014
4783
4784         * cs-parser.jay (declare_local_constants): Take an arraylist
4785         instead of a single constant.
4786
4787         (local_constant_declaration): It should take a
4788         constant_declarators, not a constant_declarator.  Fixes 49487
4789
4790         * convert.cs: Fix error report.
4791
4792 2003-10-13 Jackson Harper <jackson@ximian.com>
4793
4794         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4795         bug #49611
4796
4797 2003-10-09  Martin Baulig  <martin@ximian.com>
4798
4799         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4800         to the .ctor.
4801         (MethodCore.DoDefineParameters): Removed the TypeContainer
4802         argument; use the DeclSpace which was passed to the .ctor instead.
4803         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4804         TypeContainer; we only need a DeclSpace here.
4805
4806 2003-10-09  Martin Baulig  <martin@ximian.com>
4807
4808         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4809         to the .ctor.
4810         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4811         EmitContext's .ctor.    
4812
4813 2003-10-09  Martin Baulig  <martin@ximian.com>
4814
4815         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4816         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4817         AsAccessible(), moved them as well.
4818
4819         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4820
4821 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4822
4823         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4824
4825 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4826
4827         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4828         generation for >=, as spotted by Paolo, bug 48679.  
4829         Patch from David Waite.
4830
4831         * cs-tokenizer.cs: Add handling for #pragma.
4832
4833         * cs-parser.jay: Allow for both yield and yield return in the
4834         syntax.  The anti-cobolization of C# fight will go on!
4835
4836         * class.cs (TypeBuilder.DefineType): Catch error condition here
4837         (Parent.DefineType erroring out and returning null).
4838
4839         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4840         coping with enumerations variables, we were mistakenly processing
4841         them as a regular value type instead of built-in types.  Fixes the
4842         bug #48063
4843
4844         * typemanager.cs (IsBuiltinOrEnum): New method.
4845
4846 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4847
4848         * cs-parser.jay: Upgrade: yield now needs the return clause.
4849
4850 2003-09-19  Martin Baulig  <martin@ximian.com>
4851
4852         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4853         `MemberCache parent' argument.  Normally, an interface doesn't
4854         have a parent type except System.Object, but we use this in gmcs
4855         for generic type parameters.
4856
4857 2003-09-18  Martin Baulig  <martin@ximian.com>
4858
4859         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4860         on `type.IsInterface'; don't check whether the type has a parent
4861         to determine whether it's an interface.
4862
4863 2003-09-15  Martin Baulig  <martin@ximian.com>
4864
4865         * class.cs (TypeContainer.DefineType): Added an error flag to
4866         avoid reporting duplicate CS0146's ("class definition is
4867         circular.").
4868
4869         * driver.cs (Driver.MainDriver): Abort if
4870         RootContext.ResolveTree() reported any errors.
4871
4872 2003-09-07  Martin Baulig  <martin@ximian.com>
4873
4874         * report.cs (Error, Warning): Added overloaded versions which take
4875         a `params object[] args' and call String.Format().
4876
4877 2003-09-07  Martin Baulig  <martin@ximian.com>
4878
4879         * decl.cs (DeclSpace..ctor): Don't call
4880         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4881         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4882         (DeclSpace.RecordDecl): New method.
4883
4884         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4885
4886 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4887
4888         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4889         value attributes to be applied to ParameterBuilders.
4890
4891         * class.cs (MethodCore.LabelParameters): Make static and more
4892         generic so that it can be used from other places - like interface
4893         methods, for instance.
4894
4895         * interface.cs (Interface.Emit): Call LabelParameters before
4896         emitting attributes on the InterfaceMethod.
4897
4898 2003-08-26  Martin Baulig  <martin@ximian.com>
4899
4900         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4901         resolving aliases; fixes #47927.
4902
4903 2003-08-26  Martin Baulig  <martin@ximian.com>
4904
4905         * statement.cs (Using.DoResolve): This is internally emitting a
4906         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4907         do not always return.  Fixes #47681.
4908
4909 2003-08-26  Martin Baulig  <martin@ximian.com>
4910
4911         * decl.cs (MemberCore): Moved WarningNotHiding(),
4912         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4913         into MemberBase.
4914         (AdditionResult): Make this nested in DeclSpace.
4915         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4916         argument; call NamespaceEntry.Define() unless we're nested in a
4917         class or struct.
4918
4919         * namespace.cs (Namespace.DefineName): New public function.  This
4920         is called from DeclSpace's .ctor to add 
4921         (Namespace.Lookup): Include DeclSpaces in the lookup.
4922
4923         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4924
4925         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4926
4927 2003-08-25  Martin Baulig  <martin@ximian.com>
4928
4929         * convert.cs (Convert.ExplicitReferenceConversion): When
4930         converting from an interface type to a class, unbox if the target
4931         type is a struct type.  Fixes #47822.
4932
4933 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4934
4935         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
4936         #47854.
4937
4938 2003-08-22  Martin Baulig  <martin@ximian.com>
4939
4940         * class.cs (TypeManager.DefineType): When defining a nested type,
4941         call DefineType() on our parent; fixes #47801.
4942
4943 2003-08-22  Martin Baulig  <martin@ximian.com>
4944
4945         * class.cs (MethodData.Define): While checking if a method is an
4946         interface implementation, improve the test a bit more to fix #47654.
4947
4948 2003-08-22  Martin Baulig  <martin@ximian.com>
4949
4950         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
4951         correctly; fixes #47722.
4952
4953 2003-08-22  Martin Baulig  <martin@ximian.com>
4954
4955         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
4956         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
4957
4958         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
4959
4960 2003-08-22  Martin Baulig  <martin@ximian.com>
4961
4962         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
4963         can only be assigned in static constructors.  Fixes #47161.
4964
4965 2003-08-22  Martin Baulig  <martin@ximian.com>
4966
4967         Rewrote and improved the flow analysis code.
4968
4969         * flowbranching.cs (FlowBranching): Make this class abstract.
4970         (FlowBranching.CreateBranching): New static function to create a
4971         new flow branching.
4972         (FlowBranchingBlock, FlowBranchingException): New classes.
4973         (FlowBranching.UsageVector.Type): New public readonly field.
4974         (FlowBranching.UsageVector.Breaks): Removed the setter.
4975         (FlowBranching.UsageVector.Returns): Removed the setter.
4976         (FlowBranching.UsageVector): Added Break(), Return(),
4977         NeverReachable() and Throw() methods to modify the reachability.
4978         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
4979         done by FlowBranching.Merge().
4980         (FlowBranching.UsageVector.MergeChild): New method; merges the
4981         merge result into the current vector.
4982         (FlowBranching.Merge): New abstract method to merge a branching.
4983
4984 2003-08-12  Martin Baulig  <martin@ximian.com>
4985
4986         * expression.cs (Indirection.CacheTemporaries): Create the
4987         LocalTemporary with the pointer type, not its element type.
4988
4989 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
4990
4991         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
4992         token was a keyword or not.
4993
4994         Add `error' options where an IDENTIFIER was expected;  Provide
4995         CheckToken and CheckIdentifierToken convenience error reporting
4996         functions. 
4997
4998         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
4999
5000         * decl.cs: Rename `NamespaceEntry Namespace' public field into
5001         NameSpaceEntry NameSpaceEntry.
5002
5003         (LookupInterfaceOrClass): Avoid creating a full qualified name
5004         from namespace and name: avoid doing lookups when we know the
5005         namespace is non-existant.   Use new Tree.LookupByNamespace which
5006         looks up DeclSpaces based on their namespace, name pair.
5007
5008         * driver.cs: Provide a new `parser verbose' to display the
5009         exception thrown during parsing.  This is turned off by default
5010         now, so the output of a failure from mcs is more graceful.
5011
5012         * namespace.cs: Track all the namespaces defined in a hashtable
5013         for quick lookup.
5014
5015         (IsNamespace): New method
5016
5017 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
5018
5019         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
5020         we know that we need to concatenate (full typename can never be
5021         null). 
5022
5023         * class.cs: ditto.
5024
5025         * statement.cs: Use a bitfield;  Do not initialize to null things
5026         which are done by the constructor by default.
5027
5028         * cs-parser.jay: bug fix, parameter was 4, not 3.
5029
5030         * expression.cs: Just use the property;
5031
5032         * statement.cs: No need for GetVariableInfo method.
5033
5034 2003-08-08  Martin Baulig  <martin@ximian.com>
5035
5036         * flowanalysis.cs (FlowReturns): This is now nested in the
5037         `FlowBranching' class.
5038         (MyBitVector): Moved this here from statement.cs.
5039         (FlowBranching.SiblingType): New enum type.
5040         (FlowBranching.CreateSibling): Added `SiblingType' argument.
5041
5042 2003-08-07  Martin Baulig  <martin@ximian.com>
5043
5044         * flowanalysis.cs (FlowBranchingType): This is now nested in the
5045         `FlowBranching' class and called `BranchingType'.
5046
5047 2003-08-07  Martin Baulig  <martin@ximian.com>
5048
5049         * flowanalysis.cs: Moved all the control flow analysis code into
5050         its own file.
5051
5052 2003-08-07  Martin Baulig  <martin@ximian.com>
5053
5054         * assign.cs (Assign.DoResolve): `target' must either be an
5055         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
5056         #37319.
5057
5058 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
5059
5060         * expression.cs (BinaryMethod): This kind of expression is created by the
5061         Binary class if it determines that the operator has to be handled
5062         by a method.
5063
5064         (BinaryDelegate): This kind of expression is created if we are
5065         dealing with a + or - operator on delegates.
5066
5067         (Binary): remove method, argumetns, and DelegateOperator: when
5068         dealing with methods, 
5069
5070         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
5071
5072         * statement.cs (Block): use bitfields for the three extra booleans
5073         we had in use.   Remove unused topblock parameter.
5074
5075         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
5076
5077         * assign.cs: Drop extra unneeded tests.
5078
5079 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
5080
5081         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
5082
5083         * statement.cs (Foreach): Use VariableStorage instead of
5084         LocalBuilders.   
5085
5086         * codegen.cs (VariableStorage): New class used by clients that
5087         require a variable stored: locals or fields for variables that
5088         need to live across yield.
5089
5090         Maybe provide a convenience api for EmitThis+EmitLoad?
5091
5092         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
5093         these bad boys.
5094
5095 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
5096
5097         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
5098         RemapParameterLValue): New methods that are used to turn a
5099         precomputed FieldInfo into an expression like this:
5100
5101                 instance.FieldInfo
5102
5103         The idea is to use this instead of making LocalVariableReference
5104         have more than one meaning.
5105
5106         * cs-parser.jay: Add error production to BASE.
5107
5108         * ecore.cs: Deal with TypeManager.GetField returning null, which
5109         is now a valid return value.
5110
5111         (FieldExprNoAddress): New expression for Fields whose address can
5112         not be taken.
5113
5114         * expression.cs (LocalVariableReference): During the resolve
5115         phases, create new expressions if we are in a remapping context.
5116         Remove code that dealt with remapping here.
5117
5118         (ParameterReference): same.
5119
5120         (ProxyInstance): New expression, like the `This' expression, but
5121         it is born fully resolved.  We know what we are doing, so remove
5122         the errors that are targeted to user-provided uses of `this'.
5123
5124         * statement.cs (Foreach): our variable is now stored as an
5125         Expression;  During resolution, follow the protocol, dont just
5126         assume it will return this.
5127
5128 2003-08-06  Martin Baulig  <martin@ximian.com>
5129
5130         * support.cs (SeekableStreamReader.cs): New public class.
5131
5132         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
5133         SeekableStreamReader instead of the normal StreamReader.
5134
5135 2003-08-04  Martin Baulig  <martin@ximian.com>
5136
5137         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
5138         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
5139         deambiguate casts and delegate invocations.
5140         (parenthesized_expression): Use the new tokens to ensure this is
5141         not a cast of method invocation.
5142
5143         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
5144         when reading a `)' and Deambiguate_CloseParens () was previously
5145         called.
5146
5147         * expression.cs (ParenthesizedExpression): New class.  This is
5148         just used for the CS0075 test.
5149         (Binary.DoResolve): Check for CS0075.   
5150
5151 2003-07-29  Ravi Pratap  <ravi@ximian.com>
5152
5153         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
5154         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
5155         reference comparison.
5156
5157         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
5158         examine the ReturnType for equality - this is necessary in the
5159         cases of implicit and explicit operators whose signature also
5160         includes the return type.
5161
5162 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
5163
5164         * namespace.cs: Cache the result of the namespace computation,
5165         instead of computing it every time.
5166
5167 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
5168
5169         * decl.cs: Use a global arraylist that we reuse over invocations
5170         to avoid excesive memory consumption.  Reduces memory usage on an
5171         mcs compile by one meg (45 average).
5172
5173         * typemanager.cs (LookupTypeReflection): In .NET pointers are
5174         private, work around that.
5175
5176 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
5177
5178         * literal.cs (IntLiteral): Define Zero and One static literals. 
5179
5180         * cs-parser.jay (integer_literal): use static literals to reduce
5181         memory usage for the most used literals (0, 1 and -1).  211kb
5182         reduced in memory usage.
5183
5184         Replace all calls to `new ArrayList' with `new
5185         ArrayList(4)' which is a good average number for most allocations,
5186         and also requires only 16 bytes of memory for its buffer by
5187         default. 
5188
5189         This reduced MCS memory usage in seven megabytes for the RSS after
5190         bootstrapping.
5191
5192 2003-07-28  Ravi Pratap  <ravi@ximian.com>
5193
5194         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
5195         handle params methods the correct way by forming only one
5196         applicable set with params and normal methods in them. Earlier we
5197         were looking at params methods only if we found no normal methods
5198         which was not the correct thing to do.
5199
5200         (Invocation.BetterFunction): Take separate arguments indicating
5201         when candidate and the best method are params methods in their
5202         expanded form.
5203
5204         This fixes bugs #43367 and #46199.
5205
5206         * attribute.cs: Documentation updates.
5207
5208         (CheckAttribute): Rename to CheckAttributeTarget.
5209         (GetValidPlaces): Rename to GetValidTargets.
5210
5211         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
5212         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
5213
5214         Fixes bug #44468.
5215
5216 2003-07-28  Martin Baulig  <martin@ximian.com>
5217
5218         * class.cs (TypeContainer.DefineMembers): Use the base type's full
5219         name when looking up the base class of a nested class.  Fixes #46977.
5220
5221 2003-07-26  Martin Baulig  <martin@ximian.com>
5222
5223         * expression.cs (Indexers.Indexer): New nested struct; contains
5224         getter, setter and the indexer's type.
5225         (Indexers.Properties): This is now an ArrayList of
5226         Indexers.Indexer's.
5227         (IndexerAccess.DoResolveLValue): Correctly set the type if the
5228         indexer doesn't have any getters.
5229
5230         * assign.cs (Assign.DoResolve): Also do the implicit conversions
5231         for embedded property and indexer assignments.
5232
5233 2003-07-26  Martin Baulig  <martin@ximian.com>
5234
5235         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
5236         preprocessor directive is not the first non-whitespace character
5237         on a line.
5238
5239 2003-07-26  Martin Baulig  <martin@ximian.com>
5240
5241         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
5242         namespace parsing, follow the spec more closely.
5243
5244         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
5245         NamespaceEntry.Lookup().
5246
5247 2003-07-25  Martin Baulig  <martin@ximian.com>
5248
5249         * MethodCore.cs (OverridesSomething): New public field; it's set
5250         from TypeContainer.DefineMembers if this method overrides
5251         something (which doesn't need to be a method).  Fix #39462.
5252
5253 2003-07-25  Ravi Pratap  <ravi@ximian.com>
5254
5255         * typemanager.cs (GetMembers): Ensure that the list of members is
5256         reversed. This keeps things in sync.
5257
5258         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
5259         find an AttributeUsage attribute.
5260
5261         * expression.cs (Invocation.OverloadResolve): Perform the check
5262         which disallows Invoke to be directly called on a Delegate.
5263
5264         (Error_InvokeOnDelegate): Report error cs1533.
5265
5266 2003-07-25  Martin Baulig  <martin@ximian.com>
5267
5268         * expression.cs (Indexers.GetIndexersForType): Only look in the
5269         interface hierarchy if the requested type is already an
5270         interface.  Fixes #46788 while keeping #46502 fixed.
5271
5272 2003-07-25  Martin Baulig  <martin@ximian.com>
5273
5274         * class.cs (TypeContainer.DefineMembers): Check whether all
5275         readonly fields have been assigned and report warning CS0649 if
5276         not.
5277
5278         * statement.cs (LocalInfo.IsFixed): Always return true if this is
5279         a valuetype.
5280
5281 2003-07-24  Ravi Pratap  <ravi@ximian.com>
5282
5283         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
5284         returned from GetMethods to make things consistent with the
5285         assumptions MCS makes about ordering of methods.
5286
5287         This should comprehensively fix bug #45127 and it does :-)
5288
5289         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
5290         ordering is actually reverse.
5291
5292         * Clean up some debug messages I left lying around.
5293
5294         * interface.cs (Populate*): Get rid of code which emits attributes
5295         since the stage in which we emit attributes is the 'Emit' stage,
5296         not the define stage.
5297
5298         (Emit): Move attribute emission for interface members here.
5299
5300 2003-07-22  Ravi Pratap  <ravi@ximian.com>
5301
5302         * expression.cs (Invocation.OverloadResolve): Follow the spec more
5303         closely: we eliminate methods in base types when we have an
5304         applicable method in a top-level type.
5305
5306         Please see section 14.5.5.1 for an exact description of what goes
5307         on. 
5308
5309         This fixes bug #45127 and a host of other related to corlib compilation.
5310
5311         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
5312         array is the method corresponding to the top-level type (this is
5313         because of the changes made to icall.c) so we change this
5314         accordingly.
5315
5316         (MethodGroupExpr.Name): This too.
5317
5318         * typemanager.cs (GetElementType): New method which does the right
5319         thing when compiling corlib. 
5320
5321         * everywhere: Make use of the above in the relevant places.
5322
5323 2003-07-22  Martin Baulig  <martin@ximian.com>
5324
5325         * cs-parser.jay (invocation_expression): Moved
5326         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
5327         `cast_expression', but create a InvocationOrCast which later
5328         resolves to either an Invocation or a Cast.
5329
5330         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
5331         method; call this before EmitStatement() to make sure that this
5332         expression can be used as a statement.
5333
5334         * expression.cs (InvocationOrCast): New class; resolves to either
5335         an Invocation or a Cast.
5336
5337         * statement.cs (StatementExpression): Call ResolveStatement() on
5338         the ExpressionStatement before emitting it.
5339
5340 2003-07-21  Martin Baulig  <martin@ximian.com>
5341
5342         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
5343         `ref' and `out' attributes match; fixes #46220.
5344         (MemberAccess.ResolveMemberAccess): You can't reference a type
5345         through an expression; fixes #33180.
5346         (Indexers.GetIndexersForType): Don't return the indexers from
5347         interfaces the class implements; fixes #46502.
5348
5349 2003-07-21  Martin Baulig  <martin@ximian.com>
5350
5351         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
5352         CS0661 checks; fixes bug #30442.
5353
5354 2003-07-21  Martin Baulig  <martin@ximian.com>
5355
5356         * decl.cs (AdditionResult): Added `Error'.
5357
5358         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
5359
5360         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
5361         makes cs0031.cs actually work.
5362
5363 2003-07-20  Martin Baulig  <martin@ximian.com>
5364
5365         * namespace.cs: Fixed that bug which caused a crash when compiling
5366         the debugger's GUI.
5367
5368 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
5369
5370         * typemanager.cs (LookupTypeReflection): Never expose types which
5371         are NotPublic, NestedPrivate, NestedAssembly, or
5372         NestedFamANDAssem.  We used to return these, and later do a check
5373         that would report a meaningful error, but the problem is that we
5374         would not get the real match, if there was a name override.
5375
5376 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
5377
5378         * namespace.cs (Namespace, Name): Do not compute the namespace
5379         name dynamically, compute it in the constructor.  This reduced
5380         memory usage by 1697 KB.
5381
5382         * driver.cs: Use --pause to pause at the end.
5383
5384 2003-07-17  Peter Williams  <peter@newton.cx>
5385
5386         * Makefile: Change the name of the test target so that it doesn't
5387         conflict with the recursive test target.
5388
5389 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
5390
5391         * expression.cs (LocalVariableReference.Emit, EmitAssign,
5392         AddressOf): Do not use EmitThis, that was wrong, use the actual
5393         this pointer.
5394
5395 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
5396
5397         * class.cs (MethodData.Define): While checking if a method is an
5398         interface implementation, improve the test: If we are not public
5399         (use new test here: use the computed MethodAttributes directly,
5400         instead of the parsed modifier flags) check if the `implementing'
5401         method comes from an interface or not.
5402
5403         * pending.cs (VerifyPendingMethods): Slightly better error
5404         message.
5405
5406         * makefile: add test target that does the mcs bootstrap.
5407
5408 2003-07-16  Ravi Pratap  <ravi@ximian.com>
5409
5410         * interface.cs (Define): Do nothing here since there are no
5411         members to populate etc. Move the attribute emission out of here
5412         since this was just totally the wrong place to put it. Attribute
5413         application happens during the 'Emit' phase, not in the 'Define'
5414         phase.
5415
5416         (Emit): Add this method and move the attribute emission here
5417
5418         * rootcontext.cs (EmitCode): Call the Emit method on interface
5419         types too.
5420
5421 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5422
5423         * expression.cs (OverloadResolve): Report error only if Location
5424         is not 'Null' which means that there was a probe going on.
5425
5426 2003-07-14  Martin Baulig  <martin@ximian.com>
5427
5428         * expression.cs (ConditionalLogicalOperator): New public class to
5429         implement user defined conditional logical operators.
5430         This is section 14.11.2 in the spec and bug #40505.
5431
5432 2003-07-14  Martin Baulig  <martin@ximian.com>
5433
5434         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
5435
5436 2003-07-14  Martin Baulig  <martin@ximian.com>
5437
5438         * codegen.cs (EmitContext.InFixedInitializer): New public field.
5439
5440         * ecore.cs (IVariable.VerifyFixed): New interface method.
5441
5442         * expression.cs (Unary.ResolveOperator): When resolving the `&'
5443         operator, check whether the variable is actually fixed.  Fixes bug
5444         #36055.  Set a variable definitely assigned when taking its
5445         address as required by the spec.
5446
5447         * statement.cs (LocalInfo.IsFixed): New field.
5448         (LocalInfo.MakePinned): Set `IsFixed' to true.
5449
5450 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5451
5452         * attribute.cs (Attribute.Resolve): While doing a Member lookup
5453         for .ctors, ensure that we only ask for members declared in the
5454         attribute type (BindingFlags.DeclaredOnly).
5455
5456         Fixes bug #43632.
5457
5458         * expression.cs (Error_WrongNumArguments): Report error 1501
5459         correctly the way CSC does.
5460
5461 2003-07-13  Martin Baulig  <martin@ximian.com>
5462
5463         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
5464         lookup on the fully qualified name, to make things like "X.X" work
5465         where "X.X" is a fully qualified type name, but we also have a
5466         namespace "X" in the using list.  Fixes #41975.
5467
5468 2003-07-13  Martin Baulig  <martin@ximian.com>
5469
5470         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
5471         function. If we're a CompoundAssign, we need to create an embedded
5472         CompoundAssign, not an embedded Assign.
5473         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
5474         Fixes #45854.
5475
5476 2003-07-13  Martin Baulig  <martin@ximian.com>
5477
5478         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
5479         work to fix bug #46088.
5480
5481 2003-07-13  Ravi Pratap <ravi@ximian.com>
5482
5483         * class.cs (Operator.Emit): Do not emit attributes here - it is
5484         taken care of by the Method class that we delegate too. This takes
5485         care of bug #45876.
5486
5487 2003-07-10  Martin Baulig  <martin@ximian.com>
5488
5489         * expression.cs (TypeOfVoid): New class.
5490         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
5491
5492 2003-07-10  Martin Baulig  <martin@ximian.com>
5493
5494         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
5495         bug #35957.
5496
5497 2003-07-10  Martin Baulig  <martin@ximian.com>
5498
5499         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
5500         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
5501
5502         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
5503
5504         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
5505
5506 2003-07-10  Martin Baulig  <martin@ximian.com>
5507
5508         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
5509         of decimal.  Fixes #42850.
5510
5511         NOTE: I also fixed the created byte blob, but this doesn't work on
5512         the MS runtime and csc never produces any byte blobs for decimal
5513         arrays.
5514
5515 2003-07-10  Martin Baulig  <martin@ximian.com>
5516
5517         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
5518         structs; fixes #32068.
5519         (Block.AddChildVariableNames): Fixed #44302.
5520
5521 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5522
5523         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
5524
5525 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5526
5527         * attribute.cs: And this test is onger needed.
5528
5529 2003-07-08  Martin Baulig  <martin@ximian.com>
5530
5531         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
5532         inaccessible types.  Fixes #36313.
5533
5534         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
5535
5536         * namespace.cs (NamespaceEntry): Create implicit entries for all
5537         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
5538         implicit entries for N1.N2 and N1.
5539
5540 2003-07-08  Martin Baulig  <martin@ximian.com>
5541
5542         Rewrote the handling of namespaces to fix a lot of the issues
5543         wrt. `using' aliases etc.
5544
5545         * namespace.cs (Namespace): Splitted this class into a
5546         per-assembly `Namespace' and a per-file `NamespaceEntry'.
5547
5548         * typemanager.cs (TypeManager.IsNamespace): Removed.
5549         (TypeManager.ComputeNamespaces): Only compute namespaces from
5550         loaded assemblies here, not the namespaces from the assembly we're
5551         currently compiling.
5552
5553 2003-07-08  Martin Baulig  <martin@ximian.com>
5554
5555         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
5556
5557 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5558
5559         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
5560         already fixed it.  
5561
5562         I thought about the memory savings here, but LookupTypeReflection
5563         is used under already very constrained scenarios.  Compiling
5564         corlib or mcs only exposes one hit, so it would not really reduce
5565         any memory consumption.
5566
5567 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5568
5569         * typemanager.cs: fixes bug #45889 by only adding public types from
5570         other assemblies to the list of known types.
5571
5572 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5573
5574         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
5575         on the type we resolved.
5576
5577 2003-07-05  Martin Baulig  <martin@ximian.com>
5578
5579         * pending.cs (PendingImplementation.ParentImplements): Don't
5580         create the proxy if the parent is abstract.
5581
5582         * class.cs (TypeContainer.DefineIndexers): Process explicit
5583         interface implementations first.  Fixes #37714.
5584
5585 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
5586
5587         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
5588         defined recursively;  but since we modify the input parameters
5589         (left is set to `this' temporarily), we reset this value if the
5590         left_is_explicit is false, which gives the original semantics to
5591         the code.  
5592
5593         * literal.cs (NullPointer): new class used to represent a null
5594         literal in a pointer context.
5595
5596         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
5597         type is a pointer, use a NullPointer object instead of a
5598         NullLiteral.   Closes 43687
5599
5600         (ExplicitConversion): Convert pointer values using
5601         the conv opcode to the proper type.
5602
5603         * ecore.cs (New): change ValueTypeVariable property into a method,
5604         that returns whether the valuetype is suitable for being used.
5605
5606         * expression.cs (Binary.DoNumericPromotions): Only return if we
5607         the int constant was a valid uint, and we can return both left and
5608         right as uints.  If not, we continue processing, to trigger the
5609         type conversion.  This fixes 39018.
5610
5611         * statement.cs (Block.EmitMeta): During constant resolution, set
5612         the CurrentBlock property on the emitcontext, so that we resolve
5613         constants propertly.
5614
5615 2003-07-02  Martin Baulig  <martin@ximian.com>
5616
5617         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
5618         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
5619
5620         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
5621         than emitting it here.
5622
5623         * statement.cs: Fixed some more flow analysis bugs.
5624
5625 2003-07-02  Martin Baulig  <martin@ximian.com>
5626
5627         * class.cs (MethodData.Define): When implementing interface
5628         methods, set Final unless we're Virtual.
5629
5630         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
5631         check work for interface methods.
5632
5633 2003-07-01  Martin Baulig  <martin@ximian.com>
5634
5635         * ecore.cs (EmitContext.This): Replaced this property with a
5636         GetThis() method which takes a Location argument.  This ensures
5637         that we get the correct error location for a CS0188.
5638
5639 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
5640
5641         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
5642         ImplicitStandardConversion.
5643
5644         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
5645
5646 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
5647
5648         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
5649         optimization.
5650
5651 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
5652
5653         * class.cs (Constructor.Define): Turn off initlocals for unsafe
5654         constructors.
5655
5656         (MethodData.Define): Turn off initlocals for unsafe methods.
5657
5658 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
5659
5660         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
5661         complete;  Fixes #37521.
5662
5663         * delegate.cs: Use Modifiers.TypeAttr to compute the
5664         TypeAttributes, instead of rolling our own.  This makes the flags
5665         correct for the delegates.
5666
5667 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
5668
5669         * class.cs (Constructor.Define): Set the private flag for static
5670         constructors as well.
5671
5672         * cs-parser.jay (statement_expression): Set the return value to
5673         null, to avoid a crash when we catch an error.
5674
5675 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
5676
5677         * cs-parser.jay: Applied patch from Jackson that adds support for
5678         extern and unsafe modifiers to destructor declarations.
5679
5680         * expression.cs: Report error 21 if the user is trying to index a
5681         System.Array.
5682
5683         * driver.cs: Add an error message, suggested by the bug report.
5684
5685         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
5686         if we do not have a ": this ()" constructor initializer.  Fixes 45149
5687
5688 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
5689
5690         * namespace.cs: Add some information to reduce FAQs.
5691
5692 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
5693
5694         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
5695         underlying enumeration types.  Fixes #43915.
5696
5697         * expression.cs: Treat ushort/short as legal values to be used in
5698         bitwise operations.
5699
5700 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
5701
5702         * delegate.cs: transfer custom attributes for paramenters from
5703         the delegate declaration to Invoke and BeginInvoke.
5704
5705 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
5706
5707         * attribute.cs: handle custom marshalers and emit marshal info
5708         for fields, too.
5709
5710 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
5711
5712         * makefile.gnu: Added anonymous.cs to the compiler sources.
5713
5714 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5715
5716         * iterators.cs: Change the name of the proxy class to include two
5717         underscores.
5718
5719         * cs-parser.jay: Update grammar to include anonymous methods.
5720
5721         * anonymous.cs: new file.
5722
5723 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * class.cs (Field.Define): Add missing test for pointers and
5726         safety. 
5727
5728 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5729
5730         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5731         we use the stobj opcode.
5732
5733         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5734         since it wasn't the correct fix. 
5735
5736         It still is puzzling that we are required to use stobj for IntPtr
5737         which seems to be a ValueType.
5738
5739 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5740
5741         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5742         during regular simple name resolution.   Now, the trick is that
5743         instead of returning for processing the simplename, we do a
5744         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5745         contextual lookup type).   If a match is found, return that, if
5746         not, return for further composition.
5747
5748         This fixes long-standing 30485.
5749
5750         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5751         using the address to initialize an object, do an Stobj instead of
5752         using the regular Stelem.
5753
5754         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5755         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5756         Because if we are a BaseIndexerAccess that value will be true.
5757         Fixes 43643.
5758
5759         * statement.cs (GotoCase.Resolve): Return after reporting an
5760         error, do not attempt to continue. 
5761
5762         * expression.cs (PointerArithmetic.Emit): If our operand is a
5763         long, convert our constants to match the operand before
5764         multiplying.  Convert to I type before adding.   Fixes 43670.
5765
5766 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5767
5768         * enum.cs (ImplicitConversionExists) : Rename to
5769         ImplicitEnumConversionExists to remove ambiguity. 
5770
5771         * ecore.cs (NullCast): New type of cast expression class which
5772         basically is very similar to EmptyCast with the difference being
5773         it still is a constant since it is used only to cast a null to
5774         something else
5775         (eg. (string) null)
5776
5777         * convert.cs (ImplicitReferenceConversion): When casting a null
5778         literal, we return a NullCast.
5779
5780         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5781         should be around anymore.
5782
5783         The renaming (reported was slightly wrong). Corrections:
5784
5785         ConvertImplicitStandard -> ImplicitConversionStandard
5786         ConvertExplicitStandard -> ExplicitConversionStandard
5787
5788         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5789         before passing them in !
5790
5791         * convert.cs (ImplicitConversionStandard): When comparing for
5792         equal expr and target types, ensure that expr is not a
5793         NullLiteral.
5794
5795         In general, we must not be checking (expr_type ==
5796         target_type) in the top level conversion methods
5797         (ImplicitConversion, ExplicitConversion etc). This checking is
5798         done in the methods that they delegate to.
5799
5800 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5801
5802         * convert.cs: Move Error_CannotConvertType,
5803         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5804         ImplicitNumericConversion, ImplicitConversionExists,
5805         ImplicitUserConversionExists, StandardConversionExists,
5806         FindMostEncompassedType, FindMostSpecificSource,
5807         FindMostSpecificTarget, ImplicitUserConversion,
5808         ExplicitUserConversion, GetConversionOperators,
5809         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5810         TryImplicitIntConversion, Error_CannotConvertImplicit,
5811         ConvertImplicitRequired, ConvertNumericExplicit,
5812         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5813         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5814         its own file.
5815
5816         Perform the following renames:
5817
5818         StandardConversionExists -> ImplicitStandardConversionExists
5819         ConvertImplicit -> ImplicitConversion
5820         ConvertImplicitStandard -> ImplicitStandardConversion
5821         TryImplicitIntConversion -> ImplicitIntConversion
5822         ConvertImplicitRequired -> ImplicitConversionRequired
5823         ConvertNumericExplicit -> ExplicitNumericConversion
5824         ConvertReferenceExplicit -> ExplicitReferenceConversion
5825         ConvertExplicit -> ExplicitConversion
5826         ConvertExplicitStandard -> ExplicitStandardConversion
5827
5828 2003-05-19  Martin Baulig  <martin@ximian.com>
5829
5830         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5831         (TypeInfo): Added support for structs having structs as fields.
5832
5833         * ecore.cs (FieldExpr): Implement IVariable.
5834         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5835         VariableInfo for the field.
5836
5837 2003-05-18  Martin Baulig  <martin@ximian.com>
5838
5839         * expression.cs (This.DoResolve): Report a CS0027 if we're
5840         emitting a field initializer.
5841
5842 2003-05-18  Martin Baulig  <martin@ximian.com>
5843
5844         * expression.cs (This.ResolveBase): New public function.
5845         (This.DoResolve): Check for CS0188.
5846
5847         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5848         This.Resolve().
5849
5850         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5851         `instance_expression' to null if we don't have any non-static
5852         methods.
5853
5854 2003-05-18  Martin Baulig  <martin@ximian.com>
5855
5856         Reworked the way how local variables and parameters are handled by
5857         the flow analysis code.
5858
5859         * statement.cs (TypeInfo, VariableMap): New public classes.
5860         (VariableInfo): New public class.  This is now responsible for
5861         checking whether a variable has been assigned.  It is used for
5862         parameters and local variables.
5863         (Block.EmitMeta): Take the InternalParameters as argument; compute
5864         the layout of the flow vectors here.
5865         (Block.LocalMap, Block.ParameterMap): New public properties.
5866         (FlowBranching): The .ctor doesn't get the InternalParameters
5867         anymore since Block.EmitMeta() now computes the layout of the flow
5868         vector.
5869         (MyStructInfo): This class is now known as `StructInfo' and nested
5870         in `TypeInfo'; we don't access this directly anymore.
5871
5872         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5873         property and removed IsAssigned(), IsFieldAssigned(),
5874         SetAssigned() and SetFieldAssigned(); we now call them on the
5875         VariableInfo so we don't need to duplicate this code everywhere.
5876
5877         * expression.cs (ParameterReference): Added `Block block' argument
5878         to the .ctor.
5879         (LocalVariableReference, ParameterReference, This): The new
5880         VariableInfo class is now responsible for all the definite
5881         assignment stuff.
5882
5883         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5884         IsParameterAssigned, SetParameterAssigned): Removed.
5885
5886 2003-05-18  Martin Baulig  <martin@ximian.com>
5887
5888         * typemanager.cs (InitCoreTypes): Try calling
5889         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5890         the 3-args-version.  Corlib now also needs our `void_type'.
5891         (GetMethod): Added overloaded version which takes an optional
5892         `bool report_errors' to allow lookups of optional methods.
5893
5894 2003-05-12  Martin Baulig  <martin@ximian.com>
5895
5896         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5897         only used for locals and not for parameters.
5898
5899 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5900
5901         * support.cs (InternalParameters.ParameterType): Return the
5902         ExternalType of the parameter.
5903
5904         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5905         they were unused.
5906
5907 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5908
5909         * class.cs (MethodData.Define): Do not set the `newslot' on
5910         interface members, if they are also flagged as "override".
5911
5912         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5913         better code for ++i and i++.  This only works for static fields
5914         and local variables.
5915
5916         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5917         want to pull the DeclSpace out of the builder_to_declspace instead
5918         of the TypeBuilder (like in TypeContainer.FindMembers).
5919
5920         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
5921         instead of LookupTypeContainer.  Fixes the crash on .NET for
5922         looking up interface members.
5923
5924         * const.cs: Create our own emit context during the Definition
5925         stage, so that constants are evaluated in the proper context, when
5926         a recursive definition happens.
5927
5928 2003-05-11  Martin Baulig  <martin@ximian.com>
5929
5930         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
5931         new block for a switch section.
5932         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
5933         the adding/lookup in the switch block.  Fixes #39828.
5934
5935 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
5936
5937         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
5938         functionality: I needed to convert the data after I had performed
5939         the add/sub operation into the operands type size.
5940
5941         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
5942         pass the type for the box operation, otherwise the resulting
5943         object would have been of type object.
5944
5945         (BoxedCast): Add constructor to specify the type to box as.
5946
5947 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
5948
5949         * iterators.cs: I was reusing the `count' variable inadvertently,
5950         take steps to not allow this to happen.
5951
5952 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
5953
5954         * attribute.cs (Attribute.Resolve): Params attributes are encoded
5955         by creating an array at the point where the params starts and
5956         putting all those arguments there, then adjusting the size of the
5957         array.
5958
5959 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
5960
5961         * expression.cs (New.AddressOf): Implement interface
5962         IMemoryLocation.  This is used when the `new' operator is used in
5963         the context of an invocation to a method on a value type.
5964
5965         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
5966         example. 
5967
5968         * namespace.cs: Also check the using aliases here.
5969
5970         * driver.cs: Move the test for using validity after the types have
5971         been entered, so we do a single pass that also includes the using
5972         aliases. 
5973
5974         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
5975         in the regular case.   CreateSiblingForFinally is doing extra
5976         error checking.
5977
5978         * attribute.cs (GetAttributeArgumentExpression): Store the result
5979         on an out value, and use the return value to indicate failure
5980         instead of using null (which is a valid return for Constant.GetValue).
5981
5982         * statement.cs: Perform the analysis flow for the increment
5983         portion after the statement, because this will be the real flow of
5984         execution.  Fixes #42385
5985
5986         * codegen.cs (EmitContext.EmitArgument,
5987         EmitContext.EmitStoreArgument): New helper functions when the
5988         RemapToProxy flag is set.
5989
5990         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
5991         function.
5992
5993         Add support for remapping parameters. 
5994
5995         * iterators.cs: Propagate parameter values;  Store parameter
5996         values in the proxy classes.
5997
5998 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
5999
6000         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
6001         need a proxy reference;  I do not know what I was thinking
6002
6003         * cs-parser.jay (constructor_initializer): catch another error,
6004         and display nice message.
6005
6006         (field_declaration): catch void field declaration
6007         to flag a better error. 
6008
6009         * class.cs (MemberBase.CheckBase): Report an error instead of a
6010         warning if a new protected member is declared in a struct. 
6011         (Field.Define): catch the error of readonly/volatile.
6012
6013         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
6014
6015         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
6016         volatile variable is taken
6017
6018 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
6019
6020         * statement.cs (Fixed.Resolve): Report an error if we are not in
6021         an unsafe context.
6022
6023 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
6024
6025         * typemanager.cs: reuse the code that handles type clashes for
6026         delegates and enumerations.
6027
6028         * class.cs (Report28): Always report.
6029
6030         * expression.cs (EncodeAsAttribute): Allow nulls here.
6031
6032 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
6033
6034         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
6035         the functionality for testing whether an expression is valid for
6036         an attribute here.  Also handle the case of arrays of elements
6037         being stored. 
6038
6039         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
6040         encoding a linear array into an array of objects that are suitable
6041         to be passed to an CustomAttributeBuilder.
6042
6043         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
6044
6045         * ecore.cs: (FieldExpr): Handle field remapping here.
6046
6047         * iteratators.cs: Pass the instance variable (if the method is an
6048         instance method) to the constructors, so we can access the field
6049         variables on the class.
6050
6051         TODO: Test this with structs.  I think the THIS variable on
6052         structs might have to be a pointer, and not a refenrece
6053
6054 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
6055
6056         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
6057         local variables to fields in a proxy class.
6058
6059         * iterators.cs (PopulateProxy): Rename our internal fields to
6060         <XXX>.  
6061         Create a <THIS> field if we are an instance method, so we can
6062         reference our parent container variables.
6063         (MapVariable): Called back from the EmitContext code to enter a
6064         new variable to field mapping into the proxy class (we just create
6065         a FieldBuilder).
6066
6067         * expression.cs
6068         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
6069         for using the remapped locals to fields.
6070
6071         I placed the code here, because that gives the same semantics to
6072         local variables, and only changes the Emit code.
6073
6074         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
6075         statements inside iterators.
6076         (VariableInfo): Add a FieldBuilder for the cases when we are
6077         remapping local variables to fields in a proxy class
6078
6079         * ecore.cs (SimpleNameResolve): Avoid testing two times for
6080         current_block != null.
6081
6082         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
6083         not cope with strings, as it has been moved to the
6084         TableSwitchEmit.  Fixed bug in switch generation.
6085
6086         * expression.cs (New.DoResolve): Provide more context for the user
6087         when reporting an error.
6088
6089         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
6090         pointers. 
6091
6092         * expression.cs (MemberAccess.DoResolve): When we get a type back,
6093         check the permissions for it.  Note than in a type-resolution
6094         context the check was already present in DeclSpace.ResolveType,
6095         but was missing from the MemberAccess.
6096
6097         (ArrayCreation.CheckIndices): warn if the user has
6098         more nested levels of expressions, but there are no more
6099         dimensions specified.  Avoids crash on bug 41906.
6100
6101 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
6102
6103         * statement.cs (Block): replace Implicit bool, for a generic
6104         flags.   
6105         New flag: `Unchecked'.  This is used during the EmitMeta phase
6106         (which is out-of-line with the regular Resolve/Emit process for a
6107         statement, as this is done ahead of time, but still gets a chance
6108         to call constant resolve).
6109
6110         (Block.Flags): new enum for adding a new flag.
6111
6112         (Block.EmitMeta): track the state of unchecked.
6113
6114         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
6115         to enable constant resolution to work there as well.
6116
6117 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
6118
6119         * typemanager.cs (ienumerable_type): Also look up
6120         System.Collections.IEnumerable. 
6121
6122 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
6123
6124         TODO: Test more than one conditional per method.
6125
6126         * class.cs (Indexer.Define): Report the location where the user is
6127         referencing the unsupported feature.
6128
6129         (MethodData): Overload the use of `conditionals' to
6130         minimize the creation of needless ArrayLists.   This saves roughly
6131         212kb on my machine.
6132
6133         (Method): Implement the new IIteratorContainer interface.
6134         (Method.SetYields): Implement the method by setting the ModFlags
6135         to contain METHOD_YIELDS.
6136
6137         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
6138         which just got set to null.
6139
6140         * iterators.cs: New file.
6141
6142         (Yield, YieldBreak): New statements.
6143
6144         * statement.cs (Return.Resolve): Flag an error if we are used in
6145         an iterator method.
6146
6147         * codegen.cs (InIterator): New flag set if the code is being
6148         compiled in an iterator method.
6149
6150         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
6151         internal modifier, and we just use it to avoid adding extra
6152         fields, as this is seldom used.  
6153
6154         * cs-parser.jay: Add yield_statement (yield and yield break).
6155
6156         * driver.cs: New flag -v2 to turn on version 2 features. 
6157
6158         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
6159         hashtable when v2 is enabled.
6160
6161 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
6162
6163         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
6164         there is already a namespace defined with this name.
6165
6166         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
6167         people upgraded their corlibs.
6168
6169         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
6170         always use fully qualified types, no need to use the compiler
6171         front end.
6172
6173         (TypeManager.IsNamespace): Use binarysearch.
6174
6175         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
6176         AddDelegate): I did not quite use the new IsValid API properly: I
6177         have to pass the short-name and the fullname.  I was passing only
6178         the basename instead of the fullname sometimes. 
6179
6180         (TypeContainer.DefineType): call NamespaceClash.
6181
6182         * interface.cs (Interface.DefineType): use NamespaceClash before
6183         defining the type.
6184
6185         * delegate.cs (Delegate.DefineType): use NamespaceClash before
6186         defining the type.
6187
6188         * enum.cs: (Enum.DefineType): use NamespaceClash before
6189         defining the type.
6190
6191         * typemanager.cs (: 3-line patch that gives us some tasty 11%
6192         speed increase.  First, use the negative_hits cache when we get a
6193         negative.  Second, add the type with its full original name
6194         instead of the new . and + encoded name (reflection uses + to
6195         separate type from a nested type).  Use LookupTypeReflection
6196         directly which bypasses the type->name hashtable (that we already
6197         know does not contain the type.
6198
6199         * decl.cs (DeclSpace.ResolveTypeExpr): track the
6200         location/container type. 
6201
6202         * driver.cs: When passing utf8, use directly the UTF8Encoding.
6203
6204 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
6205
6206         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
6207
6208         * delegate.cs (NewDelegate.Resolve): Test whether an instance
6209         method is being referenced in the method group from a static
6210         context, and report error 120 if so.
6211
6212         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
6213         Error118. 
6214
6215         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
6216         is created, we create the A namespace).
6217
6218         * cs-parser.jay: A namespace also introduces a DeclarationFound.
6219         Fixes #41591
6220
6221 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
6222
6223         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
6224         invocation to ModuleBuilder.GetType with the same values will
6225         return a new type instance, so we need to cache its return
6226         values. 
6227
6228         * expression.cs (Binary.ResolveOperator): Only allow the compare
6229         operators on enums if they are of the same type.
6230
6231         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
6232         types of ValueType on their own case.  Before we were giving them
6233         the same treatment as objects.
6234
6235         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
6236         fullname.  Short name is used to compare against container name.
6237         Fullname is used to check against defined namespace names.
6238
6239         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
6240         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
6241
6242         (Method.CheckBase): Call parent.
6243         (MemberBase.CheckBase): Check for protected members on sealed
6244         classes.
6245         (PropertyBase.CheckBase): Call parent.
6246         (Field.Define): Call parent.
6247
6248         * report.cs: Negative error codes are now mapped to 8000 - code,
6249         so that the display is render more nicely.
6250
6251         * typemanager.cs: Do not use try/catch, instead report a regular
6252         error. 
6253
6254         (GetPointerType, GetReferenceType): These methods provide
6255         mechanisms to obtain the T* and T& from a T.  We had the code
6256         previously scattered around the code base, and it also used
6257         TypeManager.LookupType that would go through plenty of caches.
6258         This one goes directly to the type source.
6259
6260         In some places we did the Type.GetType followed by
6261         ModuleBuilder.GetType, but not in others, so this unifies the
6262         processing as well.
6263
6264         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
6265         statements now that we have namespace information.
6266
6267         * typemanager.cs (IsNamespace): New method, returns whether the
6268         string presented is a namespace or not.
6269
6270         (ComputeNamespaces): New public entry point, computes the list of
6271         available namespaces, using the GetNamespaces API call in Mono, or
6272         the slower version in MS.NET.   
6273
6274         Now before we start the semantic analysis phase, we have a
6275         complete list of namespaces including everything that the user has
6276         provided.
6277
6278         Deleted old code to cache namespaces in .nsc files.
6279
6280 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
6281
6282         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
6283         class/struct location definition Location for the implicit
6284         constructor location.
6285
6286         (Operator.Define): Use the location of the operator for the
6287         implicit Method definition.
6288
6289         (Constructor.Emit): use the constructor location for the implicit
6290         base initializer constructor.
6291
6292         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
6293         and the Expression class now contains two new methods:
6294
6295         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
6296         isolate type lookup from the rest of the resolution process.
6297
6298         Since we use Expressions to hold type definitions due to the way
6299         we parse the input we have historically overloaded Resolve to
6300         perform the Type lookups if a special flag is passed.  Now this is
6301         eliminated and two methods take their place. 
6302
6303         The differences in the two methods between xStep and xTerminal is
6304         that xStep is involved in our current lookup system that uses
6305         SimpleNames to compose a name, while xTerminal is used just to
6306         catch the case where the simplename lookup failed.
6307
6308 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
6309
6310         * expression.cs (ResolveMemberAccess): Remove redundant code.
6311         TypeExpr expressions are always born fully resolved.
6312
6313         * interface.cs (PopulateMethod): Do not lookup the types twice.
6314         We were doing it once during SemanticAnalysis and once during
6315         PopulateMethod.
6316
6317         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
6318         in local variable type definitions, were being returned as a
6319         SimpleName (we decomposed everything into a string), that is
6320         because primary_expression was being used instead of a type in the
6321         grammar (reduce/reduce conflicts).
6322
6323         The part that was wrong is that we converted the expression into a
6324         string (an oversimplification in one hand, compounded with primary
6325         expressions doing string concatenation).
6326
6327         So things like:
6328
6329         A.B.C [] x;
6330
6331         Would return "A.B.C[]" as a SimpleName.  This stopped things like
6332         using clauses from working on this particular context.  And a type
6333         was being matched directly against "A.B.C[]".
6334
6335         We now use the correct approach, and allow for ComposedCast to be
6336         part of the unary expression.  So the "A.B.C []" become a composed
6337         cast of "A.B.C" (as a nested group of MemberAccess with a
6338         SimpleName at the end) plus the rank composition "[]". 
6339
6340         Also fixes 35567
6341
6342 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
6343
6344         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
6345         for the access level checking.
6346
6347         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
6348         `TypeContainer container', because I kept getting confused when I
6349         was debugging this code.
6350
6351         * expression.cs (Indexers): Instead of tracking getters/setters,
6352         we now track them in parallel.  We create one arraylist less, but
6353         most importantly it is possible now for the LValue code to find a
6354         matching get for a set.
6355
6356         (IndexerAccess.DoResolveLValue): Update the code.
6357         GetIndexersForType has been modified already to extract all the
6358         indexers from a type.  The code assumed it did not.
6359
6360         Also make the code set the correct return type for the indexer.
6361         This was fixed a long time ago for properties, but was missing for
6362         indexers.  It used to be void_type.
6363
6364         (Binary.Emit): Test first for doubles instead of
6365         floats, as they are more common.
6366
6367         (Binary.EmitBranchable): Use the .un version of the branch opcodes
6368         when dealing with floats and the <=, >= operators.  This fixes bug
6369         #39314 
6370
6371         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
6372         to load the array value by emitting a load on the foreach variable
6373         type.  This was incorrect.  
6374
6375         We now emit the code to load an element using the the array
6376         variable type, and then we emit the conversion operator.
6377
6378         Fixed #40176
6379
6380 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
6381
6382         * attribute.cs: Avoid allocation of ArrayLists in the common case.
6383
6384 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
6385
6386         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
6387         test for protection before we test for signatures. 
6388
6389         (MethodSignature.ToString): implement.
6390
6391         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
6392         to the case where we reduced into a LongConstant.
6393
6394         * decl.cs (CheckAccessLevel): If the type is an array, we can not
6395         depend on whether the information is acurrate, because the
6396         Microsoft runtime will always claim that the array type is public,
6397         regardless of the real state.
6398
6399         If the type is a pointer, another problem happens: the type is
6400         reported as non-public in Microsoft.  
6401
6402         In both cases we have to call CheckAccessLevel recursively with
6403         the underlying type as the argument to be tested.
6404
6405 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
6406
6407         * assign.cs (Assign.Emit): If we are dealing with a compound
6408         assignment expression, we should use the code path that stores the
6409         intermediate result in a temporary value.  This fixes #40903.
6410
6411         *expression.cs (Indirection.ToString): Provide ToString method for
6412         debugging. 
6413
6414 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
6415
6416         * class.cs: Null out fields holding references to Block objects so
6417         they can be garbage collected.
6418
6419         * expression.cs (OverloadResolve): Remove unused local.
6420
6421 2003-04-07  Martin Baulig  <martin@ximian.com>
6422
6423         * codegen.cs (EmitContext.CurrentFile): New public field.
6424         (EmitContext.Mark): Use the CurrentFile to check whether the
6425         location is in the correct file.
6426         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
6427
6428 2003-04-07  Martin Baulig  <martin@ximian.com>
6429
6430         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
6431
6432         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
6433         location.  [FIXME: The location argument which gets passed to this
6434         method is sometimes wrong!]
6435
6436 2003-04-07  Nick Drochak <ndrochak@gol.com>
6437
6438         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
6439
6440 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
6441
6442         * expression.cs (Indirection.EmitAssign): We were using the
6443         temporary, but returning immediately instead of continuing the
6444         EmitAssing flow.
6445
6446 2003-04-06  Martin Baulig  <martin@ximian.com>
6447
6448         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
6449         if it's a nested child, but also deriving from the outer class.
6450         See test 190.cs.
6451
6452         * typemanager.cs (IsNestedChildOf): Make this work if it's a
6453         nested child, but also deriving from the outer class.  See
6454         test-190.cs.
6455         (FilterWithClosure): We may access private members of the outer
6456         class if we're a nested child and deriving from the outer class.
6457         (RealMemberLookup): Only set `closure_private_ok' if the
6458         `original_bf' contained BindingFlags.NonPublic.
6459
6460 2003-04-05  Martin Baulig  <martin@ximian.com>
6461
6462         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
6463
6464 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
6465
6466         * class.cs (Event.Define): Do not allow abstract events to have
6467         initializers. 
6468
6469 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
6470
6471         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
6472         block in event declarations.
6473
6474         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
6475         value type, get its address.
6476
6477         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
6478         leaving a class on the stack instead of a boolean value (int
6479         0/1).  Change the code so we compare against null, and then the
6480         result against zero.
6481
6482         * class.cs (TypeContainer.GetClassBases): We were checking for the
6483         parent class being sealed too late.
6484
6485         * expression.cs (Binary.Emit): For <= and >= when dealing with
6486         floating point values, use cgt.un and clt.un instead of cgt and
6487         clt alone.
6488
6489 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
6490
6491         * statement.cs: Apply the same optimization as MS: skip the 
6492         GetEnumerator returning an IEnumerator, and use the one returning a 
6493         CharEnumerator instead. This allows us to avoid the try-finally block 
6494         and the boxing.
6495
6496 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
6497
6498         * cs-parser.jay: Attributes cannot be applied to
6499                          namespaces. Fixes #40473
6500
6501 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6502
6503         * class.cs:
6504         (Add*): check if the name is valid using the full name for constants,
6505         fields, properties and events.
6506
6507 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
6508
6509         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
6510         char constants to be part of the enumeration.
6511
6512         * expression.cs (Conditional.DoResolve): Add support for operator
6513         true. Implements the missing functionality from 14.12
6514
6515         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
6516         operator true/false as required by the spec.
6517
6518         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
6519         implicit conversion to boolean.
6520
6521         * statement.cs (Statement.ResolveBoolean): A boolean expression is
6522         also one where the type implements `operator true'. 
6523
6524         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
6525         get an expression that will invoke operator true based on an
6526         expression.  
6527
6528         (GetConversionOperators): Removed the hack that called op_True
6529         here.  
6530
6531         (Expression.ResolveBoolean): Move this from Statement.
6532
6533 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
6534
6535         * ecore.cs (FieldExpr): do not allow initialization of initonly
6536         fields on derived classes
6537
6538 2003-03-13  Martin Baulig  <martin@ximian.com>
6539
6540         * statement.cs (Block.Emit): Call ig.BeginScope() and
6541         ig.EndScope() when compiling with debugging info; call
6542         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
6543
6544 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
6545
6546         * expression.cs (Indexers): Do not construct immediately, allow
6547         for new members to be appended as we go.  Fixes 38143
6548
6549 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6550
6551         * expression.cs: save/restore context when resolving an unchecked
6552         expression.
6553
6554 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
6555
6556         * cfold.cs: Catch division by zero in modulus operator during
6557         constant folding.
6558
6559 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
6560
6561         * interface.cs (Interface.DefineMembers): Avoid defining members
6562         twice. 
6563
6564 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
6565
6566         * driver.cs: handle the +/- options for -noconfig
6567
6568         * statement.cs (Unckeched.Resolve): Also track the state of
6569         unchecked in the Resolve phase.
6570
6571 2003-02-27  Martin Baulig  <martin@ximian.com>
6572
6573         * ecore.cs (Expression.MemberLookup): Don't create a
6574         MethodGroupExpr for something which is not a method.  Fixes #38291.
6575
6576 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * class.cs (MemberBase.CheckParameters): Also check that the type
6579         is unmanaged if it is a pointer.
6580
6581         * expression.cs (SizeOf.Resolve): Add location information.
6582
6583         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
6584         a managed type is declared.
6585
6586         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
6587         parameter modifiers as well.  Fixes bug 38606
6588
6589         * class.cs: Very sad.  Am backing out the speed up changes
6590         introduced by the ArrayList -> Array in the TypeContainer, as they
6591         were not actually that much faster, and introduced a bug (no error
6592         reports on duplicated methods).
6593
6594         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
6595         source first, this will guarantee that we have a valid expression
6596         before calling in lower levels functions that will require a
6597         resolved object.  Then use this original_source in the
6598         target.ResolveLValue instead of the original source that was
6599         passed to us.
6600
6601         Another change.  Use target.Resolve instead of LValueResolve.
6602         Although we are resolving for LValues, we will let the Assign code
6603         take care of that (it will be called again from Resolve).  This
6604         basically allows code like this:
6605
6606         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
6607         class Y { void A (X x) { x [0] += o; }
6608
6609         The problem was that the indexer was trying to resolve for
6610         set_Item (idx, object o) and never finding one.  The real set_Item
6611         was set_Item (idx, X).  By delaying the process we get the right
6612         semantics. 
6613
6614         Fixes bug 36505
6615
6616 2003-02-23  Martin Baulig  <martin@ximian.com>
6617
6618         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
6619         while calling DoEmit ().
6620
6621         * codegen.cs (EmitContext.Mark): Don't mark locations in other
6622         source files; if you use the #line directive inside a method, the
6623         compiler stops emitting line numbers for the debugger until it
6624         reaches the end of the method or another #line directive which
6625         restores the original file.
6626
6627 2003-02-23  Martin Baulig  <martin@ximian.com>
6628
6629         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
6630
6631 2003-02-23  Martin Baulig  <martin@ximian.com>
6632
6633         * statement.cs (Block.AddChildVariableNames): We need to call this
6634         recursively, not just for our immediate children.
6635
6636 2003-02-23  Martin Baulig  <martin@ximian.com>
6637
6638         * class.cs (Event.Define): Always make the field private, like csc does.
6639
6640         * typemanager.cs (TypeManager.RealMemberLookup): Make events
6641         actually work, fixes bug #37521.
6642
6643 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
6644
6645         * delegate.cs: When creating the various temporary "Parameters"
6646         classes, make sure that we call the ComputeAndDefineParameterTypes
6647         on those new parameters (just like we do with the formal ones), to
6648         allow them to be resolved in the context of the DeclSpace.
6649
6650         This fixes the bug that Dick observed in Bugzilla #38530.
6651
6652 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * expression.cs (ResolveMemberAccess): When resolving a constant,
6655         do not attempt to pull a constant if the value was not able to
6656         generate a valid constant.
6657
6658         * const.cs (LookupConstantValue): Do not report more errors than required.
6659
6660 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6661
6662         * expression.cs: fixes bug #38328.
6663
6664 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6665
6666         * class.cs: Changed all the various members that can be part of a
6667         class from being an ArrayList to be an Array of the right type.
6668         During the DefineType type_list, interface_list, delegate_list and
6669         enum_list are turned into types, interfaces, delegates and enums
6670         arrays.  
6671
6672         And during the member population, indexer_list, event_list,
6673         constant_list, field_list, instance_constructor_list, method_list,
6674         operator_list and property_list are turned into their real arrays.
6675
6676         Although we could probably perform this operation earlier, for
6677         good error reporting we need to keep the lists and remove the
6678         lists for longer than required.
6679
6680         This optimization was triggered by Paolo profiling the compiler
6681         speed on the output of `gen-sample-program.pl' perl script. 
6682
6683         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
6684         not crash in methods like MemberLookupFailed that use this field.  
6685
6686         This problem arises when the compiler fails to resolve a type
6687         during interface type definition for example.
6688
6689 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6690
6691         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
6692         inherit from System.Object, so we have to stop at null, not only
6693         when reaching System.Object.
6694
6695 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
6696
6697         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
6698         DeclaredOnly because the parent indexer might have had a different
6699         name, but did not loop until the top of the hierarchy was reached.
6700
6701         The problem this one fixes is 35492: when a class implemented an
6702         indexer from an interface, we were getting the interface method
6703         (which was abstract) and we were flagging an error (can not invoke
6704         abstract method).
6705
6706         This also keeps bug 33089 functioning, and test-148 functioning.
6707
6708         * typemanager.cs (IsSpecialMethod): The correct way of figuring
6709         out if a method is special is to see if it is declared in a
6710         property or event, or whether it is one of the predefined operator
6711         names.   This should fix correctly #36804.
6712
6713 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6714
6715         The goal here is to remove the dependency on EmptyCast.Peel ().
6716         Killing it completely.
6717
6718         The problem is that currently in a number of places where
6719         constants are expected, we have to "probe" for an EmptyCast, and
6720         Peel, which is not the correct thing to do, as this will be
6721         repetitive and will likely lead to errors. 
6722
6723         The idea is to remove any EmptyCasts that are used in casts that
6724         can be reduced to constants, so we only have to cope with
6725         constants. 
6726
6727         This bug hunt was triggered by Bug 37363 and the desire to remove
6728         the duplicate pattern where we were "peeling" emptycasts to check
6729         whether they were constants.  Now constants will always be
6730         constants.
6731
6732         * ecore.cs: Use an enumconstant here instead of wrapping with
6733         EmptyCast.  
6734
6735         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6736         throwing me off.  By handling this we can get rid of a few hacks.
6737
6738         * statement.cs (Switch): Removed Peel() code.
6739
6740 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6741
6742         * class.cs: Location information for error 508
6743
6744         * expression.cs (New.DoResolve): Add a guard against double
6745         resolution of an expression.  
6746
6747         The New DoResolve might be called twice when initializing field
6748         expressions (see EmitFieldInitializers, the call to
6749         GetInitializerExpression will perform a resolve on the expression,
6750         and later the assign will trigger another resolution
6751
6752         This leads to bugs (#37014)
6753
6754         * delegate.cs: The signature for EndInvoke should contain any ref
6755         or out parameters as well.  We were not doing this in the past. 
6756
6757         * class.cs (Field.Define): Do not overwrite the type definition
6758         inside the `volatile' group.  Turns out that volatile enumerations
6759         were changing the type here to perform a validity test, which
6760         broke conversions. 
6761
6762 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6763
6764         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6765         and structs, we do not want to load the instance variable
6766
6767         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6768         enum_type has to be handled like an object reference (implicit
6769         conversions exists from this to object), but the regular IsClass
6770         and IsValueType tests will never return true for this one.
6771
6772         Also we use TypeManager.IsValueType instead of type.IsValueType,
6773         just for consistency with the rest of the code (this is only
6774         needed if we ever use the construct exposed by test-180.cs inside
6775         corlib, which we dont today).
6776
6777 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6778
6779         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6780         just InternalCall.
6781
6782 2003-02-09  Martin Baulig  <martin@ximian.com>
6783
6784         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6785         (Namespace.DefineNamespaces): New static public method; this is
6786         called when we're compiling with debugging to add all namespaces
6787         to the symbol file.
6788
6789         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6790         pass it to the Namespace's .ctor.
6791
6792         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6793         and MethodBase arguments; pass the namespace ID to the symwriter;
6794         pass the MethodBase instead of the token to the symwriter.
6795         (SymbolWriter.DefineNamespace): New method to add a namespace to
6796         the symbol file.
6797
6798 2003-02-09  Martin Baulig  <martin@ximian.com>
6799
6800         * symbolwriter.cs: New file.  This is a wrapper around
6801         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6802         methods here in near future.
6803
6804 2003-02-09  Martin Baulig  <martin@ximian.com>
6805
6806         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6807         ILGenerator.MarkSequencePoint() which are actually used by the
6808         symbol writer.
6809
6810 2003-02-09  Martin Baulig  <martin@ximian.com>
6811
6812         * location.cs (SourceFile): New public sealed class.  This
6813         contains the name and an index which is used in the location's token.
6814         (Location): Reserve an appropriate number of bits in the token for
6815         the source file instead of walking over that list, this gives us a
6816         really huge performance improvement when compiling with debugging.
6817
6818         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6819         `SourceFile' argument instead of a string.
6820         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6821         but don't parse/tokenize here, we need to generate the list of all
6822         source files before we do that.
6823         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6824         the files.
6825
6826         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6827         instead of a string.
6828
6829         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6830         of a string.
6831
6832 2003-02-09  Martin Baulig  <martin@ximian.com>
6833
6834         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6835         filename on `#line default'.
6836
6837 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6838
6839         * statement.cs: don't clear the pinned var when the fixed statement
6840         returns from the method (fixes bug#37752).
6841
6842 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6843
6844         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6845         to IsValueType.
6846
6847 2003-02-07  Martin Baulig  <martin@ximian.com>
6848
6849         * driver.cs: Removed the `--debug-args' command line argument.
6850
6851         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6852         automatically by the AsssemblyBuilder.
6853         (CodeGen.InitializeSymbolWriter): We don't need to call any
6854         initialization function on the symbol writer anymore.  This method
6855         doesn't take any arguments.
6856
6857 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6858
6859         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6860         from referenced assemblies as well.
6861
6862 2003-02-02  Martin Baulig  <martin@ximian.com>
6863
6864         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6865
6866 2003-02-02  Martin Baulig  <martin@ximian.com>
6867
6868         * class.cs (Constructor.Emit): Open the symbol writer before
6869         emitting the constructor initializer.
6870         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6871         single-stepping through constructor initializers.
6872
6873 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * class.cs: Handle error 549: do not allow virtual methods in
6876         sealed classes. 
6877
6878 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6879
6880         * decl.cs: Check access levels when resolving types
6881
6882 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6883
6884         * statement.cs: Add parameters and locals set in catch blocks that might 
6885         return to set vector
6886
6887 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6888
6889         * class.cs (Operator): Set the SpecialName flags for operators.
6890
6891         * expression.cs (Invocation.DoResolve): Only block calls to
6892         accessors and operators on SpecialName methods.
6893
6894         (Cast.TryReduce): Handle conversions from char constants.
6895
6896
6897 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
6898
6899         * statement.cs: small memory and time optimization in FlowBranching.
6900
6901 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
6902
6903         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
6904         problem that the last fix but in the other sid (Set).
6905
6906         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
6907         access when there is no indexer in the hierarchy.
6908
6909 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
6910
6911         * class.cs: Combine some if statements.
6912
6913 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6914
6915         * driver.cs: fixed bug #37187.
6916
6917 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
6918
6919         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
6920         any indexer, it's needed to build a list with all the indexers in the
6921         hierarchy (AllGetters), else we have problems. Fixes #35653.
6922
6923 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
6924
6925         * class.cs (MethodData.Define): It is wrong for an interface
6926         implementation to be static in both cases: explicit and implicit.
6927         We were only handling this in one case.
6928
6929         Improve the if situation there to not have negations.
6930
6931         * class.cs (Field.Define): Turns out that we do not need to check
6932         the unsafe bit on field definition, only on usage.  Remove the test.
6933
6934 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6935
6936         * driver.cs: use assembly.Location instead of Codebase (the latest
6937         patch made mcs fail when using MS assemblies).
6938
6939 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
6940
6941         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
6942         get the path to *corlib.dll.
6943
6944 2003-01-21  Nick Drochak <ndrochak@gol.com>
6945
6946         * cs-tokenizer.cs:
6947         * pending.cs:
6948         * typemanager.cs: Remove compiler warnings
6949
6950 2003-01-20  Duncan Mak  <duncan@ximian.com>
6951
6952         * AssemblyInfo.cs: Bump the version number to 0.19.
6953
6954 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6955
6956         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
6957
6958 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
6959
6960         * class.cs (Constructor::Emit): Emit debugging info for constructors.
6961
6962 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
6963
6964         * cs-parser.jay: Small fix: we were not comparing the constructor
6965         name correctly.   Thanks to Zoltan for the initial pointer.
6966
6967 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
6968
6969         * cs-tokenizer.cs: Set file name when specified with #line
6970
6971 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
6972
6973         * cs-parser.jay: Only perform the constructor checks here if we
6974         are named like the class;  This will help provider a better
6975         error.  The constructor path is taken when a type definition is
6976         not found, but most likely the user forgot to add the type, so
6977         report that rather than the constructor error.
6978
6979 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
6980
6981         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
6982         allocations.
6983
6984 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6985
6986         * cs-parser.jay: Add cleanup call.
6987
6988 2003-01-13  Duncan Mak  <duncan@ximian.com>
6989
6990         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
6991         consistent with other methods.
6992
6993 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6994
6995         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
6996
6997 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
6998
6999         * attribute.cs: only set GuidAttr to true when we have a
7000         GuidAttribute.
7001
7002 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7003
7004         * ecore.cs:
7005         * expression.cs:
7006         * typemanager.cs: fixes to allow mcs compile corlib with the new
7007         Type.IsSubclassOf fix.
7008
7009 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
7010
7011         * expression.cs (LocalVariableReference.DoResolve): Classify a
7012         constant as a value, not as a variable.   Also, set the type for
7013         the variable.
7014
7015         * cs-parser.jay (fixed_statement): take a type instead of a
7016         pointer_type, so we can produce a better error message later.
7017
7018         * statement.cs (Fixed.Resolve): Flag types that are not pointers
7019         as an error.  
7020
7021         (For.DoEmit): Make inifinite loops have a
7022         non-conditional branch back.
7023
7024         (Fixed.DoEmit): First populate the pinned variables, then emit the
7025         statement, then clear the variables.  Before I was emitting the
7026         code once for each fixed piece.
7027
7028
7029 2003-01-08  Martin Baulig  <martin@ximian.com>
7030
7031         * statement.cs (FlowBranching.MergeChild): A break in a
7032         SWITCH_SECTION does not leave a loop.  Fixes #36155.
7033
7034 2003-01-08  Martin Baulig  <martin@ximian.com>
7035
7036         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
7037         lives in the same number space than `param_map'.  Fixes #36154.
7038
7039 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
7040
7041         * cs-parser.jay (constructor_declaration): Set the
7042         Constructor.ModFlags before probing for it.  This makes the
7043         compiler report 514, 515 and 132 (the code was there, but got
7044         broken). 
7045
7046         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
7047         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
7048         (GotoCase.Resolve): Set `Returns' to ALWAYS.
7049
7050 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
7051
7052         * enum.cs: create the enum static fields using the enum type.
7053
7054 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
7055
7056         * class.cs: don't try to create the ParamBuilder for the return
7057         type if it's not needed (and handle it breaking for the ms runtime
7058         anyway).
7059
7060 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
7061
7062         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
7063
7064 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
7065
7066         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
7067         the command.   This showed up while compiling the JANET source
7068         code, which used \r as its only newline separator.
7069
7070 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
7071
7072         * class.cs (Method.Define): If we are an operator (because it
7073         reuses our code), then set the SpecialName and HideBySig.  #36128
7074
7075 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
7076
7077         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
7078         exception, report error 120 `object reference required'.
7079
7080         * driver.cs: Add --pause option, used during to measure the size
7081         of the process as it goes with --timestamp.
7082
7083         * expression.cs (Invocation.DoResolve): Do not allow methods with
7084         SpecialName to be invoked.
7085
7086 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
7087
7088         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
7089         number before adding it.
7090
7091 2002-12-21  Ravi Pratap  <ravi@ximian.com>
7092
7093         * ecore.cs (StandardImplicitConversion): When in an unsafe
7094         context, we allow conversion between void * to any other pointer
7095         type. This fixes bug #35973.
7096
7097 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
7098
7099         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
7100         is not thrown when extensionless outputs are used 
7101
7102 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7103
7104         * rootcontext.cs: fixed compilation of corlib.
7105
7106 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
7107
7108         * attribute.cs (Attributes.Contains): Add new method.
7109
7110         * class.cs (MethodCore.LabelParameters): if the parameter is an
7111         `out' parameter, check that no attribute `[In]' has been passed.
7112
7113         * enum.cs: Handle the `value__' name in an enumeration.
7114
7115 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
7116
7117         * decl.cs: Added special case to allow overrides on "protected
7118         internal" methods
7119
7120 2002-12-18  Ravi Pratap  <ravi@ximian.com>
7121
7122         * attribute.cs (Attributes.AddAttributeSection): Rename to this
7123         since it makes much more sense.
7124
7125         (Attributes.ctor): Don't require a Location parameter.
7126
7127         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
7128
7129         * attribute.cs (ApplyAttributes): Remove extra Location parameters
7130         since we already have that information per attribute.
7131
7132         * everywhere : make appropriate changes.
7133
7134         * class.cs (LabelParameters): Write the code which actually
7135         applies attributes to the return type. We can't do this on the MS
7136         .NET runtime so we flag a warning in the case an exception is
7137         thrown.
7138
7139 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
7140
7141         * const.cs: Handle implicit null conversions here too.
7142
7143 2002-12-17  Ravi Pratap  <ravi@ximian.com>
7144
7145         * class.cs (MethodCore.LabelParameters): Remove the extra
7146         Type [] parameter since it is completely unnecessary. Instead
7147         pass in the method's attributes so that we can extract
7148         the "return" attribute.
7149
7150 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
7151
7152         * cs-parser.jay (parse): Use Report.Error to flag errors instead
7153         of ignoring it and letting the compile continue.
7154
7155         * typemanager.cs (ChangeType): use an extra argument to return an
7156         error condition instead of throwing an exception.
7157
7158 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
7159
7160         * expression.cs (Unary.TryReduce): mimic the code for the regular
7161         code path.  Perform an implicit cast in the cases where we can
7162         implicitly convert to one of the integral types, and then reduce
7163         based on that constant.   This fixes bug #35483.
7164
7165 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7166
7167         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
7168
7169 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7170
7171         * namespace.cs: fixed bug #35489.
7172
7173 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
7174
7175         * class.cs: Remove some dead code.
7176
7177         * cs-parser.jay: Estimate the number of methods needed
7178         (RootContext.MethodCount);
7179
7180         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
7181         numbers instead of StringBuilders.
7182
7183         * support.cs (PtrHashtable): Add constructor with initial size;
7184         We can now reduce reallocations of the method table.
7185
7186 2002-12-10  Ravi Pratap  <ravi@ximian.com>
7187
7188         * attribute.cs (ApplyAttributes): Keep track of the emitted
7189         attributes on a per-target basis. This fixes bug #35413.
7190
7191 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
7192
7193         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
7194         default to the Windows 1252 encoding.
7195
7196         (UnixParseOption): Support version, thanks to Alp for the missing
7197         pointer. 
7198
7199         * AssemblyInfo.cs: Add nice assembly information.
7200
7201         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
7202         (bug 35169).
7203
7204         * cs-parser.jay: Allow a trailing comma before the close bracked
7205         in the attribute_section production.
7206
7207         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
7208         address of the instance was being taken, I will take this out,
7209         because we take the address of the object immediately here.
7210
7211 2002-12-09  Ravi Pratap  <ravi@ximian.com>
7212
7213         * typemanager.cs (AreMultipleAllowed): Take care of the most
7214         obvious case where attribute type is not in the current assembly -
7215         stupid me ;-)
7216
7217 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
7218
7219         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
7220         definitions, instead of doing that afterwards.  
7221
7222         Also we use a nice little hack, depending on the constructor, we
7223         know if we are a "composed" name or a simple name.  Hence, we
7224         avoid the IndexOf test, and we avoid 
7225
7226         * codegen.cs: Add code to assist in a bug reporter to track down
7227         the source of a compiler crash. 
7228
7229 2002-12-07  Ravi Pratap  <ravi@ximian.com>
7230
7231         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
7232         types have been emitted for a given element and flag an error
7233         if something which does not have AllowMultiple set is used more
7234         than once.
7235
7236         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
7237         attribute types and their corresponding AllowMultiple properties
7238
7239         (AreMultipleAllowed): Check the property for a given type.
7240
7241         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
7242         property in the case we have a TypeContainer.
7243
7244         (Attributes.AddAttribute): Detect duplicates and just skip on
7245         adding them. This trivial fix catches a pretty gross error in our
7246         attribute emission - global attributes were being emitted twice!
7247
7248         Bugzilla bug #33187 is now fixed.
7249
7250 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
7251
7252         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
7253         instead of pp_and).
7254
7255         * expression.cs (Binary.ResolveOperator): I can only use the
7256         Concat (string, string, string) and Concat (string, string,
7257         string, string) if the child is actually a concatenation of
7258         strings. 
7259
7260 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
7263         context where we need a 2-character lookahead.
7264
7265         * pending.cs (PendingImplementation): Rework so we can keep track
7266         of interface types all the time, and flag those which were
7267         implemented by parents as optional.
7268
7269 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
7270
7271         * expression.cs (Binary.ResolveOperator): Use
7272         String.Concat(string,string,string) or
7273         String.Concat(string,string,string,string) when possible. 
7274
7275         * typemanager: More helper methods.
7276
7277
7278 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
7279
7280         * pending.cs: remove the bogus return from GetMissingInterfaces()
7281         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
7282
7283 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7284
7285         * namespace.cs: avoid duplicated 'using xxx' being added to
7286         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
7287         when we get more than one 'using' statement for the same namespace.
7288         Report a CS0105 warning for it.
7289
7290 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
7291
7292         * cs-tokenizer.cs (consume_identifier): use read directly, instead
7293         of calling getChar/putback, uses internal knowledge of it.    
7294
7295         (xtoken): Reorder tokenizer so most common patterns are checked
7296         first.  This reduces the compilation time in another 5% (from 8.11s
7297         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
7298
7299         The parsing time is 22% of the compilation in mcs, and from that
7300         64% is spent on the tokenization process.  
7301
7302         I tried using a binary search for keywords, but this is slower
7303         than the hashtable.  Another option would be to do a couple of
7304         things:
7305
7306                 * Not use a StringBuilder, instead use an array of chars,
7307                   with a set value.  Notice that this way we could catch
7308                   the 645 error without having to do it *afterwards*.
7309
7310                 * We could write a hand-parser to avoid the hashtable
7311                   compares altogether.
7312
7313         The identifier consumption process takes 37% of the tokenization
7314         time.  Another 15% is spent on is_number.  56% of the time spent
7315         on is_number is spent on Int64.Parse:
7316
7317                 * We could probably choose based on the string length to
7318                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
7319                   computations. 
7320
7321         Another 3% is spend on wrapping `xtoken' in the `token' function.
7322
7323         Handle 0xa0 as whitespace (#34752)
7324
7325 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
7326
7327         * typemanager.cs (IsCLRType): New routine to tell whether a type
7328         is one of the builtin types.  
7329
7330         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
7331         typecode in more places instead of doing pointer comparissions.
7332         We could leverage some knowledge about the way the typecodes are
7333         laid out.
7334
7335         New code to cache namespaces in assemblies, it is currently not
7336         invoked, to be used soon.
7337
7338         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
7339
7340         * expression.cs (Binary.ResolveOperator): specially handle
7341         strings, and do not perform user-defined operator overloading for
7342         built-in types.
7343
7344 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
7345
7346         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
7347         internalcall as it is a pretty simple operation;  Avoid whenever
7348         possible to call Char.IsLetter.
7349
7350         (consume_identifier): Cut by half the number of
7351         hashtable calls by merging the is_keyword and GetKeyword behavior.
7352
7353         Do not short-circuit, because if we do, we
7354         report errors (ie, #if false && true would produce an invalid
7355         directive error);
7356
7357
7358 2002-11-24  Martin Baulig  <martin@ximian.com>
7359
7360         * expression.cs (Cast.TryReduce): If we're in checked syntax,
7361         check constant ranges and report a CS0221.  Fixes #33186.
7362
7363 2002-11-24  Martin Baulig  <martin@ximian.com>
7364
7365         * cs-parser.jay: Make this work for uninitialized variable
7366         declarations in the `for' initializer.  Fixes #32416.
7367
7368 2002-11-24  Martin Baulig  <martin@ximian.com>
7369
7370         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
7371         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
7372
7373 2002-11-24  Martin Baulig  <martin@ximian.com>
7374
7375         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
7376         argument; if true, we also check for user-defined conversions.
7377         This is only needed if both arguments are of a user-defined type.
7378         Fixes #30443, added test-175.cs.
7379         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
7380
7381         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
7382
7383 2002-11-24  Martin Baulig  <martin@ximian.com>
7384
7385         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
7386         function to get the store opcode.
7387         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
7388         only emit the Ldelema if the store opcode is Stobj.  You must run
7389         both test-34 and test-167 to test this.  Fixes #34529.
7390
7391 2002-11-23  Martin Baulig  <martin@ximian.com>
7392
7393         * ecore.cs (Expression.MemberLookup): Added additional
7394         `qualifier_type' argument which is used when we're being called
7395         from MemberAccess.DoResolve() and null if we're called from a
7396         SimpleName lookup.
7397         (Expression.MemberLookupFailed): New method to report errors; this
7398         does the CS1540 check and reports the correct error message.
7399
7400         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
7401         argument for the CS1540 check and redone the way how we're dealing
7402         with private members.  See the comment in the source code for details.
7403         (FilterWithClosure): Reverted this back to revision 1.197; renamed
7404         `closure_start_type' to `closure_qualifier_type' and check whether
7405         it's not null.  It was not this filter being broken, it was just
7406         being called with the wrong arguments.
7407
7408         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
7409         and pass it the correct `qualifier_type'; this also does the error
7410         handling for us.
7411
7412 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
7413
7414         * expression.cs (Invocation.EmitParams): If the we are dealing
7415         with a non-built-in value type, load its address as well.
7416
7417         (ArrayCreation): Use a a pretty constant instead
7418         of the hardcoded value 2.   Use 6 instead of 2 for the number of
7419         static initializers.  
7420
7421         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
7422         because they are not really value types, just glorified integers. 
7423
7424         * driver.cs: Do not append .exe, the CSC compiler does not do it.
7425
7426         * ecore.cs: Remove redundant code for enumerations, make them use
7427         the same code path as everything else, fixes the casting issue
7428         with enumerations in Windows.Forms.
7429
7430         * attribute.cs: Do only cast to string if it is a string, the
7431         validation happens later.
7432
7433         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
7434         people upgrade their corlibs.
7435
7436         * ecore.cs: Oops, enumerations were not following the entire code path
7437
7438 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
7439
7440         * typemanager.cs (FilterWithClosure): Commented out the test for
7441         1540 in typemanager.cs, as it has problems when accessing
7442         protected methods from a parent class (see test-174.cs). 
7443
7444         * attribute.cs (Attribute.ValidateGuid): new method.
7445         (Attribute.Resolve): Use above.
7446
7447 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
7448
7449         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
7450
7451         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
7452         handling for enumerations, as we only needed the TypeContainer
7453         functionality to begin with (this is required for the fix below to
7454         work for enums that reference constants in a container class for
7455         example). 
7456
7457         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
7458
7459         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
7460         a valid TypeBuilder to perform lookups on.o
7461
7462         * class.cs (InheritableMemberSignatureCompare): Use true in the
7463         call to GetGetMethod and GetSetMethod, because we are comparing
7464         the signature, and we need to get the methods *even* if they are
7465         private. 
7466
7467         (PropertyBase.CheckBase): ditto.
7468
7469         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
7470         GotoCase.Resolve): Use Peel on EmpytCasts.
7471
7472         * ecore.cs (EmptyCast): drop child, add Peel method.
7473
7474 2002-11-17  Martin Baulig  <martin@ximian.com>
7475
7476         * ecore.cs (EmptyCast.Child): New public property.
7477
7478         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
7479         label resolved to an EmptyCast.  Fixes #34162.
7480         (GotoCase.Resolve): Likewise.
7481         (Block.EmitMeta): Likewise.
7482
7483 2002-11-17  Martin Baulig  <martin@ximian.com>
7484
7485         * expression.cs (Invocation.BetterConversion): Prefer int over
7486         uint; short over ushort; long over ulong for integer literals.
7487         Use ImplicitConversionExists instead of StandardConversionExists
7488         since we also need to check for user-defined implicit conversions.
7489         Fixes #34165.  Added test-173.cs.
7490
7491 2002-11-16  Martin Baulig  <martin@ximian.com>
7492
7493         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
7494         with the `true' and `false' literals.  Fixes #33151.
7495
7496 2002-11-16  Martin Baulig  <martin@ximian.com>
7497
7498         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
7499         October 22nd; don't do the cs1540 check for static members.
7500
7501         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
7502         now using our own filter here and doing the cs1540 check again.
7503
7504 2002-11-16  Martin Baulig  <martin@ximian.com>
7505
7506         * support.cs (InternalParameters): Don't crash if we don't have
7507         any fixed parameters.  Fixes #33532.
7508
7509 2002-11-16  Martin Baulig  <martin@ximian.com>
7510
7511         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
7512         when looking up static methods to make this work on Windows.
7513         Fixes #33773.
7514
7515 2002-11-16  Martin Baulig  <martin@ximian.com>
7516
7517         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
7518         a setter rather than using PropertyInfo.CanWrite.
7519
7520 2002-11-15  Nick Drochak  <ndrochak@gol.com>
7521
7522         * class.cs: Allow acces to block member by subclasses. Fixes build
7523         breaker.
7524
7525 2002-11-14  Martin Baulig  <martin@ximian.com>
7526
7527         * class.cs (Constructor.Emit): Added the extern/block check.
7528         Fixes bug #33678.
7529
7530 2002-11-14  Martin Baulig  <martin@ximian.com>
7531
7532         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
7533         iteration while looking for indexers, this is needed because the
7534         indexer may have a different name in our base classes.  Fixed the
7535         error reporting (no indexers at all, not get accessor, no
7536         overloaded match).  Fixes bug #33089.
7537         (IndexerAccess.DoResolveLValue): Likewise.
7538
7539 2002-11-14  Martin Baulig  <martin@ximian.com>
7540
7541         * class.cs (PropertyBase.CheckBase): Make this work for multiple
7542         indexers.  Fixes the first part of bug #33089.
7543         (MethodSignature.InheritableMemberSignatureCompare): Added support
7544         for properties.
7545
7546 2002-11-13  Ravi Pratap  <ravi@ximian.com>
7547
7548         * attribute.cs (Attribute.Resolve): Catch the
7549         NullReferenceException and report it since it isn't supposed to
7550         happen. 
7551
7552 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
7553
7554         * expression.cs (Binary.EmitBranchable): Also handle the cases for
7555         LogicalOr and LogicalAnd that can benefit from recursively
7556         handling EmitBranchable.  The code now should be nice for Paolo.
7557
7558 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
7559
7560         * typemanager.cs (LookupType): Added a negative-hit hashtable for
7561         the Type lookups, as we perform quite a number of lookups on
7562         non-Types.  This can be removed once we can deterministically tell
7563         whether we have a type or a namespace in advance.
7564
7565         But this might require special hacks from our corlib.
7566
7567         * TODO: updated.
7568
7569         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
7570         and double which avoids a conversion from an integer to a double.
7571
7572         * expression.cs: tiny optimization, avoid calling IsConstant,
7573         because it effectively performs the lookup twice.
7574
7575 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
7576
7577         But a bogus return here to keep the semantics of the old code
7578         until the Mono runtime is fixed.
7579
7580         * pending.cs (GetMissingInterfaces): New method used to remove all
7581         the interfaces that are already implemented by our parent
7582         classes from the list of pending methods. 
7583
7584         * interface.cs: Add checks for calls after ResolveTypeExpr.
7585
7586 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * class.cs (Class.Emit): Report warning 67: event not used if the
7589         warning level is beyond 3.
7590
7591         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
7592         being a NullLiteral.
7593
7594         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
7595         specifiers. 
7596
7597         * class.cs (TypeContainer.GetClassBases): Cover a missing code
7598         path that might fail if a type can not be resolved.
7599
7600         * expression.cs (Binary.Emit): Emit unsigned versions of the
7601         operators. 
7602
7603         * driver.cs: use error 5.
7604
7605 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
7606
7607         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
7608
7609 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
7610
7611         * cs-parser.jay (switch_section): A beautiful patch from Martin
7612         Baulig that fixed 33094.
7613
7614 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
7615
7616         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
7617         Check whether the base is abstract and report an error if so.
7618
7619         * expression.cs (IndexerAccess.DoResolveLValue,
7620         IndexerAccess.DoResolve): ditto. 
7621
7622         (Invocation.DoResolve): ditto.
7623
7624         (Invocation.FullMethodDesc): Improve the report string.
7625
7626         * statement.cs (Block): Eliminate IsVariableDefined as it is
7627         basically just a wrapper for GetVariableInfo.
7628
7629         * ecore.cs (SimpleName): Use new 
7630
7631         * support.cs (ReflectionParamter.ParameterType): We unwrap the
7632         type, as we return the actual parameter ref/unref state on a
7633         different call.
7634
7635 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
7636
7637         * support.cs: Return proper flags REF/OUT fixing the previous
7638         commit.  
7639
7640         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
7641         not used to mean `ref' but `ref or out' in ParameterReference
7642
7643         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
7644         full type signature instead of calling TypeManger.CSharpName
7645         ourselves. 
7646
7647         * support.cs (InternalParameters.ParameterDesc): Do not compare
7648         directly to the modflags, because REF/OUT will actually be bitsets
7649         if set. 
7650
7651         * delegate.cs (VerifyMethod): Check also the modifiers.
7652
7653         * cs-tokenizer.cs: Fix bug where floating point values with an
7654         exponent where a sign was missing was ignored.
7655
7656         * driver.cs: Allow multiple assemblies to be specified in a single
7657         /r: argument
7658
7659 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
7660
7661         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
7662         because identifiers after a parenthesis would end up in this kind
7663         of production, and we needed to desamiguate it for having casts
7664         like:
7665
7666                 (UserDefinedType *) xxx
7667
7668 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
7669
7670         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
7671         we should set on the Bindingflags.NonPublic, but not turn on
7672         private_ok.  private_ok controls whether a Private member is
7673         returned (this is chekced on the filter routine), while the
7674         BindingFlags.NonPublic just controls whether private/protected
7675         will be allowed.   This fixes the problem part of the problem of
7676         private properties being allowed to be used in derived classes.
7677
7678         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
7679         so we can call the children DoResolveLValue method (this will
7680         properly signal errors on lvalue assignments to base properties)
7681
7682         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
7683         getter are null, and we have a property info, we know that this
7684         happened because the lookup failed, so we report an error 122 for
7685         protection level violation.
7686
7687         We also silently return if setter and getter are null in the
7688         resolve functions, this condition only happens if we have flagged
7689         the error before.  This is the other half of the problem. 
7690
7691         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
7692         not have accessibility information, that is why we were returning
7693         true in the filter function in typemanager.cs.
7694
7695         To properly report 122 (property is inaccessible because of its
7696         protection level) correctly, we report this error in ResolveAccess
7697         by failing if both the setter and the getter are lacking (ie, the
7698         lookup failed). 
7699
7700         DoResolve and DoLResolve have been modified to check for both
7701         setter/getter being null and returning silently, the reason being
7702         that I did not want to put the knowledge about this error in upper
7703         layers, like:
7704
7705         int old = Report.Errors;
7706         x = new PropertyExpr (...);
7707         if (old != Report.Errors)
7708                 return null;
7709         else
7710                 return x;
7711
7712         So the property expr is returned, but it is invalid, so the error
7713         will be flagged during the resolve process. 
7714
7715         * class.cs: Remove InheritablePropertySignatureCompare from the
7716         class, as we no longer depend on the property signature to compute
7717         whether it is possible to implement a method or not.
7718
7719         The reason is that calling PropertyInfo.GetGetMethod will return
7720         null (in .NET, in Mono it works, and we should change this), in
7721         cases where the Get Method does not exist in that particular
7722         class.
7723
7724         So this code:
7725
7726         class X { public virtual int A { get { return 1; } } }
7727         class Y : X { }
7728         class Z : Y { public override int A { get { return 2; } } }
7729
7730         Would fail in Z because the parent (Y) would not have the property
7731         defined.  So we avoid this completely now (because the alternative
7732         fix was ugly and slow), and we now depend exclusively on the
7733         method names.
7734
7735         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7736         reference method, instead of using the property.
7737
7738         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7739         routines are gone now.
7740
7741         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7742         names, they were incorrectly named.
7743
7744         * cs-tokenizer.cs: Return are more gentle token on failure. 
7745
7746         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7747         had an out-of-sync index variable, which caused it to remove from
7748         the list of pending methods the wrong method sometimes.
7749
7750 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7751
7752         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7753         CanWrite, because those refer to this particular instance of the
7754         property, and do not take into account the fact that we can
7755         override single members of a property.
7756
7757         Constructor requires an EmitContext.  The resolution process does
7758         not happen here, but we need to compute the accessors before,
7759         because the resolution does not always happen for properties.
7760
7761         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7762         subclass, before we did not update this flag, but we did update
7763         bindingflags. 
7764
7765         (GetAccessors): Drop this routine, as it did not work in the
7766         presence of partially overwritten set/get methods. 
7767
7768         Notice that this broke the cs1540 detection, but that will require
7769         more thinking. 
7770
7771 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7772
7773         * class.cs:
7774         * codegen.cs:
7775         * driver.cs: issue a warning instead of an error if we don't support
7776         debugging for the platform. Also ignore a couple of errors that may
7777         arise when trying to write the symbols. Undo my previous patch.
7778
7779 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7780
7781         * driver.cs: ignore /debug switch except for Unix platforms.
7782
7783 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7784
7785         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7786
7787 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7788
7789         * driver.cs: Do not make mcs-debug conditional, so we do not break
7790         builds that use it.
7791
7792         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7793         review this patch.  But basically after all the children variables
7794         have been merged, the value of "Breaks" was not being set to
7795         new_breaks for Switch blocks.  I think that it should be set after
7796         it has executed.  Currently I set this to the value of new_breaks,
7797         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7798         conservative, but I do not understand this code very well.
7799
7800         I did not break anything in the build, so that is good ;-)
7801
7802         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7803
7804 2002-10-20  Mark Crichton  <crichton@gimp.org>
7805
7806         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7807
7808 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7809
7810         * cfold.cs: Fixed compile blocker.
7811
7812 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7813
7814         * driver.cs: I was chekcing the key, not the file.
7815
7816 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7817
7818         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7819         message that we were generating - we just need to silently return
7820         a null.
7821
7822 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7823
7824         * class.cs (Event.Define): Change my previous commit, as this
7825         breaks the debugger.  This is a temporary hack, as it seems like
7826         the compiler is generating events incorrectly to begin with.
7827
7828         * expression.cs (Binary.ResolveOperator): Added support for 
7829         "U operator - (E x, E y)"
7830
7831         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7832         y)".
7833
7834         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7835         init-only variables, but this path did not take into account that
7836         there might be also instance readonly variables.  Correct this
7837         problem. 
7838
7839         This fixes bug 32253
7840
7841         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7842         delegates as well.
7843
7844         * driver.cs: Change the extension for modules to `netmodule'
7845
7846         * cs-parser.jay: Improved slightly the location tracking for
7847         the debugger symbols.
7848
7849         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7850         modifiers that were specified instead of the hardcoded value
7851         (FamAndAssem).  This was basically ignoring the static modifier,
7852         and others.  Fixes 32429.
7853
7854         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7855         fixed a bug in the process (32476)
7856
7857         * expression.cs (ArrayAccess.EmitAssign): Patch from
7858         hwang_rob@yahoo.ca that fixes bug 31834.3
7859
7860 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7861
7862         * driver.cs: Make the module extension .netmodule.
7863
7864 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7865
7866         * driver.cs: Report an error if the resource file is not found
7867         instead of crashing.
7868
7869         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7870         false, like Emit does.
7871
7872 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7873
7874         * typemanager.cs: Remove unused private member.  Also reported mcs
7875         bug to report this as a warning like csc.
7876
7877 2002-10-15  Martin Baulig  <martin@gnome.org>
7878
7879         * statement.cs (Statement.Emit): Made this a virtual method; emits
7880         the line number info and calls DoEmit().
7881         (Statement.DoEmit): New protected abstract method, formerly knows
7882         as Statement.Emit().
7883
7884         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7885
7886 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7887
7888         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7889         have fixed a remaining problem: not every AddXXXX was adding a
7890         fully qualified name.  
7891
7892         Now everyone registers a fully qualified name in the DeclSpace as
7893         being defined instead of the partial name.  
7894
7895         Downsides: we are slower than we need to be due to the excess
7896         copies and the names being registered this way.  
7897
7898         The reason for this is that we currently depend (on the corlib
7899         bootstrap for instance) that types are fully qualified, because
7900         we dump all the types in the namespace, and we should really have
7901         types inserted into the proper namespace, so we can only store the
7902         basenames in the defined_names array.
7903
7904 2002-10-10  Martin Baulig  <martin@gnome.org>
7905
7906         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
7907         from bug #31834, see the bug report for a testcase which is
7908         miscompiled.
7909
7910 2002-10-10  Martin Baulig  <martin@gnome.org>
7911
7912         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
7913         flow analysis code for this.
7914
7915         * statement.cs (Do, While, For): Tell the flow analysis code about
7916         infinite loops.
7917         (FlowBranching.UsageVector): Added support for infinite loops.
7918         (Block.Resolve): Moved the dead code elimination here and use flow
7919         analysis to do it.
7920
7921 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
7922
7923         * class.cs (Field.Define): Catch cycles on struct type
7924         definitions. 
7925
7926         * typemanager.cs (IsUnmanagedtype): Do not recursively check
7927         fields if the fields are static.  We only need to check instance
7928         fields. 
7929
7930         * expression.cs (As.DoResolve): Test for reference type.
7931
7932         * statement.cs (Using.ResolveExpression): Use
7933         ConvertImplicitRequired, not ConvertImplicit which reports an
7934         error on failture
7935         (Using.ResolveLocalVariableDecls): ditto.
7936
7937         * expression.cs (Binary.ResolveOperator): Report errors in a few
7938         places where we had to.
7939
7940         * typemanager.cs (IsUnmanagedtype): Finish implementation.
7941
7942 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
7943
7944         * expression.cs: Use StoreFromPtr instead of extracting the type
7945         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
7946
7947         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
7948         an enumeration value to a System.Enum, but System.Enum is not a
7949         value type, but an class type, so we need to box.
7950
7951         (Expression.ConvertExplicit): One codepath could return
7952         errors but not flag them.  Fix this.  Fixes #31853
7953
7954         * parameter.cs (Resolve): Do not allow void as a parameter type.
7955
7956 2002-10-06  Martin Baulig  <martin@gnome.org>
7957
7958         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
7959         if it's a class type and not a struct.  Fixes #31815.
7960
7961 2002-10-06  Martin Baulig  <martin@gnome.org>
7962
7963         * statement.cs: Reworked the flow analysis code a bit to make it
7964         usable for dead code elimination.
7965
7966 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7967
7968         * cs-parser.jay: allow empty source files. Fixes bug #31781.
7969
7970 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7971
7972         * expression.cs (ComposedCast.DoResolveType): A quick workaround
7973         to fix the test 165, will investigate deeper.
7974
7975 2002-10-04  Martin Baulig  <martin@gnome.org>
7976
7977         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
7978         finally blocks actually work.
7979         (Try.Resolve): We don't need to create a sibling for `finally' if
7980         there is no finally block.
7981
7982 2002-10-04  Martin Baulig  <martin@gnome.org>
7983
7984         * class.cs (Constructor.Define): The default accessibility for a
7985         non-default constructor is private, not public.
7986
7987 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7988
7989         * class.cs (Constructor): Make AllowedModifiers public, add
7990         EXTERN.
7991
7992         * cs-parser.jay: Perform the modifiers test here, as the
7993         constructor for the Constructor class usually receives a zero
7994         because of the way we create it (first we create, later we
7995         customize, and we were never checking the modifiers).
7996
7997         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
7998         is a version of LookupTypeReflection that includes the type-name
7999         cache.  This can be used as a fast path for functions that know
8000         the fully qualified name and are only calling into *.GetType() to
8001         obtain a composed type.
8002
8003         This is also used by TypeManager.LookupType during its type
8004         composition.
8005
8006         (LookupType): We now also track the real type name, as sometimes
8007         we can get a quey for the real type name from things like
8008         ComposedCast.  This fixes bug 31422.
8009
8010         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
8011         complete type fullname, it does not have to go through the type
8012         resolution system to obtain the composed version of the type (for
8013         obtaining arrays or pointers).
8014
8015         (Conditional.Emit): Use the EmitBoolExpression to
8016         generate nicer code, as requested by Paolo.
8017
8018         (ArrayCreation.CheckIndices): Use the patch from
8019         hwang_rob@yahoo.ca to validate the array initializers. 
8020
8021 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
8022
8023         * class.cs (ConstructorInitializer.Emit): simplify code by using
8024         Invocation.EmitCall, and at the same time, fix the bugs in calling
8025         parent constructors that took variable arguments. 
8026
8027         * ecore.cs (Expression.ConvertNumericExplicit,
8028         Expression.ImplicitNumericConversion): Remove the code that
8029         manually wrapped decimal (InternalTypeConstructor call is now gone
8030         as well).
8031
8032         * expression.cs (Cast.TryReduce): Also handle decimal types when
8033         trying to perform a constant fold on the type.
8034
8035         * typemanager.cs (IsUnmanagedtype): Partially implemented.
8036
8037         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
8038         that only turned off an error report, and did nothing else. 
8039
8040 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
8041
8042         * driver.cs: Handle and ignore /fullpaths
8043
8044 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
8045
8046         * expression.cs (Binary.ResolveOperator): Catch the case where
8047         DoNumericPromotions returns true, 
8048
8049         (Binary.DoNumericPromotions): Simplify the code, and the tests.
8050
8051 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
8052
8053         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
8054         report error 70.
8055
8056 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
8057
8058         * ecore.cs (ConvertNumericExplicit): It is not enough that the
8059         conversion exists, but it is also required that the conversion be
8060         performed.  This manifested in "(Type64Enum) 2".  
8061
8062         * class.cs (TypeManager.AddMethod): The fix is not to change
8063         AddEnum, because that one was using a fully qualified name (every
8064         DeclSpace derivative does), but to change the AddMethod routine
8065         that was using an un-namespaced name.  This now correctly reports
8066         the duplicated name.
8067
8068         Revert patch until I can properly fix it.  The issue
8069         is that we have a shared Type space across all namespaces
8070         currently, which is wrong.
8071
8072         Options include making the Namespace a DeclSpace, and merge
8073         current_namespace/current_container in the parser.
8074
8075 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
8076
8077         * cs-parser.jay: Improve error reporting when we get a different
8078         kind of expression in local_variable_type and
8079         local_variable_pointer_type. 
8080
8081         Propagate this to avoid missleading errors being reported.
8082
8083         * ecore.cs (ImplicitReferenceConversion): treat
8084         TypeManager.value_type as a target just like object_type.   As
8085         code like this:
8086
8087         ValueType v = 1;
8088
8089         Is valid, and needs to result in the int 1 being boxed before it
8090         is assigned to the value type v.
8091
8092         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
8093         to validate the enumeration name.
8094
8095         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
8096         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
8097         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
8098
8099         * ecore.cs (TryImplicitIntConversion): When doing an
8100         implicit-enumeration-conversion, check if the type is 64-bits and
8101         perform a conversion before passing to EnumConstant.
8102
8103 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
8104
8105         * decl.cs (Error_AmbiguousTypeReference); New routine used to
8106         report ambiguous type references.  Unlike the MS version, we
8107         report what the ambiguity is.   Innovation at work ;-)
8108
8109         (DeclSpace.FindType): Require a location argument to
8110         display when we display an ambiguous error.
8111
8112         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
8113
8114         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
8115
8116         * expression.cs (EmitDynamicInitializers): Apply patch from
8117         hwang_rob@yahoo.ca that fixes the order in which we emit our
8118         initializers. 
8119
8120 2002-09-21  Martin Baulig  <martin@gnome.org>
8121
8122         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
8123         delegate takes no arguments.
8124
8125 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
8128         from integers.
8129
8130         * expression.cs: Extract the underlying type.
8131
8132         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
8133
8134         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
8135
8136 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
8137
8138         * class.cs (TypeContainer.DefineType): We can not use the nice
8139         PackingSize with the size set to 1 DefineType method, because it
8140         will not allow us to define the interfaces that the struct
8141         implements.
8142
8143         This completes the fixing of bug 27287
8144
8145         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
8146         means also structs.  This fixes part of the problem. 
8147         (Expresion.ImplicitReferenceConversionExists): ditto.
8148
8149         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
8150         error if there were no errors reported during the type lookup
8151         process, to avoid duplicates or redundant errors.  Without this
8152         you would get an ambiguous errors plus a type not found.  We have
8153         beaten the user enough with the first error.  
8154
8155         (DeclSparce.FindType): Emit a warning if we have an ambiguous
8156         reference. 
8157
8158         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
8159         during the resolution process, stop the lookup, this avoids
8160         repeated error reports (same error twice).
8161
8162         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
8163
8164         * typemanager.cs (LookupType): Redo the type lookup code to match
8165         the needs of System.Reflection.  
8166
8167         The issue is that System.Reflection requires references to nested
8168         types to begin with a "+" sign instead of a dot.  So toplevel
8169         types look like: "NameSpace.TopLevelClass", and nested ones look
8170         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
8171         levels. 
8172
8173 2002-09-19  Martin Baulig  <martin@gnome.org>
8174
8175         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
8176         says that a method always returns or always throws an exception,
8177         don't report the CS0161.
8178
8179         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
8180         set `Returns = new_returns'.
8181
8182 2002-09-19  Martin Baulig  <martin@gnome.org>
8183
8184         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
8185         to an enum constant, check for a CS0176.
8186
8187 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
8188
8189         * class.cs (TypeContainer.CheckPairedOperators): Now we check
8190         for operators that must be in pairs and report errors.
8191
8192         * ecore.cs (SimpleName.DoResolveType): During the initial type
8193         resolution process, when we define types recursively, we must
8194         check first for types in our current scope before we perform
8195         lookups in the enclosing scopes.
8196
8197         * expression.cs (MakeByteBlob): Handle Decimal blobs.
8198
8199         (Invocation.VerifyArgumentsCompat): Call
8200         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
8201         I thought we were supposed to always call this, but there are a
8202         few places in the code where we dont do it.
8203
8204 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
8205
8206         * driver.cs: Add support in -linkres and -resource to specify the
8207         name of the identifier.
8208
8209 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8210
8211         * ecore.cs (StandardConversionExists): Sync with the conversion
8212         code: allow anything-* to void* conversions.
8213
8214         (FindMostSpecificSource): Use an Expression argument
8215         instead of a Type, because we might be handed over a Literal which
8216         gets a few more implicit conversions that plain types do not.  So
8217         this information was being lost.
8218
8219         Also, we drop the temporary type-holder expression when not
8220         required.
8221
8222 2002-09-17  Martin Baulig  <martin@gnome.org>
8223
8224         * class.cs (PropertyBase.CheckBase): Don't check the base class if
8225         this is an explicit interface implementation.
8226
8227 2002-09-17  Martin Baulig  <martin@gnome.org>
8228
8229         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
8230         different `IndexerName' attributes.
8231
8232         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
8233         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
8234         virtual CommonResolve().
8235
8236 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
8239         and convert that to the UnderlyingType.
8240
8241         * statement.cs (Foreach.Resolve): Indexers are just like variables
8242         or PropertyAccesses.
8243
8244         * cs-tokenizer.cs (consume_string): Track line numbers and columns
8245         inside quoted strings, we were not doing this before.
8246
8247 2002-09-16  Martin Baulig  <martin@gnome.org>
8248
8249         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
8250         resolve it.  This is needed for the definite assignment check of the
8251         instance expression, fixes bug #29846.
8252         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
8253
8254 2002-09-16  Nick Drochak  <ndrochak@gol.com>
8255
8256         * parameter.cs: Fix compile error.  Cannot reference static member
8257         from an instance object.  Is this an mcs bug?
8258
8259 2002-09-14  Martin Baulig  <martin@gnome.org>
8260
8261         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
8262         multiple times.  Fixes bug #30295, added test-166.cs.
8263
8264 2002-09-14  Martin Baulig  <martin@gnome.org>
8265
8266         * statement.cs (Block.Emit): Don't emit unreachable code.
8267         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
8268         `break' statements.
8269         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
8270
8271 2002-09-14  Martin Baulig  <martin@gnome.org>
8272
8273         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
8274         is set.
8275
8276 2002-09-14  Martin Baulig  <martin@gnome.org>
8277
8278         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
8279         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
8280         be false on the ms runtime.
8281
8282 2002-09-13  Martin Baulig  <martin@gnome.org>
8283
8284         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
8285         the CS0038 error message.
8286
8287 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
8288
8289         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
8290         constant inside, return it.
8291
8292 2002-09-12  Martin Baulig  <martin@gnome.org>
8293
8294         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
8295         implicit conversion can be done between enum types.
8296
8297         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
8298         check whether an implicit conversion to the current enum's UnderlyingType
8299         exists and report an error if not.
8300
8301         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
8302         without debugging support.
8303
8304         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
8305         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
8306
8307 2002-09-12  Martin Baulig  <martin@gnome.org>
8308
8309         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
8310
8311         * ecore.cs (IMemberExpr.DeclaringType): New property.
8312         (SimpleName.SimpleNameResolve): Check whether we're accessing a
8313         nonstatic member of an outer type (CS0038).
8314
8315 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
8316
8317         * driver.cs: Activate the using-error detector at warning level
8318         4 (at least for MS-compatible APIs).
8319
8320         * namespace.cs (VerifyUsing): Small buglett fix.
8321
8322         * pending.cs (PendingImplementation): pass the container pointer. 
8323
8324         * interface.cs (GetMethods): Allow for recursive definition.  Long
8325         term, I would like to move every type to support recursive
8326         definitions, not the current ordering mechanism that we have right
8327         now.
8328
8329         The situation is this: Attributes are handled before interfaces,
8330         so we can apply attributes to interfaces.  But some attributes
8331         implement interfaces, we will now handle the simple cases
8332         (recursive definitions will just get an error).  
8333
8334         * parameter.cs: Only invalidate types at the end if we fail to
8335         lookup all types.  
8336
8337 2002-09-09  Martin Baulig  <martin@gnome.org>
8338
8339         * ecore.cs (PropertyExpr.Emit): Also check for
8340         TypeManager.system_int_array_get_length so this'll also work when
8341         compiling corlib.  Fixes #30003.
8342
8343 2002-09-09  Martin Baulig  <martin@gnome.org>
8344
8345         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
8346         and throw an exception if we can't get the type's size.  Fixed #30040,
8347         added test-165.cs.
8348
8349 2002-09-09  Martin Baulig  <martin@gnome.org>
8350
8351         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
8352
8353         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
8354         context.  Fixes bug #30027.
8355
8356         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
8357         virtual functions.  Fixes bug #30043, added test-164.cs.
8358
8359 2002-09-08  Ravi Pratap  <ravi@ximian.com>
8360
8361         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
8362
8363 2002-09-08  Nick Drochak  <ndrochak@gol.com>
8364
8365         * driver.cs: Use an object to get the windows codepage since it's not a
8366         static property.
8367
8368 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
8369
8370         * statement.cs (For.Emit): for infinite loops (test == null)
8371         return whether there is a break inside, not always "true".
8372
8373         * namespace.cs (UsingEntry): New struct to hold the name of the
8374         using definition, the location where it is defined, and whether it
8375         has been used in a successful type lookup.
8376
8377         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
8378         strings.
8379
8380         * decl.cs: ditto.
8381
8382 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8383
8384         * attribute.cs : Fix incorrect code which relied on catching
8385         a NullReferenceException to detect a null being passed in
8386         where an object was expected.
8387
8388 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
8389
8390         * statement.cs (Try): flag the catch variable as assigned
8391
8392         * expression.cs (Cast): Simplified by using ResolveType instead of
8393         manually resolving.
8394
8395         * statement.cs (Catch): Fix bug by using ResolveType.
8396
8397 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8398
8399         * expression.cs (BetterConversion): Special case for when we have
8400         a NullLiteral as the argument and we have to choose between string
8401         and object types - we choose string the way csc does.
8402
8403         * attribute.cs (Attribute.Resolve): Catch the
8404         NullReferenceException and report error #182 since the Mono
8405         runtime no more has the bug and having this exception raised means
8406         we tried to select a constructor which takes an object and is
8407         passed a null.
8408
8409 2002-09-05  Ravi Pratap  <ravi@ximian.com>
8410
8411         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
8412         message (1502, 1503) when we can't locate a method after overload
8413         resolution. This is much more informative and closes the bug
8414         Miguel reported.
8415
8416         * interface.cs (PopulateMethod): Return if there are no argument
8417         types. Fixes a NullReferenceException bug.
8418
8419         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
8420         expressions too. Previously we were checking only in one place for
8421         positional arguments leaving out named arguments.
8422
8423         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
8424         type to the enum type is not allowed. Remove code corresponding to
8425         that.
8426
8427         (ConvertNumericExplicit): Allow explicit conversions from
8428         the underlying type to enum type. This precisely follows the spec
8429         and closes a bug filed by Gonzalo.
8430
8431 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8432
8433         * compiler.csproj:
8434         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
8435
8436 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
8437
8438         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
8439         it was important that we stored the right value after the
8440         reduction in `converted'.
8441
8442 2002-09-04  Martin Baulig  <martin@gnome.org>
8443
8444         * location.cs (Location.SymbolDocument): Use full pathnames for the
8445         source files.
8446
8447 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
8448
8449         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
8450         of the expression resolve mechanism, because that will catch the
8451         SimpleName error failures.
8452
8453         (Conditional): If we can not resolve the
8454         expression, return, do not crash.
8455
8456 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8457
8458         * cs-tokenizer.cs:
8459         (location): display token name instead of its number.
8460
8461 2002-08-28  Martin Baulig  <martin@gnome.org>
8462
8463         * expression.cs (Binary.ResolveOperator): Don't silently return
8464         but return an error if an operator cannot be applied between two
8465         enum types.
8466
8467 2002-08-28  Martin Baulig  <martin@gnome.org>
8468
8469         * class.cs (Constructor.Define): Set the permission attributes
8470         correctly instead of making all constructors public.
8471
8472 2002-08-28  Martin Baulig  <martin@gnome.org>
8473
8474         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
8475         for private members before reporting a CS0103; if we find anything,
8476         it's a CS0122.
8477
8478 2002-08-28  Martin Baulig  <martin@gnome.org>
8479
8480         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
8481         to check whether `closure_start_type == closure_invocation_type',
8482         we also need to check whether `m.DeclaringType == closure_invocation_type'
8483         before bypassing the permission checks.  We might be accessing
8484         protected/private members from the base class.
8485         (TypeManager.RealMemberLookup): Only set private_ok if private
8486         members were requested via BindingFlags.NonPublic.
8487
8488         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
8489
8490         * expression.cs (MemberAccess.ResolveMemberAccess): Set
8491         MethodGroupExpr.IsExplicitImpl if appropriate.
8492         (Invocation.DoResolve): Don't report the CS0120 for explicit
8493         interface implementations.
8494
8495 2002-08-27  Martin Baulig  <martin@gnome.org>
8496
8497         * expression.cs (Invocation.DoResolve): If this is a static
8498         method and we don't have an InstanceExpression, we must report
8499         a CS0120.
8500
8501 2002-08-25  Martin Baulig  <martin@gnome.org>
8502
8503         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
8504         `==' between a valuetype and an object.
8505
8506 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
8507
8508         * ecore.cs (TypeExpr): Provide a ToString method.
8509
8510 2002-08-24  Martin Baulig  <martin@gnome.org>
8511
8512         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
8513         now called proggie.dbg and it's a binary file.
8514
8515 2002-08-23  Martin Baulig  <martin@gnome.org>
8516
8517         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
8518
8519 2002-08-23  Martin Baulig  <martin@gnome.org>
8520
8521         * struct.cs (MyStructInfo.ctor): Make this work with empty
8522         structs; it's not allowed to use foreach() on null.
8523
8524 2002-08-23  Martin Baulig  <martin@gnome.org>
8525
8526         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
8527         writer the full pathname of the generated assembly.
8528
8529 2002-08-23  Martin Baulig  <martin@gnome.org>
8530
8531         * statements.cs (FlowBranching.UsageVector.MergeChildren):
8532         A `finally' block never returns or breaks; improved handling of
8533         unreachable code.
8534
8535 2002-08-23  Martin Baulig  <martin@gnome.org>
8536
8537         * statement.cs (Throw.Resolve): Allow `throw null'.
8538
8539 2002-08-23  Martin Baulig  <martin@gnome.org>
8540
8541         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
8542         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
8543         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
8544         MemberLookup would return a wrong event if this is an explicit
8545         interface implementation and the class has an event with the same
8546         name.
8547
8548 2002-08-23  Martin Baulig  <martin@gnome.org>
8549
8550         * statement.cs (Block.AddChildVariableNames): New public method.
8551         (Block.AddChildVariableName): Likewise.
8552         (Block.IsVariableNameUsedInChildBlock): Likewise.
8553         (Block.AddVariable): Check whether a variable name has already
8554         been used in a child block.
8555
8556         * cs-parser.jay (declare_local_variables): Mark all variable names
8557         from the current block as being used in a child block in the
8558         implicit block.
8559
8560 2002-08-23  Martin Baulig  <martin@gnome.org>
8561
8562         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
8563         find the symbol writer.
8564
8565         * driver.cs: csc also allows the arguments to /define being
8566         separated by commas, not only by semicolons.
8567
8568 2002-08-23  Martin Baulig  <martin@gnome.org>
8569
8570         * interface.cs (Interface.GetMembers): Added static check for events.
8571
8572 2002-08-15  Martin Baulig  <martin@gnome.org>
8573
8574         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
8575         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
8576
8577         * ecore.cs (Expression.MemberLookup): Added documentation and explained
8578         why the MethodData.EmitDestructor() change was necessary.
8579
8580 2002-08-20  Martin Baulig  <martin@gnome.org>
8581
8582         * class.cs (TypeContainer.FindMembers): Added static check for events.
8583
8584         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
8585
8586         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
8587         use Type.GetEvents(), not Type.FindMembers().
8588
8589 2002-08-20  Martin Baulig  <martin@gnome.org>
8590
8591         * decl.cs (MemberCache): Added a special method cache which will
8592         be used for method-only searched.  This ensures that a method
8593         search will return a MethodInfo with the correct ReflectedType for
8594         inherited methods.      
8595
8596 2002-08-20  Martin Baulig  <martin@gnome.org>
8597
8598         * decl.cs (DeclSpace.FindMembers): Made this public.
8599
8600 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8601
8602         * delegate.cs: fixed build on windows.
8603         [FIXME:  Filed as bug #29150: MCS must report these errors.]
8604
8605 2002-08-19  Ravi Pratap  <ravi@ximian.com>
8606
8607         * ecore.cs (StandardConversionExists): Return a false
8608         if we are trying to convert the void type to anything else
8609         since that is not allowed.
8610
8611         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
8612         we flag error 70 in the event an event is trying to be accessed
8613         directly from outside the declaring type.
8614
8615 2002-08-20  Martin Baulig  <martin@gnome.org>
8616
8617         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
8618         MemberCache from typemanager.cs to decl.cs.
8619
8620 2002-08-19  Martin Baulig  <martin@gnome.org>
8621
8622         * class.cs (TypeContainer): Implement IMemberContainer.
8623         (TypeContainer.DefineMembers): Create the MemberCache.
8624         (TypeContainer.FindMembers): Do better BindingFlags checking; only
8625         return public members if BindingFlags.Public was given, check
8626         whether members are static.
8627
8628 2002-08-16  Martin Baulig  <martin@gnome.org>
8629
8630         * decl.cs (DeclSpace.Define): Splitted this in Define and
8631         DefineMembers.  DefineMembers is called first and initializes the
8632         MemberCache.
8633
8634         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
8635         DefineMembers() on all our DeclSpaces.
8636
8637         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
8638         but call DefineMembers() on all nested interfaces.  We call their
8639         Define() in our new Define() function.
8640
8641         * interface.cs (Interface): Implement IMemberContainer.
8642         (Interface.Define): Moved all code except the attribute stuf to
8643         DefineMembers().
8644         (Interface.DefineMembers): Initialize the member cache.
8645
8646         * typemanager.cs (IMemberFinder): Removed this interface, we don't
8647         need this anymore since we can use MemberCache.FindMembers directly.
8648
8649 2002-08-19  Martin Baulig  <martin@gnome.org>
8650
8651         * typemanager.cs (MemberCache): When creating the cache for an
8652         interface type, add all inherited members.
8653         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
8654         to `out bool used_cache' and documented it.
8655         (TypeManager.MemberLookup): If we already used the cache in the first
8656         iteration, we don't need to do the interfaces check.
8657
8658 2002-08-19  Martin Baulig  <martin@gnome.org>
8659
8660         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
8661         here from IMemberFinder and don't implement this interface anymore.
8662         (DeclSpace.MemberCache): Moved here from IMemberFinder.
8663
8664         * typemanager.cs (IMemberFinder): This interface is now only used by
8665         classes which actually support the member cache.
8666         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
8667         since we only put DeclSpaces into this Hashtable.
8668         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
8669         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
8670
8671 2002-08-16  Martin Baulig  <martin@gnome.org>
8672
8673         * typemanager.cs (ICachingMemberFinder): Removed.
8674         (IMemberFinder.MemberCache): New property.
8675         (TypeManager.FindMembers): Merged this with RealFindMembers().
8676         This function will never be called from TypeManager.MemberLookup()
8677         so we can't use the cache here, just the IMemberFinder.
8678         (TypeManager.MemberLookup_FindMembers): Check whether the
8679         IMemberFinder has a MemberCache and call the cache's FindMembers
8680         function.
8681         (MemberCache): Rewrote larger parts of this yet another time and
8682         cleaned it up a bit.
8683
8684 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
8685
8686         * driver.cs (LoadArgs): Support quoting.
8687
8688         (Usage): Show the CSC-like command line arguments.
8689
8690         Improved a few error messages.
8691
8692 2002-08-15  Martin Baulig  <martin@gnome.org>
8693
8694         * typemanager.cs (IMemberContainer.Type): New property.
8695         (IMemberContainer.IsInterface): New property.
8696
8697         The following changes are conditional to BROKEN_RUNTIME, which is
8698         defined at the top of the file.
8699
8700         * typemanager.cs (MemberCache.MemberCache): Don't add the base
8701         class'es members, but add all members from TypeHandle.ObjectType
8702         if we're an interface.
8703         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
8704         is the current type.
8705         (MemberCache.CacheEntry.Container): Removed this field.
8706         (TypeHandle.GetMembers): Include inherited members.
8707
8708 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8709
8710         * typemanager.cs: fixed compilation and added a comment on a field that
8711         is never used.
8712
8713 2002-08-15  Martin Baulig  <martin@gnome.org>
8714
8715         * class.cs (ConstructorInitializer.Resolve): In the
8716         Expression.MemberLookup call, use the queried_type as
8717         invocation_type.
8718
8719         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8720         declared' attribute, it's always true.
8721         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8722         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8723         temporary wrapper for FindMembers which tells MemberLookup whether
8724         members from the base classes are included in the return value.
8725         This will go away soon.
8726         (TypeManager.MemberLookup): Use this temporary hack here; once the
8727         new MemberCache is completed, we don't need to do the DeclaredOnly
8728         looping here anymore since the MemberCache will take care of this.
8729         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8730         (MemberCache): When creating the MemberCache for a class, get
8731         members from the current class and all its base classes.
8732         (MemberCache.CacheEntry.Container): New field.  This is a
8733         temporary hack until the Mono runtime is fixed to distinguish
8734         between ReflectedType and DeclaringType.  It allows us to use MCS
8735         with both the MS runtime and the unfixed Mono runtime without
8736         problems and without accecting performance.
8737         (MemberCache.SearchMembers): The DeclaredOnly looping from
8738         TypeManager.MemberLookup is now done here.      
8739
8740 2002-08-14  Martin Baulig  <martin@gnome.org>
8741
8742         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8743         Type.GetFields on dynamic types but get the fields from the
8744         corresponding TypeContainer.
8745         (MyStructInfo.GetStructInfo): Added check for enum types.
8746
8747         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8748         (MemberList.SyncRoot): Implemented.
8749         (TypeManager.FilterWithClosure): No need to check permissions if
8750         closure_start_type == closure_invocation_type, don't crash if
8751         closure_invocation_type is null.
8752
8753 2002-08-13  Martin Baulig  <martin@gnome.org>
8754
8755         Rewrote TypeContainer.FindMembers to use a member cache.  This
8756         gives us a speed increase of about 35% for the self-hosting MCS
8757         build and of about 15-20% for the class libs (both on GNU/Linux).
8758
8759         * report.cs (Timer): New class to get enhanced profiling.  This
8760         whole class is "TIMER" conditional since it remarkably slows down
8761         compilation speed.
8762
8763         * class.cs (MemberList): New class.  This is an IList wrapper
8764         which we're now using instead of passing MemberInfo[]'s around to
8765         avoid copying this array unnecessarily.
8766         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8767         (ICachingMemberFinder, IMemberContainer): New interface.
8768         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8769         has already been checked, otherwise use it for the name comparision.
8770         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8771         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8772         if possible.  Returns a MemberList, not a MemberInfo [].
8773         (TypeHandle): New class, implements IMemberContainer.  We create
8774         one instance of this class per type, it contains a MemberCache
8775         which is used to do the member lookups.
8776         (MemberCache): New class.  Each instance of this class contains
8777         all members of a type and a name-based hash table.
8778         (MemberCache.FindMembers): This is our new member lookup
8779         function.  First, it looks up all members of the requested name in
8780         the hash table.  Then, it walks this list and sorts out all
8781         applicable members and returns them.
8782
8783 2002-08-13  Martin Baulig  <martin@gnome.org>
8784
8785         In addition to a nice code cleanup, this gives us a performance
8786         increase of about 1.4% on GNU/Linux - not much, but it's already
8787         half a second for the self-hosting MCS compilation.
8788
8789         * typemanager.cs (IMemberFinder): New interface.  It is used by
8790         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8791         Enum, Delegate or Interface.
8792         (TypeManager.finder_to_member_finder): New PtrHashtable.
8793         (TypeManager.finder_to_container): Removed.
8794         (TypeManager.finder_to_delegate): Removed.
8795         (TypeManager.finder_to_interface): Removed.
8796         (TypeManager.finder_to_enum): Removed.
8797
8798         * interface.cs (Interface): Implement IMemberFinder.
8799
8800         * delegate.cs (Delegate): Implement IMemberFinder.
8801
8802         * enum.cs (Enum): Implement IMemberFinder.
8803
8804         * class.cs (TypeContainer): Implement IMemberFinder.
8805
8806 2002-08-12  Martin Baulig  <martin@gnome.org>
8807
8808         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8809
8810 2002-08-12  Martin Baulig  <martin@gnome.org>
8811
8812         * ecore.cs (ITypeExpression): New interface for expressions which
8813         resolve to a type.
8814         (TypeExpression): Renamed to TypeLookupExpression.
8815         (Expression.DoResolve): If we're doing a types-only lookup, the
8816         expression must implement the ITypeExpression interface and we
8817         call DoResolveType() on it.
8818         (SimpleName): Implement the new ITypeExpression interface.
8819         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8820         hack, the situation that we're only looking up types can't happen
8821         anymore when this method is called.  Moved the type lookup code to
8822         DoResolveType() and call it.
8823         (SimpleName.DoResolveType): This ITypeExpression interface method
8824         is now doing the types-only lookup.
8825         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8826         (ResolveFlags): Added MaskExprClass.
8827
8828         * expression.cs (MemberAccess): Implement the ITypeExpression
8829         interface.
8830         (MemberAccess.DoResolve): Added support for a types-only lookup
8831         when we're called via ITypeExpression.DoResolveType().
8832         (ComposedCast): Implement the ITypeExpression interface.
8833
8834         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8835         Expression.Resolve() with ResolveFlags.Type instead.
8836
8837 2002-08-12  Martin Baulig  <martin@gnome.org>
8838
8839         * interface.cs (Interface.Define): Apply attributes.
8840
8841         * attribute.cs (Attribute.ApplyAttributes): Added support for
8842         interface attributes.
8843
8844 2002-08-11  Martin Baulig  <martin@gnome.org>
8845
8846         * statement.cs (Block.Emit): Only check the "this" variable if we
8847         do not always throw an exception.
8848
8849         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8850         whether the property has a set accessor.
8851
8852 2002-08-11  Martin Baulig  <martin@gnome.org>
8853
8854         Added control flow analysis support for structs.
8855
8856         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8857         with control flow analysis turned off.
8858         (IVariable): New interface.
8859         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8860         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8861         (FieldExpr.DoResolve): Resolve the instance expression with flow
8862         analysis turned off and do the definite assignment check after the
8863         resolving when we know what the expression will resolve to.
8864
8865         * expression.cs (LocalVariableReference, ParameterReference):
8866         Implement the new IVariable interface, only call the flow analysis
8867         code if ec.DoFlowAnalysis is true.
8868         (This): Added constructor which takes a Block argument.  Implement
8869         the new IVariable interface.
8870         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8871         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8872         This does the definite assignment checks for struct members.
8873
8874         * class.cs (Constructor.Emit): If this is a non-static `struct'
8875         constructor which doesn't have any initializer, call
8876         Block.AddThisVariable() to tell the flow analysis code that all
8877         struct elements must be initialized before control returns from
8878         the constructor.
8879
8880         * statement.cs (MyStructInfo): New public class.
8881         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8882         argument to this indexer.  If non-zero, check an individual struct
8883         member, not the whole struct.
8884         (FlowBranching.CheckOutParameters): Check struct members.
8885         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8886         overloaded versions of these methods which take an additional
8887         `int field_idx' argument to check struct members.
8888         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8889         overloaded versions of these methods which take an additional
8890         `string field_name' argument to check struct member.s
8891         (VariableInfo): Implement the IVariable interface.
8892         (VariableInfo.StructInfo): New public property.  Returns the
8893         MyStructInfo instance of the variable if it's a struct or null.
8894         (Block.AddThisVariable): New public method.  This is called from
8895         Constructor.Emit() for non-static `struct' constructor which do
8896         not have any initializer.  It creates a special variable for the
8897         "this" instance variable which will be checked by the flow
8898         analysis code to ensure that all of the struct's fields are
8899         initialized before control returns from the constructor.
8900         (UsageVector): Added support for struct members.  If a
8901         variable/parameter is a struct with N members, we reserve a slot
8902         in the usage vector for each member.  A struct is considered fully
8903         initialized if either the struct itself (slot 0) or all its
8904         members are initialized.
8905
8906 2002-08-08  Martin Baulig  <martin@gnome.org>
8907
8908         * driver.cs (Driver.MainDriver): Only report an error CS5001
8909         if there were no compilation errors.
8910
8911         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
8912         `UnsafeContext' property to determine whether the parent is in
8913         unsafe context rather than checking the parent's ModFlags:
8914         classes nested in an unsafe class are unsafe as well.
8915
8916 2002-08-08  Martin Baulig  <martin@gnome.org>
8917
8918         * statement.cs (UsageVector.MergeChildren): Distinguish between
8919         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
8920         we return.  Added test17() and test18() to test-154.cs.
8921
8922 2002-08-08  Martin Baulig  <martin@gnome.org>
8923
8924         * typemanager.cs (TypeManager.FilterWithClosure): If we have
8925         Family access, make sure the invoking type isn't a subclass of the
8926         queried type (that'd be a CS1540).
8927
8928         * ecore.cs (Expression.MemberLookup): Added overloaded version of
8929         this method which takes an additional `Type invocation_type'.
8930
8931         * expression.cs (BaseAccess.DoResolve): Use the base type as
8932         invocation and query type.
8933         (MemberAccess.DoResolve): If the lookup failed and we're about to
8934         report a CS0122, try a lookup with the ec.ContainerType - if this
8935         succeeds, we must report a CS1540.
8936
8937 2002-08-08  Martin Baulig  <martin@gnome.org>
8938
8939         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
8940         (MethodGroupExpr): Implement the IMemberExpr interface.
8941
8942         * expression (MemberAccess.ResolveMemberAccess): No need to have
8943         any special code for MethodGroupExprs anymore, they're now
8944         IMemberExprs.   
8945
8946 2002-08-08  Martin Baulig  <martin@gnome.org>
8947
8948         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
8949         Family, FamANDAssem and FamORAssem permissions.
8950         (TypeManager.IsSubclassOrNestedChildOf): New public method.
8951
8952 2002-08-08  Martin Baulig  <martin@gnome.org>
8953
8954         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
8955         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
8956         or loop block.
8957
8958 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
8959
8960         * driver.cs: implemented /resource option to embed managed resources.
8961
8962 2002-08-07  Martin Baulig  <martin@gnome.org>
8963
8964         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
8965         (FieldBase.HasFieldInitializer): New public property.
8966         (FieldBase.GetInitializerExpression): New public method.  Resolves and
8967         returns the field initializer and makes sure it is only resolved once.
8968         (TypeContainer.EmitFieldInitializers): Call
8969         FieldBase.GetInitializerExpression to get the initializer, this ensures
8970         that it isn't resolved multiple times.
8971
8972         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
8973         the resolving process (SimpleName/MemberLookup) that we're currently
8974         emitting a field initializer (which must not access any instance members,
8975         this is an error CS0236).
8976
8977         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
8978         argument, if the `IsFieldInitializer' flag is set, we must report and
8979         error CS0236 and not an error CS0120.   
8980
8981 2002-08-07  Martin Baulig  <martin@gnome.org>
8982
8983         * ecore.cs (IMemberExpr): New public interface.
8984         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
8985         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
8986         if the expression is an IMemberExpr.
8987
8988         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
8989         to be null, implicitly default to `this' if we're non-static in
8990         this case.  Simplified the code a lot by using the new IMemberExpr
8991         interface.  Also fixed bug #28176 here.
8992
8993 2002-08-06  Martin Baulig  <martin@gnome.org>
8994
8995         * cs-parser.jay (SimpleLookup): Removed.  We need to create
8996         ParameterReferences during semantic analysis so that we can do a
8997         type-only search when resolving Cast, TypeOf and SizeOf.
8998         (block): Pass the `current_local_parameters' to the Block's
8999         constructor.
9000
9001         * class.cs (ConstructorInitializer): Added `Parameters parameters'
9002         argument to the constructor.
9003         (ConstructorInitializer.Resolve): Create a temporary implicit
9004         block with the parameters.
9005
9006         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
9007         references here if we aren't doing a type-only search.
9008
9009         * statement.cs (Block): Added constructor which takes a
9010         `Parameters parameters' argument.
9011         (Block.Parameters): New public property.
9012
9013         * support.cs (InternalParameters.Parameters): Renamed `parameters'
9014         to `Parameters' and made it public readonly.
9015
9016 2002-08-06  Martin Baulig  <martin@gnome.org>
9017
9018         * ecore.cs (Expression.Warning): Made this public as well.
9019
9020         * report.cs (Report.Debug): Print the contents of collections.
9021
9022 2002-08-06  Martin Baulig  <martin@gnome.org>
9023
9024         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
9025         used to tell Resolve() which kinds of expressions it may return.
9026         (Expression.Resolve): Added overloaded version of this method which
9027         takes a `ResolveFlags flags' argument.  This can be used to tell
9028         Resolve() which kinds of expressions it may return.  Reports a
9029         CS0118 on error.
9030         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
9031         ResolveFlags.SimpleName.
9032         (Expression.Error118): Added overloaded version of this method which
9033         takes a `ResolveFlags flags' argument.  It uses the flags to determine
9034         which kinds of expressions are allowed.
9035
9036         * expression.cs (Argument.ResolveMethodGroup): New public method.
9037         Resolves an argument, but allows a MethodGroup to be returned.
9038         This is used when invoking a delegate.
9039
9040         * TODO: Updated a bit.
9041
9042 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9043
9044         Fixed compilation with csc.
9045
9046         * ecore.cs: Expression.Error made public. Is this correct? Should
9047         Warning be made public too?
9048
9049         * expression.cs: use ea.Location instead of ea.loc.
9050         [FIXME:  Filed as bug #28607: MCS must report these errors.]
9051
9052 2002-08-06  Martin Baulig  <martin@gnome.org>
9053
9054         * ecore.cs (Expression.loc): Moved the location here instead of
9055         duplicating it in all derived classes.
9056         (Expression.Location): New public property.
9057         (Expression.Error, Expression.Warning): Made them non-static and
9058         removed the location argument.
9059         (Expression.Warning): Added overloaded version which takes an
9060         `int level' argument.
9061         (Expression.Error118): Make this non-static and removed the
9062         expression and location arguments.
9063         (TypeExpr): Added location argument to the constructor.
9064
9065         * expression.cs (StaticCallExpr): Added location argument to
9066         the constructor.
9067         (Indirection, PointerArithmetic): Likewise.
9068         (CheckedExpr, UnCheckedExpr): Likewise.
9069         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
9070         (StringPtr): Likewise.
9071
9072
9073 2002-08-05  Martin Baulig  <martin@gnome.org>
9074
9075         * expression.cs (BaseAccess.DoResolve): Actually report errors.
9076
9077         * assign.cs (Assign.DoResolve): Check whether the source
9078         expression is a value or variable.
9079
9080         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
9081         while resolving the corresponding blocks.
9082
9083         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
9084         an error, don't silently return null.
9085
9086         * statement.cs (Block.AddVariable): Do the error reporting here
9087         and distinguish between CS0128 and CS0136.
9088         (Block.DoResolve): Report all unused labels (warning CS0164).
9089         (LabeledStatement): Pass the location to the constructor.
9090         (LabeledStatement.HasBeenReferenced): New property.
9091         (LabeledStatement.Resolve): Set it to true here.
9092
9093         * statement.cs (Return.Emit): Return success even after reporting
9094         a type mismatch error (CS0126 or CS0127), this is what csc does and
9095         it avoids confusing the users with any consecutive errors.
9096
9097 2002-08-05  Martin Baulig  <martin@gnome.org>
9098
9099         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
9100
9101         * const.cs (Const.LookupConstantValue): Catch circular definitions.
9102
9103         * expression.cs (MemberAccess.DoResolve): Silently return if an
9104         error has already been reported.
9105
9106         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
9107         error has already been reported.
9108
9109 2002-08-05  Martin Baulig  <martin@gnome.org>
9110
9111         * statement.cs (UsageVector): Only initialize the `parameters'
9112         vector if we actually have any "out" parameters.
9113
9114 2002-08-05  Martin Baulig  <martin@gnome.org>
9115
9116         * expression.cs (Binary.ResolveOperator): When combining delegates,
9117         they must have the same type.
9118
9119 2002-08-05  Martin Baulig  <martin@gnome.org>
9120
9121         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
9122         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
9123         work with the ms runtime and we also don't need it: if we're a
9124         PropertyBuilder and not in the `indexer_arguments' hash, then we
9125         are a property and not an indexer.
9126
9127         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
9128         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
9129         since the latter one doesn't work with the ms runtime.
9130
9131 2002-08-03  Martin Baulig  <martin@gnome.org>
9132
9133         Fixed bugs #27998 and #22735.
9134
9135         * class.cs (Method.IsOperator): New public field.
9136         (Method.CheckBase): Report CS0111 if there's already a method
9137         with the same parameters in the current class.  Report CS0508 when
9138         attempting to change the return type of an inherited method.
9139         (MethodData.Emit): Report CS0179 if a method doesn't have a body
9140         and it's not marked abstract or extern.
9141         (PropertyBase): New abstract base class for Property and Indexer.
9142         (PropertyBase.CheckBase): Moved here from Property and made it work
9143         for indexers.
9144         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
9145         the same so we can reuse it there.
9146         (Property, Indexer): Derive from PropertyBase.
9147         (MethodSignature.inheritable_property_signature_filter): New delegate
9148         to find properties and indexers.
9149
9150         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
9151         argument and improved error reporting.
9152
9153         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
9154         EmptyReadOnlyParameters and made it a property.
9155
9156         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
9157         version of this method which takes a `PropertyInfo indexer'.
9158         (TypeManager.RegisterIndexer): New method.
9159
9160         * class.cs: Added myself as author of this file :-)
9161
9162 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9163
9164         * class.cs: fixed compilation on windoze.
9165
9166 2002-08-03  Martin Baulig  <martin@gnome.org>
9167
9168         * interface.cs (Interface.GetInterfaceBases): Check whether all
9169         base interfaces are at least as accessible than the current one.
9170
9171         * class.cs (TypeContainer.GetClassBases): Check whether base types
9172         are at least as accessible than the current type.
9173         (TypeContainer.AsAccessible): Implemented and made non-static.
9174         (MemberBase.CheckParameters): Report errors if the accessibility
9175         checks fail.
9176
9177         * delegate.cs (Delegate.Delegate): The default visibility is
9178         internal for top-level types and private for nested types.
9179         (Delegate.Define): Report errors if the accessibility checks fail.
9180
9181         * enum.cs (Enum.Enum): The default visibility is internal for
9182         top-level types and private for nested types.
9183         (Enum.DefineType): Compute the correct visibility.
9184
9185         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
9186         function which takes a `bool is_toplevel' instead of a TypeContainer.
9187
9188         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
9189         builtin type.
9190
9191 2002-08-02  Martin Baulig  <martin@gnome.org>
9192
9193         * expression.cs (LocalVariableReferenc): Added constructor which
9194         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
9195         (LocalVariableReference.IsReadOnly): New property.
9196         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
9197         variable is readonly, use our own readonly flag to do this; you can
9198         use the new constructor to get a writable reference to a read-only
9199         variable.
9200
9201         * cs-parser.jay (foreach_statement, using_statement): Get a writable
9202         reference to the local variable.
9203
9204 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * rootcontext.cs (ResolveCore): Also include System.Exception
9207
9208         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
9209         we reach an EmptyStatement.
9210
9211         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
9212         is also fine.
9213
9214         * expression.cs (Binary.ResolveOperator): Check error result in
9215         two places.
9216
9217         use brtrue/brfalse directly and avoid compares to null.
9218
9219 2002-08-02  Martin Baulig  <martin@gnome.org>
9220
9221         * class.cs (TypeContainer.Define): Define all nested interfaces here.
9222         Fixes bug #28407, added test-155.cs.
9223
9224 2002-08-01  Martin Baulig  <martin@gnome.org>
9225
9226         * class.cs (Event.EmitDefaultMethod): Make this work with static
9227         events.  Fixes #28311, added verify-3.cs.
9228
9229 2002-08-01  Martin Baulig  <martin@gnome.org>
9230
9231         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
9232         `is_disposable' fields.
9233         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
9234         `hm.is_disposable' if we're using the collection pattern.
9235         (Foreach.EmitCollectionForeach): Use the correct type for the
9236         enumerator's local variable, only emit the try/finally block if
9237         necessary (fixes #27713).
9238
9239 2002-08-01  Martin Baulig  <martin@gnome.org>
9240
9241         * ecore.cs (Expression.report118): Renamed to Error118 and made
9242         it public static.
9243
9244         * statement.cs (Throw.Resolve): Check whether the expression is of
9245         the correct type (CS0118) and whether the type derives from
9246         System.Exception (CS0155).
9247         (Catch.Resolve): New method.  Do the type lookup here and check
9248         whether it derives from System.Exception (CS0155).
9249         (Catch.CatchType, Catch.IsGeneral): New public properties.
9250
9251         * typemanager.cs (TypeManager.exception_type): Added.
9252
9253 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
9254
9255         * driver.cs: Updated About function.
9256
9257 2002-07-31  Martin Baulig  <martin@gnome.org>
9258
9259         Implemented Control Flow Analysis.
9260
9261         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
9262         (EmitContext.CurrentBranching): Added.
9263         (EmitContext.StartFlowBranching): Added.
9264         (EmitContext.EndFlowBranching): Added.
9265         (EmitContext.KillFlowBranching): Added.
9266         (EmitContext.IsVariableAssigned): Added.
9267         (EmitContext.SetVariableAssigned): Added.
9268         (EmitContext.IsParameterAssigned): Added.
9269         (EmitContext.SetParameterAssigned): Added.
9270         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
9271         Added control flow analysis stuff here.
9272
9273         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
9274         resolve the expression as lvalue.
9275         (LocalVariableReference.DoResolve): Check whether the variable has
9276         already been assigned.
9277         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
9278         the parameter as assigned here.
9279         (ParameterReference.DoResolve): Check whether the parameter has already
9280         been assigned.
9281         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
9282         expression as lvalue.
9283
9284         * statement.cs (FlowBranching): New class for the flow analysis code.
9285         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
9286         (LabeledStatement.IsDefined): New public property.
9287         (LabeledStatement.AddUsageVector): New public method to tell flow
9288         analyis that the label may be reached via a forward jump.
9289         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
9290         flow analysis.
9291         (VariableInfo.Number): New public field.  This is used by flow analysis
9292         to number all locals of a block.
9293         (Block.CountVariables): New public property.  This is the number of
9294         local variables in this block (including the locals from all parent
9295         blocks).
9296         (Block.EmitMeta): Number all the variables.
9297
9298         * statement.cs: Added flow analysis support to all classes.
9299
9300 2002-07-31  Martin Baulig  <martin@gnome.org>
9301
9302         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
9303         To get debugging messages, compile mcs with /define:MCS_DEBUG and
9304         then use this argument.
9305
9306         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
9307
9308         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
9309         use this to specify /define options.
9310
9311 2002-07-29  Martin Baulig  <martin@gnome.org>
9312
9313         * statement.cs (Fixed): Moved all code that does variable lookups
9314         and resolvings from Emit to Resolve.
9315
9316         * statement.cs (For): Moved all code that does variable lookups
9317         and resolvings from Emit to Resolve.
9318
9319         * statement.cs (Using): Moved all code that does variable lookups
9320         and resolvings from Emit to Resolve.
9321
9322 2002-07-29  Martin Baulig  <martin@gnome.org>
9323
9324         * attribute.cs (Attribute.Resolve): Explicitly catch a
9325         System.NullReferenceException when creating the
9326         CustromAttributeBuilder and report a different warning message.
9327
9328 2002-07-29  Martin Baulig  <martin@gnome.org>
9329
9330         * support.cs (ParameterData.ParameterName): Added method to
9331         get the name of a parameter.
9332
9333         * typemanager.cs (TypeManager.IsValueType): New public method.
9334
9335 2002-07-29  Martin Baulig  <martin@gnome.org>
9336
9337         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
9338         is a flag which specifies that it's either ref or out.
9339         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
9340         the out parameter to `out Parameter.Modifier mod', also set the
9341         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
9342
9343         * support.cs (InternalParameters.ParameterModifier): Distinguish
9344         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9345         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9346
9347         * expression.cs (Argument.GetParameterModifier): Distinguish
9348         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9349         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9350
9351 2002-07-29  Martin Baulig  <martin@gnome.org>
9352
9353         * expression.cs (ParameterReference.ParameterReference): Added
9354         `Location loc' argument to the constructor.
9355
9356         * cs-parser.jay: Pass location to ParameterReference.
9357
9358 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * statement.cs (Try): Initialize the location.
9361
9362         * cs-parser.jay: pass location to Try.
9363
9364         * expression.cs (Unary.Reduce): Change the prototype to return
9365         whether a constant fold could be performed or not.  The result is
9366         returned in an out parameters.  In the case of Indirection and
9367         AddressOf, we want to perform the full tests.
9368
9369 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
9370
9371         * statement.cs (Statement.Emit): Flag dead code.
9372
9373 2002-07-27  Andrew Birkett  <andy@nobugs.org>
9374
9375         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
9376
9377 2002-07-27  Martin Baulig  <martin@gnome.org>
9378
9379         * class.cs (MethodData.Define): Put back call to
9380         TypeManager.AddMethod(), accidentally commented this out.
9381
9382         * report.cs (Debug): New public method to print debugging information,
9383         this is `[Conditional ("DEBUG")]'.
9384
9385 2002-07-26  Martin Baulig  <martin@gnome.org>
9386
9387         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
9388         (switch_statement): Push the current_block to the switch_stack and
9389         pop it again when we're done with the switch.
9390         (switch_section): The new block is a child of the current_block.
9391         Fixes bug #24007, added test-152.cs.
9392
9393 2002-07-27  Martin Baulig  <martin@gnome.org>
9394
9395         * expression.cs (Invocation.EmitArguments): When calling a varargs
9396         function with only its fixed arguments, we need to pass an empty
9397         array.
9398
9399 2002-07-27  Martin Baulig  <martin@gnome.org>
9400
9401         Mono 0.13 has been released.
9402
9403 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
9404
9405         * driver.cs: Rename --resource to --linkres, because that is what
9406         we do currently, we dont support --resource yet.
9407
9408         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
9409
9410 2002-07-25  Martin Baulig  <martin@gnome.org>
9411
9412         * class.cs (MethodData): New public class.  This is a `method builder'
9413         class for a method or one accessor of a Property/Indexer/Event.
9414         (MethodData.GetMethodFlags): Moved here from MemberBase.
9415         (MethodData.ApplyAttributes): Likewise.
9416         (MethodData.ApplyObsoleteAttribute): Likewise.
9417         (MethodData.ApplyConditionalAttribute): Likewise.
9418         (MethodData.ApplyDllImportAttribute): Likewise.
9419         (MethodData.CheckAbstractAndExternal): Likewise.
9420         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
9421         (MethodData.Emit): Formerly known as Method.Emit().
9422         (MemberBase): Moved everything which was specific to a single
9423         accessor/method to MethodData.
9424         (Method): Create a new MethodData and call Define() and Emit() on it.
9425         (Property, Indexer, Event): Create a new MethodData objects for each
9426         accessor and call Define() and Emit() on them.
9427
9428 2002-07-25  Martin Baulig  <martin@gnome.org>
9429
9430         Made MethodCore derive from MemberBase to reuse the code from there.
9431         MemberBase now also checks for attributes.
9432
9433         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
9434         (MemberBase.GetMethodFlags): Moved here from class Method and marked
9435         as virtual.
9436         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
9437         `CallingConventions cc' and `Attributes opt_attrs' arguments.
9438         (MemberBase.ApplyAttributes): New virtual method; applies the
9439         attributes to a method or accessor.
9440         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
9441         (MemberBase.ApplyConditionalAttribute): Likewise.
9442         (MemberBase.ApplyDllImportAttribute): Likewise.
9443         (MemberBase.CheckAbstractAndExternal): Likewise.
9444         (MethodCore.ParameterTypes): This is now a property instead of a
9445         method, it's initialized from DoDefineParameters().
9446         (MethodCore.ParameterInfo): Removed the set accessor.
9447         (MethodCore.DoDefineParameters): New protected virtual method to
9448         initialize ParameterTypes and ParameterInfo.
9449         (Method.GetReturnType): We can now simply return the MemberType.
9450         (Method.GetMethodFlags): Override the MemberBase version and add
9451         the conditional flags.
9452         (Method.CheckBase): Moved some code from Define() here, call
9453         DoDefineParameters() here.
9454         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
9455         here to avoid some larger code duplication.
9456         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
9457         ensure that abstract and external accessors don't declare a body.
9458
9459         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
9460         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
9461         lookup in the attribute's parent classes, so we need to abort as soon
9462         as we found the first match.
9463         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
9464         the attribute has no arguments.
9465
9466         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
9467         of a Method.
9468
9469 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9470
9471         * cs-parser.jay: reverted previous patch.
9472
9473 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9474
9475         * cs-parser.jay: fixed bug #22119.
9476
9477 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9478
9479         * attribute.cs: fixed compilation. The error was:
9480         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
9481         be assigned to before control leaves the current method."
9482         [FIXME:  Filed as bug #28186: MCS must report this error.]
9483
9484 2002-07-25  Martin Baulig  <martin@gnome.org>
9485
9486         * attribute.cs (Attribute.Conditional_GetConditionName): New static
9487         method to pull the condition name ouf of a Conditional attribute.
9488         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
9489         the obsolete message and error flag out of an Obsolete attribute.
9490
9491         * class.cs (Method.GetMethodFlags): New public method to get the
9492         TypeManager.MethodFlags for this method.
9493         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
9494         private methods.
9495         (Method.Define): Get and apply the Obsolete and Conditional attributes;
9496         if we're overriding a virtual function, set the new private variable
9497         `parent_method'; call the new TypeManager.AddMethod().
9498
9499         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
9500         the MethodBuilder and the Method in a PtrHashtable.
9501         (TypeManager.builder_to_method): Added for this purpose.
9502         (TypeManager.MethodFlags): Added IsObsoleteError.
9503         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
9504         Obsolete and Conditional arguments in MethodBuilders.  If we discover
9505         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
9506         the message from the attribute.
9507
9508 2002-07-24  Martin Baulig  <martin@gnome.org>
9509
9510         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
9511         preprocessor directives, ensure that the argument to #define/#undef is
9512         exactly one identifier and that it's actually an identifier.
9513
9514         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
9515         did not work ....
9516
9517 2002-07-24  Martin Baulig  <martin@gnome.org>
9518
9519         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
9520         initialize it to TypeManager.object_type in the constructor.
9521         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
9522         of the `hm.get_current' method if we're using the collection pattern.
9523         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
9524         for the explicit conversion to make it work when we're using the collection
9525         pattern and the `Current' property has a different return type than `object'.
9526         Fixes #27713.
9527
9528 2002-07-24  Martin Baulig  <martin@gnome.org>
9529
9530         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
9531         does not match, but don't report any errors.  This method is called in
9532         order for all methods in a MethodGroupExpr until a matching method is
9533         found, so we don't want to bail out if the first method doesn't match.
9534         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
9535         matches, report the 123.  Fixes #28070.
9536
9537 2002-07-24  Martin Baulig  <martin@gnome.org>
9538
9539         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
9540         TypeManager.TypeToCoreType() to the top of the method so the
9541         following equality checks will work.  Fixes #28107.
9542
9543 2002-07-24  Martin Baulig  <martin@gnome.org>
9544
9545         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
9546         operand is of type uint, and the other operand is of type sbyte,
9547         short or int, the operands are converted to type long." -
9548         Actually do what this comment already told us.  Fixes bug #28106,
9549         added test-150.cs.
9550
9551 2002-07-24  Martin Baulig  <martin@gnome.org>
9552
9553         * class.cs (MethodBase): New abstract class.  This is now a base
9554         class for Property, Indexer and Event to avoid some code duplication
9555         in their Define() and DefineMethods() methods.
9556         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
9557         generic methods for Define() and DefineMethods().
9558         (FieldBase): Derive from MemberBase, not MemberCore.
9559         (Property): Derive from MemberBase, not MemberCore.
9560         (Property.DefineMethod): Moved all the code from this method to the
9561         new MethodBase.DefineAccessor(), just call it with appropriate
9562         argumetnts.
9563         (Property.Define): Call the new Property.DoDefine(), this does some
9564         sanity checks and we don't need to duplicate the code everywhere.
9565         (Event): Derive from MemberBase, not MemberCore.
9566         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
9567         accessors, this will also make them work with interface events.
9568         (Indexer): Derive from MemberBase, not MemberCore.
9569         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
9570         (Indexer.Define): Use the new MethodBase functions.
9571
9572         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
9573         argument to the constructor.
9574         (Interface.FindMembers): Added support for interface events.
9575         (Interface.PopluateEvent): Implemented.
9576
9577         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
9578
9579 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
9580
9581         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
9582         but this is required to check for a method name being the same as
9583         the containing class.  
9584
9585         Handle this now.
9586
9587 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9588
9589         * interface.cs: initialize variable.
9590
9591 2002-07-23  Martin Baulig  <martin@gnome.org>
9592
9593         Implemented the IndexerName attribute in interfaces.
9594
9595         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
9596         name if this is an explicit interface implementation.
9597         (Indexer.InterfaceIndexerName): New public variable.  If we're
9598         implementing an interface indexer, this is the IndexerName in that
9599         interface.  Otherwise, it's the IndexerName.
9600         (Indexer.DefineMethod): If we're implementing interface indexer,
9601         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
9602         and Pending.ImplementIndexer methods.
9603         (Indexer.Define): Also define the PropertyBuilder if we're
9604         implementing an interface indexer and this is neither an explicit
9605         interface implementation nor do the IndexerName match the one in
9606         the interface.
9607
9608         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
9609         If a method is defined here, then we always need to create a proxy
9610         for it.  This is used when implementing interface indexers.
9611         (Pending.IsInterfaceIndexer): New public method.
9612         (Pending.ImplementIndexer): New public method.
9613         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
9614         This is used when implementing interface indexers to define a proxy
9615         if necessary.
9616         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
9617         define a proxy if necessary.
9618
9619         * interface.cs (Interface.IndexerName): New public variable.
9620         (Interface.PopulateIndexer): Set the IndexerName.
9621         (Interface.DefineIndexers): New private method.  Populate all the
9622         indexers and make sure their IndexerNames match.
9623
9624         * typemanager.cs (IndexerPropertyName): Added support for interface
9625         indexers.
9626
9627 2002-07-22  Martin Baulig  <martin@gnome.org>
9628
9629         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
9630         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
9631         ret if HasReturnLabel.
9632         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
9633         variables.
9634
9635         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
9636         and set the ec.LoopBeginTryCatchLevel.
9637         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
9638         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
9639         the current ec.TryCatchLevel, the branch goes out of an exception
9640         block.  In this case, we need to use Leave and not Br.
9641
9642 2002-07-22  Martin Baulig  <martin@gnome.org>
9643
9644         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
9645         block unless the block does not always return or it is contained in
9646         another try { ... } catch { ... } block.  Fixes bug #26506.
9647         Added verify-1.cs to the test suite.
9648
9649 2002-07-22  Martin Baulig  <martin@gnome.org>
9650
9651         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
9652         then we do not always return.  Fixes bug #24985.
9653
9654 2002-07-22  Martin Baulig  <martin@gnome.org>
9655
9656         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
9657         lookup on a per-class level; ie. walk up the class hierarchy until we
9658         found at least one applicable method, then choose the best among them.
9659         Fixes bug #24463 and test-29.cs.
9660
9661 2002-07-22  Martin Baulig  <martin@gnome.org>
9662
9663         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
9664         return types of the methods.  The return type is not part of the
9665         signature and we must not check it to make the `new' modifier work.
9666         Fixes bug #27999, also added test-147.cs.
9667         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
9668
9669         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
9670         on the method's return type.
9671
9672 2002-07-21  Martin Baulig  <martin@gnome.org>
9673
9674         * assign.cs: Make this work if the rightmost source is a constant and
9675         we need to do an implicit type conversion.  Also adding a few more tests
9676         to test-38.cs which should have caught this.
9677
9678         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
9679         target in the makefile for this.  The makefile.gnu is primarily intended
9680         for end-users who don't want to debug the compiler.
9681
9682 2002-07-21  Martin Baulig  <martin@gnome.org>
9683
9684         * assign.cs: Improved the Assign class so it can now handle embedded
9685         assignments (X = Y = Z = something).  As a side-effect this'll now also
9686         consume less local variables.  test-38.cs now passes with MCS, added
9687         a few new test cases to that test.
9688
9689 2002-07-20  Martin Baulig  <martin@gnome.org>
9690
9691         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
9692         instructions.  Fixes bug #27977, also added test-146.cs.
9693
9694 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9695
9696         * cs-tokenizer.cs: fixed getHex ().
9697
9698 2002-07-19  Martin Baulig  <martin@gnome.org>
9699
9700         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
9701         not Type.GetType() to lookup the array type.  This is needed when
9702         we're constructing an array of a user-defined type.
9703         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
9704         single-dimensional arrays, but also for single-dimensial arrays of
9705         type decimal.
9706
9707 2002-07-19  Martin Baulig  <martin@gnome.org>
9708
9709         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
9710         this function is called, it's not allowed to share LocalBuilders
9711         among ILGenerators.
9712
9713 2002-07-19  Martin Baulig  <martin@gnome.org>
9714
9715         * expression.cs (Argument.Resolve): Report an error 118 when trying
9716         to pass a type as argument.
9717
9718 2002-07-18  Martin Baulig  <martin@gnome.org>
9719
9720         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9721         Conv_R_Un for the signed `long' type.
9722
9723 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9724
9725         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9726         `expr' for the temporary result, as that will fail if we do
9727         multiple resolves on the same expression.
9728
9729 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9730
9731         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9732         ec.TypeContainer for looking up aliases. 
9733
9734         * class.cs (TypeContainer): Remove LookupAlias from here.
9735
9736         * decl.cs (DeclSpace); Move here.
9737
9738 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * class.cs (FindMembers): Only call filter if the constructor
9741         bulider is not null.
9742
9743         Also handle delegates in `NestedTypes' now.  Now we will perform
9744         type lookups using the standard resolution process.  This also
9745         fixes a bug.
9746
9747         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9748         This uses Expressions (the limited kind that can be parsed by the
9749         tree) instead of strings.
9750
9751         * expression.cs (ComposedCast.ToString): Implement, used to flag
9752         errors since now we have to render expressions.
9753
9754         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9755         FormArrayType. 
9756
9757         * ecore.cs (SimpleName.ToString): ditto.
9758
9759         * cs-parser.jay: Instead of using strings to assemble types, use
9760         Expressions to assemble the type (using SimpleName, ComposedCast,
9761         MemberAccess).  This should fix the type lookups in declarations,
9762         because we were using a different code path for this.
9763
9764         * statement.cs (Block.Resolve): Continue processing statements
9765         even when there is an error.
9766
9767 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9768
9769         * class.cs (Event.Define): Also remove the `remove' method from
9770         the list of pending items.
9771
9772         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9773         generate more compact code. 
9774
9775 2002-07-17  Martin Baulig  <martin@gnome.org>
9776
9777         * const.cs (Const.LookupConstantValue): Add support for constant
9778         `unchecked' and `checked' expressions.
9779         Also adding test case test-140.cs for this.
9780
9781 2002-07-17  Martin Baulig  <martin@gnome.org>
9782
9783         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9784         check whether mi.ReturnType implements the IEnumerator interface; the
9785         `==' and the IsAssignableFrom() will fail in this situation.
9786
9787 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9788
9789         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9790         here too.
9791
9792 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9793
9794         * expression.cs: fixed bug #27811.
9795
9796 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9799         Molaro: when we are a ref, the value already contains a pointer
9800         value, do not take the address of it.
9801
9802 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9803         * removed mb-parser.jay and mb-tokenizer.cs
9804
9805 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9806
9807         * expression.cs: check against the building corlib void type.
9808
9809 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9810
9811         * ecore.cs: fix for valuetype static readonly fields: when 
9812         initializing them, we need their address, not the address of a copy.
9813
9814 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9815
9816         * typemanager.cs: register also enum_type in corlib.
9817
9818 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9819
9820         * class.cs: allow calling this (but not base) initializers in structs.
9821
9822 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9823
9824         * ecore.cs: make sure we compare against the building base types
9825         in GetTypeSize ().
9826
9827 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9828
9829         * typemanager.cs: fix TypeToCoreType() to handle void and object
9830         (corlib gets no more typerefs after this change).
9831
9832 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9833
9834         * expression.cs (ArrayCreation.EmitArrayArguments): use
9835         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9836
9837         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9838         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9839         array indexes, the runtime actually forbids them.
9840
9841         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9842         for array arguments here.
9843
9844         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9845         instead of the default for ValueTypes.
9846
9847         (New.DoEmit): Use IsValueType instead of
9848         IsSubclassOf (value_type)
9849         (New.DoResolve): ditto.
9850         (Invocation.EmitCall): ditto.
9851
9852         * assign.cs (Assign): ditto.
9853
9854         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9855         Statements *are* currently doing part of their resolution during
9856         Emit.  
9857
9858         Expressions do always resolve during resolve, but statements are
9859         only required to propagate resolution to their children.
9860
9861 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9862
9863         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9864
9865         (LoadAssembly): Do not add the dll if it is already specified
9866
9867         (MainDriver): Add the System directory to the link path at the end,
9868         after all the other -L arguments. 
9869
9870         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9871         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9872         ldelem.u1) and using the opposite for sbytes.
9873
9874         This fixes Digger, and we can finally run it.
9875
9876         * driver.cs (UnixParseOption): Move the option parsing here.  
9877         (CSCParseOption): Implement CSC-like parsing of options.
9878
9879         We now support both modes of operation, the old Unix way, and the
9880         new CSC-like way.  This should help those who wanted to make cross
9881         platform makefiles.
9882
9883         The only thing broken is that /r:, /reference: and /lib: are not
9884         implemented, because I want to make those have the same semantics
9885         as the CSC compiler has, and kill once and for all the confussion
9886         around this.   Will be doing this tomorrow.
9887
9888         * statement.cs (Unsafe.Resolve): The state is checked during
9889         resolve, not emit, so we have to set the flags for IsUnsfe here.
9890
9891 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9892
9893         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9894         not catch the Error_ObjectRefRequired in SimpleName (as it is
9895         possible to have a class/instance variable name that later gets
9896         deambiguated), we have to check this here.      
9897
9898 2002-07-10  Ravi Pratap  <ravi@ximian.com>
9899
9900         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
9901         make static and put into Expression.
9902
9903         (Event.Define): Register the private field of the event with the 
9904         TypeManager so that GetFieldFromEvent can get at it.
9905
9906         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
9907         keep track of the private field associated with an event which
9908         has no accessors.
9909
9910         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
9911         private field.
9912
9913         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
9914
9915 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9916
9917         * expression.cs (Binary.EmitBranchable): this routine emits the
9918         Binary expression in a branchable context.  This basically means:
9919         we need to branch somewhere, not just get the value on the stack.
9920
9921         This works together with Statement.EmitBoolExpression.
9922
9923         * statement.cs (Statement.EmitBoolExpression): Use
9924         EmitBranchable. 
9925
9926 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * statement.cs (For): Reduce the number of jumps in loops.
9929
9930         (For): Implement loop inversion for the For statement.
9931
9932         (Break): We can be breaking out of a Try/Catch controlled section
9933         (foreach might have an implicit try/catch clause), so we need to
9934         use Leave instead of Br.
9935
9936         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
9937         now).  If the instace expression supports IMemoryLocation, we use
9938         the AddressOf method from the IMemoryLocation to extract the
9939         address instead of emitting the instance.
9940
9941         This showed up with `This', as we were emitting the instance
9942         always (Emit) instead of the Address of This.  Particularly
9943         interesting when This is a value type, as we dont want the Emit
9944         effect (which was to load the object).
9945
9946 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
9947
9948         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
9949
9950         * statement.cs (Checked): Set the CheckedState during the resolve
9951         process too, as the ConvCast operations track the checked state on
9952         the resolve process, and not emit.
9953
9954         * cs-parser.jay (namespace_member_declaration): Flag that we have
9955         found a declaration when we do.  This is used to flag error 1529
9956
9957         * driver.cs: Report ok when we display the help only.
9958
9959 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
9960
9961         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
9962
9963 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
9964
9965         * cs-tokenizer.cs (define): We also have to track locally the
9966         defines.  AllDefines is just used for the Conditional Attribute,
9967         but we also need the local defines for the current source code. 
9968
9969 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * statement.cs (While, For, Do): These loops can exit through a
9972         Break statement, use this information to tell whether the
9973         statement is the last piece of code.
9974
9975         (Break): Flag that we break.
9976
9977         * codegen.cs (EmitContexts): New `Breaks' state variable.
9978
9979 2002-07-03  Martin Baulig  <martin@gnome.org>
9980
9981         * class.cs (TypeContainer.MethodModifiersValid): Allow override
9982         modifiers in method declarations in structs.  Otherwise, you won't
9983         be able to override things like Object.Equals().
9984
9985 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9986
9987         * class.cs (Method, Property, Indexer): Do not allow the public
9988         modifier to be used in explicit interface implementations.
9989
9990         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
9991         override modifiers in method declarations in structs
9992
9993 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
9994
9995         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
9996         integer or real overflow, report an error
9997
9998 2002-07-02  Martin Baulig  <martin@gnome.org>
9999
10000         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
10001         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
10002         to tell the runtime about our newly created System.Object and
10003         System.ValueType types.
10004
10005 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
10006
10007         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
10008         struct instead of Ldarg/Starg.
10009
10010 2002-07-02  Martin Baulig  <martin@gnome.org>
10011
10012         * expression.cs (Indirection.Indirection): Call
10013         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
10014
10015 2002-07-02  Martin Baulig  <martin@gnome.org>
10016
10017         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
10018         ValueType, call TypeManager.TypeToCoreType() on it.
10019         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
10020         the OpCodes.Newarr argument.
10021
10022 2002-07-02  Martin Baulig  <martin@gnome.org>
10023
10024         * expression.cs (Invocation.EmitCall): When compiling corlib,
10025         replace all calls to the system's System.Array type to calls to
10026         the newly created one.
10027
10028         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
10029         System.Array methods.
10030         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
10031         from the system's System.Array type which must be replaced.
10032
10033 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
10034
10035         * typemanager.cs: load unverifiable_code_ctor so we can build
10036         corlib using the correct type. Avoid using GetTypeCode() with
10037         TypeBuilders.
10038         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
10039         TypeManager.object_type to allow building corlib.
10040
10041 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
10042
10043         * ecore.cs: handle System.Enum separately in LoadFromPtr().
10044
10045 2002-07-01  Martin Baulig  <martin@gnome.org>
10046
10047         * class.cs: Make the last change actually work, we need to check
10048         whether `ifaces != null' to avoid a crash.
10049
10050 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
10051
10052         * class.cs: when we build structs without fields that implement
10053         interfaces, we need to add the interfaces separately, since there is
10054         no API to both set the size and add the interfaces at type creation
10055         time.
10056
10057 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
10058
10059         * expression.cs: the dimension arguments to the array constructors
10060         need to be converted if they are a long.
10061
10062 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
10063
10064         * class.cs: don't emit ldarg.0 if there is no parent constructor
10065         (fixes showstopper for corlib).
10066
10067 2002-06-29  Martin Baulig  <martin@gnome.org>
10068
10069         MCS now compiles corlib on GNU/Linux :-)
10070
10071         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
10072         ie. check for MethodImplOptions.InternalCall.
10073
10074         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
10075         and TypeManager.attribute_type are null, so we must explicitly check
10076         whether parent is not null to find out whether it's an attribute type.
10077         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
10078         and SetBuilder, not only if the property is neither abstract nor external.
10079         This is necessary to set the MethodImplOptions on the accessor methods.
10080         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
10081         SetBuilder, see Property.Emit().
10082
10083         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
10084         populate "System.Object", "System.ValueType" and "System.Attribute" since
10085         they've already been populated from BootCorlib_PopulateCoreTypes().
10086
10087 2002-06-29  Martin Baulig  <martin@gnome.org>
10088
10089         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
10090         is the NullLiteral, we also need to make sure that target_type is not
10091         an enum type.   
10092
10093 2002-06-29  Martin Baulig  <martin@gnome.org>
10094
10095         * rootcontext.cs (RootContext.ResolveCore): We must initialize
10096         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
10097         before calling BootstrapCorlib_ResolveDelegate ().
10098
10099 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10100
10101         * statement.cs: fixed build-breaker. All tests passed ok.
10102
10103 2002-06-27  Martin Baulig  <martin@gnome.org>
10104
10105         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
10106         for System.Decimal when compiling corlib.
10107
10108 2002-06-27  Martin Baulig  <martin@gnome.org>
10109
10110         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
10111         switch blocks which contain nothing but a default clause.
10112
10113 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
10114
10115        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
10116
10117 2002-06-27  Martin Baulig  <martin@gnome.org>
10118
10119         * ecore.cs (PropertyExpr.PropertyExpr): Call
10120         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
10121
10122         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
10123         is already a TypeBuilder.
10124
10125 2002-06-27  Martin Baulig  <martin@gnome.org>
10126
10127         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
10128         `target_type == TypeManager.array_type', not IsAssignableFrom() in
10129         the "from an array-type to System.Array" case.  This makes it work
10130         when compiling corlib.
10131
10132 2002-06-27  Martin Baulig  <martin@gnome.org>
10133
10134         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
10135         non-static PropertyExpr, set its InstanceExpression.  This makes
10136         the `ICollection.Count' property work in System/Array.cs.
10137
10138 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
10139
10140         * driver.cs: Made error handling more consistent.  Errors now
10141         tracked by Report class, so many methods which used to return int
10142         now return void.  Main() now prints success/failure and 
10143         errors/warnings message.
10144
10145         Renamed '--probe' compiler argument to '--expect-error'.  Removed
10146         the magic number return values (123 and 124).  Now, if the
10147         expected error occurs, the compiler exits with success (exit value
10148         0).  If the compilation completes without seeing that particular
10149         error, the compiler exits with failure (exit value 1).  The
10150         makefile in mcs/errors has been changed to handle the new behaviour.
10151
10152         * report.cs: Made 'expected error' number a property and renamed
10153         it from 'Probe' to 'ExpectedError'.
10154
10155         * genericparser.cs: Removed error handling support, since it is
10156         now all done by Report class.
10157
10158         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
10159         class, so parse() no longer returns an int.
10160
10161         * namespace.cs: Use Report.Error instead of GenericParser.error
10162
10163 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
10164
10165         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
10166         TypeContainer.AddOperator): At the front of the list put the
10167         explicit implementations, so they get resolved/defined first. 
10168
10169 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
10170
10171         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
10172         interface type is implemented by this TypeContainer.  Used during
10173         explicit interface implementation.
10174
10175         (Property.Define, Indexer.Define, Method.Define): Validate that
10176         the given interface in the explicit implementation is one of the
10177         base classes for the containing type.
10178
10179         Also if we are explicitly implementing an interface, but there is
10180         no match in the pending implementation table, report an error.
10181
10182         (Property.Define): Only define the property if we are
10183         not explicitly implementing a property from an interface.  Use the
10184         correct name also for those properties (the same CSC uses,
10185         although that is really not needed).
10186
10187         (Property.Emit): Do not emit attributes for explicitly implemented
10188         properties, as there is no TypeBuilder.
10189
10190         (Indexer.Emit): ditto.
10191
10192         Hiding then means that we do not really *implement* a pending
10193         implementation, which makes code fail.
10194
10195 2002-06-22  Martin Baulig  <martin@gnome.org>
10196
10197         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
10198         the return value of Object.GetType().  [FIXME: we need to do this whenever
10199         we get a type back from the reflection library].
10200
10201 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
10202
10203         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
10204
10205 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * attribute.cs: Return null if we can not look up the type.
10208
10209         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
10210         the interface types found.
10211
10212         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
10213         interface types found.
10214
10215         * typemanager.cs (GetInterfaces): Make this routine returns alll
10216         the interfaces and work around the lame differences between
10217         System.Type and System.Reflection.Emit.TypeBuilder in the results
10218         result for GetInterfaces.
10219
10220         (ExpandInterfaces): Given an array of interface types, expand and
10221         eliminate repeated ocurrences of an interface.  This expands in
10222         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
10223         be IA, IB, IC.
10224
10225 2002-06-21  Martin Baulig  <martin@gnome.org>
10226
10227         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
10228         on System.Enum.
10229
10230 2002-06-21  Martin Baulig  <martin@gnome.org>
10231
10232         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
10233         and called with one of the core types, return the corresponding typebuilder for
10234         that type.
10235
10236         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
10237         element type.
10238
10239 2002-06-21  Martin Baulig  <martin@gnome.org>
10240
10241         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
10242         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
10243         (Expression.ConvertReferenceExplicit): Likewise.
10244
10245         * expression.cs (ElementAccess.DoResolve): Likewise.
10246         (ElementAccess.DoResolveLValue): Likewise.
10247
10248 2002-06-10  Martin Baulig  <martin@gnome.org>
10249
10250         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
10251         add the "value" parameter to the parameter list.
10252
10253         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
10254         to our caller.
10255
10256 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
10259         the argument to an int, uint, long or ulong, per the spec.  Also
10260         catch negative constants in array creation.
10261
10262 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
10263
10264         * class.cs: do not allow the same interface to appear twice in
10265         the definition list.
10266
10267 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
10268
10269         * ecore.cs: don't use ldlen with System.Array.
10270
10271 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
10272
10273         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
10274
10275 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
10276
10277         * modifiers.cs: produce correct field attributes for protected
10278         internal. Easy fix so miguel can work on ther harder stuff:-)
10279
10280 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
10281
10282         * pending.cs: New file.  Move the code from class.cs here.
10283         Support clearning the pending flag for all methods (when not doing
10284         explicit interface implementation).
10285
10286 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
10287
10288         * rootcontext.cs: added a couple more types needed to bootstrap.
10289
10290 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
10291
10292         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
10293         constructor in the type, instead of any constructor in the type
10294         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
10295         a bug in the Mono runtime when applying the params attribute). 
10296
10297 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
10298         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
10299
10300 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
10301
10302         * expression.cs (Unary.ResolveOperator): Use TypeManager
10303         to resolve the type.
10304
10305 2002-06-13  Ravi Pratap  <ravi@ximian.com>
10306
10307         * cs-parser.jay (enum_member_declaration): Pass in the attributes
10308         attached.
10309
10310         * enum.cs (AddEnumMember): Add support to store the attributes associated 
10311         with each member too.
10312
10313         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
10314         field builders too - this takes care of the enum member case.
10315
10316 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
10317
10318         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
10319         address-of operator on both value types and pointers.
10320
10321 2002-06-10  Martin Baulig  <martin@gnome.org>
10322
10323         * interface.cs (Interface.PopulateIndexer): Add the indexer's
10324         PropertyBuilder to the `property_builders' list.
10325
10326         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
10327         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
10328         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
10329         find any indexers which are inherited from an interface.
10330
10331 2002-06-09  Martin Baulig  <martin@gnome.org>
10332
10333         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
10334         the same type as the constant if necessary.  There's also a test-130.cs
10335         for this.
10336
10337         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
10338
10339         * typemanager.cs (TypeManager.ChangeType): Previously known as
10340         Enum.ChangeEnumType().
10341
10342 2002-06-09  Martin Baulig  <martin@gnome.org>
10343
10344         * expression.cs (Cast.TryReduce): Added support for consts.
10345
10346 2002-06-08  Ravi Pratap  <ravi@ximian.com>
10347
10348         * class.cs (Accessor): Hold attributes information so we can pass
10349         it along.
10350
10351         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
10352         Modify to pass in attributes attached to the methods.
10353
10354         (add_accessor_declaration, remove_accessor_declaration): Ditto.
10355
10356         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
10357         to handle the Accessor kind :-)
10358
10359         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
10360
10361 2002-06-08  Martin Baulig  <martin@gnome.org>
10362
10363         * expression.cs (Unary.TryReduceNegative): Added support for
10364         ULongConstants.
10365
10366 2002-06-08  Martin Baulig  <martin@gnome.org>
10367
10368         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
10369         name can't be found in the `defined_names' - the caller will do a
10370         MemberLookup in this case and thus find methods in System.Enum
10371         such as Enum.IsDefined().
10372
10373 2002-06-08  Martin Baulig  <martin@gnome.org>
10374
10375         * enum.cs (Enum.ChangeEnumType): This is a custom version of
10376         Convert.ChangeType() which works with TypeBuilder created types.
10377         (Enum.LookupEnumValue, Enum.Define): Use it here.
10378
10379         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
10380         `TypeBuilder.BaseType != null' check.
10381         (TypeContainer.FindMembers): Only lookup parent members if we
10382         actually have a parent.
10383         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
10384         (ConstructorInitializer.Resolve): Likewise.
10385
10386         * interface.cs (Interface.FindMembers): Added
10387         `TypeBuilder.BaseType != null' check.
10388
10389         * rootcontext.cs (RootContext.ResolveCore): Added
10390         "System.Runtime.CompilerServices.IndexerNameAttribute" to
10391         classes_second_stage.
10392
10393         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
10394         debug_type and trace_type when compiling with --nostdlib.       
10395
10396 2002-06-07  Martin Baulig  <martin@gnome.org>
10397
10398         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
10399         (AddField): Set it to true when adding a non-static field.
10400         (DefineType): Use `have_nonstatic_fields' to find out whether we
10401         have non-static fields, not `Fields != null'.
10402
10403 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
10404
10405         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
10406         dereferencing a null on the static-field code path)
10407
10408 2002-05-30  Martin Baulig  <martin@gnome.org>
10409
10410         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
10411         to take command line arguments.  Use reflection to call the new
10412         custom `Initialize' function on the symbol writer and pass it the
10413         command line arguments.
10414
10415         * driver.cs (--debug-args): New command line argument to pass command
10416         line arguments to the symbol writer.
10417
10418 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
10419
10420         * assign.cs (DoResolve): Forgot to do the implicit conversion to
10421         the target type for indexers and properties.  Thanks to Joe for
10422         catching this.
10423
10424 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * typemanager.cs (MethodFlags): returns the method flags
10427         (Obsolete/ShouldIgnore) that control warning emission and whether
10428         the invocation should be made, or ignored. 
10429
10430         * expression.cs (Invocation.Emit): Remove previous hack, we should
10431         not do this on matching a base type, we should do this based on an attribute
10432
10433         Only emit calls to System.Diagnostics.Debug and
10434         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
10435         on the command line.
10436
10437         * rootcontext.cs: Global settings for tracing and debugging.
10438
10439         * cs-tokenizer.cs (define): New utility function to track
10440         defines.   Set the global settings for TRACE and DEBUG if found.
10441
10442 2002-05-25  Ravi Pratap  <ravi@ximian.com>
10443
10444         * interface.cs (Populate*): Pass in the TypeContainer as well as
10445         the DeclSpace as parameters so that we can create EmitContexts and
10446         then use that to apply attributes etc.
10447
10448         (PopulateMethod, PopulateEvent, PopulateProperty)
10449         (PopulateIndexer): Apply attributes everywhere.
10450
10451         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
10452         etc.
10453
10454         (ApplyAttributes): Update accordingly.
10455
10456         We now apply interface attributes for all members too.
10457
10458 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
10459
10460         * class.cs (Indexer.Define); Correctly check if we are explicit
10461         implementation (instead of checking the Name for a ".", we
10462         directly look up if the InterfaceType was specified).
10463
10464         Delay the creation of the PropertyBuilder.
10465
10466         Only create the PropertyBuilder if we are not an explicit
10467         interface implementation.   This means that explicit interface
10468         implementation members do not participate in regular function
10469         lookups, and hence fixes another major ambiguity problem in
10470         overload resolution (that was the visible effect).
10471
10472         (DefineMethod): Return whether we are doing an interface
10473         implementation. 
10474
10475         * typemanager.cs: Temporary hack until we get attributes in
10476         interfaces (Ravi is working on that) and we get IndexerName
10477         support in interfaces.
10478
10479         * interface.cs: Register the indexers as properties.
10480
10481         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
10482         warning, I have verified that this is a bug in the .NET runtime
10483         (JavaScript suffers of the same problem).
10484
10485         * typemanager.cs (MemberLookup): When looking up members for
10486         interfaces, the parent of an interface is the implicit
10487         System.Object (so we succeed in searches of Object methods in an
10488         interface method invocation.  Example:  IEnumerable x;  x.ToString
10489         ()) 
10490
10491 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
10492
10493         * class.cs (Event): Events should also register if they do
10494         implement the methods that an interface requires.
10495
10496         * typemanager.cs (MemberLookup); use the new GetInterfaces
10497         method. 
10498
10499         (GetInterfaces): The code used to lookup interfaces for a type is
10500         used in more than one place, factor it here. 
10501
10502         * driver.cs: Track the errors at the bottom of the file, we kept
10503         on going.
10504
10505         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
10506         instance if the method we are calling is static!
10507
10508 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
10509
10510         * attribute.cs (ApplyAttributes): Make this function filter out
10511         the IndexerName attribute (as that attribute in reality is never
10512         applied) and return the string constant for the IndexerName
10513         attribute. 
10514
10515         * class.cs (TypeContainer.Emit): Validate that all the indexers
10516         have the same IndexerName attribute, and if so, set the
10517         DefaultName attribute on the class. 
10518
10519         * typemanager.cs: The return value might contain other stuff (not
10520         only methods).  For instance, consider a method with an "Item"
10521         property and an Item method.
10522
10523         * class.cs: If there is a problem with the parameter types,
10524         return. 
10525
10526 2002-05-24  Ravi Pratap  <ravi@ximian.com>
10527
10528         * ecore.cs (ImplicitConversionExists): Wrapper function which also
10529         looks at user defined conversion after making a call to 
10530         StandardConversionExists - we need this for overload resolution.
10531
10532         * expression.cs : Update accordingly the various method calls.
10533
10534         This fixes 2 bugs filed against implicit user defined conversions 
10535
10536 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
10537
10538         * statement.cs: Track the result of the assignment.
10539
10540 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
10541
10542         * expression.cs (MemberAccess): Improved error reporting for
10543         inaccessible members.
10544
10545 2002-05-22  Martin Baulig  <martin@gnome.org>
10546
10547         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
10548         itself with debugging support.
10549
10550 2002-05-22  Martin Baulig  <martin@gnome.org>
10551
10552         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
10553         Removed, this isn't needed anymore.
10554
10555 2002-05-20  Martin Baulig  <martin@gnome.org>
10556
10557         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
10558         be underlying type for an enum.
10559
10560 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
10563         that splits out the loading of just the core types.
10564
10565         * rootcontext.cs (ResolveCore): Split the struct resolution in
10566         two, so we can load the enumeration underlying types before any
10567         enums are used.
10568
10569         * expression.cs (Is): Bandaid until we fix properly Switch (see
10570         bug #24985 for details).
10571
10572         * typemanager.cs (ImplementsInterface): The hashtable will contain
10573         a null if there are no interfaces implemented.
10574
10575 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * cs-parser.jay (indexer_declarator): It is fine to have array
10578         parameters
10579
10580 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10581
10582         * typemanager.cs: (RegisterBuilder): New function used to register
10583         TypeBuilders that implement interfaces.  Since
10584         TypeBuilder.GetInterfaces (as usual) does not work with lame
10585         Reflection.Emit. 
10586         (AddUserType): register interfaces.
10587
10588         (ImplementsInterface): Use the builder_to_ifaces hash if we are
10589         dealing with TypeBuilder.  Also, arrays are showing up as
10590         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
10591         methods can not be invoked on them!
10592
10593         * ecore.cs (ExplicitReferenceConversionExists): Made public.
10594         (ImplicitReferenceConversionExists): Split out from
10595         StandardConversionExists. 
10596
10597         * expression.cs (As): We were only implementing one of the three
10598         cases for the as operator.  We now implement them all.
10599         (Is): Implement the various other cases for Is as well.
10600
10601         * typemanager.cs (CACHE): New define used to control if we want or
10602         not the FindMembers cache.  Seems to have a negative impact on
10603         performance currently
10604
10605         (MemberLookup): Nested types have full acess to
10606         enclosing type members
10607
10608         Remove code that coped with instance/static returns for events, we
10609         now catch this in RealFindMembers.
10610
10611         (RealFindMembers): only perform static lookup if the instance
10612         lookup did not return a type or an event.  
10613
10614 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10615
10616         * assign.cs (CompoundAssign): We pass more semantic information
10617         now to Compound Assignments than we did before: now we have all
10618         the information at hand, and now we resolve the target *before* we
10619         do the expression expansion, which allows the "CacheValue" method
10620         to have the effect we intended (before, a [x] += 1 would generate
10621         two differen ArrayAccess expressions from the ElementAccess,
10622         during the resolution process).
10623
10624         (CompoundAssign.DoResolve): Resolve target and original_source here.
10625
10626 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
10627
10628         * expression.cs (ArrayAccess): dropped debugging information. 
10629
10630         * typemanager.cs: Small bug fix: I was always returning i_members,
10631         instead of one of i_members or s_members (depending on which had
10632         the content).
10633
10634         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
10635         method is invoked before any code generation takes place, and it
10636         is a mechanism to inform that the expression will be invoked more
10637         than once, and that the method should use temporary values to
10638         avoid having side effects
10639
10640         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
10641
10642         * ecore.cs (Expression.CacheTemporaries): Provide empty default
10643         implementation.
10644
10645         * expression.cs (Indirection, ArrayAccess): Add support for
10646         CacheTemporaries in these two bad boys. 
10647
10648         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
10649         ldobj or ldind_ref.  
10650         (StoreFromPtr): Handle stobj as well.
10651
10652         * expression.cs (UnaryMutator): Share more code.
10653
10654         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
10655         down: I was not tracking the Filter function as well, which
10656         was affecting the results of the cache.
10657
10658 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
10659
10660         * attribute.cs: Remove the hack to handle the CharSet property on
10661         StructLayouts. 
10662
10663 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * attribute.cs (DoResolve): More uglyness, we now only try to
10666         resolve the attribute partially, to extract the CharSet
10667         information (only if we are a StructLayout attribute).  Otherwise 
10668
10669         (GetExtraTypeInfo): Add some code to conditionally kill in the
10670         future this.   I am more and more convinced that the .NET
10671         framework has special code to handle the attribute setting on
10672         certain elements.
10673
10674         * expression.cs (IsParamsMethodApplicable): Revert my previous
10675         foreach change here, it was wrong.
10676
10677 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
10680         (pp_expr): do not abort on unknown input, just return.
10681         (eval): abort if there are pending chars.
10682
10683         * attribute.cs (Attribute.Resolve): Positional parameters are
10684         optional.  Deal with that case.
10685
10686         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
10687         the Ansi/Unicode/Auto information for the type.
10688
10689         (TypeContainer.DefineType): instantiate the EmitContext here, as
10690         we will be using it during the type definition (to resolve
10691         attributes) and during the emit phase.
10692
10693         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
10694         to pull type information out of the attributes
10695
10696         (Attribute.Resolve): track the constructor builder, and allow for
10697         multiple invocations (structs and classes will use this).
10698
10699         * ecore.cs (MemberLookupFinal): new version with all the
10700         parameters customizable.
10701
10702         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
10703         constructors.  Return if the result value is null (as the error
10704         would have been flagged already by MemberLookupFinal)
10705
10706         Do not allow instances of abstract classes or interfaces to be
10707         created.
10708
10709         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
10710         We have to compare the assembly property here when dealing with
10711         FamANDAssem and Assembly access modifiers, because we might be
10712         creating an assembly from *modules* (that means that we are not
10713         getting TypeBuilders for types defined in other modules that are
10714         part of this assembly).
10715
10716         (Method.Emit): If the method is marked abstract and has a body,
10717         emit an error. 
10718
10719         (TypeContainer.DefineMembers): If both the defined member and the
10720         parent name match are methods, then do not emit any warnings: let
10721         the Method.Define routine take care of flagging warnings.  But if
10722         there is a mismatch (method overrides something else, or method is
10723         overriwritten by something, then emit warning).
10724
10725         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10726         set to null, this means `do not check for the return type on the
10727         signature'. 
10728
10729         (Method.Define): set the return type for the method signature to
10730         null, so that we get methods with the same name and parameters and
10731         different return types.  This is used to flag warning 114 (you are
10732         hiding a method, and you probably want to use the new/override
10733         keywords instead).
10734
10735         * typemanager.cs (MemberLookup): Implemented proper access
10736         control, closing a long standing set of bug reports.  The problem
10737         was that the Framework only has two bits: Public and NonPublic,
10738         and NonPublic includes private and protected methods, but we need
10739         to enforce the FamANDAssem, FamOrAssem and Family. 
10740
10741 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10742
10743         * statement.cs (GotoCase): Return true: Ammounts to giving up
10744         knowledge on whether we return or not, and letting the other case
10745         be responsible for it.
10746
10747 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10748
10749         * driver.cs: Do not load directories for each file processed, only
10750         do it if there is a pattern.
10751
10752         * ecore.cs: Report readonly assigns here as well, as we might have
10753         been resolved only by MemberAccess.
10754
10755         (SimpleName.SimpleNameResolve): Also be useful for LValue
10756         resolution.   We need this to propagate assign to local readonly variables
10757
10758         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10759         do not want to reuse potential criteria memory.
10760
10761         * class.cs (MyEventBuilder): Set reflected_type;
10762
10763         * ecore.cs (Constantify): Added support for constifying bools.
10764
10765         (RootContext.LookupType): Added a cache for values looked up in
10766         the declaration space.
10767
10768         * typemanager.cs (FindMembers): Now is a front-end to
10769         RealFindMembers, and provides a two-level hashtable-based cache to
10770         the request.  
10771
10772         15% performance improvement: from 22.5 to 19.2 seconds.
10773
10774         * expression.cs (IsParamsMethodApplicable): use foreach.
10775         (Invocation.DoResolve): ditto.
10776         (New.DoResolve): ditto.
10777         (ArrayCreation.DoResolve): ditto.
10778
10779         * ecore.cs (FindMostEncompassingType): use foreach.
10780
10781         * delegate.cs (NewDelegate.DoResolve): Use foreach
10782
10783         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10784         (RemoveMethods): use foreach.
10785
10786         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10787         nested foreach statements instead of for, and also break out of
10788         the inner loop once a match is found.
10789
10790         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10791
10792 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10793
10794         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10795         we actually unwrap the expression to allow for extra information
10796         to be extracted. 
10797
10798         * expression.cs: Use Shr_Un on unsigned operations. 
10799
10800 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10801
10802         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10803         applicable operators was not being considered correctly. This closes
10804         the bug Miguel reported.
10805
10806 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10807
10808         * attribute.cs: check that the type derives from System.Attribute
10809         and report the correct error in that case (moved the duplicate code to
10810         its own method, too).
10811
10812 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10813
10814         * attribute.cs: lookup attribute type name as the spec says: first the
10815         bare attribute name and then name + "Attribute" (nant compiles with
10816         mcs after this fix).
10817
10818 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10821         Because of the way we parse things, we should try to see if a
10822         UIntConstant can fit in an integer.
10823
10824 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10825
10826         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10827         when we are in an explicit context.
10828
10829         (ConvertReferenceExplicit): When converting from Iface type S to Class
10830         T make sure the rules are implemented as an OR.
10831
10832         * parameter.cs (ParameterType): Make it a property for now although the
10833         purpose really isn't anything immediate.
10834
10835         * expression.cs (Is*Applicable): Do better checking on the parameter type
10836         of a ref/out parameter. The ones from the system assemblies are already 
10837         marked with the correct type so we don't need to do any correction.
10838
10839         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10840         the object type is standard too so include that.
10841
10842 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * ecore.cs (StandardConversionExists): Augment with missing code:
10845         deal with IntConstant, LongConstants and Enumerations.
10846
10847         * assign.cs: Report the error, instead of failing silently
10848
10849         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10850         typecontainer that they are declared, because the
10851         typecontainer/namespace will have the list of using clauses that
10852         need to be applied.
10853
10854         Assembly Attributes were escaping the normal registration
10855         mechanism. 
10856
10857         (EmitCode): Apply attributes within an EmitContext that represents
10858         the container they were declared on.
10859
10860         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10861
10862 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10863
10864         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10865         Revamp completely - make much cleaner as we now operate only
10866         on a set of Types.
10867
10868         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10869         to implement the logic detailed in the spec more correctly.
10870
10871         (UserDefinedConversion): Update accordingly.
10872
10873 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10874
10875         * statement.cs: Return flow analysis information up.
10876
10877         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10878         and the default.
10879
10880         (token): Do not consume an extra character before calling
10881         decimal_digits.
10882
10883 2002-05-06  Piers Haken <piersh@friskit.com>
10884
10885         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10886
10887 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10888
10889         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10890         EmitContext during the instance constructor initializer
10891         resolution, to stop access to instance variables.
10892
10893         This is mandated by the spec, last paragraph of the `constructor
10894         initializers' section. 
10895
10896 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * cs-parser.jay, class.cs (Accessor): new class used to represent
10899         an accessor (get or set).  In the past we used `null' to represent
10900         a missing accessor.  But this is ambiguous because there was no
10901         way to tell in abstract indexers/properties if one of them was
10902         specified.
10903
10904         Now there is a way of addressing that.
10905
10906         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
10907         instead of FindMembers.
10908
10909         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
10910         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
10911
10912         * attribute.cs: Treat indexers and properties as the same in terms
10913         of applying attributes
10914
10915         * ecore.cs (FindMostEncompassedType): Use statically initialized
10916         EmptyExpressions()s like we do elsewhere to avoid creating useless
10917         objects (and we take this out of the tight loop).
10918
10919         (GetConversionOperators): Move the code to extract the actual
10920         operators to a separate routine to clean things up.
10921
10922 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
10923
10924         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
10925         events are always registered FieldBuilders.
10926
10927         * class.cs (FieldBase): New class shared by Fields 
10928
10929         * delegate.cs: If we are a toplevel delegate, use our full name.
10930         If we are a nested delegate, then only use our tail name.
10931
10932 2002-05-02  Ravi Pratap  <ravi@ximian.com>
10933
10934         * expression.cs (IsApplicable): Ensure that we add the "&" to
10935         ref/out types before comparing it with the type of the argument.
10936
10937         (IsParamsMethodApplicable): Ditto.
10938
10939         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
10940         silly me ;-)
10941
10942         * delegate.cs : Handle the case when we have more than one applicable
10943         method. Flag an error only when we finish checking all.
10944
10945 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
10946
10947         * expression.cs: Add support for boolean static initializers.
10948
10949 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
10950
10951         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
10952
10953         * parameter.cs (ComputeParameterTypes,
10954         ComputeAndDefineParameterTypes): Better error handling: now we
10955         clear the `types' cache if we fail during any of the type lookups.
10956         We also return the status code correctly to our caller
10957
10958         * delegate.cs: If we fail to define a delegate, abort the extra
10959         steps. 
10960
10961         * expression.cs (Binary.ResolveOperator): for
10962         operator==(object,object) and operator !=(object, object) we also
10963         have to verify that there is an implicit conversion from one to
10964         the other.
10965
10966         (ArrayAccess.DoResolve): Array Access can operate on
10967         non-variables. 
10968
10969 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
10970
10971         * assign.cs (CompoundAssign): A new class used as a "flag" that
10972         the assignment actually is happening as part of a compound
10973         assignment operator.
10974
10975         During compound assignment, a few new rules exist to enable things
10976         like:
10977
10978         byte b |= 1 + 2
10979
10980         From the spec:
10981
10982         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
10983         to the type of x) if y is implicitly convertible to the type of x,
10984         and the operator is a builtin operator and the return type of the
10985         operator is explicitly convertible to the type of x. 
10986
10987         * rootcontext.cs: Reset warning level to 2.  4 catches various
10988         "interesting" features in mcs, we must clean this up at some
10989         point, but currently am trying to kill other bugs ;-)
10990
10991         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
10992         in container classes as well.  
10993
10994         * expression.cs (Binary.ResolveOperator): Handle string case
10995         before anything else (as operator overloading does emit an error
10996         before doing anything else).
10997
10998         This code could go away when we move to a table driven model, but
10999         i could not come up with a good plan last night.
11000
11001 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
11002
11003         * typemanager.cs (CSharpName): reimplementation using regex.
11004         * class.cs: added null check for fields in Emit
11005         * rootcontext.cs: set warninglevel to 4
11006
11007 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * typemanager.cs (CSharpName): reimplemented with Lupus
11010         suggestion.
11011
11012 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * statement.cs (If): correclty implement Resolve, because we were
11015         not catching sem errors in there.  The same process is needed
11016         everywhere else. 
11017         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
11018
11019
11020         (Statement.Warning_DeadCodeFound): Factorize code.
11021         (While): Report dead code here too.
11022
11023         (Statement): Added Resolve virtual method to allow
11024         for resolution split from the emit code.
11025
11026 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
11027
11028         * statement.cs (EmitBoolExpression): No longer try to resolve the
11029         expression here.    
11030         (MakeBoolean): New utility function that resolve, implicitly
11031         converts to boolean and tags the expression. 
11032
11033
11034         (If, Do): Implement dead code elimination.
11035         (While): Implement loop inversion
11036
11037         (Do, While, For, If): Resolve the expression prior to calling our
11038         code generation.
11039
11040 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
11041
11042         * class.cs:
11043           - added method Report28 (warning: program has more than one entry point)
11044           - added method IsEntryPoint, implements paragraph 10.1 of the spec
11045           - modified method Method.Define, the part at the end of the method
11046
11047         * rootcontext.cs: added static public Location EntryPointLocation;
11048           
11049         * ../errors/cs0028.cs : Add test case for the above warning.              
11050
11051         * typemanager.cs:
11052           - modified method CSharpName to allow arrays of primitive type to
11053             be printed nicely (e.g. instead of System.Int32[][] it now prints
11054             int[][])
11055           - added method CSharpSignature: returns the signature of a method
11056             in string format to be used in reporting errors, warnings, etc.
11057
11058         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
11059         with String.Empty.
11060
11061 2002-04-26  Ravi Pratap  <ravi@ximian.com>
11062
11063         * delegate.cs (Define): Fix extremely silly bug where I was
11064         setting the type of the 'object' parameter of the BeginInvoke
11065         method to System.IAsyncResult instead of System.Object ;-)
11066
11067 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
11070         here. 
11071
11072         (Constructor.Emit): return if we fail to initialize the
11073         constructor.  Another door closed!  
11074
11075         * expression.cs (New.DoResolve): Improve error message (from -6 to
11076         1501).  Use DeclaredOnly lookup to find the exact constructor.
11077
11078         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
11079         loop.  This is useful.
11080
11081         * cs-parser.jay: Adjust the default parameters so that destructors
11082         have the proper signature.
11083
11084 2002-04-26  Martin Baulig  <martin@gnome.org>
11085
11086         * driver.cs (LoadAssembly): If `assembly' contains any characters
11087         which are only valid in path names and not in assembly names
11088         (currently slash, backslash and point), use Assembly.LoadFrom ()
11089         instead of Assembly.Load () on the `assembly' (before iteration
11090         over the link_paths).
11091
11092 2002-04-26  Martin Baulig  <martin@gnome.org>
11093
11094         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
11095
11096 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
11097
11098         * class.cs (Property): use the new typemanager.MemberLookup
11099
11100         (TypeContainer.MemberLookup): Implement using the
11101         TypeManager.MemberLookup now. 
11102
11103         * typemanager.cs: Make MemberLookup a function of the TypeManager,
11104         and return MemberInfos, so that these can be used without an
11105         EmitContext (what we had before).
11106
11107 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
11108
11109         * expression.cs: Fix the case where the argument to params if the
11110         type of the params.  I omitted handling this before.   Fixed
11111
11112 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
11113
11114         * driver.cs: Call BootCorlib_PopulateCoreType
11115
11116         * class.cs (Property.CheckBase): Check for properties only, not
11117         for all members. 
11118
11119         * interface.cs: Temporary hack: try/catch around the
11120         CustomAttributeBuilder, because I am getting an exception that I
11121         do not understand.
11122
11123         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
11124         types whose definitions are required to be there (attributes are
11125         defined before standard types).
11126
11127         Compute definitions as we boot the various types, as they are used
11128         immediately (value_type class will need object_type, but if we do
11129         not initialize object_type, we will pass a null, which will let
11130         the runtime pick the System.Object from the existing corlib, which
11131         is not what we want).
11132
11133 2002-04-22  Patrik Torstensson <totte@labs2.com>
11134
11135         * cs-tokenizer.cs: fixed a number of trim() issues.
11136
11137 2002-04-22  Ravi Pratap  <ravi@ximian.com>
11138
11139         * expression.cs (Argument.Type): Ensure that we return the correct
11140         type when we have out or ref parameters [in which case we 
11141         append a "&"].
11142
11143 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
11144
11145         * class.cs (Property, Indexer): Allow extern modifier in there. 
11146
11147         * typemanager.cs (InitBaseTypes): Initializes object_type and
11148         value_type, since those will be used early on during the bootstrap
11149         process to compile corlib.
11150
11151         (InitCoreTypes): Move code from here to InitBaseTypes.
11152
11153 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
11156         single-dimension arrays as using the ldlen opcode.  
11157
11158         Daniel Lewis discovered this optimization.  
11159
11160         * typemanager.cs: Add signature for System.Array::get_Length
11161
11162 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11163
11164         * statement.cs: report the error when the foreach does not apply to an
11165         array nor a collection.
11166
11167 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
11168
11169         * expression.cs: Add implicit conversions to the operator ~.
11170
11171         * constant.cs (DecimalConstant.Emit): Emit decimal value.
11172
11173         * typemanager.cs: Locate the decimal constructor.
11174
11175 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11176
11177         * attribute.cs: use the new property of TypeOf.
11178         * expression.cs: added 'get' property around typearg.
11179
11180         These changes fix a build breaker reported by NickD. Is this the
11181         correct way to fix?  If not, please, revert my changes and make it
11182         work :-).
11183
11184 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * attribute.cs: Add support for typeof in attribute invocations.
11187         I am not sure that this is right though.
11188
11189 2002-04-14  Duncan Mak  <duncan@ximian.com>
11190
11191         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
11192         Binary.Operator.Division case.
11193
11194 2002-04-13  Ravi Pratap  <ravi@ximian.com>
11195
11196         * class.cs (DefineType): Ensure that we do a proper check on
11197         attribute types and also register it with the TypeManager.
11198
11199         (TypeContainer.Targets): The default for attribute types is
11200         AttributeTargets.All.
11201
11202         * attribute.cs (ApplyAttributes): Registering the attribute type
11203         is done elsewhere, not when we discover we have a Usage attribute.
11204
11205 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11206
11207         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
11208         and get rid of is_delegate parameter.
11209
11210         * everywhere : update.
11211
11212 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11213
11214         * cs-parser.jay (compilation_unit): Revamp completely to use
11215         some new ideas that I got from Rhys' grammar to solve the problems
11216         with assembly level attributes.
11217
11218         (outer_declaration): New grammar production.
11219
11220         (attribute_sections): Add.
11221
11222         (opt_attributes): Base on attribute_sections
11223
11224         (namespace_declaration): Allow opt_attributes to tackle the case
11225         when we have assembly level attributes - we are clever in this
11226         regard now ;-)
11227
11228         * attribute.cs (ApplyAttributes): Do not worry about assembly 
11229         attributes in the non-global context.
11230
11231         * rootcontext.cs (AddGlobalAttributes): Go back to using this
11232         instead of SetGlobalAttributes.
11233
11234         * class.cs, rootcontext.cs : Ensure we define and generate 
11235         attribute types before anything else.
11236
11237         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
11238         and flag the new error -20 for the case when the attribute type
11239         does not have valid targets specified. csc does not catch this.
11240
11241         * ../errors/errors.txt : update for error # -20
11242
11243 2002-04-11  Ravi Pratap  <ravi@ximian.com>
11244
11245         * support.cs (InternalParameters.ParameterModifier): Do some null
11246         checking and return sane values.
11247
11248         * class.cs (Method.Define): If we are a PInvoke method, ensure
11249         that we are static and extern. Report error # 601
11250
11251         * ../errors/cs0601.cs : Add test case for the above error.
11252
11253 2002-04-07  Ravi Pratap  <ravi@ximian.com>
11254
11255         * rootcontext.cs (attribute_types): We need to keep type of
11256         all attribute types separately and emit code for them first.
11257
11258         (RegisterAttribute) : Implement.
11259
11260         * class.cs (DefineType): Check if the current Type is a custom
11261         attribute type and register it accordingly.
11262
11263         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
11264         adding the first attribute twice and rename to
11265
11266         (SetGlobalAttributes): this.
11267
11268         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
11269         lookups.
11270
11271         * attribute.cs (ApplyAttributes): Take an additional argument telling us
11272         if we are processing global arguments. Hmm, I am unsure of this.
11273
11274 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11275
11276         * expression.cs: added static array of strings to avoid calling
11277         Enum.ToString () for Operator in Binary. Significant recover of
11278         performance.
11279
11280 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
11281
11282         * class.cs (FindMembers): Allow the Builders of the various
11283         members to be null.  If they are skip them.  This only happens
11284         during the PInvoke declaration.
11285
11286 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
11289         failure, so we do not keep going afterwards.
11290
11291         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
11292         wanted to pass `false' as the `is_delegate' argument.  If this is
11293         the case, why not use delegate_type == null to mean `is_delegate =
11294         false' and anything else as is_delegate = true.
11295
11296 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
11297
11298         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
11299         code for the section, not the beginning of the tests.
11300
11301 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
11302
11303         * cfold.cs: Handle operator + (Enum x, Underlying x) 
11304
11305         * expression.cs (Binary): same.  Warn about errors where we have
11306         Enum/Enum in operator + as well.
11307
11308 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
11309
11310         * statement.cs:
11311                 - added support for switch(bool)
11312                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
11313                 - add TableSwitchEmit() to handle table-based switch statements
11314
11315 2002-04-05  Ravi Pratap  <ravi@ximian.com>
11316
11317         * expression.cs (Invocation.OverloadResolve): Factor out code which
11318         does parameter compatibility checking with arguments so that we can 
11319         re-use the code even from Delegate.VerifyApplicability
11320
11321         (VerifyArgumentsCompat): Move above code here.
11322
11323         * delegate.cs (VerifyApplicability): Get rid of duplicate code
11324         and instead make a call to the above method.
11325
11326 2002-03-31  Ravi Pratap  <ravi@ximian.com>
11327
11328         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
11329         We use it to keep track of classes which are attribute types.
11330
11331 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
11332
11333         * delegate.cs (Delegate.Define): Correctly define the types in the
11334         presence of fixed and array parameters.
11335
11336         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
11337         doing FindMembers.
11338
11339         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
11340         include NonPublic after the first iteration.
11341
11342         * class.cs (Indexer.CheckBase): Only check if both parents are
11343         non-null. 
11344
11345         * cs-parser.jay (accessor_body): If empty, set to null.
11346
11347         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
11348         same code path here to resolve constants names that we did have in
11349         MemberAccess.DoResolve.  There is too much code duplicated here.
11350
11351 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
11354
11355         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
11356         to MakeUnionSet.
11357
11358         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
11359         tokens, numbers and strings.
11360
11361         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
11362         parenthesis.
11363
11364         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
11365         asyncronous parameters and the regular parameters.  
11366
11367         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
11368         specify the target directory.
11369
11370         * expression.cs: (This.DoResolve): Simplify
11371         (As.Emit): Optimize, do not generate IsInst if the expression is
11372         always of the given type.
11373
11374         (Is.DoResolve): Bug fix, we were reporting both always/never for
11375         the is expression.
11376
11377         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
11378         creating too many unnecessary arrays.
11379
11380 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
11381
11382         * class.cs (EmitFieldInitializer): Use Assign expression to assign
11383         fields instead of rolling our own initializer.   Takes care of all
11384         implicit conversions, and drops unnecessary static checks/argument.
11385
11386 2002-03-31  Dick Porter  <dick@ximian.com>
11387
11388         * driver.cs: use the GetDirectories() return values properly, and
11389         use "/" as path separator.
11390
11391 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * expression.cs (Unary): Optimize - - expr into expr.
11394         (Binary): Optimize a + (-b) into a -b.
11395
11396         * codegen.cs (CodeGen): Made all methods static.
11397
11398 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
11399
11400         * rootcontext.cs: 
11401
11402         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
11403         TypeBuilder property.
11404
11405         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
11406         instead. 
11407
11408         * tree.cs: Removed the various RecordXXXX, and replaced with a
11409         single RecordDecl.  Removed all the accessor methods, and just
11410         left a single access point Type 
11411
11412         * enum.cs: Rename DefineEnum to DefineType.
11413
11414         * decl.cs: New abstract method `DefineType' used to unify the
11415         Defines for Enumerations, Interfaces, TypeContainers and
11416         Delegates.
11417
11418         (FindType): Moved LookupInterfaceOrClass here.  Moved the
11419         LookupBaseClasses method that used to live in class.cs and
11420         interface.cs here, and renamed to FindType.
11421
11422         * delegate.cs: Implement DefineType.  Take advantage of the
11423         refactored pattern for locating the parent builder without taking
11424         the parent_builder argument (which we know does not work if we are
11425         nested, and triggering a toplevel definition).
11426
11427 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
11430         accessibility of a member has changed during override and report
11431         an error if so.
11432
11433         * class.cs (Method.Define, Property.Define): Only complain on
11434         overrides if the method is private, any other accessibility is
11435         fine (and since we just checked the permission is the same, we are
11436         good to go).
11437
11438         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
11439         and elif are processed always.  The other pre-processing
11440         directives are only processed if we are "taking" the path
11441
11442 2002-03-29  Martin Baulig  <martin@gnome.org>
11443
11444         * class.cs (Method.Emit): Only emit symbolic debugging info if the
11445         current location is not Null.
11446
11447         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
11448         a separate method so we can profile it.
11449
11450         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
11451         `span.Seconds' are just seconds, but no minutes or hours.
11452         (MainDriver): Profile the CodeGen.SaveSymbols calls.
11453
11454 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11455
11456         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
11457         Remove the gratuitous set of Final:
11458
11459                                 // If an interface implementation, then we can set Final.
11460                                 if (((flags & MethodAttributes.Abstract) == 0) &&
11461                                     implementing.DeclaringType.IsInterface)
11462                                         flags |= MethodAttributes.Final;
11463
11464         I do not know what I was smoking when I used that.
11465
11466
11467         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
11468         step into fixing the name resolution issues for delegates and
11469         unifying the toplevel name resolution.
11470
11471 2002-03-28  Martin Baulig  <martin@gnome.org>
11472
11473         * class.cs (Method.Emit): If we have a symbol writer, call its
11474         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
11475         tell it about the current method.
11476
11477         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
11478         writer that we're going to emit the first byte of IL code for a new
11479         statement (a new source line).
11480         (EmitContext.EmitTopBlock): If we have a symbol writer, call
11481         EmitContext.Mark() before emitting any code.
11482
11483         * location.cs (SymbolDocument): Return null when we're Null.
11484
11485         * statement.cs (Statement): Moved the `Location loc' variable here.
11486         (Statement.EmitBoolExpression): If we have a symbol writer, call
11487         ec.Mark() before emitting any code to tell it that we're at the
11488         beginning of a new statement.
11489         (StatementExpression): Added `Location' argument to the constructor.
11490         (Block): Added public readonly variable `StartLocation' and public
11491         variable `EndLocation'.  The latter is to be set using SetEndLocation().
11492         (Block): Added constructor which takes a start and end location.
11493         (Block.SetEndLocation): New method. This sets the end location.
11494         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
11495         local variables we create.
11496         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
11497         each statement and do also mark the begin and end of the block.
11498
11499         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
11500         tell it the current lexer.Location, use Location.Null for the end of the
11501         block.
11502         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
11503         current block, set its end location using SetEndLocation().
11504         (statement_expression): StatementExpression constructor now takes the
11505         lexer.Location as additional argument.
11506         (for_statement, declare_local_variables): Likewise.
11507         (declare_local_variables): When creating a new implicit block, use the
11508         new Block constructor and pass it the lexer.Location.
11509
11510 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11511
11512         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
11513         members also on the parent interfaces recursively.
11514
11515 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
11516
11517         * report.cs: Use new formats, since Gonzalo finished the missing
11518         bits. 
11519
11520         * expression.cs (Binary.ResolveOperator): added missing operator|
11521         operator& and operator^ for bool/bool.
11522
11523         * cs-parser.jay: CheckDef now takes a Location argument that is
11524         used to report errors more precisly (instead of reporting the end
11525         of a definition, we try to track something which is a lot closer
11526         to the source of the problem).
11527
11528         * cs-tokenizer.cs: Track global token use, so we can properly flag
11529         the use of #define/#undef after the first token has been seen.
11530
11531         Also, rename the reportXXXX to Error_DescriptiveName
11532
11533         * decl.cs (DeclSpace.IsTopLevel): Move property here from
11534         TypeContainer, so that Enum and Interface can use this too.
11535
11536         * class.cs (TypeContainer.LookupInterfaceOrClass,
11537         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
11538         `builder' argument.  Typically this was used to pass the parent
11539         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
11540         the definition).  
11541
11542         The problem is that a nested class could trigger the definition of
11543         a toplevel class, and the builder would be obviously wrong in that
11544         case. 
11545
11546         So we drop this argument, and we compute dynamically the
11547         TypeBuilder/ModuleBuilder (the correct information was available
11548         to us anyways from DeclSpace.Parent)
11549
11550         * interface.cs (Interface.DefineInterface): Drop builder
11551         parameter cleanup like class.cs
11552
11553         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
11554         like class.cs
11555
11556         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
11557         values. 
11558
11559         (Try.Emit): Propagate the returns value from the statement.
11560
11561         (Return.Emit): Even if we are leavning 
11562
11563         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
11564
11565         * modifiers.cs: Fix the computation of MethodAttributes flags.
11566
11567 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
11568
11569         * driver.cs: allow compilation of files that start with '/'.
11570         Add a default case when checking the argument of --target.
11571
11572 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
11573
11574         * interface.cs: Implement the same search algorithm for types in
11575         the interface code.
11576
11577         * delegate.cs: Do not allow multiple definition.
11578
11579         * Recovered ChangeLog that got accidentally amputated
11580
11581         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
11582
11583         * rootcontext.cs: Load manually enum to allow core classes to
11584         contain enumerations.
11585
11586         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
11587         Update to new static methods in TypeManager.
11588
11589         * typemanager.cs (GetMethod, GetConstructor): Use our
11590         implementation of FindMembers to find the members, since during
11591         corlib compilation, the types are TypeBuilders and GetMethod and
11592         GetConstructor do not work.
11593
11594         Make all methods in TypeManager static.
11595
11596         (InitCodeHelpers): Split the functionality from
11597         the InitCodeTypes function.
11598
11599         * driver.cs: Call InitCodeHelpers after we have populated the
11600         types. 
11601
11602         * cs-parser.jay (delegate_declaration): we did not used to compute
11603         the delegate name correctly for void delegates.
11604
11605 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * rootcontext.cs (RootContext): Init the interface_resolve_order
11608         and type_container_resolve_order always.
11609
11610         (ResolveCore, BootstrapCorlib_ResolveClass,
11611         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
11612         compiler when compiling with --nostdlib
11613
11614         * class.cs (TypeContainer.DefineType): Check that our parent is
11615         not null.  This test is most important when we are bootstraping
11616         the core types.
11617
11618         * codegen.cs: Split out the symbol writing code.
11619
11620 2002-03-25  Martin Baulig  <martin@gnome.org>
11621
11622         * driver.cs (-g): Made -g an alias for --debug.
11623
11624 2002-03-24  Martin Baulig  <martin@gnome.org>
11625
11626         * codegen.cs (SymbolWriter): New public variable. Returns the
11627         current symbol writer.
11628         (CodeGen): Added `bool want_debugging_support' argument to the
11629          constructor. If true, tell the ModuleBuild that we want debugging
11630         support and ask it for the ISymbolWriter.
11631         (Save): If we have a symbol writer, call it's Close() method after
11632         saving the assembly.
11633
11634         * driver.c (--debug): New command line argument to create a
11635         debugger information file.
11636
11637         * location.cs (SymbolDocument): New public property. Returns an
11638         ISymbolDocumentWriter object for the current source file or null
11639         if we don't have a symbol writer.
11640
11641 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
11642
11643         * driver.cs (LoadAssembly): Correctly return when all the paths
11644         have been tried and not before.
11645
11646         * statement.cs (Switch.Emit): return the actual coverage for this
11647         statement (returns/not-returns)
11648
11649         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
11650         switch of the statement if we are the last switch section.  That
11651         kills two problems: try/catch problems (we used to emit an empty
11652         nop at the end) and switch statements where all branches would
11653         return. 
11654
11655 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
11656
11657         * driver.cs: Add default assemblies (the equivalent to the
11658         Microsoft CSC.RSP file)
11659
11660         * cs-tokenizer.cs: When updating `cols and setting it to zero,
11661         also update tokens_seen and set it to false.
11662
11663         * driver.cs: Implement --recurse for Mike.
11664
11665         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
11666         correctly splitting out the paths.
11667
11668 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
11669
11670         * interface.cs (Interface.PopulateProperty): Instead of using
11671         `parent' as the declaration space for the set parameters, use
11672         `this' 
11673
11674         * support.cs (InternalParameters): InternalParameters constructor
11675         takes a DeclSpace instead of a TypeContainer.
11676
11677         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
11678         types are being initialized, load the address of it before calling
11679         the function.  
11680
11681         (New): Provide a mechanism to disable the generation of local
11682         value type temporaries when the caller will be providing us with
11683         an address to store it.
11684
11685         (ArrayCreation.EmitDynamicInitializers): Use it.
11686
11687 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
11688
11689         * expression.cs (Invocation.EmitArguments): Only probe for array
11690         property if there is more than one argument.  Sorry about that.
11691
11692         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
11693         empty param arrays.
11694
11695         * class.cs (Method.LabelParameters): Fix incorrect code path that
11696         prevented the `ParamArrayAttribute' from being applied to the
11697         params attribute.
11698
11699 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
11700
11701         * support.cs (ReflectionParameters): Correctly compute whether the
11702         last argument is a params array.  Fixes the problem with
11703         string.Split ('a')
11704
11705         * typemanager.cs: Make the assemblies array always be non-null
11706         (empty, but non-null)
11707
11708         * tree.cs (RecordDecl): New function that abstracts the recording
11709         of names.  This reports error 101, and provides a pointer to the
11710         previous declaration.  Fixes a crash in the compiler.
11711
11712         * cs-parser.jay (constructor_declaration): Update to new grammar,
11713         and provide a constructor_body that can be empty.
11714
11715 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11716
11717         * driver.cs: Add support for --resources.
11718
11719         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11720         Make all types for the various array helper methods be integer.
11721
11722         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11723         CheckState to ConvCast.
11724
11725         (ConvCast): Now it takes a `checked' state argument, to avoid
11726         depending on the emit context for the conversion, and just using
11727         the resolve time setting.
11728
11729         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11730         instead of Invocation.EmitArguments.  We do not emit the original
11731         arguments, instead we emit those which have been converted to
11732         unsigned int expressions.
11733
11734         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11735
11736         * codegen.cs: ditto.
11737
11738         * expression.cs (LocalVariableReference): Drop the use of the
11739         Store function that depended on the variable index.
11740
11741         * statement.cs (VariableInfo): Drop the `Idx' property from this
11742         class, as this is not taking into account the indexes for
11743         temporaries tat we generate during the execution, getting the
11744         indexes wrong.
11745
11746         * class.cs: First emit class initializers, then call the parent
11747         constructor. 
11748
11749         * expression.cs (Binary): Fix opcode emision.
11750         (UnaryMutator.EmitCode): Support checked code generation
11751
11752         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11753         matches for events for both the Static and Instance scans,
11754         pointing to the same element.   Fix that.
11755
11756 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11757
11758         * rootcontext.cs (ResolveTree): Always set the
11759         interface_resolve_order, because nested interfaces will be calling
11760         into us.
11761
11762         * class.cs (GetInterfaceOrClass): Track the same resolution
11763         process used by TypeManager.LookupType.  This fixes the nested
11764         type lookups in class declarations (separate path from
11765         LookupType). 
11766
11767         (TypeContainer.DefineType): Also define nested interfaces.
11768         (TypeContainer.RegisterOrder): New public function used to
11769         register the order in which child interfaces need to be closed.
11770
11771         Nested interfaces need to be closed after their parents have been
11772         created. 
11773
11774         * interface.cs (InterfaceAttr): Put all the logic for computing
11775         the interface attribute here. 
11776
11777         (DefineInterface): Register our interface order with the
11778         RootContext or with the TypeContainer depending on the case.
11779
11780 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11781
11782         * cs-parser.jay: rework foreach statement to work with the new
11783         changes to the policy on SimpleNames.
11784
11785         * report.cs: support Stacktrace on warnings as well.
11786
11787         * makefile: drop --unsafe and /unsafe from the compile.
11788
11789 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11790
11791         * ecore.cs (StandardConversionExists): Modify to take an Expression
11792         as the first parameter. Ensure we do null -> reference type conversion
11793         checking.
11794
11795         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11796         temporary Expression objects.
11797
11798 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11799
11800         * interface.cs: workaround bug in method overloading resolution
11801         (there is already a bugzilla bug for it).
11802
11803 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11804
11805         We could also solve this problem by having a separate path for
11806         performing type lookups, instead of DoResolve, we could have a
11807         ResolveType entry point, and only participating pieces of the
11808         production (simplename, deref, array) would implement this. 
11809
11810         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11811         signal SimpleName to only resolve type names and not attempt to
11812         resolve anything else.
11813
11814         * expression.cs (Cast): Set the flag.
11815
11816         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11817
11818         * class.cs: Only report 108 if there is no `new' modifier.
11819
11820         * cs-parser.jay: rework foreach statement to work with the new
11821         changes to the policy on SimpleNames.
11822
11823         * report.cs: support Stacktrace on warnings as well.
11824
11825         * makefile: drop --unsafe and /unsafe from the compile.
11826
11827 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11828
11829         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11830         lookups here, instead of doing that at parse time.  This means
11831         that our grammar will not introduce `LocalVariableReferences' as
11832         expressions at this point.  That solves the problem of code like
11833         this:
11834
11835         class X {
11836            static void Main ()
11837            { int X = 1;
11838             { X x = null }}}
11839
11840         This is only half the fix.  The full fix requires parameters to
11841         also be handled in this way.
11842
11843         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11844         makes the use more obvious of the DeclSpace.  The
11845         ec.TypeContainer.TypeBuilder is now only used to pull the
11846         TypeBuilder for it.
11847
11848         My theory is that I can get rid of the TypeBuilder completely from
11849         the EmitContext, and have typecasts where it is used (from
11850         DeclSpace to where it matters).  
11851
11852         The only pending problem is that the code that implements Aliases
11853         is on TypeContainer, and probably should go in DeclSpace.
11854
11855         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11856         lookups here, instead of doing that at parse time.  This means
11857         that our grammar will not introduce `LocalVariableReferences' as
11858         expressions at this point.  That solves the problem of code like
11859         this:
11860
11861         class X {
11862            static void Main ()
11863            { int X = 1;
11864             { X x = null }}}
11865
11866         This is only half the fix.  The full fix requires parameters to
11867         also be handled in this way.
11868
11869         * class.cs (Property.DefineMethod): When implementing an interface
11870         method, set newslot, when implementing an abstract method, do not
11871         set the flag (before we tried never setting it, or always setting
11872         it, which is the difference).
11873         (Indexer.DefineMethod): same.
11874         (Method.DefineMethod): same.
11875
11876         * ecore.cs: Only set the status used flag if we get back a Field.
11877
11878         * attribute.cs: Temporary hack, so Paolo can keep working.
11879
11880 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11881
11882         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11883         the unmanaged type in the case we have a MarshalAs attribute.
11884
11885         (Resolve): Handle the case when we are parsing the special MarshalAs
11886         attribute [we need to store the unmanaged type to use later]
11887
11888         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11889         MarshalAs Attribute.
11890
11891         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11892         on parameters and accordingly set the marshalling info.
11893
11894 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11895
11896         * class.cs: Optimizing slightly by removing redundant code after
11897         we switched to the `NoTypes' return value.
11898         (Property.DefineMethod): use NoTypes here too.
11899
11900         This fixes the bug I introduced in my last batch of changes.
11901
11902 2002-03-05  Ravi Pratap  <ravi@ximian.com>
11903
11904         * tree.cs (RecordEnum): Add. We now keep track of enums too.
11905
11906         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
11907         Enums since those are types too. 
11908
11909         * cs-parser.jay (enum_declaration): Record enums as we parse them.
11910
11911         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
11912         thanks to a call during the lookup process.
11913
11914 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
11915
11916         * statement.cs (Foreach): Lots of work to accomodate a particular
11917         kind of foreach statement that I had not kept in mind.  It is
11918         possible to have foreachs on classes that provide a GetEnumerator
11919         method that return objects that implement the "pattern" for using
11920         a foreach, there is no need to support GetEnumerator
11921         specifically. 
11922
11923         This is needed to compile nant.
11924
11925         * decl.cs: Only report 114 if the member is not `Finalize' and if
11926         the warning level is at least 2.
11927
11928         * class.cs: Moved the compare function from Method to
11929         MethodSignature. 
11930
11931         (MethodSignature.InheritableMemberSignatureCompare): Add new
11932         filter function that is used to extract inheritable methods from a
11933         class. 
11934
11935         (Method.Define): Use the new `inheritable_method_signature_filter'
11936         delegate
11937
11938         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
11939         command. 
11940
11941 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
11944
11945         * cs-parser.jay: Add opt_semicolon to the interface declaration.
11946
11947         * expression.cs: Pass location information to
11948         ConvertImplicitStandard. 
11949
11950         * class.cs: Added debugging code to track return values from
11951         interfaces. 
11952
11953 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
11954
11955         * expression.cs (Is.DoResolve): If either side of the `is' is an
11956         interface, do not flag the warning.
11957
11958         * ecore.cs (ImplicitReferenceConversion): We need a separate test
11959         for interfaces
11960
11961         * report.cs: Allow for --fatal to be used with --probe.
11962
11963         * typemanager.cs (NoTypes): Move the definition for the empty Type
11964         array here. 
11965
11966         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
11967         properties. 
11968         (TypeContainer.DefineProxy): New function used to proxy to parent
11969         implementations when implementing interfaces.
11970         (TypeContainer.ParentImplements): used to lookup if our parent
11971         implements a public function that is required by an interface.
11972         (TypeContainer.VerifyPendingMethods): Hook this up.
11973
11974         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
11975         `modules' and `assemblies' arraylists into arrays.  We only grow
11976         these are the very early start up of the program, so this improves
11977         the speedof LookupType (nicely measured).
11978
11979         * expression.cs (MakeByteBlob): Replaced unsafe code with
11980         BitConverter, as suggested by Paolo.
11981
11982         * cfold.cs (ConstantFold.Binary): Special case: perform constant
11983         folding of string concatenation, but if either side is a string,
11984         and the other is not, then return null, and let the runtime use
11985         the concatenation on the string plus the object (using
11986         `Object.ToString'). 
11987
11988 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
11989
11990         Constant Folding has been implemented now.
11991
11992         * expression.cs (Unary.Reduce): Do not throw an exception, catch
11993         the error instead on types that are not supported in one's
11994         complement. 
11995
11996         * constant.cs (Constant and all children): New set of functions to
11997         perform implict and explicit conversions.
11998
11999         * ecore.cs (EnumConstant): Implement the new functions to perform
12000         conversion by proxying to the child expression.
12001
12002         * codegen.cs: (ConstantCheckState): Constant evaluation has its
12003         own separate setting that can not be turned off from the command
12004         line using --unchecked or --checked and is only controlled using
12005         the checked/unchecked statements and expressions.  This setting is
12006         used by the constant folder to flag errors.
12007
12008         * expression.cs (CheckedExpr, UncheckedExpr): Set the
12009         ConstantCheckState as well.   
12010
12011         During Resolve, they also have to flag the state, because the
12012         constant folder runs completely in the Resolve phase.
12013
12014         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
12015         well.
12016
12017 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
12018
12019         * cfold.cs: New file, this file contains the constant folder.
12020
12021         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
12022         argument to track whether we are using the resulting address to
12023         load or store a value and provide better error messages. 
12024
12025         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
12026         new AddressOf arguments.
12027
12028         * statement.cs (Foreach.EmitCollectionForeach): Update
12029
12030         * expression.cs (Argument.Emit): Call AddressOf with proper
12031         arguments to track usage.
12032
12033         (New.DoEmit): Call AddressOf with new arguments.
12034
12035         (Unary.Emit): Adjust AddressOf call.
12036
12037 2002-03-01  Ravi Pratap  <ravi@ximian.com>
12038
12039         * cs-parser.jay (member_access): Change the case for pre-defined types
12040         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
12041         this suggestion.
12042
12043         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
12044         a method body.
12045
12046         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
12047         essentially like methods and apply attributes like MethodImplOptions to them too.
12048
12049         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
12050         not being null.
12051
12052         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
12053         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
12054         is the DeclSpace.
12055
12056         * Update code everywhere accordingly.
12057
12058         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
12059
12060         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
12061
12062 2002-02-28  Ravi Pratap  <ravi@ximian.com>
12063
12064         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
12065         try performing lookups against those instead of jumping straight into using
12066         the 'using' clauses.
12067
12068         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
12069
12070         (LookupType): Perform lookups in implicit parents too.
12071
12072         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
12073         sequence as RootContext.LookupType. 
12074
12075         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
12076         the various cases of namespace lookups into this method.
12077
12078 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
12079
12080         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
12081         in positional arguments)
12082
12083         * class.cs (Operator): Update the AllowedModifiers to contain
12084         extern. 
12085
12086         * cs-parser.jay: Update operator declaration to allow for the
12087         operator body to be empty.
12088
12089         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
12090         values. 
12091
12092 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
12093
12094         * class.cs (Method.Emit): Label parameters.
12095
12096         * driver.cs: Return 1 or 0 as the program exit code.
12097
12098 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * expression.cs: Special case the `null' object when trying to
12101         auto-compute the type, as anything can be explicitly converted to
12102         that. 
12103
12104         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
12105         spotting this Paolo.
12106
12107         (Expression.ImplicitNumericConversion): Perform comparissions of
12108         the type using the underlying type in the case of an enumeration
12109         rather than using the enumeration type for the compare.
12110
12111         Cope with the underlying == type case, which is not possible to
12112         catch before. 
12113
12114         (Expression.ConvertNumericExplicit): Perform comparissions of
12115         the type using the underlying type in the case of an enumeration
12116         rather than using the enumeration type for the compare.
12117
12118         * driver.cs: If the user does not supply an extension, assume .exe
12119
12120         * cs-parser.jay (if_statement): Rewrote so that we can track the
12121         location for the if statement.
12122
12123         * expression.cs (Binary.ConstantFold): Only concat strings when
12124         the operation is "+", not everything ;-)
12125
12126         * statement.cs (Statement.EmitBoolExpression): Take a location
12127         argument. 
12128         (If, While, Do): Track location.
12129
12130         * expression.cs (Binary.ResolveOperator): In the object + string
12131         case, I was missing a call to ConvertImplicit
12132
12133 2002-02-25  Ravi Pratap  <ravi@ximian.com>
12134
12135         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
12136         Location arguments. Ensure we use RootContext.LookupType to do our work
12137         and not try to do a direct Type.GetType and ModuleBuilder.GetType
12138
12139         * interface.cs (PopulateMethod): Handle the type of the parameter being
12140         null gracefully.
12141
12142         * expression.cs (Invocation.BetterFunction): Handle the case when we 
12143         have a params method with no fixed arguments and a call is made with no
12144         arguments.
12145
12146 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
12149         the verbatim-string-literal
12150
12151         * support.cs (InternalParameters.ParameterModifier): handle null
12152         fixed parameters.
12153         (InternalParameters.ParameterType): ditto.
12154
12155         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
12156         duplicating the name of the variable parameter.
12157         (GetParameterByName): Fix bug where we were not looking up array
12158         paramters if they were the only present (thanks Paolo!).
12159         (GetParameterInfo): We only have an empty set of types if both
12160         fixed and array are set to null.
12161         (GetParameterInfo-idx): Handle FixedParameter == null
12162
12163         * cs-parser.jay: Handle the case where there is no catch
12164         statements (missing null test).
12165
12166 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * driver.cs (MainDriver): Be conservative on our command line
12169         handling.
12170
12171         Catch DirectoryNotFoundException when calling GetFiles.
12172
12173         (SplitPathAndPattern): Used to split the input specification into
12174         a path and a pattern that we can feed to Directory.GetFiles.
12175
12176 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
12177
12178         * statement.cs (Fixed): Implement the last case of the Fixed
12179         statement (string handling).
12180
12181         * expression.cs (StringPtr): New class used to return a char * to
12182         a string;  Used by the Fixed statement.
12183
12184         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
12185
12186         * expression.cs (Binary.ResolveOperator): Remove redundant
12187         MemberLookup pn parent type.
12188         Optimize union call, we do not need a union if the types are the same.
12189         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
12190         type.
12191
12192         Specialize the use of MemberLookup everywhere, instead of using
12193         the default settings. 
12194
12195         (StackAlloc): Implement stackalloc keyword.
12196
12197         * cs-parser.jay: Add rule to parse stackalloc.
12198
12199         * driver.cs: Handle /h, /help, /?
12200
12201         * expression.cs (MakeByteBlob): Removed the hacks we had in place
12202         before we supported unsafe code.
12203
12204         * makefile: add --unsafe to the self compilation of mcs.
12205
12206 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
12207
12208         * expression.cs (PointerArithmetic): New class that is used to
12209         perform pointer arithmetic.
12210         (Binary.Resolve): Handle pointer arithmetic
12211         Handle pointer comparission.
12212         (ArrayPtr): Utility expression class that is used to take the
12213         address of an array.
12214
12215         (ElementAccess): Implement array access for pointers
12216
12217         * statement.cs (Fixed): Implement fixed statement for arrays, we
12218         are missing one more case before we are done.
12219
12220         * expression.cs (Indirection): Implement EmitAssign and set the
12221         ExprClass to Variable.  This allows pointer dereferences to be
12222         treated as variables, and to have values assigned to them.
12223
12224         * ecore.cs (Expression.StoreFromPtr): New utility function to
12225         store values dereferencing.
12226
12227 2002-02-20  Ravi Pratap  <ravi@ximian.com>
12228
12229         * expression.cs (Binary.ResolveOperator): Ensure that we are
12230         not trying to operate on a void type - this fixes the reported
12231         bug.
12232
12233         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
12234         the parent implementation is sealed.
12235
12236         * ../errors/cs0239.cs : Add.
12237
12238         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
12239
12240         * typemanager.cs (unverifiable_code_type): Corresponds to 
12241         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
12242         which have unsafe code in them.
12243
12244         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
12245         unsafe context.
12246
12247 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
12248
12249         * cs-tokenizer.cs: Add support for @"litreal strings"
12250
12251         Make tokenizer accept pre-processor directives
12252         on any column (remove the old C-like limitation). 
12253
12254         * rootcontext.cs (EmitCode): Emit any global attributes.
12255         (AddGlobalAttributes): Used to keep track of assembly attributes. 
12256
12257         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
12258
12259         * cs-parser.jay: Add support for global attributes.  
12260
12261 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
12262
12263         * expression.cs (Indirection): New helper class.  Unary will
12264         create Indirection classes to be able to implement the
12265         IMemoryLocation interface on it.
12266
12267 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
12268
12269         * cs-parser.jay (fixed_statement): reference the right statement.
12270
12271         * statement.cs (Fixed.Emit): Finish implementing the fixed
12272         statement for the &x case.
12273
12274 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
12275
12276         * class.cs (Property.Define, Method.Define): Remove newslot when
12277         `implementing'.  
12278
12279         * modifiers.cs: My use of NewSlot when `Abstract' was set was
12280         wrong.  NewSlot should only be used if the `new' keyword is present.
12281
12282         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
12283         locating our system dir.  Sorry about this.
12284
12285 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * driver.cs (GetSystemDir): Compute correctly the location of our
12288         system assemblies.  I was using the compiler directory instead of
12289         the library directory.
12290
12291 2002-02-13  Ravi Pratap  <ravi@ximian.com>
12292
12293         * expression.cs (BetterFunction): Put back in what Miguel commented out
12294         since it is the correct fix. The problem is elsewhere ;-)
12295
12296         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
12297         parameters of the parms method are themselves compatible or not !
12298
12299         (StandardConversionExists): Fix very dangerous bug where we were forgetting
12300         to check that a class implements an interface before saying that an implicit
12301         conversion was allowed. Use ImplementsInterface to do the checking.
12302
12303 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12304
12305         * class.cs (Method.Define): Track whether we are an explicit
12306         implementation or not.  And only call DefineMethodOverride if we
12307         are an explicit implementation.
12308
12309         (Property.DefineMethod): Ditto.
12310
12311 2002-02-11  Ravi Pratap  <ravi@ximian.com>
12312
12313         * expression.cs (BetterFunction): Catch hideous bug which was
12314          preventing us from detecting ambiguous calls due to implicit casts i.e
12315         cs0121.
12316
12317 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
12318
12319         * support.cs (Pair): Remove un-needed method.  I figured why I was
12320         getting the error in cs-parser.jay, the variable in a foreach loop
12321         is readonly, and the compiler does not really treat this as a variable.
12322
12323         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
12324         instead of EQUALS in grammar.  
12325
12326         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
12327
12328         * expression.cs (Unary.DoResolve): Check whether the argument is
12329         managed or not.
12330
12331 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
12332
12333         * support.cs: Api for Pair to set a value.  Despite the fact that
12334         the variables are public the MS C# compiler refuses to compile
12335         code that accesses the field if the variable is part of a foreach
12336         statement. 
12337
12338         * statement.cs (Fixed): Begin implementation of the fixed
12339         statement.
12340
12341         (Block.AddVariable): Return the VariableInfo on success and null
12342         on failure instead of true/false. 
12343
12344         * cs-parser.jay (foreach): Catch errors on variables already
12345         defined (we were ignoring this value before) and properly unwind
12346         the block hierarchy
12347
12348         (fixed_statement): grammar for the fixed statement.
12349
12350 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
12353         pointer types to be incretemented.
12354
12355         (SizeOf): Implement.
12356
12357         * cs-parser.jay (pointer_member_access): Implement
12358         expr->IDENTIFIER production.
12359
12360         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
12361         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
12362         on safe contexts.
12363
12364         (Unary): Implement indirection.
12365
12366         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
12367         use in non-unsafe context).
12368
12369         (SimpleName.DoResolve): Check for pointers in field access on safe
12370         contexts. 
12371
12372         (Expression.LoadFromPtr): Factor the load-indirect code in this
12373         function.  This was duplicated in UnboxCast and ParameterReference
12374
12375 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * expression.cs (ComposedCast): report an error if a pointer cast
12378         is used in a safe region.
12379
12380         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
12381         pointer type casts in unsafe context.
12382
12383         * codegen.cs (EmitContext): Set up IsUnsafe.
12384
12385         * cs-parser.jay (non_expression_type): Add productions for pointer
12386         casts. 
12387
12388         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
12389         code.  We should not use force into static mode if the method is
12390         not virtual.  Fixes bug in MIS
12391
12392         * statement.cs (Do.Emit, While.Emit, For.Emit,
12393         Statement.EmitBoolExpression): Add support to Do and While to
12394         propagate infinite loop as `I do return' semantics.
12395
12396         Improve the For case to also test for boolean constants.
12397
12398         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
12399         to the list of attributes we can add.
12400
12401         Remove `EmitContext' argument.
12402
12403         * class.cs (Method.Define): Apply parameter attributes.
12404         (Constructor.Define): Apply parameter attributes.
12405         (MethodCore.LabelParameters): Move here the core of labeling
12406         parameters. 
12407
12408         * support.cs (ReflectionParameters.ParameterModifier,
12409         InternalParameters.ParameterModifier): Use IsByRef on the type and
12410         only return the OUT bit for these parameters instead of in/out/ref
12411         flags.
12412
12413         This is because I miss-understood things.  The ParameterInfo.IsIn
12414         and IsOut represent whether the parameter has the [In] and [Out]
12415         attributes set.  
12416
12417 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * ecore.cs (FieldExpr.Emit): Release temporaries.
12420
12421         * assign.cs (LocalTemporary.Release): new function.
12422
12423         * codegen.cs (EmitContext.GetTemporaryStorage,
12424         EmitContext.FreeTemporaryStorage): Rework the way we deal with
12425         temporary storage.  Now we can "put back" localbuilders when we
12426         are done with them
12427
12428 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
12431         need to make a copy of the variable to generate verifiable code.
12432
12433 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
12434
12435         * driver.cs: Compute dynamically the system directory.
12436
12437         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
12438         Slower, but more generally useful.  Used by the abstract
12439         registering implementation. 
12440
12441         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
12442         the rules for the special rule on Type/instances.  First check if
12443         we have the same name, and if so, try that special static path
12444         rather than the instance path.
12445
12446 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
12449         for, while and if.
12450
12451         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
12452         Enum, ValueType, Delegate or Array for non-corlib compiles.
12453
12454         * cs-tokenizer.cs: Catch long identifiers (645)
12455
12456         * typemanager.cs (IndexerPropetyName): Ravi never tested this
12457         piece of code.
12458
12459         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
12460         fix, we were returning too early, so we were not registering
12461         pending methods from abstract classes.
12462
12463         Do not register pending methods if the class is abstract.
12464
12465         * expression.cs (Conditional.DoResolve): Report circular implicit
12466         conversions when we neecd to compute it for conditional
12467         expressions. 
12468
12469         (Is.DoResolve): If the expression is always of the provided type,
12470         flag warning 183.  If the expression can not ever be of the
12471         provided type flag warning 184.
12472
12473         * class.cs: Catch 169 as well.
12474
12475         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
12476         read. 
12477
12478 2002-01-18  Nick Drochak  <ndrochak@gol.com>
12479
12480         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
12481
12482 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
12483
12484         * interface.cs: (PopulateMethod): Check for pointers being defined
12485         only if the unsafe context is active.
12486         (PopulateProperty): ditto.
12487         (PopulateIndexer): ditto.
12488
12489         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
12490         specified.  If pointers are present, make sure that they are
12491         present in an unsafe context.
12492         (Constructor, Constructor.Define): ditto.
12493         (Field, Field.Define): ditto.
12494         (Property, Property.Define): ditto.
12495         (Event, Event.Define): ditto.
12496
12497         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
12498         hashtable if there are classes or structs defined.
12499
12500         * expression.cs (LocalVariableReference.DoResolve): Simplify this
12501         code, as the constant resolution moved.
12502
12503         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
12504         the metadata, so we can flag error 133. 
12505
12506         * decl.cs (MemberCore.UnsafeOK): New function to test that a
12507         pointer is being declared in an unsafe context.
12508
12509 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
12510
12511         * modifiers.cs (Modifiers.Check): Require a Location argument.
12512         Report error 227 for Unsafe use.
12513
12514         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
12515
12516         * statement.cs (For.Emit): If the test is null, then report that
12517         we do `return', as we wont reach anything afterwards.
12518
12519         (Switch.SwitchGoverningType): Track the expression that matched
12520         the conversion.
12521
12522         * driver.cs: Allow negative numbers as an error code to flag.
12523
12524         * cs-parser.jay: Handle 1551.
12525
12526         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
12527
12528 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * cs-parser.jay: Report 1518 (type declaration can only contain
12531         class, struct, interface, enum or delegate)
12532
12533         (switch_label): Report 1523 (keywords `case' or `default' must
12534         preced code)
12535
12536         (opt_switch_sections): Report 1522 (empty switch)
12537
12538         * driver.cs: Report 1515 (response file specified multiple times)
12539         Report 1516 (Source file specified multiple times).
12540
12541         * expression.cs (Argument.Resolve): Signal 1510
12542
12543         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
12544         access not allowed in static code)
12545
12546 2002-01-11  Ravi Pratap  <ravi@ximian.com>
12547
12548         * typemanager.cs (IsPointerType): Utility method which we are going
12549         to need a lot.
12550
12551         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
12552         the object type, so we take care of that.
12553
12554         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
12555
12556         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
12557         added to non-params parameters :-)
12558
12559         * typemanager.cs (CSharpName): Include 'void' type too. 
12560
12561         (void_ptr_type): Include in the set of core types.
12562
12563         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
12564         duplicating code.
12565
12566         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
12567         an unsafe context.
12568
12569         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
12570         completely forgotten about it.
12571
12572 2002-01-10  Ravi Pratap  <ravi@ximian.com>
12573
12574         * cs-parser.jay (pointer_type): Add. This begins our implementation
12575         of parsing rules for unsafe code.
12576
12577         (unsafe_statement): Implement.
12578
12579         (embedded_statement): Modify to include the above.
12580
12581         * statement.cs (Unsafe): Implement new class for unsafe blocks.
12582
12583         * codegen.cs (EmitContext.InUnsafe): Add. This determines
12584         if the current context is an unsafe one.
12585
12586         * cs-parser.jay (local_variable_pointer_type): Since local variable types
12587         are handled differently, we need separate rules for them.
12588
12589         (local_variable_declaration): Update to use local_variable_pointer_type
12590         to allow variable declarations of unmanaged pointer types.
12591
12592         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
12593         in unsafe contexts.
12594
12595         * ../errors/cs0214.cs : Add.
12596
12597 2002-01-16  Nick Drochak  <ndrochak@gol.com>
12598
12599         * makefile: remove 'response' file when cleaning.
12600
12601 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12602
12603         * cs-parser.jay: Report 1524.
12604
12605 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
12606
12607         * typemanager.cs (RegisterMethod): drop checking if we have
12608         registered this from here
12609
12610 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
12611
12612         * class.cs (Method.EmitDestructor): Implement calling our base
12613         destructor. 
12614
12615         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
12616         value of InFinally.
12617
12618         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
12619         this routine and will wrap the call in a try/catch block.  Deal
12620         with the case.
12621
12622 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
12623
12624         * ecore.cs (Expression.MemberLookup): instead of taking a
12625         parameter `same_type' that was used to tell whether we could
12626         access private members we compute our containing type from the
12627         EmitContext.
12628
12629         (FieldExpr): Added partial support for volatile fields.  This does
12630         not work for volatile fields exposed from assemblies, as I can not
12631         figure out how to extract the modreq from it.
12632
12633         Updated all the source files to use this.
12634
12635         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
12636         because it is referenced by MemberLookup very often. 
12637
12638 2002-01-09  Ravi Pratap  <ravi@ximian.com>
12639
12640         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
12641         TypeBuilder.GetCustomAttributes to retrieve what we need.
12642
12643         Get rid of redundant default_member_attr_type as this is the same as
12644         default_member_type which already exists.
12645
12646         * interface.cs, attribute.cs : Update accordingly.
12647
12648 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
12649
12650         * typemanager.cs: Enable IndexerPropertyName again.  It does not
12651         work for TYpeBuilders though.  Ravi, can you please fix this?
12652
12653         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
12654
12655         * expression.cs (Argument.Emit): Handle the case of ref objects
12656         being passed to ref functions;  
12657
12658         (ParameterReference.EmitLoad): Loads the content of the pointer
12659         without dereferencing.
12660
12661 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12662
12663         * cs-tokenizer.cs: Implemented the pre-processing expressions.
12664
12665 2002-01-08  Ravi Pratap  <ravi@ximian.com>
12666
12667         * class.cs (Indexer.DefineMethod): Incorporate the interface
12668         type in the name of the method if we are doing explicit interface
12669         implementation.
12670
12671         * expression.cs (ConversionExists): Remove as it is completely obsolete.
12672
12673         (BetterConversion): Fix extremely trivial bug where we were referring to
12674         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
12675         again !
12676
12677         * ../errors/bug16.cs : Add although we have fixed it.
12678
12679 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12680
12681         * expression.cs (BaseIndexer): Begin implementation.
12682
12683         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
12684
12685         * cs-parser.jay (indexer_declarator): Use qualified_identifier
12686         production directly to remove a shift/reduce, and implement
12687         explicit interface implementation.
12688
12689         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
12690         after a floating point suffix.
12691
12692         * expression.cs (DoNumericPromotions): Improved the conversion for
12693         uint/uint.  If we have a constant, we avoid doing a typecast to a
12694         larger type.
12695
12696         * class.cs (Indexer): Implement explicit interface implementation
12697         for indexers.
12698
12699 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
12700
12701         * class.cs: make the default instance constructor public and hidebysig.
12702
12703 2001-01-03  Ravi Pratap  <ravi@ximian.com>
12704
12705         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
12706         so we can call it from elsewhere.
12707
12708         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
12709         we emit it internally if the class has a defined indexer; otherwise the user
12710         emits it by decorating the class definition with the DefaultMemberAttribute.
12711
12712         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
12713         attribute is not used on a type which defines an indexer.
12714
12715         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12716         character when we skip whitespace.
12717
12718         * ../errors/cs0646.cs : Add.
12719
12720 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12723         again. 
12724
12725         * makefile: Add practical target `mcs3.exe' which builds the third
12726         generation compiler. 
12727
12728         * expression.cs (New): Fix structures constructor calling.
12729
12730         * class.cs (Property, Method, Indexer): Emit Final flag on the
12731         method if we are an interface implementation and we are not
12732         abstract. 
12733
12734         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12735         whether this property is referencing a `base' method.
12736
12737         * expression.cs (Invocation.EmitCall): take an extra argument:
12738         is_base, this is used to determine whether the `call' or
12739         `callvirt' opcode should be used.
12740
12741
12742         * delegate.cs: update EmitCall.
12743
12744         * class.cs (Method.Define): Set NewSlot for the cases where we are
12745         not implementing an interface method.
12746
12747         (Property.Define): ditto.
12748
12749 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12750
12751         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12752         'r'.  Allows mcs to parse itself fully.
12753
12754 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12755
12756         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12757         of the number of initializers that require the InitializeArray method.
12758
12759         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12760         update the above field where necessary.
12761
12762         (MakeByteBlob): Update accordingly.
12763
12764         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12765         greater than 2.
12766
12767         (EmitDynamicInitializers): Update in accordance with the new optimization.
12768
12769         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12770         same OpCode applies.
12771
12772         * cs-parser.jay : Fix some glaring errors I introduced.
12773
12774 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12775
12776         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12777         so that we can check for name clashes there too.
12778
12779         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12780         for interface indexers.
12781
12782         * interfaces.cs (Define): Emit the default member attribute.
12783
12784         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12785         variable was being referred to while setting the value ;-)
12786
12787 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12788
12789         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12790         byte-by-byte information when we know the data is zero.
12791
12792         Make the block always a multiple of 4, because
12793         DefineInitializedData has a bug.
12794
12795         * assign.cs: Fix, we should assign from the temporary, not from
12796         the source. 
12797
12798         * expression.cs (MakeByteBlob): Fix my incorrect code.
12799
12800 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * typemanager.cs (EnumToUnderlying): This function is used to get
12803         the underlying type from an enumeration, because it does not
12804         always work. 
12805
12806         * constant.cs: Use the I4_S form for values between -128 and 127.
12807
12808         * statement.cs (Block.LookupLabel): Looks up a label.
12809         (Block): Drop support for labeled blocks.
12810
12811         (LabeledStatement): New kind of statement that represents a label
12812         only.
12813
12814         (Goto): Finally implement this bad boy.
12815
12816         * cs-parser.jay: Update to reflect new mechanism to implement
12817         labels.
12818
12819 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12820
12821         * codegen.cs (EmitContext.This): a codegen property that keeps the
12822         a single instance of this instead of creating many different this
12823         instances. 
12824
12825         * delegate.cs (Delegate.DoResolve): Update to use the property;
12826
12827         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12828
12829         * expression.cs (BaseAccess.DoResolve): Ditto.
12830
12831 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12832
12833         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12834         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12835
12836         (InitCoreTypes): Update accordingly.
12837
12838         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12839         so we can quickly store the state.
12840
12841         (ApplyAttributes): Set the correct implementation flags
12842         for InternalCall methods.
12843
12844 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12845
12846         * expression.cs (EmitCall): if a method is not virtual, then do
12847         not use callvirt on it.
12848
12849         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12850         user defined stuff) requires the use of stobj, which takes an
12851         address on the stack instead of an array and an index.  So emit
12852         the Ldelema operation for it.
12853
12854         (EmitStoreOpcode): Use stobj for valuetypes.
12855
12856         (UnaryMutator.EmitCode): Use the right 1 value depending on
12857         whether we are dealing with int64/uint64, float or doubles.
12858
12859         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12860         constructors that I implemented last night.
12861
12862         (Constructor.IsDefault): Fix to work properly for static
12863         constructors.
12864
12865         * cs-parser.jay (CheckDef): report method signature errors.
12866         Update error number 103 to be 132.
12867
12868         * decl.cs: New AdditionResult enumeration value: MethodExists.
12869         Although we do this check for methods later on in the semantic
12870         analysis, catching repeated default constructors is so easy that
12871         we catch these here. 
12872
12873         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12874         promotions code.
12875
12876         (ParameterReference.EmitAssign, Emit): handle
12877         bools as bytes.
12878
12879         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12880         (ArrayAccess.EmitStoreOpcode): ditto.
12881
12882         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12883
12884         * expression.cs (MakeByteBlob): Complete all the missing types
12885         (uint, short, ushort, byte, sbyte)
12886
12887         * class.cs: Only init instance field initializers on instance
12888         constructors. 
12889
12890         Rename `constructors' to instance_constructors. 
12891
12892         (TypeContainer.AddConstructor): Only add constructors to the list
12893         if it is not static.
12894
12895         Make sure that we handle default_static_constructor independently
12896         everywhere where we handle instance_constructors
12897
12898 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * class.cs: Do not lookup or create a base initializer for a
12901         static constructor.
12902
12903         (ConstructorInitializer.Resolve): use the proper type to lookup
12904         for constructors.
12905
12906         * cs-parser.jay: Report error 1585 (modifiers between type and name).
12907
12908         * enum.cs, interface.cs: Remove CloseType, this is taken care by
12909         in DeclSpace. 
12910
12911         * decl.cs: CloseType is now an virtual method, the default
12912         implementation just closes this type.
12913
12914 2001-12-28  Ravi Pratap  <ravi@ximian.com>
12915
12916         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
12917         to PreserveSig by default. Also emit HideBySig on such methods.
12918
12919         Basically, set the defaults to standard values.
12920
12921         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
12922         argument, if candidate is better, it can't be worse than the best !
12923
12924         (Invocation): Re-write bits to differentiate between methods being
12925         applicable in their expanded form and their normal form - for params
12926         methods of course.
12927
12928         Get rid of use_standard everywhere as only standard conversions are allowed
12929         in overload resolution. 
12930
12931         More spec conformance.
12932
12933 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * driver.cs: Add --timestamp, to see where the compiler spends
12936         most of its time.
12937
12938         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
12939         `this' in static code.
12940
12941         (SimpleName.DoResolve): Implement in terms of a helper function
12942         that allows static-references to be passed upstream to
12943         MemberAccess.
12944
12945         (Expression.ResolveWithSimpleName): Resolve specially simple
12946         names when called by MemberAccess to implement the special
12947         semantics. 
12948
12949         (Expression.ImplicitReferenceConversion): Handle conversions from
12950         Null to reference types before others, as Null's type is
12951         System.Object. 
12952
12953         * expression.cs (Invocation.EmitCall): Handle the special case of
12954         calling methods declared on a reference type from a ValueType
12955         (Base classes System.Object and System.Enum)
12956
12957         (MemberAccess.Resolve): Only perform lookups on Enumerations if
12958         the left hand side is a TypeExpr, not on every enumeration. 
12959
12960         (Binary.Resolve): If types are reference types, then do a cast to
12961         object on operators != and == of both arguments.
12962
12963         * typemanager.cs (FindMembers): Extract instance and static
12964         members if requested.
12965
12966         * interface.cs (PopulateProperty): Use void_type instead of null
12967         as the return type for the setter method.
12968
12969         (PopulateIndexer): ditto.
12970
12971 2001-12-27  Ravi Pratap  <ravi@ximian.com>
12972
12973         * support.cs (ReflectionParameters): Fix minor bug where we
12974         were examining the wrong parameter for the ParamArray attribute.
12975
12976         Cope with requests for the type of the parameter at position
12977         greater than the params parameter's. We now return the element
12978         type of the params array as that makes more sense.
12979
12980         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
12981         accordingly as we no longer have to extract the element type
12982         ourselves.
12983
12984         (Invocation.OverloadResolve): Update.
12985
12986 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12987
12988         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
12989         against IEnumerator, test whether the return value is a descendant
12990         of the IEnumerator interface.
12991
12992         * class.cs (Indexer.Define): Use an auxiliary method to implement
12993         the other bits of the method definition.  Begin support for
12994         explicit interface implementation.
12995
12996         (Property.DefineMethod): Use TypeManager.void_type instead of null
12997         for an empty return value.
12998
12999 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
13000
13001         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
13002         dealing with a FieldExpr which is composed of a FieldBuilder, in
13003         the code path we did extract the constant, but we should have
13004         obtained the underlying value to be able to cast it (otherwise we
13005         end up in an infinite loop, this is what Ravi was running into).
13006
13007         (ArrayCreation.UpdateIndices): Arrays might be empty.
13008
13009         (MemberAccess.ResolveMemberAccess): Add support for section
13010         14.5.4.1 that deals with the special case of E.I when E is a type
13011         and something else, that I can be a reference to a static member.
13012
13013         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
13014         handle a particular array type to create byte blobs, it is just
13015         something we dont generate byteblobs for.
13016
13017         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
13018         arguments. 
13019
13020         * location.cs (Push): remove the key from the hashtable that we
13021         are about to add.   This happens for empty files.
13022
13023         * driver.cs: Dispose files after we have parsed them.
13024
13025         (tokenize): new function that only runs the tokenizer on its
13026         input, for speed testing.
13027
13028 2001-12-26  Ravi Pratap  <ravi@ximian.com>
13029
13030         * class.cs (Event.Define): Define the private field only if there
13031         are no accessors defined.
13032
13033         * expression.cs (ResolveMemberAccess): If there is no associated
13034         field with the event, that means we have an event defined with its
13035         own accessors and we should flag error cs0070 since transforming
13036         ourselves into a field is not valid in that case.
13037
13038         * ecore.cs (SimpleName.DoResolve): Same as above.
13039
13040         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
13041         and charset to sane values.
13042
13043 2001-12-25  Ravi Pratap  <ravi@ximian.com>
13044
13045         * assign.cs (DoResolve): Perform check on events only if they 
13046         are being accessed outside the declaring type.
13047
13048         * cs-parser.jay (event_declarations): Update rules to correctly
13049         set the type of the implicit parameter etc.
13050
13051         (add_accessor, remove_accessor): Set current local parameters.
13052
13053         * expression.cs (Binary): For delegate addition and subtraction,
13054         cast the return value from the method into the appropriate delegate
13055         type.
13056
13057 2001-12-24  Ravi Pratap  <ravi@ximian.com>
13058
13059         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
13060         of these as the workaround is unnecessary.
13061
13062         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
13063         delegate data - none of that is needed at all.
13064
13065         Re-write bits to extract the instance expression and the delegate method
13066         correctly.
13067
13068         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
13069         on delegates too.
13070
13071         * attribute.cs (ApplyAttributes): New method to take care of common tasks
13072         of attaching attributes instead of duplicating code everywhere.
13073
13074         * everywhere : Update code to do attribute emission using the above method.
13075
13076 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
13077
13078         * expression.cs (IsParamsMethodApplicable): if there are not
13079         parameters, return immediately.
13080
13081         * ecore.cs: The 0 literal can be implicity converted to an enum
13082         type. 
13083
13084         (SimpleName.DoResolve): First lookup the type, then lookup the
13085         members. 
13086
13087         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
13088         want to get its address.  If the InstanceExpression is not
13089         addressable, store the result in a temporary variable, then get
13090         the address of it.
13091
13092         * codegen.cs: Only display 219 errors on warning level or above. 
13093
13094         * expression.cs (ArrayAccess): Make it implement the
13095         IMemoryLocation interface.
13096
13097         (Binary.DoResolve): handle the operator == (object a, object b)
13098         and operator != (object a, object b) without incurring into a
13099         BoxedCast (because 5 != o should never be performed).
13100
13101         Handle binary enumerator operators.
13102
13103         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
13104         value type, otherwise use Ldelem_ref.
13105
13106         Use precomputed names;
13107
13108         (AddressOf): Implement address of
13109
13110         * cs-parser.jay (labeled_statement): Fix recursive block
13111         addition by reworking the production.
13112
13113         * expression.cs (New.DoEmit): New has a special case:
13114                 
13115                  If we are dealing with a ValueType, we have a few
13116                  situations to deal with:
13117                 
13118                     * The target of New is a ValueType variable, that is
13119                       easy, we just pass this as the variable reference
13120                 
13121                     * The target of New is being passed as an argument,
13122                       to a boxing operation or a function that takes a
13123                       ValueType.
13124                 
13125                       In this case, we need to create a temporary variable
13126                       that is the argument of New.
13127
13128
13129 2001-12-23  Ravi Pratap  <ravi@ximian.com>
13130
13131         * rootcontext.cs (LookupType): Check that current_type is not null before
13132         going about looking at nested types.
13133
13134         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
13135         not implement the IAssignMethod interface any more.
13136
13137         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
13138         where we tranform them into FieldExprs if they are being resolved from within
13139         the declaring type.
13140
13141         * ecore.cs (SimpleName.DoResolve): Do the same here.
13142
13143         * assign.cs (DoResolve, Emit): Clean up code considerably. 
13144
13145         * ../errors/bug10.cs : Add.
13146
13147         * ../errors/cs0070.cs : Add.
13148
13149         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
13150
13151         * assign.cs : Get rid of EventIsLocal everywhere.
13152
13153 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
13154
13155         * ecore.cs (ConvertIntLiteral): finished the implementation.
13156
13157         * statement.cs (SwitchLabel): Convert the value we are using as a
13158         key before looking up the table.
13159
13160 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13161
13162         * codegen.cs (EmitTopBlock): Require a Location argument now.
13163
13164         * cs-parser.jay (constructor_declarator): We need to setup
13165         current_local_parameters before we parse the
13166         opt_constructor_initializer, to allow the variables to be bound
13167         to the constructor arguments.
13168
13169         * rootcontext.cs (LookupType): First lookup nested classes in our
13170         class and our parents before we go looking outside our class.
13171
13172         * expression.cs (ConstantFold): Extract/debox the values at the
13173         beginnning. 
13174
13175         * rootcontext.cs (EmitCode): Resolve the constants first before we
13176         resolve the types.  This is not really needed, but it helps debugging.
13177
13178         * statement.cs: report location.
13179
13180         * cs-parser.jay: pass location to throw statement.
13181
13182         * driver.cs: Small bug fix.
13183
13184         * report.cs: Updated format to be 4-zero filled digits.
13185
13186 2001-12-22  Ravi Pratap  <ravi@ximian.com>
13187
13188         * expression.cs (CheckIndices): Fix minor bug where the wrong
13189         variable was being referred to ;-)
13190
13191         (DoEmit): Do not call EmitStaticInitializers when the 
13192         underlying type is System.Object.
13193
13194 2001-12-21  Ravi Pratap  <ravi@ximian.com>
13195
13196         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
13197         and do the usual workaround for SRE.
13198
13199         * class.cs (MyEventBuilder.EventType): New member to get at the type
13200         of the event, quickly.
13201
13202         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
13203
13204         * assign.cs (Assign.DoResolve): Handle the case when the target
13205         is an EventExpr and perform the necessary checks.
13206
13207         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
13208         interface.
13209
13210         (SimpleName.MemberStaticCheck): Include check for EventExpr.
13211
13212         (EventExpr): Set the type in the constructor itself since we 
13213         are meant to be born fully resolved.
13214
13215         (EventExpr.Define): Revert code I wrote earlier.
13216                 
13217         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
13218         instance expression is null. The instance expression is a This in that case
13219         or a null, depending on whether it is a static method or not.
13220
13221         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
13222         refers to more than one method.
13223
13224         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
13225         and accordingly flag errors.
13226
13227 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13228
13229         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
13230
13231 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13232
13233         * location.cs (ToString): Provide useful rutine.
13234
13235 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13236
13237         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
13238         objects, return the actual integral boxed.
13239
13240         * statement.cs (SwitchLabel): define an ILLabel for each
13241         SwitchLabel. 
13242
13243         (Switch.CheckSwitch): If the value is a Literal, extract
13244         the underlying literal.
13245
13246         Also in the unused hashtable we had, add the SwitchLabel so we can
13247         quickly look this value up.
13248
13249         * constant.cs: Implement a bunch of new constants.  Rewrite
13250         Literal based on this.  Made changes everywhere to adapt to this.
13251
13252         * expression.cs (Expression.MakeByteBlob): Optimize routine by
13253         dereferencing array only once, and also copes with enumrations.
13254
13255         bytes are two bytes wide, not one.
13256
13257         (Cast): Perform constant conversions.
13258
13259         * ecore.cs (TryImplicitIntConversion): Return literals instead of
13260         wrappers to the literals here.
13261
13262         * expression.cs (DoNumericPromotions): long literals can converted
13263         to ulong implicity (this is taken care of elsewhere, but I was
13264         missing this spot).
13265
13266         * ecore.cs (Expression.Literalize): Make the return type Literal,
13267         to improve type checking.
13268
13269         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
13270
13271 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13272
13273         * literal.cs: Revert code from ravi that checked the bounds.  The
13274         bounds are sane by the definition of the type itself. 
13275
13276         * typemanager.cs: Fix implementation of ImplementsInterface.  We
13277         need to actually look up in our parent hierarchy for interfaces
13278         implemented. 
13279
13280         * const.cs: Use the underlying type for enumerations
13281
13282         * delegate.cs: Compute the basename for the delegate creation,
13283         that should fix the delegate test case, and restore the correct
13284         Type Lookup semantics in rootcontext
13285
13286         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
13287         referencing a nested type with the Reflection API is using the "+"
13288         sign. 
13289
13290         * cs-parser.jay: Do not require EOF token at the end.
13291
13292 2001-12-20  Ravi Pratap  <ravi@ximian.com>
13293
13294         * rootcontext.cs (LookupType): Concatenate type names with
13295         a '.' instead of a '+' The test suite passes again.
13296
13297         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
13298         field of the enumeration.
13299
13300         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
13301         the case when the member is an EventExpr.
13302
13303         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
13304         static has an associated instance expression.
13305
13306         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
13307
13308         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
13309
13310         * class.cs (Event.Define): Register event and perform appropriate checks
13311         for error #111.
13312
13313         We define the Add and Remove methods even if the use provides none because
13314         in that case, we provide default implementations ourselves.
13315
13316         Define a private field of the type of the event. This is done by the CSC compiler
13317         and we should be doing it too ;-)
13318
13319         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
13320         More methods we use in code we generate.
13321
13322         (multicast_delegate_type, delegate_type): Two separate types since the distinction
13323         is important.
13324
13325         (InitCoreTypes): Update accordingly for the above.
13326
13327         * class.cs (Event.Emit): Generate code for default accessors that we provide
13328
13329         (EmitDefaultMethod): Do the job in the above.
13330
13331         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
13332         appropriate place.
13333
13334 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13335
13336         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
13337         builders even if we were missing one.
13338
13339         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
13340         pass the Basename as our class name instead of the Name.  The
13341         basename will be correctly composed for us.
13342
13343         * parameter.cs (Paramters): Now takes a Location argument.
13344
13345         * decl.cs (DeclSpace.LookupType): Removed convenience function and
13346         make all the code call directly LookupType in RootContext and take
13347         this chance to pass the Location information everywhere.
13348
13349         * Everywhere: pass Location information.
13350
13351 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
13352
13353         * class.cs (Constructor.Define): Updated way of detecting the
13354         length of the parameters.
13355
13356         (TypeContainer.DefineType): Use basename as the type name for
13357         nested types.
13358
13359         (TypeContainer.Define): Do not recursively define types here, as
13360         definition is taken care in order by the RootContext.
13361
13362         * tree.cs: Keep track of namespaces in a per-file basis.
13363
13364         * parameter.cs (Parameter.ComputeSignature): Update to use
13365         DeclSpace. 
13366
13367         (Parameters.GetSignature): ditto.
13368
13369         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
13370         instead of a TypeContainer.
13371
13372         (Interface.SemanticAnalysis): Use `this' instead of our parent to
13373         resolve names.  Because we need to be resolve in our context, not
13374         our parents.
13375
13376         * driver.cs: Implement response files.
13377
13378         * class.cs (TypeContainer.DefineType): If we are defined, do not
13379         redefine ourselves.
13380
13381         (Event.Emit): Emit the code for add/remove handlers.
13382         (Event.Define): Save the MethodBuilders for add/remove.
13383
13384         * typemanager.cs: Use pair here too.
13385
13386         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
13387         DictionaryEntry requires the first argument to be non-null.  
13388
13389         (enum_declaration): Compute full name for registering the
13390         enumeration.
13391
13392         (delegate_declaration): Instead of using
13393         formal_parameter_list, use opt_formal_parameter_list as the list
13394         can be empty.
13395
13396         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
13397         (EventParsing): New property that controls whether `add' and
13398         `remove' are returned as tokens or identifiers (for events);
13399
13400 2001-12-19  Ravi Pratap  <ravi@ximian.com>
13401
13402         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
13403         use MyEventBuilder only and let it wrap the real builder for us.
13404
13405         (MyEventBuilder): Revamp constructor etc.
13406
13407         Implement all operations that we perform on EventBuilder in precisely the same
13408         way here too.
13409
13410         (FindMembers): Update to use the EventBuilder member.
13411
13412         (Event.Emit): Update accordingly.
13413
13414 2001-12-18  Ravi Pratap  <ravi@ximian.com>
13415
13416         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
13417         by calling the appropriate methods.
13418
13419         (GetCustomAttributes): Make stubs as they cannot possibly do anything
13420         useful.
13421
13422         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
13423
13424 2001-12-17  Ravi Pratap  <ravi@ximian.com>
13425
13426         * delegate.cs (Delegate.Populate): Check that the return type
13427         and various parameters types are indeed accessible.
13428
13429         * class.cs (Constructor.Define): Same here.
13430
13431         (Field.Define): Ditto.
13432
13433         (Event.Define): Ditto.
13434
13435         (Operator.Define): Check that the underlying Method defined itself
13436         correctly - so it's MethodBuilder should not be null.
13437
13438         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
13439         expression happens to be null.
13440
13441         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
13442         members but as of now we don't seem to be able to do anything really useful with it.
13443
13444         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
13445         not the EventBuilder.
13446
13447 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
13448
13449         * cs-tokenizer.cs: Add support for defines.
13450         Add support for #if, #elif, #else, #endif
13451
13452         (eval_var): evaluates a variable.
13453         (eval): stubbed for evaluating functions.
13454
13455         * cs-parser.jay: Pass the defines information
13456
13457         * driver.cs: Add --define command line option.
13458
13459         * decl.cs: Move MemberCore here.
13460
13461         Make it the base class for DeclSpace.  This allows us to catch and
13462         report 108 and 109 for everything now.
13463
13464         * class.cs (TypeContainer.Define): Extract all the members
13465         before populating and emit the warning 108 (new keyword required
13466         to override) instead of having each member implement this.
13467
13468         (MemberCore.Define): New abstract method, we will be using this in
13469         the warning reporting engine in Populate.
13470
13471         (Operator.Define): Adjust to new MemberCore protocol. 
13472
13473         * const.cs (Const): This does not derive from Expression, it is a
13474         temporary object we use to create fields, it is a MemberCore. 
13475
13476         * class.cs (Method.Define): Allow the entry point to be in a
13477         specific class.
13478
13479         * driver.cs: Rewrite the argument handler to clean it up a bit.
13480
13481         * rootcontext.cs: Made it just an auxiliary namespace feature by
13482         making everything static.
13483
13484         * driver.cs: Adapt code to use RootContext type name instead of
13485         instance variable.
13486
13487         * delegate.cs: Remove RootContext argument.
13488
13489         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
13490         argument. 
13491
13492         * class.cs (Event.Define): The lookup can fail.
13493
13494         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
13495
13496         * expression.cs: Resolve the this instance before invoking the code.
13497
13498 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
13499
13500         * cs-parser.jay: Add a production in element_access that allows
13501         the thing to become a "type" reference.  This way we can parse
13502         things like "(string [])" as a type.
13503
13504         Note that this still does not handle the more complex rules of
13505         casts. 
13506
13507
13508         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
13509
13510         * ecore.cs: (CopyNewMethods): new utility function used to
13511         assemble the list of methods from running FindMembers.
13512
13513         (MemberLookup): Rework FindMembers so that 
13514
13515 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * class.cs (TypeContainer): Remove Delegates who fail to be
13518         defined.
13519
13520         * delegate.cs (Populate): Verify that we dont get null return
13521         values.   TODO: Check for AsAccessible.
13522
13523         * cs-parser.jay: Use basename to emit error 574 (destructor should
13524         have the same name as container class), not the full name.
13525
13526         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
13527         possible representation.  
13528
13529         Also implements integer type suffixes U and L.
13530
13531 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * expression.cs (ArrayCreation.DoResolve): We need to do the
13534         argument resolution *always*.
13535
13536         * decl.cs: Make this hold the namespace.  Hold the root context as
13537         well.
13538         (LookupType): Move here.
13539
13540         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
13541
13542         * location.cs (Row, Name): Fixed the code, it was always returning
13543         references to the first file.
13544
13545         * interface.cs: Register properties defined through interfaces.
13546
13547         * driver.cs: Add support for globbing on the command line
13548
13549         * class.cs (Field): Make it derive from MemberCore as well.
13550         (Event): ditto.
13551
13552 2001-12-15  Ravi Pratap  <ravi@ximian.com>
13553
13554         * class.cs (Event::Define): Check that the type of the event is a delegate
13555         type else flag error #66.
13556
13557         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
13558         same.
13559
13560         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
13561         values of EntryPoint, CharSet etc etc.
13562
13563         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
13564
13565         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
13566         be null and we should ignore this. I am not sure if this is really clean. Apparently,
13567         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
13568         which needs this to do its work.
13569
13570         * ../errors/cs0066.cs : Add.
13571
13572 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
13573
13574         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
13575         helper functions.
13576
13577         * class.cs: (MethodSignature.MethodSignature): Removed hack that
13578         clears out the parameters field.
13579         (MemberSignatureCompare): Cleanup
13580
13581         (MemberCore): New base class used to share code between MethodCore
13582         and Property.
13583
13584         (RegisterRequiredImplementations) BindingFlags.Public requires
13585         either BindingFlags.Instace or Static.  Use instance here.
13586
13587         (Property): Refactored code to cope better with the full spec.
13588
13589         * parameter.cs (GetParameterInfo): Return an empty array instead
13590         of null on error.
13591
13592         * class.cs (Property): Abstract or extern properties have no bodies.
13593
13594         * parameter.cs (GetParameterInfo): return a zero-sized array.
13595
13596         * class.cs (TypeContainer.MethodModifiersValid): Move all the
13597         method modifier validation to the typecontainer so we can reuse
13598         this on properties.
13599
13600         (MethodCore.ParameterTypes): return an empty sized array of types.
13601
13602         (Property.Define): Test property modifier validity.
13603
13604         Add tests for sealed/override too.
13605
13606         (Method.Emit): abstract or extern methods have no bodies.
13607
13608 2001-12-14  Ravi Pratap  <ravi@ximian.com>
13609
13610         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
13611         thing.
13612
13613         (Method::Define, ::Emit): Modify accordingly.
13614
13615         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
13616
13617         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
13618
13619         * makefile: Pass in /unsafe.
13620
13621 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
13622
13623         * class.cs (MakeKey): Kill routine.
13624
13625         * class.cs (TypeContainer.Define): Correctly define explicit
13626         method implementations (they require the full interface name plus
13627         the method name).
13628
13629         * typemanager.cs: Deply the PtrHashtable here and stop using the
13630         lame keys.  Things work so much better.
13631
13632         This of course broke everyone who depended on `RegisterMethod' to
13633         do the `test for existance' test.  This has to be done elsewhere.
13634
13635         * support.cs (PtrHashtable): A hashtable that avoid comparing with
13636         the object stupid Equals method (because, that like fails all over
13637         the place).  We still do not use it.
13638
13639         * class.cs (TypeContainer.SetRequiredInterface,
13640         TypeContainer.RequireMethods): Killed these two routines and moved
13641         all the functionality to RegisterRequiredImplementations.
13642
13643         (TypeContainer.RegisterRequiredImplementations): This routine now
13644         registers all the implementations required in an array for the
13645         interfaces and abstract methods.  We use an array of structures
13646         which can be computed ahead of time to reduce memory usage and we
13647         also assume that lookups are cheap as most classes will not
13648         implement too many interfaces.
13649
13650         We also avoid creating too many MethodSignatures.
13651
13652         (TypeContainer.IsInterfaceMethod): Update and optionally does not
13653         clear the "pending" bit if we find that there are problems with
13654         the declaration.
13655
13656         (TypeContainer.VerifyPendingMethods): Update to report errors of
13657         methods that look like implementations but are not.
13658
13659         (TypeContainer.Define): Add support for explicit interface method
13660         implementation. 
13661
13662 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
13663
13664         * typemanager.cs: Keep track of the parameters here instead of
13665         being a feature of the TypeContainer.
13666
13667         * class.cs: Drop the registration of parameters here, as
13668         InterfaceMethods are also interface declarations.
13669
13670         * delegate.cs: Register methods with the TypeManager not only with
13671         the TypeContainer.  This code was buggy.
13672
13673         * interface.cs: Full registation here.
13674
13675 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * expression.cs: Remove reducer for binary expressions, it can not
13678         be done this way.
13679
13680         * const.cs: Put here the code that used to go into constant.cs
13681
13682         * constant.cs: Put here the code for constants, this is a new base
13683         class for Literals.
13684
13685         * literal.cs: Make Literal derive from Constant.
13686
13687 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
13688
13689         * statement.cs (Return.Emit): Report error 157 if the user
13690         attempts to return from a finally block.
13691
13692         (Return.Emit): Instead of emitting a return, jump to the end of
13693         the function.
13694
13695         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
13696         LocalBuilder to store the result of the function.  ReturnLabel is
13697         the target where we jump.
13698
13699
13700 2001-12-09  Radek Doulik  <rodo@ximian.com>
13701
13702         * cs-parser.jay: remember alias in current namespace
13703
13704         * ecore.cs (SimpleName::DoResolve): use aliases for types or
13705         namespaces
13706
13707         * class.cs (LookupAlias): lookup alias in my_namespace
13708
13709         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
13710         aliases hashtable
13711         (LookupAlias): lookup alias in this and if needed in parent
13712         namespaces
13713
13714 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13715
13716         * support.cs: 
13717
13718         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13719         making things static.  I need this to avoid passing the
13720         TypeContainer when calling ParameterType.
13721
13722         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13723         that did string manipulation to compute the type and then call
13724         GetType.  Use Parameter.ParameterType instead.
13725
13726         * cs-tokenizer.cs: Consume the suffix for floating values.
13727
13728         * expression.cs (ParameterReference): figure out whether this is a
13729         reference parameter or not.  Kill an extra variable by computing
13730         the arg_idx during emission.
13731
13732         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13733         function that returns whether a parameter is an out/ref value or not.
13734
13735         (Parameter.ParameterType): The type of the parameter (base,
13736         without ref/out applied).
13737
13738         (Parameter.Resolve): Perform resolution here.
13739         (Parameter.ExternalType): The full type (with ref/out applied).
13740
13741         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13742         support for expressions on the using statement.
13743
13744 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13745
13746         * statement.cs (Using.EmitLocalVariableDecls): Split the
13747         localvariable handling of the using statement.
13748
13749         (Block.EmitMeta): Keep track of variable count across blocks.  We
13750         were reusing slots on separate branches of blocks.
13751
13752         (Try.Emit): Emit the general code block, we were not emitting it. 
13753
13754         Check the type of the declaration to be an IDisposable or
13755         something that can be implicity converted to it. 
13756
13757         Emit conversions if required.
13758
13759         * ecore.cs (EmptyExpression): New utility class.
13760         (Expression.ImplicitConversionExists): New utility function.
13761
13762 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13763
13764         * statement.cs (Using): Implement.
13765
13766         * expression.cs (LocalVariableReference): Support read only variables.
13767
13768         * statement.cs: Remove the explicit emit for the Leave opcode.
13769         (VariableInfo): Add a readonly field.
13770
13771 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13772
13773         * ecore.cs (ConvCast): new class used to encapsulate the various
13774         explicit integer conversions that works in both checked and
13775         unchecked contexts.
13776
13777         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13778         properly generate the overflow opcodes.
13779
13780 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13781
13782         * statement.cs: The correct type for the EmptyExpression is the
13783         element_type, not the variable type.  Ravi pointed this out.
13784
13785 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13786
13787         * class.cs (Method::Define): Handle PInvoke methods specially
13788         by using DefinePInvokeMethod instead of the usual one.
13789
13790         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13791         above to do the task of extracting information and defining the method.
13792
13793 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13794
13795         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13796         of the condition for string type.
13797
13798         (Emit): Move that here. 
13799
13800         (ArrayCreation::CheckIndices): Keep string literals in their expression
13801         form.
13802
13803         (EmitDynamicInitializers): Handle strings appropriately.
13804
13805 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13806
13807         * codegen.cs (EmitContext): Replace multiple variables with a
13808         single pointer to the current Switch statement.
13809
13810         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13811         EmitContext.
13812
13813 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13814
13815         * statement.cs 
13816
13817         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13818         default'.
13819
13820         (Foreach.Emit): Foreach on arrays was not setting
13821         up the loop variables (for break/continue).
13822
13823         (GotoCase): Semi-implented.
13824
13825 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13826
13827         * attribute.cs (CheckAttribute): Handle system attributes by using
13828         Attribute.GetAttributes to examine information we need.
13829
13830         (GetValidPlaces): Same here.
13831
13832         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13833
13834         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13835
13836         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13837
13838         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13839
13840         (Method::Emit): Handle the case when we are a PInvoke method.
13841
13842 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * expression.cs: Use ResolveWithSimpleName on compound names.
13845
13846 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13847
13848         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13849         before trying to reduce it.
13850
13851         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13852
13853         * constant.cs (LookupConstantValue): Implement.
13854
13855         (EmitConstant): Use the above in emitting the constant.
13856
13857         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13858         that are user-defined by doing a LookupConstantValue on them.
13859
13860         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13861         too, like above.
13862
13863 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13866
13867         (BaseAccess.DoResolve): Implement.
13868
13869         (MemberAccess.DoResolve): Split this routine into a
13870         ResolveMemberAccess routine that can be used independently
13871
13872 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13873
13874         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13875         As that share bits of the implementation.  Is returns a boolean,
13876         while As returns the Type that is being probed.
13877
13878 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13879
13880         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13881         instead of a Literal - much easier.
13882
13883         (EnumInTransit): Remove - utterly useless :-)
13884
13885         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13886
13887         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13888
13889         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13890         chain when we have no associated expression.
13891
13892 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13893
13894         * constant.cs (Define): Use Location while reporting the errror.
13895
13896         Also emit a warning when 'new' is used and there is no inherited
13897         member to hide.
13898
13899         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
13900         populated.
13901
13902         (LookupEnumValue): Implement to lookup an enum member's value and define it
13903         if necessary.
13904
13905         (Populate): Re-write accordingly to use the above routine.
13906
13907 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * expression.cs (This): Fix prototype for DoResolveLValue to
13910         override the base class DoResolveLValue.
13911
13912         * cs-parser.cs: Report errors cs574 and cs575 (destructor
13913         declarations) 
13914
13915         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
13916         (we need to load the address of the field here).  This fixes
13917         test-22. 
13918
13919         (FieldExpr.DoResolveLValue): Call the DoResolve
13920         function to initialize the Instance expression.
13921
13922         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
13923         correctly the GetEnumerator operation on a value type.
13924
13925         * cs-parser.jay: Add more simple parsing error catches.
13926
13927         * statement.cs (Switch): Add support for string switches.
13928         Handle null specially.
13929
13930         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
13931
13932 2001-11-28  Ravi Pratap  <ravi@ximian.com>
13933
13934         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
13935
13936         (declare_local_constant): New helper function.
13937
13938         * statement.cs (AddConstant): Keep a separate record of constants
13939
13940         (IsConstant): Implement to determine if a variable is a constant.
13941
13942         (GetConstantExpression): Implement.
13943
13944         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
13945
13946         * statement.cs (IsVariableDefined): Re-write.
13947
13948 2001-11-27  Ravi Pratap  <ravi@ximian.com>
13949
13950         * class.cs (TypeContainer::FindMembers): Look for constants
13951         in the case when we are looking for MemberTypes.Field
13952
13953         * expression.cs (MemberAccess::DoResolve): Check that in the
13954         case we are a FieldExpr and a Literal, we are not being accessed
13955         by an instance reference.
13956
13957         * cs-parser.jay (local_constant_declaration): Implement.
13958
13959         (declaration_statement): Implement for constant declarations.
13960
13961 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * statement.cs (Switch): Catch double defaults.
13964
13965         (Switch): More work on the switch() statement
13966         implementation.  It works for integral values now, need to finish
13967         string support.
13968
13969
13970 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13971
13972         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
13973         integer literals into other integer literals.  To be used by
13974         switch. 
13975
13976 2001-11-24  Ravi Pratap  <ravi@ximian.com>
13977
13978         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
13979         some memory.
13980
13981         (EmitDynamicInitializers): Cope with the above since we extract data
13982         directly from ArrayData now.
13983
13984         (ExpectInitializers): Keep track of whether initializers are mandatory
13985         or not.
13986
13987         (Bounds): Make it a hashtable to prevent the same dimension being 
13988         recorded for every element in that dimension.
13989
13990         (EmitDynamicInitializers): Fix bug which prevented the Set array method
13991         from being found.
13992
13993         Also fix bug which was causing the indices to be emitted in the reverse
13994         order.
13995
13996 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * expression.cs (ArrayCreation): Implement the bits that Ravi left
13999         unfinished.  They do not work, because the underlying code is
14000         sloppy.
14001
14002 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * cs-parser.jay: Remove bogus fixme.
14005
14006         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
14007         on Switch statement.
14008
14009 2001-11-23  Ravi Pratap  <ravi@ximian.com>
14010
14011         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
14012         the same. 
14013
14014         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
14015         parameter. Apparently, any expression is allowed. 
14016
14017         (ValidateInitializers): Update accordingly.
14018
14019         (CheckIndices): Fix some tricky bugs thanks to recursion.
14020
14021         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
14022         I was being completely brain-dead.
14023
14024         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
14025         and re-write acordingly.
14026
14027         (DelegateInvocation): Re-write accordingly.
14028
14029         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
14030
14031         (MakeByteBlob): Handle types more correctly.
14032
14033         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
14034         initialization from expressions but it is incomplete because I am a complete
14035         Dodo :-|
14036
14037 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14038
14039         * statement.cs (If.Emit): Fix a bug that generated incorrect code
14040         on If.  Basically, we have to return `true' (ie, we do return to
14041         our caller) only if both branches of the if return.
14042
14043         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
14044         short-circuit operators, handle them as short circuit operators. 
14045
14046         (Cast.DoResolve): Resolve type.
14047         (Cast.Cast): Take an expression as the target type.
14048
14049         * cs-parser.jay (cast_expression): Remove old hack that only
14050         allowed a limited set of types to be handled.  Now we take a
14051         unary_expression and we resolve to a type during semantic
14052         analysis.
14053
14054         Use the grammar productions from Rhys to handle casts (this is
14055         not complete like Rhys syntax yet, we fail to handle that corner
14056         case that C# has regarding (-x), but we will get there.
14057
14058 2001-11-22  Ravi Pratap  <ravi@ximian.com>
14059
14060         * class.cs (EmitFieldInitializer): Take care of the case when we have a
14061         field which is an array type.
14062
14063         * cs-parser.jay (declare_local_variables): Support array initialization too.
14064
14065         * typemanager.cs (MakeKey): Implement.
14066
14067         (everywhere): Use the above appropriately.
14068
14069         * cs-parser.jay (for_statement): Update for array initialization while
14070         declaring variables.
14071
14072         * ecore.cs : The error message was correct, it's the variable's names that
14073         were misleading ;-) Make the code more readable.
14074
14075         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
14076         the correct type etc.
14077
14078         (ConvertExplicit): Handle Enum types by examining the underlying type.
14079
14080 2001-11-21  Ravi Pratap  <ravi@ximian.com>
14081
14082         * parameter.cs (GetCallingConvention): Always return
14083         CallingConventions.Standard for now.
14084
14085 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14086
14087         * expression.cs (Binary.ResolveOperator): Update the values of `l'
14088         and `r' after calling DoNumericPromotions.
14089
14090         * ecore.cs: Fix error message (the types were in the wrong order).
14091
14092         * statement.cs (Foreach.ProbeCollectionType): Need to pass
14093         BindingFlags.Instance as well 
14094
14095         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
14096         implicit int literal conversion in an empty cast so that we
14097         propagate the right type upstream.
14098
14099         (UnboxCast): new class used to unbox value types.
14100         (Expression.ConvertExplicit): Add explicit type conversions done
14101         by unboxing.
14102
14103         (Expression.ImplicitNumericConversion): Oops, forgot to test for
14104         the target type before applying the implicit LongLiterals to ULong
14105         literal cast.
14106
14107 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
14108
14109         * cs-parser.jay (for_statement): Reworked the way For works: now
14110         we declare manually any variables that are introduced in
14111         for_initializer to solve the problem of having out-of-band code
14112         emition (that is what got for broken).
14113
14114         (declaration_statement): Perform the actual variable declaration
14115         that used to be done in local_variable_declaration here.
14116
14117         (local_variable_declaration): Do not declare anything, just pass
14118         the information on a DictionaryEntry
14119
14120 2001-11-20  Ravi Pratap  <ravi@ximian.com>
14121
14122         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
14123         re-write of the logic to now make it recursive.
14124
14125         (UpdateIndices): Re-write accordingly.
14126
14127         Store element data in a separate ArrayData list in the above methods.
14128
14129         (MakeByteBlob): Implement to dump the array data into a byte array.
14130
14131 2001-11-19  Ravi Pratap  <ravi@ximian.com>
14132
14133         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
14134         into CheckIndices.
14135
14136         * constant.cs (Define): Implement.
14137
14138         (EmitConstant): Re-write fully.
14139
14140         Pass in location info.
14141
14142         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
14143         respectively.
14144
14145         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
14146         DictionaryEntry since we need location info too.
14147
14148         (constant_declaration): Update accordingly.
14149
14150         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
14151         code into another method : UpdateIndices.
14152
14153 2001-11-18  Ravi Pratap  <ravi@ximian.com>
14154
14155         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
14156         some type checking etc.
14157
14158 2001-11-17  Ravi Pratap  <ravi@ximian.com>
14159
14160         * expression.cs (ArrayCreation::ValidateInitializers): Implement
14161         bits to provide dimension info if the user skips doing that.
14162
14163         Update second constructor to store the rank correctly.
14164
14165 2001-11-16  Ravi Pratap  <ravi@ximian.com>
14166
14167         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
14168         and try to implement.
14169
14170         * ../errors/cs0150.cs : Add.
14171
14172         * ../errors/cs0178.cs : Add.
14173
14174 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
14175
14176         * statement.cs: Implement foreach on multi-dimensional arrays. 
14177
14178         * parameter.cs (Parameters.GetParameterByName): Also lookup the
14179         name of the params argument.
14180
14181         * expression.cs: Use EmitStoreOpcode to get the right opcode while
14182         initializing the array.
14183
14184         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
14185         we can use this elsewhere.
14186
14187         * statement.cs: Finish implementation of foreach for single
14188         dimension arrays.
14189
14190         * cs-parser.jay: Use an out-of-band stack to pass information
14191         around, I wonder why I need this.
14192
14193         foreach_block: Make the new foreach_block the current_block.
14194
14195         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
14196         function used to return a static Parameters structure.  Used for
14197         empty parameters, as those are created very frequently.
14198
14199         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
14200
14201 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14202
14203         * interface.cs : Default modifier is private, not public. The
14204         make verify test passes again.
14205
14206 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14207
14208         * support.cs (ReflectionParameters): Fix logic to determine
14209         whether the last parameter is a params one. Test 9 passes again.
14210
14211         * delegate.cs (Populate): Register the builders we define with
14212         RegisterParameterForBuilder. Test 19 passes again.
14213
14214         * cs-parser.jay (property_declaration): Reference $6 instead
14215         of $$ to get at the location.
14216
14217         (indexer_declaration): Similar stuff.
14218
14219         (attribute): Ditto.
14220
14221         * class.cs (Property): Register parameters for the Get and Set methods
14222         if they exist. Test 23 passes again.
14223
14224         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
14225         call to EmitArguments as we are sure there aren't any params arguments. 
14226         Test 32 passes again.
14227
14228         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
14229         IndexOutOfRangeException. 
14230
14231         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
14232         Test 33 now passes again.
14233
14234 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
14237         broke a bunch of things.  Will have to come up with a better way
14238         of tracking locations.
14239
14240         * statement.cs: Implemented foreach for single dimension arrays.
14241
14242 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14243
14244         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
14245         an error.  This removes the lookup from the critical path.
14246
14247         * cs-parser.jay: Removed use of temporary_loc, which is completely
14248         broken. 
14249
14250 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
14251
14252         * support.cs (ReflectionParameters.ParameterModifier): Report
14253         whether the argument is a PARAMS argument or not.
14254
14255         * class.cs: Set the attribute `ParamArrayAttribute' on the
14256         parameter argument.
14257
14258         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
14259         and cons_param_array_attribute (ConstructorInfo for
14260         ParamArrayAttribute)., 
14261
14262         * codegen.cs: Emit the return using the `Return' statement, that
14263         way we can report the error correctly for missing return values. 
14264
14265         * class.cs (Method.Emit): Clean up.
14266
14267         * expression.cs (Argument.Resolve): Take another argument: the
14268         location where this argument is used.  Notice that this is not
14269         part of the "Argument" class as to reduce the size of the
14270         structure (we know the approximate location anyways).
14271
14272         Test if the argument is a variable-reference, if not, then
14273         complain with a 206.
14274
14275         (Argument.Emit): Emit addresses of variables.
14276
14277         (Argument.FullDesc): Simplify.
14278
14279         (Invocation.DoResolve): Update for Argument.Resolve.
14280
14281         (ElementAccess.DoResolve): ditto.
14282
14283         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
14284         method should be virtual, as this method is always virtual.
14285
14286         (NewDelegate.DoResolve): Update for Argument.Resolve.
14287
14288         * class.cs (ConstructorInitializer.DoResolve): ditto.
14289
14290         * attribute.cs (Attribute.Resolve): ditto.
14291
14292 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
14293
14294         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
14295
14296         * expression.cs (ParameterReference): Drop IStackStorage and implement
14297         IAssignMethod instead. 
14298
14299         (LocalVariableReference): ditto.
14300
14301         * ecore.cs (FieldExpr): Drop IStackStorage and implement
14302         IAssignMethod instead. 
14303
14304 2001-11-13  Miguel de Icaza <miguel@ximian.com>
14305
14306         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
14307         enumerations that are used in heavily used structures derive from
14308         byte in a laughable and pathetic attempt to reduce memory usage.
14309         This is the kind of pre-optimzations that you should not do at
14310         home without adult supervision.
14311
14312         * expression.cs (UnaryMutator): New class, used to handle ++ and
14313         -- separatedly from the other unary operators.  Cleans up the
14314         code, and kills the ExpressionStatement dependency in Unary.
14315
14316         (Unary): Removed `method' and `Arguments' from this class, making
14317         it smaller, and moving it all to SimpleCall, so I can reuse this
14318         code in other locations and avoid creating a lot of transient data
14319         strucutres when not required.
14320
14321         * cs-parser.jay: Adjust for new changes.
14322
14323 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * enum.cs (Enum.Populate): If there is a failure during
14326         definition, return
14327
14328         * cs-parser.jay (opt_enum_base): we used to catch type errors
14329         here, but this is really incorrect.  The type error should be
14330         catched during semantic analysis.
14331
14332 2001-12-11  Ravi Pratap  <ravi@ximian.com>
14333
14334         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
14335         current_local_parameters as expected since I, in my stupidity, had forgotten
14336         to do this :-)
14337
14338         * attribute.cs (GetValidPlaces): Fix stupid bug.
14339
14340         * class.cs (Method::Emit): Perform check on applicability of attributes.
14341
14342         (Constructor::Emit): Ditto.
14343
14344         (Field::Emit): Ditto.
14345
14346         (Field.Location): Store location information.
14347
14348         (Property, Event, Indexer, Operator): Ditto.
14349
14350         * cs-parser.jay (field_declaration): Pass in location for each field.
14351
14352         * ../errors/cs0592.cs : Add.
14353
14354 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14355
14356         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
14357
14358         (InitCoreTypes): Update accordingly.
14359
14360         (RegisterAttrType, LookupAttr): Implement.
14361
14362         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
14363         info about the same.
14364
14365         (Resolve): Update to populate the above as necessary.
14366
14367         (Error592): Helper.
14368
14369         (GetValidPlaces): Helper to the above.
14370
14371         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
14372
14373         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
14374
14375 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14376
14377         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
14378
14379         * ../errors/cs0617.cs : Add.
14380
14381 2001-11-11  Ravi Pratap  <ravi@ximian.com>
14382
14383         * enum.cs (Emit): Rename to Populate to be more consistent with what
14384         we expect it to do and when exactly it is called.
14385
14386         * class.cs, rootcontext.cs : Update accordingly.
14387
14388         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
14389         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
14390
14391         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
14392
14393         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
14394         of a fieldinfo using the above, when dealing with a FieldBuilder.
14395
14396 2001-11-10  Ravi Pratap  <ravi@ximian.com>
14397
14398         * ../errors/cs0031.cs : Add.
14399
14400         * ../errors/cs1008.cs : Add.
14401
14402         * ../errrors/cs0543.cs : Add.
14403
14404         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
14405         enum type.
14406
14407         (FindMembers): Implement.
14408
14409         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
14410         enums and delegates too.
14411
14412         (enum_types): Rename to builder_to_enum.
14413
14414         (delegate_types): Rename to builder_to_delegate.
14415
14416         * delegate.cs (FindMembers): Implement.
14417
14418 2001-11-09  Ravi Pratap  <ravi@ximian.com>
14419
14420         * typemanager.cs (IsEnumType): Implement.
14421
14422         * enum.cs (Emit): Re-write parts to account for the underlying type
14423         better and perform checking etc.
14424
14425         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
14426         of the underlying type.
14427
14428         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
14429         value
14430
14431         * enum.cs (error31): Helper to report error #31.
14432
14433         * cs-parser.jay (enum_declaration): Store location of each member too.
14434
14435         * enum.cs (member_to_location): New hashtable. 
14436
14437         (AddEnumMember): Update location hashtable.
14438
14439         (Emit): Use the location of each member while reporting errors.
14440
14441 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14442
14443         * cs-parser.jay: A for_initializer if is a
14444         local_variable_declaration really ammount to have an implicit
14445         block with the variable declaration and no initializer for for.
14446
14447         * statement.cs (For.Emit): Cope with null initializers.
14448
14449         This fixes the infinite loop on for initializers.
14450
14451 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
14452
14453         * enum.cs: More cleanup.
14454
14455         * ecore.cs: Remove dead code.
14456
14457         * class.cs (Property.Emit): More simplification.
14458         (Event.Emit): ditto.
14459
14460         Reworked to have less levels of indentation.
14461
14462 2001-11-08  Ravi Pratap  <ravi@ximian.com>
14463
14464         * class.cs (Property): Emit attributes.
14465
14466         (Field): Ditto.
14467
14468         (Event): Ditto.
14469
14470         (Indexer): Ditto.
14471
14472         (Operator): Ditto.
14473
14474         * enum.cs (Emit): Ditto.
14475
14476         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
14477         Enums too.
14478
14479         * class.cs (Field, Event, etc.): Move attribute generation into the
14480         Emit method everywhere.
14481
14482         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
14483         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
14484         as we had no way of defining nested enums !
14485
14486         * rootcontext.cs : Adjust code accordingly.
14487
14488         * typemanager.cs (AddEnumType): To keep track of enum types separately.
14489
14490 2001-11-07  Ravi Pratap  <ravi@ximian.com>
14491
14492         * expression.cs (EvalConstantExpression): Move into ecore.cs
14493
14494         * enum.cs (Enum): Rename some members and make them public and readonly
14495         according to our convention.
14496
14497         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
14498         nothing else.
14499
14500         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
14501
14502         (Enum::Emit): Write a simple version for now which doesn't try to compute
14503         expressions. I shall modify this to be more robust in just a while.
14504
14505         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
14506
14507         (TypeContainer::CloseType): Create the Enum types too.
14508
14509         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
14510
14511         * expression.cs (EvalConstantExpression): Get rid of completely.
14512
14513         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
14514         user-defined values and other cases.
14515
14516         (IsValidEnumLiteral): Helper function.
14517
14518         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
14519         out there in the case we had a literal FieldExpr.
14520
14521         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
14522
14523         (Literalize): Revamp a bit to take two arguments.
14524
14525         (EnumLiteral): New class which derives from Literal to wrap enum literals.
14526
14527 2001-11-06  Ravi Pratap  <ravi@ximian.com>
14528
14529         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
14530
14531         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
14532
14533         (Resolve): Use the above to ensure we have proper initializers.
14534
14535 2001-11-05  Ravi Pratap  <ravi@ximian.com>
14536
14537         * expression.cs (Expression::EvalConstantExpression): New method to 
14538         evaluate constant expressions.
14539
14540         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
14541
14542 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
14543
14544         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
14545         in an array.
14546
14547         (Binary.ResolveOperator): Handle operator != (object a, object b)
14548         and operator == (object a, object b);
14549
14550         (Binary.DoNumericPromotions): Indicate whether the numeric
14551         promotion was possible.
14552
14553         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
14554         Implement.  
14555
14556         Made the ArrayAccess implement interface IAssignMethod instead of
14557         IStackStore as the order in which arguments are passed reflects
14558         this.
14559
14560         * assign.cs: Instead of using expr.ExprClass to select the way of
14561         assinging, probe for the IStackStore/IAssignMethod interfaces.
14562
14563         * typemanager.cs: Load InitializeArray definition.
14564
14565         * rootcontext.cs (RootContext.MakeStaticData): Used to define
14566         static data that can be used to initialize arrays. 
14567
14568 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * expression.cs: Handle operator== and operator!= for booleans.
14571
14572         (Conditioal.Reduce): Implement reducer for the ?: operator.
14573
14574         (Conditional.Resolve): Implement dead code elimination.
14575
14576         (Binary.Resolve): Catch string literals and return a new
14577         concatenated string.
14578
14579         (Unary.Reduce): Implement reduction of unary expressions.
14580
14581         * ecore.cs: Split out the expression core handling here.
14582
14583         (Expression.Reduce): New method used to perform constant folding
14584         and CSE.  This is needed to support constant-expressions. 
14585
14586         * statement.cs (Statement.EmitBoolExpression): Pass true and false
14587         targets, and optimize for !x.
14588
14589 2001-11-04  Ravi Pratap  <ravi@ximian.com>
14590
14591         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
14592         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
14593         set custom atttributes.
14594
14595         * literal.cs (Literal::GetValue): New abstract method to return the actual
14596         value of the literal, cast as an object.
14597
14598         (*Literal): Implement GetValue method.
14599
14600         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
14601         expressions to the arraylist but objects of type Argument.
14602
14603         * class.cs (TypeContainer::Emit): Emit our attributes too.
14604
14605         (Method::Emit, Constructor::Emit): Ditto.
14606
14607         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
14608         to be ignoring earlier.
14609
14610 2001-11-03  Ravi Pratap  <ravi@ximian.com>
14611
14612         * attribute.cs (AttributeSection::Define): Implement to do the business
14613         of constructing a CustomAttributeBuilder.
14614
14615         (Attribute): New trivial class. Increases readability of code.  
14616
14617         * cs-parser.jay : Update accordingly.
14618
14619         (positional_argument_list, named_argument_list, named_argument): New rules
14620
14621         (attribute_arguments): Use the above so that we are more correct.
14622
14623 2001-11-02  Ravi Pratap  <ravi@ximian.com>
14624
14625         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
14626         to perform all checks for a method with a params parameter.
14627
14628         (Invocation::OverloadResolve): Update to use the above method and therefore
14629         cope correctly with params method invocations.
14630
14631         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
14632         params too.
14633
14634         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
14635         constructors in our parent too because we can't afford to miss out on 
14636         protected ones ;-)
14637
14638         * attribute.cs (AttributeSection): New name for the class Attribute
14639
14640         Other trivial changes to improve readability.
14641
14642         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
14643         use the new class names.
14644
14645 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14646
14647         * class.cs (Method::Define): Complete definition for params types too
14648
14649         (Indexer::Define): Ditto.
14650
14651         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
14652         Cope everywhere with a request for info about the array parameter.
14653
14654 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14655
14656         * tree.cs (RecordNamespace): Fix up to check for the correct key.
14657
14658         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
14659         local_variable_type to extract the string corresponding to the type.
14660
14661         (local_variable_type): Fixup the action to use the new helper method.
14662
14663         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
14664         go.
14665
14666         * expression.cs : Clean out code which uses the above.
14667
14668 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14669
14670         * typemanager.cs (RegisterMethod): Check if we already have an existing key
14671         and bale out if necessary by returning a false.
14672
14673         (RegisterProperty): Ditto.
14674
14675         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
14676         and print out appropriate error messages.
14677
14678         * interface.cs (everywhere): Ditto.
14679
14680         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
14681         location to constructor.
14682
14683         * class.cs (Property, Event, Indexer): Update accordingly.
14684
14685         * ../errors/cs111.cs : Added.
14686
14687         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
14688         of a method, as laid down by the spec.
14689
14690         (Invocation::OverloadResolve): Use the above method.
14691
14692 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14693
14694         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
14695         now take a TypeContainer and a Parameters object.
14696
14697         (ParameterData): Modify return type of ParameterModifier method to be 
14698         Parameter.Modifier and not a string.
14699
14700         (ReflectionParameters, InternalParameters): Update accordingly.
14701
14702         * expression.cs (Argument::GetParameterModifier): Same here.
14703
14704         * support.cs (InternalParameters::ParameterType): Find a better way of determining
14705         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
14706         symbol in it at all so maybe this is only for now.
14707
14708 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14709
14710         * support.cs (InternalParameters): Constructor now takes an extra argument 
14711         which is the actual Parameters class.
14712
14713         (ParameterDesc): Update to provide info on ref/out modifiers.
14714
14715         * class.cs (everywhere): Update call to InternalParameters to pass in
14716         the second argument too.
14717
14718         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14719         to return the modifier info [ref/out etc]
14720
14721         (InternalParameters, ReflectionParameters): Implement the above.
14722
14723         * expression.cs (Argument::ParameterModifier): Similar function to return
14724         info about the argument's modifiers.
14725
14726         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14727         too.
14728
14729         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14730         a new SetFormalParameters object which we pass to InternalParameters.
14731
14732 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14733
14734         * expression.cs (NewArray): Merge into the ArrayCreation class.
14735
14736 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14737
14738         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14739         NewUserdefinedArray into one as there wasn't much of a use in having
14740         two separate ones.
14741
14742         * expression.cs (Argument): Change field's name to ArgType from Type.
14743
14744         (Type): New readonly property which returns the proper type, taking into 
14745         account ref/out modifiers.
14746
14747         (everywhere): Adjust code accordingly for the above.
14748
14749         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14750         whether we are emitting for a ref or out parameter.
14751
14752         * expression.cs (Argument::Emit): Use the above field to set the state.
14753
14754         (LocalVariableReference::Emit): Update to honour the flag and emit the
14755         right stuff.
14756
14757         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14758
14759         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14760
14761         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14762
14763         (ReflectionParameters, InternalParameters): Implement the above method.
14764
14765         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14766         reporting errors.
14767
14768         (Invocation::FullMethodDesc): Ditto. 
14769
14770 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14771
14772         * cs-parser.jay: Add extra production for the second form of array
14773         creation. 
14774
14775         * expression.cs (ArrayCreation): Update to reflect the above
14776         change. 
14777
14778         * Small changes to prepare for Array initialization.
14779
14780 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * typemanager.cs (ImplementsInterface): interface might be null;
14783         Deal with this problem;
14784
14785         Also, we do store negative hits on the cache (null values), so use
14786         this instead of calling t.GetInterfaces on the type everytime.
14787
14788 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14789
14790         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14791
14792         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14793         split functionality out into different classes.
14794
14795         (New::FormArrayType): Move into NewBuiltinArray.
14796
14797         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14798         quite useless.
14799
14800         (NewBuiltinArray): New class to handle creation of built-in arrays.
14801
14802         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14803         account creation of one-dimensional arrays.
14804
14805         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14806
14807         (NewUserdefinedArray::DoResolve): Implement.
14808
14809         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14810
14811         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14812         we maintain inside the TypeManager. This is necessary to perform lookups on the
14813         module builder.
14814
14815         (LookupType): Update to perform GetType on the module builders too.     
14816
14817         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14818
14819         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14820
14821 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14822
14823         * expression.cs (New::DoResolve): Implement guts of array creation.
14824
14825         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14826
14827 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14828
14829         * expression.cs: Fix bug I introduced lsat night that broke
14830         Delegates. 
14831
14832         (Expression.Resolve): Report a 246 error (can not resolve name)
14833         if we find a SimpleName in the stream.
14834
14835         (Expression.ResolveLValue): Ditto.
14836
14837         (Expression.ResolveWithSimpleName): This function is a variant of
14838         ResolveName, this one allows SimpleNames to be returned without a
14839         warning.  The only consumer of SimpleNames is MemberAccess
14840
14841 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14842
14843         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14844         might arrive here.  I have my doubts that this is correct.
14845
14846         * statement.cs (Lock): Implement lock statement.
14847
14848         * cs-parser.jay: Small fixes to support `lock' and `using'
14849
14850         * cs-tokenizer.cs: Remove extra space
14851
14852         * driver.cs: New flag --checked, allows to turn on integer math
14853         checking. 
14854
14855         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14856         Threading.Monitor.Exit 
14857
14858 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14859
14860         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14861         Expression Class to be IndexerAccess.
14862
14863         Notice that Indexer::DoResolve sets the eclass to Value.
14864
14865 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14866
14867         * class.cs (TypeContainer::Emit): Emit code for indexers.
14868
14869         * assign.cs (IAssignMethod): New interface implemented by Indexers
14870         and Properties for handling assignment.
14871
14872         (Assign::Emit): Simplify and reuse code. 
14873
14874         * expression.cs (IndexerAccess, PropertyExpr): Implement
14875         IAssignMethod, clean up old code. 
14876
14877 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14878
14879         * typemanager.cs (ImplementsInterface): New method to determine if a type
14880         implements a given interface. Provides a nice cache too.
14881
14882         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14883         method.
14884
14885         (ConvertReferenceExplicit): Ditto.
14886
14887         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14888         various methods, with correct names etc.
14889
14890         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14891         Operator.UnaryNegation.
14892
14893         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14894         we have a unary plus or minus operator.
14895
14896         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
14897         UnaryMinus.
14898
14899         * everywhere : update accordingly.
14900
14901         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
14902         respectively.
14903
14904         * class.cs (Method::Define): For the case where we are implementing a method
14905         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
14906         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
14907
14908 2001-10-21  Ravi Pratap  <ravi@ximian.com>
14909
14910         * interface.cs (FindMembers): Implement to work around S.R.E
14911         lameness.
14912
14913         * typemanager.cs (IsInterfaceType): Implement.
14914
14915         (FindMembers): Update to handle interface types too.
14916
14917         * expression.cs (ImplicitReferenceConversion): Re-write bits which
14918         use IsAssignableFrom as that is not correct - it doesn't work.
14919
14920         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
14921         and accordingly override EmitStatement.
14922
14923         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
14924         using the correct logic :-)
14925
14926 2001-10-19  Ravi Pratap  <ravi@ximian.com>
14927
14928         * ../errors/cs-11.cs : Add to demonstrate error -11 
14929
14930 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
14931
14932         * assign.cs (Assign::Resolve): Resolve right hand side first, and
14933         then pass this as a hint to ResolveLValue.
14934
14935         * expression.cs (FieldExpr): Add Location information
14936
14937         (FieldExpr::LValueResolve): Report assignment to readonly
14938         variable. 
14939
14940         (Expression::ExprClassFromMemberInfo): Pass location information.
14941
14942         (Expression::ResolveLValue): Add new method that resolves an
14943         LValue. 
14944
14945         (Expression::DoResolveLValue): Default invocation calls
14946         DoResolve. 
14947
14948         (Indexers): New class used to keep track of indexers in a given
14949         Type. 
14950
14951         (IStackStore): Renamed from LValue, as it did not really describe
14952         what this did.  Also ResolveLValue is gone from this interface and
14953         now is part of Expression.
14954
14955         (ElementAccess): Depending on the element access type
14956
14957         * typemanager.cs: Add `indexer_name_type' as a Core type
14958         (System.Runtime.CompilerServices.IndexerNameAttribute)
14959
14960         * statement.cs (Goto): Take a location.
14961
14962 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14963
14964         * delegate.cs (Delegate::VerifyDelegate): New method to verify
14965         if two delegates are compatible.
14966
14967         (NewDelegate::DoResolve): Update to take care of the case when
14968         we instantiate a delegate from another delegate.
14969
14970         * typemanager.cs (FindMembers): Don't even try to look up members
14971         of Delegate types for now.
14972
14973 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14974
14975         * delegate.cs (NewDelegate): New class to take care of delegate
14976         instantiation.
14977
14978         * expression.cs (New): Split the delegate related code out into 
14979         the NewDelegate class.
14980
14981         * delegate.cs (DelegateInvocation): New class to handle delegate 
14982         invocation.
14983
14984         * expression.cs (Invocation): Split out delegate related code into
14985         the DelegateInvocation class.
14986
14987 2001-10-17  Ravi Pratap  <ravi@ximian.com>
14988
14989         * expression.cs (New::DoResolve): Implement delegate creation fully
14990         and according to the spec.
14991
14992         (New::DoEmit): Update to handle delegates differently.
14993
14994         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
14995         because of which we were printing out arguments in reverse order !
14996
14997         * delegate.cs (VerifyMethod): Implement to check if the given method
14998         matches the delegate.
14999
15000         (FullDelegateDesc): Implement.
15001
15002         (VerifyApplicability): Implement.
15003
15004         * expression.cs (Invocation::DoResolve): Update to accordingly handle
15005         delegate invocations too.
15006
15007         (Invocation::Emit): Ditto.
15008
15009         * ../errors/cs1593.cs : Added.
15010
15011         * ../errors/cs1594.cs : Added.
15012
15013         * delegate.cs (InstanceExpression, TargetMethod): New properties.
15014
15015 2001-10-16  Ravi Pratap  <ravi@ximian.com>
15016
15017         * typemanager.cs (intptr_type): Core type for System.IntPtr
15018
15019         (InitCoreTypes): Update for the same.
15020
15021         (iasyncresult_type, asynccallback_type): Ditto.
15022
15023         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
15024         correct.
15025
15026         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
15027         too.
15028
15029         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
15030         the builders for the 4 members of a delegate type :-)
15031
15032         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
15033         type.
15034
15035         * expression.cs (New::DoResolve): Implement guts for delegate creation.
15036
15037         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
15038
15039 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * statement.cs (Break::Emit): Implement.   
15042         (Continue::Emit): Implement.
15043
15044         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15045         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15046         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15047         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
15048         end loop
15049
15050         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
15051         properties that track the label for the current loop (begin of the
15052         loop and end of the loop).
15053
15054 2001-10-15  Ravi Pratap  <ravi@ximian.com>
15055
15056         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
15057         use of emitting anything at all.
15058
15059         * class.cs, rootcontext.cs : Get rid of calls to the same.
15060
15061         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
15062
15063         (Populate): Define the constructor correctly and set the implementation
15064         attributes.
15065
15066         * typemanager.cs (delegate_types): New hashtable to hold delegates that
15067         have been defined.
15068
15069         (AddDelegateType): Implement.
15070
15071         (IsDelegateType): Implement helper method.
15072
15073         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
15074
15075         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
15076         and accordingly handle it.
15077
15078         * delegate.cs (Populate): Take TypeContainer argument.
15079         Implement bits to define the Invoke method. However, I still haven't figured out
15080         how to take care of the native int bit :-(
15081
15082         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
15083         Qualify the name of the delegate, not its return type !
15084
15085         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
15086         conversion.
15087
15088         (StandardConversionExists): Checking for array types turns out to be recursive.
15089
15090         (ConvertReferenceExplicit): Implement array conversion.
15091
15092         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
15093
15094 2001-10-12  Ravi Pratap  <ravi@ximian.com>
15095
15096         * cs-parser.jay (delegate_declaration): Store the fully qualified
15097         name as it is a type declaration.
15098
15099         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
15100         readonly.
15101
15102         (DefineDelegate): Renamed from Define. Does the same thing essentially,
15103         as TypeContainer::DefineType.
15104
15105         (Populate): Method in which all the definition of the various methods (Invoke)
15106         etc is done.
15107
15108         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
15109         see.
15110
15111         (CloseDelegate): Finally creates the delegate.
15112
15113         * class.cs (TypeContainer::DefineType): Update to define delegates.
15114         (Populate, Emit and CloseType): Do the same thing here too.
15115
15116         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
15117         delegates in all these operations.
15118
15119 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
15120
15121         * expression.cs: LocalTemporary: a new expression used to
15122         reference a temporary that has been created.
15123
15124         * assign.cs: Handle PropertyAccess back here, so that we can
15125         provide the proper semantic access to properties.
15126
15127         * expression.cs (Expression::ConvertReferenceExplicit): Implement
15128         a few more explicit conversions. 
15129
15130         * modifiers.cs: `NEW' modifier maps to HideBySig.
15131
15132         * expression.cs (PropertyExpr): Make this into an
15133         ExpressionStatement, and support the EmitStatement code path. 
15134
15135         Perform get/set error checking, clean up the interface.
15136
15137         * assign.cs: recognize PropertyExprs as targets, and if so, turn
15138         them into toplevel access objects.
15139
15140 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
15141
15142         * expression.cs: PropertyExpr::PropertyExpr: use work around the
15143         SRE.
15144
15145         * typemanager.cs: Keep track here of our PropertyBuilders again to
15146         work around lameness in SRE.
15147
15148 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * expression.cs (LValue::LValueResolve): New method in the
15151         interface, used to perform a second resolution pass for LValues. 
15152
15153         (This::DoResolve): Catch the use of this in static methods.
15154
15155         (This::LValueResolve): Implement.
15156
15157         (This::Store): Remove warning, assigning to `this' in structures
15158         is 
15159
15160         (Invocation::Emit): Deal with invocation of
15161         methods on value types.  We need to pass the address to structure
15162         methods rather than the object itself.  (The equivalent code to
15163         emit "this" for structures leaves the entire structure on the
15164         stack instead of a pointer to it). 
15165
15166         (ParameterReference::DoResolve): Compute the real index for the
15167         argument based on whether the method takes or not a `this' pointer
15168         (ie, the method is static).
15169
15170         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
15171         value types returned from functions when we need to invoke a
15172         method on the sturcture.
15173
15174
15175 2001-10-11  Ravi Pratap  <ravi@ximian.com>
15176
15177         * class.cs (TypeContainer::DefineType): Method to actually do the business of
15178         defining the type in the Modulebuilder or Typebuilder. This is to take
15179         care of nested types which need to be defined on the TypeBuilder using
15180         DefineNestedMethod.
15181
15182         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
15183         methods in RootContext, only ported to be part of TypeContainer.
15184
15185         (TypeContainer::GetInterfaceOrClass): Ditto.
15186
15187         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
15188
15189         * interface.cs (Interface::DefineInterface): New method. Does exactly
15190         what RootContext.CreateInterface did earlier, only it takes care of nested types 
15191         too.
15192
15193         (Interface::GetInterfaces): Move from RootContext here and port.
15194
15195         (Interface::GetInterfaceByName): Same here.
15196
15197         * rootcontext.cs (ResolveTree): Re-write.
15198
15199         (PopulateTypes): Re-write.
15200
15201         * class.cs (TypeContainer::Populate): Populate nested types too.
15202         (TypeContainer::Emit): Emit nested members too.
15203
15204         * typemanager.cs (AddUserType): Do not make use of the FullName property,
15205         instead just use the name argument passed in as it is already fully
15206         qualified.
15207
15208         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
15209         to TypeContainer mapping to see if a type is user-defined.
15210
15211         * class.cs (TypeContainer::CloseType): Implement. 
15212
15213         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
15214         the default constructor.
15215
15216         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
15217         twice.
15218
15219         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
15220
15221         * interface.cs (CloseType): Create the type here.
15222
15223         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
15224         the hierarchy.
15225
15226         Remove all the methods which are now in TypeContainer.
15227
15228 2001-10-10  Ravi Pratap  <ravi@ximian.com>
15229
15230         * delegate.cs (Define): Re-write bits to define the delegate
15231         correctly.
15232
15233 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
15234
15235         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
15236
15237         * expression.cs (ImplicitReferenceConversion): handle null as well
15238         as a source to convert to any reference type.
15239
15240         * statement.cs (Return): Perform any implicit conversions to
15241         expected return type.  
15242
15243         Validate use of return statement.  
15244
15245         * codegen.cs (EmitContext): Pass the expected return type here.
15246
15247         * class.cs (Method, Constructor, Property): Pass expected return
15248         type to EmitContext.
15249
15250 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
15251
15252         * expression.cs: Make DoResolve take an EmitContext instead of a
15253         TypeContainer.
15254
15255         Replaced `l' and `location' for `loc', for consistency.
15256
15257         (Error, Warning): Remove unneeded Tc argument.
15258
15259         * assign.cs, literal.cs, constant.cs: Update to new calling
15260         convention. 
15261
15262         * codegen.cs: EmitContext now contains a flag indicating whether
15263         code is being generated in a static method or not.
15264
15265         * cs-parser.jay: DecomposeQI, new function that replaces the old
15266         QualifiedIdentifier.  Now we always decompose the assembled
15267         strings from qualified_identifier productions into a group of
15268         memberaccesses.
15269
15270 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
15271
15272         * rootcontext.cs: Deal with field-less struct types correctly now
15273         by passing the size option to Define Type.
15274
15275         * class.cs: Removed hack that created one static field. 
15276
15277 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15278
15279         * statement.cs: Moved most of the code generation here. 
15280
15281 2001-10-09  Ravi Pratap  <ravi@ximian.com>
15282
15283         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
15284         seem very right.
15285
15286         (ElementAccess): Remove useless bits for now - keep checks as the spec
15287         says.
15288
15289 2001-10-08  Ravi Pratap  <ravi@ximian.com>
15290
15291         * expression.cs (ElementAccess::DoResolve): Remove my crap code
15292         and start performing checks according to the spec.
15293
15294 2001-10-07  Ravi Pratap  <ravi@ximian.com>
15295
15296         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
15297         rank_specifiers instead.
15298
15299         (rank_specifiers): Change the order in which the rank specifiers are stored
15300
15301         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
15302
15303         * expression.cs (ElementAccess): Implement the LValue interface too.
15304
15305 2001-10-06  Ravi Pratap  <ravi@ximian.com>
15306
15307         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
15308         except that user defined conversions are not included.
15309
15310         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
15311         perform the conversion of the return type, if necessary.
15312
15313         (New::DoResolve): Check whether we are creating an array or an object
15314         and accordingly do the needful.
15315
15316         (New::Emit): Same here.
15317
15318         (New::DoResolve): Implement guts of array creation.
15319
15320         (New::FormLookupType): Helper function.
15321
15322 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * codegen.cs: Removed most of the code generation here, and move the
15325         corresponding code generation bits to the statement classes. 
15326
15327         Added support for try/catch/finalize and throw.
15328
15329         * cs-parser.jay: Added support for try/catch/finalize.
15330
15331         * class.cs: Catch static methods having the flags override,
15332         virtual or abstract.
15333
15334         * expression.cs (UserCast): This user cast was not really doing
15335         what it was supposed to do.  Which is to be born in fully resolved
15336         state.  Parts of the resolution were being performed at Emit time! 
15337
15338         Fixed this code.
15339
15340 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * expression.cs: Implicity convert the result from UserCast.
15343
15344 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15345
15346         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
15347         prevented it from working correctly. 
15348
15349         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
15350         merely ConvertImplicit.
15351
15352 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15353
15354         * typemanager.cs: Make the LookupTypeContainer function static,
15355         and not per-instance.  
15356
15357         * class.cs: Make static FindMembers (the one that takes a Type
15358         argument). 
15359
15360         * codegen.cs: Add EmitForeach here.
15361
15362         * cs-parser.jay: Make foreach a toplevel object instead of the
15363         inline expansion, as we need to perform semantic analysis on it. 
15364
15365 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15366
15367         * expression.cs (Expression::ImplicitUserConversion): Rename to
15368         UserDefinedConversion.
15369
15370         (Expression::UserDefinedConversion): Take an extra argument specifying 
15371         whether we look for explicit user conversions too.
15372
15373         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
15374
15375         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
15376
15377         (ExplicitUserConversion): Make it a call to UserDefinedConversion
15378         with the appropriate arguments.
15379
15380         * cs-parser.jay (cast_expression): Record location too.
15381
15382         * expression.cs (Cast): Record location info.
15383
15384         (Expression::ConvertExplicit): Take location argument.
15385
15386         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
15387         to determine if we are doing explicit conversions.
15388
15389         (UserCast::Emit): Update accordingly.
15390
15391         (Expression::ConvertExplicit): Report an error if everything fails.
15392
15393         * ../errors/cs0030.cs : Add.
15394
15395 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * modifiers.cs: If the ABSTRACT keyword is present, also set the
15398         virtual and newslot bits. 
15399
15400         * class.cs (TypeContainer::RegisterRequiredImplementations):
15401         Record methods we need.
15402
15403         (TypeContainer::MakeKey): Helper function to make keys for
15404         MethodBases, since the Methodbase key is useless.
15405
15406         (TypeContainer::Populate): Call RegisterRequiredImplementations
15407         before defining the methods.   
15408
15409         Create a mapping for method_builders_to_methods ahead of time
15410         instead of inside a tight loop.
15411
15412         (::RequireMethods):  Accept an object as the data to set into the
15413         hashtable so we can report interface vs abstract method mismatch.
15414
15415 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15416
15417         * report.cs: Make all of it static.
15418
15419         * rootcontext.cs: Drop object_type and value_type computations, as
15420         we have those in the TypeManager anyways.
15421
15422         Drop report instance variable too, now it is a global.
15423
15424         * driver.cs: Use try/catch on command line handling.
15425
15426         Add --probe option to debug the error reporting system with a test
15427         suite. 
15428
15429         * report.cs: Add support for exiting program when a probe
15430         condition is reached.
15431
15432 2001-10-03  Ravi Pratap  <ravi@ximian.com>
15433
15434         * expression.cs (Binary::DoNumericPromotions): Fix the case when
15435         we do a forcible conversion regardless of type, to check if 
15436         ForceConversion returns a null.
15437
15438         (Binary::error19): Use location to report error.
15439
15440         (Unary::error23): Use location here too.
15441
15442         * ../errors/cs0019.cs : Check in.
15443
15444         * ../errors/cs0023.cs : Check in.
15445
15446         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
15447         case of a non-null MethodInfo object with a length of 0 !
15448
15449         (Binary::ResolveOperator): Flag error if overload resolution fails to find
15450         an applicable member - according to the spec :-)
15451         Also fix logic to find members in base types.
15452
15453         (Unary::ResolveOperator): Same here.
15454
15455         (Unary::report23): Change name to error23 and make first argument a TypeContainer
15456         as I was getting thoroughly confused between this and error19 :-)
15457
15458         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
15459         (::FindMostEncompassedType): Implement.
15460         (::FindMostEncompassingType): Implement.
15461         (::StandardConversionExists): Implement.
15462
15463         (UserImplicitCast): Re-vamp. We now need info about most specific
15464         source and target types so that we can do the necessary conversions.
15465
15466         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
15467         mathematical union with no duplicates.
15468
15469 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15470
15471         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
15472         in order from base classes to child classes, so that we can in
15473         child classes look up in our parent for method names and
15474         attributes (required for handling abstract, virtual, new, override
15475         constructs: we need to instrospect our base class, and if we dont
15476         populate the classes in order, the introspection might be
15477         incorrect.  For example, a method could query its parent before
15478         the parent has any methods and would determine that the parent has
15479         no abstract methods (while it could have had them)).
15480
15481         (RootContext::CreateType): Record the order in which we define the
15482         classes.
15483
15484 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
15485
15486         * class.cs (TypeContainer::Populate): Also method definitions can
15487         fail now, keep track of this.
15488
15489         (TypeContainer::FindMembers): Implement support for
15490         DeclaredOnly/noDeclaredOnly flag.
15491
15492         (Constructor::Emit) Return the ConstructorBuilder.
15493
15494         (Method::Emit) Return the MethodBuilder. 
15495         Check for abstract or virtual methods to be public.
15496
15497         * rootcontext.cs (RootContext::CreateType): Register all the
15498         abstract methods required for the class to be complete and the
15499         interface methods that must be implemented. 
15500
15501         * cs-parser.jay: Report error 501 (method requires body if it is
15502         not marked abstract or extern).
15503
15504         * expression.cs (TypeOf::Emit): Implement.
15505
15506         * typemanager.cs: runtime_handle_type, new global type.
15507
15508         * class.cs (Property::Emit): Generate code for properties.
15509
15510 2001-10-02  Ravi Pratap  <ravi@ximian.com>
15511
15512         * expression.cs (Unary::ResolveOperator): Find operators on base type
15513         too - we now conform exactly to the spec.
15514
15515         (Binary::ResolveOperator): Same here.
15516
15517         * class.cs (Operator::Define): Fix minor quirk in the tests.
15518
15519         * ../errors/cs0215.cs : Added.
15520
15521         * ../errors/cs0556.cs : Added.
15522
15523         * ../errors/cs0555.cs : Added.
15524
15525 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15526
15527         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
15528         single integer which is really efficient
15529
15530 2001-10-01  Ravi Pratap  <ravi@ximian.com>
15531
15532         *  expression.cs (Expression::ImplicitUserConversion): Use location
15533         even in the case when we are examining True operators.
15534  
15535         * class.cs (Operator::Define): Perform extensive checks to conform
15536         with the rules for operator overloading in the spec.
15537
15538         * expression.cs (Expression::ImplicitReferenceConversion): Implement
15539         some of the other conversions mentioned in the spec.
15540
15541         * typemanager.cs (array_type): New static member for the System.Array built-in
15542         type.
15543
15544         (cloneable_interface): For System.ICloneable interface.
15545
15546         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
15547         we start resolving the tree and populating types.
15548
15549         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
15550  
15551 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * expression.cs (Expression::ExprClassFromMemberInfo,
15554         Expression::Literalize): Create literal expressions from
15555         FieldInfos which are literals.
15556
15557         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
15558         type casts, because they were wrong.  The test suite in tests
15559         caught these ones.
15560
15561         (ImplicitNumericConversion): ushort to ulong requires a widening
15562         cast. 
15563
15564         Int32 constant to long requires widening cast as well.
15565
15566         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
15567         for integers because the type on the stack is not i4.
15568
15569 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * expression.cs (report118): require location argument. 
15572
15573         * parameter.cs: Do not dereference potential null value.
15574
15575         * class.cs: Catch methods that lack the `new' keyword when
15576         overriding a name.  Report warnings when `new' is used without
15577         anything being there to override.
15578
15579         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
15580
15581         * class.cs: Only add constructor to hashtable if it is non-null
15582         (as now constructors can fail on define).
15583
15584         (TypeManager, Class, Struct): Take location arguments.
15585
15586         Catch field instance initialization in structs as errors.
15587
15588         accepting_filter: a new filter for FindMembers that is static so
15589         that we dont create an instance per invocation.
15590
15591         (Constructor::Define): Catch errors where a struct constructor is
15592         parameterless 
15593
15594         * cs-parser.jay: Pass location information for various new
15595         constructs. 
15596
15597         * delegate.cs (Delegate): take a location argument.
15598
15599         * driver.cs: Do not call EmitCode if there were problesm in the
15600         Definition of the types, as many Builders wont be there. 
15601
15602         * decl.cs (Decl::Decl): Require a location argument.
15603
15604         * cs-tokenizer.cs: Handle properly hex constants that can not fit
15605         into integers, and find the most appropiate integer for it.
15606
15607         * literal.cs: Implement ULongLiteral.
15608
15609         * rootcontext.cs: Provide better information about the location of
15610         failure when CreateType fails.
15611
15612 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
15615         as well.
15616
15617         * expression.cs (Binary::CheckShiftArguments): Add missing type
15618         computation.
15619         (Binary::ResolveOperator): Add type to the logical and and logical
15620         or, Bitwise And/Or and Exclusive Or code paths, it was missing
15621         before.
15622
15623         (Binary::DoNumericPromotions): In the case where either argument
15624         is ulong (and most signed types combined with ulong cause an
15625         error) perform implicit integer constant conversions as well.
15626
15627 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15628
15629         * expression.cs (UserImplicitCast): Method should always be
15630         non-null. 
15631         (Invocation::BetterConversion): Simplified test for IntLiteral.
15632
15633         (Expression::ImplicitNumericConversion): Split this routine out.
15634         Put the code that performs implicit constant integer conversions
15635         here. 
15636
15637         (Expression::Resolve): Become a wrapper around DoResolve so we can
15638         check eclass and type being set after resolve.
15639
15640         (Invocation::Badness): Remove this dead function
15641
15642         (Binary::ResolveOperator): Do not compute the expensive argumnets
15643         unless we have a union for it.
15644
15645         (Probe::Emit): Is needs to do an isinst and then
15646         compare against null.
15647
15648         (::CanConvert): Added Location argument.  If the Location argument
15649         is null (Location.Null), then we do not report errors.  This is
15650         used by the `probe' mechanism of the Explicit conversion.  We do
15651         not want to generate an error for something that the user
15652         explicitly requested to be casted.  But the pipeline for an
15653         explicit cast first tests for potential implicit casts.
15654
15655         So for now, if the Location is null, it means `Probe only' to
15656         avoid adding another argument.   Might have to revise this
15657         strategy later.
15658
15659         (ClassCast): New class used to type cast objects into arbitrary
15660         classes (used in Explicit Reference Conversions).
15661
15662         Implement `as' as well.
15663
15664         Reverted all the patches from Ravi below: they were broken:
15665
15666                 * The use of `level' as a mechanism to stop recursive
15667                   invocations is wrong.  That was there just to catch the
15668                   bug with a strack trace but not as a way of addressing
15669                   the problem.
15670
15671                   To fix the problem we have to *understand* what is going
15672                   on and the interactions and come up with a plan, not
15673                   just get things going.
15674
15675                 * The use of the type conversion cache that I proposed
15676                   last night had an open topic: How does this work across
15677                   protection domains.  A user defined conversion might not
15678                   be public in the location where we are applying the
15679                   conversion, a different conversion might be selected
15680                   (ie, private A->B (better) but public B->A (worse),
15681                   inside A, A->B applies, but outside it, B->A will
15682                   apply).
15683
15684                 * On top of that (ie, even if the above is solved),
15685                   conversions in a cache need to be abstract.  Ie, `To
15686                   convert from an Int to a Short use an OpcodeCast', not
15687                   `To convert from an Int to a Short use the OpcodeCast on
15688                   the variable 5' (which is what this patch was doing).
15689
15690 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15691
15692         * expression.cs (Invocation::ConversionExists): Re-write to use
15693         the conversion cache
15694
15695         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
15696         cache all conversions done, not just user-defined ones.
15697
15698         (Invocation::BetterConversion): The real culprit. Use ConversionExists
15699         to determine if a conversion exists instead of acutually trying to 
15700         perform the conversion. It's faster too.
15701
15702         (Expression::ConvertExplicit): Modify to use ConversionExists to check
15703         and only then attempt the implicit conversion.
15704
15705 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15706
15707         * expression.cs (ConvertImplicit): Use a cache for conversions
15708         already found. Check level of recursion and bail out if necessary.
15709
15710 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15711
15712         * typemanager.cs (string_concat_string_string, string_concat_object_object):
15713         Export standard methods that we expect for string operations.
15714
15715         * statement.cs (Block::UsageWarning): Track usage of variables and
15716         report the errors for not used variables.
15717
15718         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15719         operator. 
15720
15721 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15722
15723         * codegen.cs: remove unnneded code 
15724
15725         * expression.cs: Removed BuiltinTypeAccess class
15726
15727         Fix the order in which implicit conversions are
15728         done.  
15729
15730         The previous fixed dropped support for boxed conversions (adding a
15731         test to the test suite now)
15732
15733         (UserImplicitCast::CanConvert): Remove test for source being null,
15734         that code is broken.  We should not feed a null to begin with, if
15735         we do, then we should track the bug where the problem originates
15736         and not try to cover it up here.
15737
15738         Return a resolved expression of type UserImplicitCast on success
15739         rather than true/false.  Ravi: this is what I was talking about,
15740         the pattern is to use a static method as a "constructor" for
15741         objects. 
15742
15743         Also, do not create arguments until the very last minute,
15744         otherwise we always create the arguments even for lookups that
15745         will never be performed. 
15746
15747         (UserImplicitCast::Resolve): Eliminate, objects of type
15748         UserImplicitCast are born in a fully resolved state. 
15749
15750         * typemanager.cs (InitCoreTypes): Init also value_type
15751         (System.ValueType). 
15752
15753         * expression.cs (Cast::Resolve): First resolve the child expression.
15754
15755         (LValue): Add new method AddressOf to be used by
15756         the `&' operator.  
15757
15758         Change the argument of Store to take an EmitContext instead of an
15759         ILGenerator, because things like FieldExpr need to be able to call
15760         their children expression to generate the instance code. 
15761
15762         (Expression::Error, Expression::Warning): Sugar functions for
15763         reporting errors.
15764
15765         (Expression::MemberLookup): Accept a TypeContainer instead of a
15766         Report as the first argument.
15767
15768         (Expression::ResolvePrimary): Killed.  I still want to improve
15769         this as currently the code is just not right.
15770
15771         (Expression::ResolveMemberAccess): Simplify, but it is still
15772         wrong. 
15773
15774         (Unary::Resolve): Catch errors in AddressOf operators.
15775
15776         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15777         index to a byte for the short-version, or the compiler will choose
15778         the wrong Emit call, which generates the wrong data.
15779
15780         (ParameterReference::Emit, ::Store): same.
15781
15782         (FieldExpr::AddressOf): Implement.
15783
15784         * typemanager.cs: TypeManager: made public variable instead of
15785         property.
15786
15787         * driver.cs: document --fatal.
15788
15789         * report.cs (ErrorMessage, WarningMessage): new names for the old
15790         Error and Warning classes.
15791
15792         * cs-parser.jay (member_access): Turn built-in access to types
15793         into a normal simplename
15794
15795 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15796
15797         * expression.cs (Invocation::BetterConversion): Fix to cope
15798         with q being null, since this was introducing a bug.
15799
15800         * expression.cs (ConvertImplicit): Do built-in conversions first.
15801
15802 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15803
15804         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15805
15806 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15807
15808         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15809         I had introduced long ago (what's new ?).
15810
15811         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15812         the work of all the checking. 
15813         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15814         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15815
15816         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15817         that is the right way. 
15818
15819         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15820         overloading resolution. Use everywhere instead of cutting and pasting code.
15821
15822         (Binary::ResolveOperator): Use MakeUnionSet.
15823
15824         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15825         we have to convert to bool types. Not complete yet.
15826
15827 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15828
15829         * typemanager.cs (TypeManager::CSharpName): support ushort.
15830
15831         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15832         to provide an expression that performsn an implicit constant int
15833         conversion (section 6.1.6).
15834         (Expression::ConvertImplicitRequired): Reworked to include
15835         implicit constant expression conversions.
15836
15837         (Expression::ConvertNumericExplicit): Finished.
15838
15839         (Invocation::Emit): If InstanceExpression is null, then it means
15840         that we perform a call on this.
15841
15842 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15843
15844         * expression.cs (Unary::Emit): Remove some dead code.
15845         (Probe): Implement Resolve and Emit for `is'.
15846         (Expression::ConvertImplicitRequired): Attempt to do constant
15847         expression conversions here.  Maybe should be moved to
15848         ConvertImplicit, but I am not sure.
15849         (Expression::ImplicitLongConstantConversionPossible,
15850         Expression::ImplicitIntConstantConversionPossible): New functions
15851         that tell whether is it possible to apply an implicit constant
15852         expression conversion.
15853
15854         (ConvertNumericExplicit): Started work on explicit numeric
15855         conversions.
15856
15857         * cs-parser.jay: Update operator constants.
15858
15859         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15860         (Parameters::GetSignature): Hook up VerifyArgs here.
15861         (Parameters::VerifyArgs): Verifies that no two arguments have the
15862         same name. 
15863
15864         * class.cs (Operator): Update the operator names to reflect the
15865         ones that the spec expects (as we are just stringizing the
15866         operator names).
15867
15868         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15869         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15870         previous usage did only work for our methods.
15871         (Expression::ConvertImplicit): Handle decimal implicit numeric
15872         conversions as well.
15873         (Expression::InternalTypeConstructor): Used to invoke constructors
15874         on internal types for default promotions.
15875
15876         (Unary::Emit): Implement special handling for the pre/post
15877         increment/decrement for overloaded operators, as they need to have
15878         the same semantics as the other operators.
15879
15880         (Binary::ResolveOperator): ditto.
15881         (Invocation::ConversionExists): ditto.
15882         (UserImplicitCast::Resolve): ditto.
15883
15884 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15885
15886         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15887         operator, return after emitting body. Regression tests pass again !
15888
15889         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15890         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15891         (Invocation::OverloadResolve): Ditto.
15892         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15893
15894         * everywhere : update calls to the above methods accordingly.
15895
15896 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15897
15898         * assign.cs (Assign): Make it inherit from ExpressionStatement.
15899
15900         * expression.cs (ExpressionStatement): New base class used for
15901         expressions that can appear in statements, so that we can provide
15902         an alternate path to generate expression that do not leave a value
15903         on the stack.
15904
15905         (Expression::Emit, and all the derivatives): We no longer return
15906         whether a value is left on the stack or not.  Every expression
15907         after being emitted leaves a single value on the stack.
15908
15909         * codegen.cs (EmitContext::EmitStatementExpression): Use the
15910         facilties of ExpressionStatement if possible.
15911
15912         * cs-parser.jay: Update statement_expression.
15913
15914 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
15915
15916         * driver.cs: Change the wording of message
15917
15918 2001-09-25  Ravi Pratap  <ravi@ximian.com>
15919
15920         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
15921         the type of the expression to the return type of the method if
15922         we have an overloaded operator match ! The regression tests pass again !
15923         (Unary::ResolveOperator): Ditto.
15924
15925         * expression.cs (Invocation::ConversionExists): Correct the member lookup
15926         to find "op_Implicit", not "implicit" ;-)
15927         (UserImplicitCast): New class to take care of user-defined implicit conversions.
15928         (ConvertImplicit, ForceConversion): Take TypeContainer argument
15929
15930         * everywhere : Correct calls to the above accordingly.
15931
15932         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
15933         (ConvertImplicit): Do user-defined conversion if it exists.
15934
15935 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
15936
15937         * assign.cs: track location.
15938         (Resolve): Use implicit conversions on assignment.
15939
15940         * literal.cs: Oops.  Not good, Emit of short access values should
15941         pass (Bytes) or the wrong argument will be selected.
15942
15943         * expression.cs (Unary::Emit): Emit code for -expr.
15944
15945         (Unary::ResolveOperator): Handle `Substract' for non-constants
15946         (substract from zero from the non-constants).
15947         Deal with Doubles as well. 
15948
15949         (Expression::ConvertImplicitRequired): New routine that reports an
15950         error if no implicit conversion exists. 
15951
15952         (Invocation::OverloadResolve): Store the converted implicit
15953         expressions if we make them
15954
15955 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15956
15957         * class.cs (ConstructorInitializer): Take a Location argument.
15958         (ConstructorBaseInitializer): Same here.
15959         (ConstructorThisInitializer): Same here.
15960
15961         * cs-parser.jay : Update all calls accordingly.
15962
15963         * expression.cs (Unary, Binary, New): Take location argument.
15964         Update accordingly everywhere.
15965
15966         * cs-parser.jay : Update all calls to the above to take a location
15967         argument.
15968
15969         * class.cs : Ditto.
15970
15971 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15972
15973         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
15974         (Invocation::BetterConversion): Same here
15975         (Invocation::ConversionExists): Ditto.
15976
15977         (Invocation::ConversionExists): Implement.
15978
15979 2001-09-22  Ravi Pratap  <ravi@ximian.com>
15980
15981         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
15982         Also take an additional TypeContainer argument.
15983
15984         * All over : Pass in TypeContainer as argument to OverloadResolve.
15985
15986         * typemanager.cs (CSharpName): Update to check for the string type and return
15987         that too.
15988
15989         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
15990         a given method.
15991
15992 2001-09-21  Ravi Pratap  <ravi@ximian.com>
15993
15994         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
15995         (Invocation::BetterFunction): Implement.
15996         (Invocation::BetterConversion): Implement.
15997         (Invocation::ConversionExists): Skeleton, no implementation yet.
15998
15999         Okay, things work fine !
16000
16001 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
16002
16003         * typemanager.cs: declare and load enum_type, delegate_type and
16004         void_type. 
16005
16006         * expression.cs (Expression::Emit): Now emit returns a value that
16007         tells whether a value is left on the stack or not.  This strategy
16008         might be reveted tomorrow with a mechanism that would address
16009         multiple assignments.
16010         (Expression::report118): Utility routine to report mismatches on
16011         the ExprClass.
16012
16013         (Unary::Report23): Report impossible type/operator combination
16014         utility function.
16015
16016         (Unary::IsIncrementableNumber): Whether the type can be
16017         incremented or decremented with add.
16018         (Unary::ResolveOperator): Also allow enumerations to be bitwise
16019         complemented. 
16020         (Unary::ResolveOperator): Implement ++, !, ~,
16021
16022         (Invocation::Emit): Deal with new Emit convetion.
16023
16024         * All Expression derivatives: Updated their Emit method to return
16025         whether they leave values on the stack or not.
16026
16027         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
16028         stack for expressions that are statements. 
16029
16030 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
16031
16032         * expression.cs (LValue): New interface.  Must be implemented by
16033         LValue objects.
16034         (LocalVariableReference, ParameterReference, FieldExpr): Implement
16035         LValue interface.
16036
16037         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
16038         interface for generating code, simplifies the code.
16039
16040 2001-09-20  Ravi Pratap  <ravi@ximian.com>
16041
16042         * expression.cs (everywhere): Comment out return statements in ::Resolve
16043         methods to avoid the warnings.
16044
16045 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * driver.cs (parse): Report error 2001 if we can not open the
16048         source file.
16049
16050         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
16051         not resolve it.
16052
16053         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
16054         object. 
16055
16056         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
16057         otherwise nested blocks end up with the same index.
16058
16059         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
16060
16061         * expression.cs:  Instead of having FIXMEs in the Resolve
16062         functions, throw exceptions so it is obvious that we are facing a
16063         bug. 
16064
16065         * cs-parser.jay (invocation_expression): Pass Location information.
16066
16067         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
16068         Use a basename for those routines because .NET does not like paths
16069         on them. 
16070
16071         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
16072         already defined.
16073
16074 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
16077         are loading the correct data types (throws an exception if not).
16078         (TypeManager::InitCoreTypes): Use CoreLookupType
16079
16080         * expression.cs (Unary::ResolveOperator): return the child
16081         expression for expressions which are just +expr.
16082         (Unary::ResolveOperator): Return negative literals for -LITERAL
16083         expressions (otherwise they are Unary {Literal}).
16084         (Invocation::Badness): Take into account `Implicit constant
16085         expression conversions'.
16086
16087         * literal.cs (LongLiteral): Implement long literal class.
16088         (IntLiteral): export the `Value' of the intliteral. 
16089
16090 2001-09-19  Ravi Pratap  <ravi@ximian.com>
16091
16092         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
16093
16094         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
16095         instead of 'Operator'
16096
16097         * expression.cs (Binary::ResolveOperator): Update accordingly.
16098         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
16099         and 'Minus'
16100
16101         * cs-parser.jay (unary_expression): Update to use the new names.
16102
16103         * gen-treedump.cs (GetUnary): Same here.
16104
16105         * expression.cs (Unary::Resolve): Implement.
16106         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
16107         operators are found instead of making noise ;-)
16108         (Unary::ResolveOperator): New method to do precisely the same thing which
16109         Binary::ResolveOperator does for Binary expressions.
16110         (Unary.method, .Arguments): Add.
16111         (Unary::OperName): Implement.   
16112         (Unary::ForceConversion): Copy and Paste !
16113
16114         * class.cs (Operator::Define): Fix a small bug for the case when we have 
16115         a unary operator.
16116
16117         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
16118         for the inbuilt operators. Only overloading works for now ;-)
16119
16120 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
16121
16122         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
16123         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
16124
16125         * expression.cs (This::Emit): Implement. 
16126         (This::Resolve): Implement.
16127         (TypeOf:Resolve): Implement.
16128         (Expression::ResolveSimpleName): Add an implicit this to instance
16129         field references. 
16130         (MemberAccess::Resolve): Deal with Parameters and Fields. 
16131         Bind instance variable to Field expressions.
16132         (FieldExpr::Instance): New field used to track the expression that
16133         represents the object instance.
16134         (FieldExpr::Resolve): Track potential errors from MemberLookup not
16135         binding 
16136         (FieldExpr::Emit): Implement.
16137
16138         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
16139         the last instruction contains a return opcode to avoid generating
16140         the last `ret' instruction (this generates correct code, and it is
16141         nice to pass the peverify output).
16142
16143         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
16144         initializer for static and instance variables.
16145         (Constructor::Emit): Allow initializer to be null in the case of
16146         static constructors.  Only emit initializer for instance
16147         constructors. 
16148
16149         (TypeContainer::FindMembers): Return a null array if there are no
16150         matches.
16151
16152         Also fix the code for the MemberTypes.Method branch, as it was not
16153         scanning that for operators (or tried to access null variables before).
16154
16155         * assign.cs (Assign::Emit): Handle instance and static fields. 
16156
16157         * TODO: Updated.
16158
16159         * driver.cs: Stop compilation if there are parse errors.
16160
16161         * cs-parser.jay (constructor_declaration): Provide default base
16162         initializer for non-static constructors.
16163         (constructor_declarator): Do not provide a default base
16164         initializers if none was specified.
16165         Catch the fact that constructors should not have parameters.
16166
16167         * class.cs: Do not emit parent class initializers for static
16168         constructors, that should be flagged as an error.
16169
16170 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16171
16172         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
16173         Move back code into TypeContainer::Populate.
16174
16175 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16176
16177         * class.cs (TypeContainer::AddConstructor): Fix the check to
16178         compare against Name, not Basename. 
16179         (Operator::OpType): Change Plus and Minus to Add and Subtract.
16180
16181         * cs-parser.jay : Update accordingly.
16182
16183         * class.cs (TypeContainer::FindMembers): For the case where we are searching
16184         for methods, don't forget to look into the operators too.
16185         (RegisterMethodBuilder): Helper method to take care of this for
16186         methods, constructors and operators.
16187         (Operator::Define): Completely revamp.
16188         (Operator.OperatorMethod, MethodName): New fields.
16189         (TypeContainer::Populate): Move the registering of builders into
16190         RegisterMethodBuilder.
16191         (Operator::Emit): Re-write.
16192
16193         * expression.cs (Binary::Emit): Comment out code path to emit method
16194         invocation stuff for the case when we have a user defined operator. I am
16195         just not able to get it right !
16196
16197 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
16200         argument. 
16201
16202         (Expression::MemberLookup): Provide a version that allows to
16203         specify the MemberTypes and BindingFlags. 
16204
16205         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
16206         so it was not fetching variable information from outer blocks.
16207
16208         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
16209         Beforefieldinit as it was buggy.
16210
16211         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
16212         that Ravi put here.  
16213
16214         * class.cs (Constructor::Emit): Only emit if block is not null.
16215         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
16216         deal with this by semantically definining it as if the user had
16217         done it.
16218
16219         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
16220         constructors as we now "emit" them at a higher level.
16221
16222         (TypeContainer::DefineDefaultConstructor): Used to define the
16223         default constructors if none was provided.
16224
16225         (ConstructorInitializer): Add methods Resolve and Emit. 
16226
16227         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
16228
16229 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16230
16231         * class.cs (TypeContainer::EmitDefaultConstructor): Register
16232         the default constructor builder with our hashtable for methodbuilders
16233         to methodcores.
16234
16235         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
16236         and argument_count is 0 in which case we have a match.
16237         (Binary::ResolveOperator): More null checking and miscellaneous coding
16238         style cleanup.
16239
16240 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16241
16242         * rootcontext.cs (IsNameSpace): Compare against null.
16243
16244         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
16245
16246         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
16247         and Unary::Operator.
16248
16249         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
16250         accordingly.
16251
16252         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
16253         we have overloaded operators.
16254         (Binary::ResolveOperator): Implement the part which does the operator overload
16255         resolution.
16256
16257         * class.cs (Operator::Emit): Implement.
16258         (TypeContainer::Emit): Emit the operators we have too.
16259
16260         * expression.cs (Binary::Emit): Update to emit the appropriate code for
16261         the case when we have a user-defined operator.
16262
16263 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
16266
16267 2001-09-16  Ravi Pratap  <ravi@ximian.com>
16268
16269         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
16270         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
16271         (Constructor::Emit): Implement.
16272         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
16273         if we have no work to do. 
16274         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
16275         Emit method.
16276
16277         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
16278         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
16279
16280         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
16281         of parent.parent.
16282
16283 2001-09-15  Ravi Pratap  <ravi@ximian.com>
16284
16285         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
16286         in the source.
16287         (Tree::RecordNamespace): Method to do what the name says ;-)
16288         (Tree::Namespaces): Property to get at the namespaces hashtable.
16289
16290         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
16291         keep track.
16292
16293         * rootcontext.cs (IsNamespace): Fixed it :-)
16294
16295 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * class.cs (TypeContainer::FindMembers): Add support for
16298         constructors. 
16299         (MethodCore): New class that encapsulates both the shared aspects
16300         of a Constructor and a Method.  
16301         (Method, Constructor): Factored pieces into MethodCore.
16302
16303         * driver.cs: Added --fatal which makes errors throw exceptions.
16304         Load System assembly as well as part of the standard library.
16305
16306         * report.cs: Allow throwing exceptions on errors for debugging.
16307
16308         * modifiers.cs: Do not use `parent', instead use the real type
16309         container to evaluate permission settings.
16310
16311         * class.cs: Put Ravi's patch back in.  He is right, and we will
16312         have to cope with the
16313
16314 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16315
16316         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
16317         FamORAssem, not FamANDAssem.
16318
16319 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * driver.cs: Added --parse option that only parses its input files
16322         and terminates.
16323
16324         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
16325         incorrect.  IsTopLevel is not used to tell whether an object is
16326         root_types or not (that can be achieved by testing this ==
16327         root_types).  But to see if this is a top-level *class* (not
16328         necessarly our "toplevel" container). 
16329
16330 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16331
16332         * enum.cs (Enum::Define): Modify to call the Lookup method on the
16333         parent instead of a direct call to GetType.
16334
16335 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16336
16337         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
16338         Modifiers.TypeAttr. This should just be a call to that method.
16339
16340         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
16341         object so that we can determine if we are top-level or not.
16342
16343         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
16344         TypeContainer too.
16345
16346         * enum.cs (Enum::Define): Ditto.
16347
16348         * modifiers.cs (FieldAttr): Re-write.
16349
16350         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
16351         (TypeContainer::HaveStaticConstructor): New property to provide access
16352         to precisely that info.
16353
16354         * modifiers.cs (MethodAttr): Re-write.
16355         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
16356
16357         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
16358         of top-level types as claimed.
16359
16360 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * expression.cs (MemberLookup): Fruitless attempt to lookup
16363         constructors.  Maybe I need to emit default constructors?  That
16364         might be it (currently .NET emits this for me automatically).
16365         (Invocation::OverloadResolve): Cope with Arguments == null.
16366         (Invocation::EmitArguments): new function, shared by the new
16367         constructor and us.
16368         (Invocation::Emit): Handle static and instance methods.  Emit
16369         proper call instruction for virtual or non-virtual invocations.
16370         (New::Emit): Implement.
16371         (New::Resolve): Implement.
16372         (MemberAccess:Resolve): Implement.
16373         (MethodGroupExpr::InstanceExpression): used conforming to the spec
16374         to track instances.
16375         (FieldExpr::Resolve): Set type.
16376
16377         * support.cs: Handle empty arguments.
16378                 
16379         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
16380         SimpleLookup): Auxiliary routines to help parse a qualifier
16381         identifier.  
16382
16383         Update qualifier_identifier rule.
16384
16385         * codegen.cs: Removed debugging messages.
16386
16387         * class.cs: Make this a global thing, this acts just as a "key" to
16388         objects that we might have around.
16389
16390         (Populate): Only initialize method_builders_to_methods once.
16391
16392         * expression.cs (PropertyExpr): Initialize type from the
16393         PropertyType. 
16394
16395         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
16396         Resolve pattern.  Attempt to implicitly convert value to boolean.
16397         Emit code.
16398
16399         * expression.cs: Set the type for the int32/int32 argument case.
16400         (Binary::ResolveOperator): Set the return type to boolean for
16401         comparission operators
16402
16403         * typemanager.cs: Remove debugging print code.
16404
16405         (Invocation::Resolve): resolve type.
16406
16407         * class.cs: Allocate a MemberInfo of the correct size, as the code
16408         elsewhere depends on the test to reflect the correct contents.
16409
16410         (Method::) Keep track of parameters, due to System.Reflection holes
16411
16412         (TypeContainer::Populate): Keep track of MethodBuilders to Method
16413         mapping here.
16414
16415         (TypeContainer::FindMembers): Use ArrayList and then copy an array
16416         of the exact size and return that.
16417
16418         (Class::LookupMethodByBuilder): New function that maps
16419         MethodBuilders to its methods.  Required to locate the information
16420         on methods because System.Reflection bit us again.
16421
16422         * support.cs: New file, contains an interface ParameterData and
16423         two implementations: ReflectionParameters and InternalParameters
16424         used to access Parameter information.  We will need to grow this
16425         as required.
16426
16427         * expression.cs (Invocation::GetParameterData): implement a cache
16428         and a wrapper around the ParameterData creation for methods. 
16429         (Invocation::OverloadResolve): Use new code.
16430
16431 2001-09-13  Ravi Pratap  <ravi@ximian.com>
16432
16433         * class.cs (TypeContainer::EmitField): Remove and move into 
16434         (Field::Define): here and modify accordingly.
16435         (Field.FieldBuilder): New member.
16436         (TypeContainer::Populate): Update accordingly.
16437         (TypeContainer::FindMembers): Implement.
16438
16439 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16440
16441         * statement.cs: (VariableInfo::VariableType): New field to be
16442         initialized with the full type once it is resolved. 
16443
16444 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * parameter.cs (GetParameterInfo): Use a type cache to compute
16447         things only once, and to reuse this information
16448
16449         * expression.cs (LocalVariableReference::Emit): Implement.
16450         (OpcodeCast::Emit): fix.
16451
16452         (ParameterReference::Resolve): Implement.
16453         (ParameterReference::Emit): Implement.
16454
16455         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
16456         that are expressions need to stay as Expressions.
16457
16458         * typemanager.cs (CSharpName): Returns the C# name of a type if
16459         possible. 
16460
16461         * expression.cs (Expression::ConvertImplicit): New function that
16462         implements implicit type conversions.
16463
16464         (Expression::ImplicitReferenceConversion): Implements implicit
16465         reference conversions.
16466
16467         (EmptyCast): New type for transparent casts.
16468
16469         (OpcodeCast): New type for casts of types that are performed with
16470         a sequence of bytecodes.
16471
16472         (BoxedCast): New type used for casting value types into reference
16473         types.  Emits a box opcode.
16474
16475         (Binary::DoNumericPromotions): Implements numeric promotions of
16476         and computation of the Binary::Type.
16477
16478         (Binary::EmitBranchable): Optimization.
16479
16480         (Binary::Emit): Implement code emission for expressions.
16481
16482         * typemanager.cs (TypeManager): Added two new core types: sbyte
16483         and byte.
16484
16485 2001-09-12  Ravi Pratap  <ravi@ximian.com>
16486
16487         * class.cs (TypeContainer::FindMembers): Method which does exactly
16488         what Type.FindMembers does, only we don't have to use reflection. No
16489         implementation yet.
16490
16491         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
16492         typecontainer objects as we need to get at them.
16493         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
16494
16495         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
16496         typecontainer object.
16497
16498         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
16499         of just a Report object.
16500
16501 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16502
16503         * class.cs (Event::Define): Go back to using the prefixes "add_" and
16504         "remove_"
16505         (TypeContainer::Populate): Now define the delegates of the type too.
16506         (TypeContainer.Delegates): Property to access the list of delegates defined
16507         in the type.
16508
16509         * delegates.cs (Delegate::Define): Implement partially.
16510
16511         * modifiers.cs (TypeAttr): Handle more flags.
16512
16513 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16514
16515         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
16516         and not <=
16517         (Operator::Define): Re-write logic to get types by using the LookupType method
16518         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
16519         (Indexer::Define): Ditto.
16520         (Event::Define): Ditto.
16521         (Property::Define): Ditto.
16522
16523 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16524
16525         * class.cs (TypeContainer::Populate): Now define operators too. 
16526         (TypeContainer.Operators): New property to access the list of operators
16527         in a type.
16528         (Operator.OperatorMethodBuilder): New member to hold the method builder
16529         for the operator we are defining.
16530         (Operator::Define): Implement.
16531
16532 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16533
16534         * class.cs (Event::Define): Make the prefixes of the accessor methods
16535         addOn_ and removeOn_ 
16536
16537         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
16538         of the location being passed in too. Ideally, this should go later since all
16539         error reporting should be done through the Report object.
16540
16541         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
16542         (Populate): Iterate thru the indexers we have and define them too.
16543         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
16544         for the get and set accessors.
16545         (Indexer::Define): Implement.
16546
16547 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
16550         my previous implementation, did not work.
16551
16552         * typemanager.cs: Add a couple of missing types (the longs).
16553
16554         * literal.cs: Use TypeManager.bool_type instead of getting it.
16555
16556         * expression.cs (EventExpr): New kind of expressions.
16557         (Expressio::ExprClassFromMemberInfo): finish
16558
16559 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
16560
16561         * assign.cs: Emit stores to static fields differently.
16562
16563 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16564
16565         * Merge in changes and adjust code to tackle conflicts. Backed out my
16566         code in Assign::Resolve ;-) 
16567
16568 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16569
16570         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
16571         instead Report.Error and also pass in the location.
16572         (CSharpParser::Lexer): New readonly property to return the reference
16573         to the Tokenizer object.
16574         (declare_local_variables): Use Report.Error with location instead of plain 
16575         old error.
16576         (CheckDef): Ditto.
16577
16578         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
16579         (Operator.CheckBinaryOperator): Ditto.
16580
16581         * cs-parser.jay (operator_declarator): Update accordingly.
16582
16583         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
16584         (CheckBinaryOperator): Same here.
16585
16586         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
16587         on the name without any prefixes of namespace names etc. This is because we
16588         already might have something already fully qualified like 
16589         'System.Console.WriteLine'
16590
16591         * assign.cs (Resolve): Begin implementation. Stuck ;-)
16592
16593 2001-09-07  Ravi Pratap  <ravi@ximian.com>
16594
16595         * cs-tokenizer.cs (location): Return a string which also contains
16596         the file name.
16597
16598         * expression.cs (ElementAccess): New class for expressions of the
16599         type 'element access.'
16600         (BaseAccess): New class for expressions of the type 'base access.'
16601         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
16602         respectively.
16603
16604         * cs-parser.jay (element_access): Implement action.
16605         (base_access): Implement actions.
16606         (checked_expression, unchecked_expression): Implement.
16607
16608         * cs-parser.jay (local_variable_type): Correct and implement.
16609         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
16610
16611         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
16612
16613         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
16614         name and the specifiers.
16615
16616         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
16617
16618         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
16619         making them all public ;-)
16620
16621         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
16622         class anyways.
16623
16624 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
16625
16626         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
16627         PropertyExprs.
16628         (FieldExpr, PropertyExprs): New resolved expressions.
16629         (SimpleName::MemberStaticCheck): Perform static checks for access
16630         to non-static fields on static methods. Maybe this should be
16631         generalized for MemberAccesses. 
16632         (SimpleName::ResolveSimpleName): More work on simple name
16633         resolution. 
16634
16635         * cs-parser.jay (primary_expression/qualified_identifier): track
16636         the parameter index.
16637
16638         * codegen.cs (CodeGen::Save): Catch save exception, report error.
16639         (EmitContext::EmitBoolExpression): Chain to expression generation
16640         instead of temporary hack.
16641         (::EmitStatementExpression): Put generic expression code generation.
16642
16643         * assign.cs (Assign::Emit): Implement variable assignments to
16644         local variables, parameters and fields.
16645
16646 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
16647
16648         * statement.cs (Block::GetVariableInfo): New method, returns the
16649         VariableInfo for a variable name in a block.
16650         (Block::GetVariableType): Implement in terms of GetVariableInfo
16651
16652         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
16653         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
16654
16655 2001-09-06  Ravi Pratap  <ravi@ximian.com>
16656
16657         * cs-parser.jay (operator_declaration): Continue on my quest : update
16658         to take attributes argument.
16659         (event_declaration): Ditto.
16660         (enum_declaration): Ditto.
16661         (indexer_declaration): Ditto.
16662
16663         * class.cs (Operator::Operator): Update constructor accordingly.
16664         (Event::Event): Ditto.
16665
16666         * delegate.cs (Delegate::Delegate): Same here.
16667
16668         * enum.cs (Enum::Enum): Same here.
16669
16670 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16671
16672         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
16673
16674         * ../tests/cs0658.cs : New file to demonstrate error 0658.
16675
16676         * attribute.cs (Attributes): New class to encapsulate all attributes which were
16677         being passed around as an arraylist.
16678         (Attributes::AddAttribute): Method to add attribute sections.
16679
16680         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
16681         (struct_declaration): Update accordingly.
16682         (constant_declaration): Update.
16683         (field_declaration): Update.
16684         (method_header): Update.
16685         (fixed_parameter): Update.
16686         (parameter_array): Ditto.
16687         (property_declaration): Ditto.
16688         (destructor_declaration): Ditto.
16689
16690         * class.cs (Struct::Struct): Update constructors accordingly.
16691         (Class::Class): Ditto.
16692         (Field::Field): Ditto.
16693         (Method::Method): Ditto.
16694         (Property::Property): Ditto.
16695         (TypeContainer::OptAttribute): update property's return type.
16696
16697         * interface.cs (Interface.opt_attributes): New member.
16698         (Interface::Interface): Update to take the extra Attributes argument.
16699
16700         * parameter.cs (Parameter::Parameter): Ditto.
16701
16702         * constant.cs (Constant::Constant): Ditto.
16703
16704         * interface.cs (InterfaceMemberBase): New OptAttributes field.
16705         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
16706         the attributes as a parameter.
16707         (InterfaceProperty): Update constructor call.
16708         (InterfaceEvent): Ditto.
16709         (InterfaceMethod): Ditto.
16710         (InterfaceIndexer): Ditto.
16711
16712         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
16713         pass the attributes too.
16714         (interface_event_declaration): Ditto.
16715         (interface_property_declaration): Ditto.
16716         (interface_method_declaration): Ditto.
16717         (interface_declaration): Ditto.
16718
16719 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16720
16721         * class.cs (Method::Define): Track the "static Main" definition to
16722         create an entry point. 
16723
16724         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16725         EntryPoint if we find it. 
16726
16727         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16728         (EmitContext::ig): Make this variable public.
16729
16730         * driver.cs: Make the default output file be the first file name
16731         with the .exe extension.  
16732
16733         Detect empty compilations
16734
16735         Handle various kinds of output targets.  Handle --target and
16736         rename -t to --dumper.
16737
16738         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16739         methods inherited from Expression return now an Expression.  This
16740         will is used during the tree rewriting as we resolve them during
16741         semantic analysis.
16742
16743         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16744         the spec.  Missing entirely is the information about
16745         accessability of elements of it.
16746
16747         (Expression::ExprClassFromMemberInfo): New constructor for
16748         Expressions that creates a fully initialized Expression based on
16749         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16750         a Type.
16751
16752         (Invocation::Resolve): Begin implementing resolution of invocations.
16753
16754         * literal.cs (StringLiteral):  Implement Emit.
16755
16756 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16757
16758         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16759         member.
16760
16761 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16762
16763         * cs-parser.jay (attribute_arguments): Implement actions.
16764         (attribute): Fix bug in production. Implement action.
16765         (attribute_list): Implement.
16766         (attribute_target): Implement.
16767         (attribute_target_specifier, opt_target_specifier): Implement
16768         (CheckAttributeTarget): New method to check if the attribute target
16769         is valid.
16770         (attribute_section): Implement.
16771         (opt_attributes): Implement.
16772
16773         * attribute.cs : New file to handle attributes.
16774         (Attribute): Class to hold attribute info.
16775
16776         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16777         (attribute_section): Modify production to use 2 different rules to 
16778         achieve the same thing. 1 s/r conflict down !
16779         Clean out commented, useless, non-reducing dimension_separator rules.
16780
16781         * class.cs (TypeContainer.attributes): New member to hold list
16782         of attributes for a type.
16783         (Struct::Struct): Modify to take one more argument, the attribute list.
16784         (Class::Class): Ditto.
16785         (Field::Field): Ditto.
16786         (Method::Method): Ditto.
16787         (Property::Property): Ditto.
16788
16789         * cs-parser.jay (struct_declaration): Update constructor call to
16790         pass in the attributes too.
16791         (class_declaration): Ditto.
16792         (constant_declaration): Ditto.
16793         (field_declaration): Ditto.
16794         (method_header): Ditto.
16795         (fixed_parameter): Ditto.
16796         (parameter_array): Ditto.
16797         (property_declaration): Ditto.
16798
16799         * constant.cs (Constant::Constant): Update constructor similarly.
16800         Use System.Collections.
16801
16802         * parameter.cs (Parameter::Parameter): Update as above.
16803
16804 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16805
16806         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16807         (TypeContainer.delegates): New member to hold list of delegates.
16808
16809         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16810         this time as I seem to be on crack ;-)
16811
16812 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16815         tell whether an identifier represents a namespace.
16816
16817         * expression.cs (NamespaceExpr): A namespace expression, used only
16818         temporarly during expression resolution.
16819         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16820         utility functions to resolve names on expressions.
16821
16822 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * codegen.cs: Add hook for StatementExpressions. 
16825
16826         * class.cs: Fix inverted test for static flag in methods.
16827
16828 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16829
16830         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16831         to make it coincide with MS' number.
16832         (Operator::CheckBinaryOperator): Ditto.
16833
16834         * ../errors/errors.txt : Remove error numbers added earlier.
16835
16836         * ../errors/cs1019.cs : Test case for error # 1019
16837
16838         * ../errros/cs1020.cs : Test case for error # 1020
16839
16840         * cs-parser.jay : Clean out commented cruft.
16841         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16842         used anywhere - non-reducing rule.
16843         (namespace_declarations): Non-reducing rule - comment out.
16844
16845         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16846         with TypeContainer::AddEnum.
16847
16848         * delegate.cs : New file for delegate handling classes.
16849         (Delegate): Class for declaring delegates.
16850
16851         * makefile : Update.
16852
16853         * cs-parser.jay (delegate_declaration): Implement.
16854
16855 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16856
16857         * class.cs (Event::Define): Implement.
16858         (Event.EventBuilder): New member.
16859
16860         * class.cs (TypeContainer::Populate): Update to define all enums and events
16861         we have.
16862         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16863         readonly fields for all these cases ?
16864
16865 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16866
16867         * class.cs (Property): Revamp to use the convention of making fields readonly.
16868         Accordingly modify code elsewhere.
16869
16870         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16871         the Define method of the Property class.
16872
16873         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16874         trivial bug.
16875         (TypeContainer::Populate): Update to define all the properties we have. Also
16876         define all enumerations.
16877
16878         * enum.cs (Define): Implement.
16879
16880 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16881
16882         * cs-parser.jay (overloadable_operator): The semantic value is an
16883         enum of the Operator class.
16884         (operator_declarator): Implement actions.
16885         (operator_declaration): Implement.
16886
16887         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16888         validity of definitions.
16889         (Operator::CheckBinaryOperator): Static method to check for binary operators
16890         (TypeContainer::AddOperator): New method to add an operator to a type.
16891
16892         * cs-parser.jay (indexer_declaration): Added line to actually call the
16893         AddIndexer method so it gets added ;-)
16894
16895         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
16896         already taken care of by the MS compiler ?  
16897
16898 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16899
16900         * class.cs (Operator): New class for operator declarations.
16901         (Operator::OpType): Enum for the various operators.
16902
16903 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16904
16905         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
16906         ostensibly handle this in semantic analysis.
16907
16908         * cs-parser.jay (general_catch_clause): Comment out
16909         (specific_catch_clauses, specific_catch_clause): Ditto.
16910         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
16911         (catch_args, opt_catch_args): New productions.
16912         (catch_clause): Rewrite to use the new productions above
16913         (catch_clauses): Modify accordingly.
16914         (opt_catch_clauses): New production to use in try_statement
16915         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
16916         and re-write the code in the actions to extract the specific and
16917         general catch clauses by being a little smart ;-)
16918
16919         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
16920         Hooray, try and catch statements parse fine !
16921
16922 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16923
16924         * statement.cs (Block::GetVariableType): Fix logic to extract the type
16925         string from the hashtable of variables.
16926
16927         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
16928         I end up making that mistake ;-)
16929         (catch_clauses): Fixed gross error which made Key and Value of the 
16930         DictionaryEntry the same : $1 !!
16931
16932 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16933
16934         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
16935
16936         * cs-parser.jay (event_declaration): Correct to remove the semicolon
16937         when the add and remove accessors are specified. 
16938
16939 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16940
16941         * cs-parser.jay (IndexerDeclaration): New helper class to hold
16942         information about indexer_declarator.
16943         (indexer_declarator): Implement actions.
16944         (parsing_indexer): New local boolean used to keep track of whether
16945         we are parsing indexers or properties. This is necessary because 
16946         implicit_parameters come into picture even for the get accessor in the 
16947         case of an indexer.
16948         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
16949
16950         * class.cs (Indexer): New class for indexer declarations.
16951         (TypeContainer::AddIndexer): New method to add an indexer to a type.
16952         (TypeContainer::indexers): New member to hold list of indexers for the
16953         type.
16954
16955 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16956
16957         * cs-parser.jay (add_accessor_declaration): Implement action.
16958         (remove_accessor_declaration): Implement action.
16959         (event_accessors_declaration): Implement
16960         (variable_declarators): swap statements for first rule - trivial.
16961
16962         * class.cs (Event): New class to hold information about event
16963         declarations.
16964         (TypeContainer::AddEvent): New method to add an event to a type
16965         (TypeContainer::events): New member to hold list of events.
16966
16967         * cs-parser.jay (event_declaration): Implement actions.
16968
16969 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16970
16971         * cs-parser.jay (dim_separators): Implement. Make it a string
16972         concatenating all the commas together, just as they appear.
16973         (opt_dim_separators): Modify accordingly
16974         (rank_specifiers): Update accordingly. Basically do the same
16975         thing - instead, collect the brackets here.
16976         (opt_rank_sepcifiers): Modify accordingly.
16977         (array_type): Modify to actually return the complete type string
16978         instead of ignoring the rank_specifiers.
16979         (expression_list): Implement to collect the expressions
16980         (variable_initializer): Implement. We make it a list of expressions
16981         essentially so that we can handle the array_initializer case neatly too.
16982         (variable_initializer_list): Implement.
16983         (array_initializer): Make it a list of variable_initializers
16984         (opt_array_initializer): Modify accordingly.
16985
16986         * expression.cs (New::NType): Add enumeration to help us
16987         keep track of whether we have an object/delegate creation
16988         or an array creation.
16989         (New:NewType, New::Rank, New::Indices, New::Initializers): New
16990         members to hold data about array creation.
16991         (New:New): Modify to update NewType
16992         (New:New): New Overloaded contructor for the array creation
16993         case.
16994
16995         * cs-parser.jay (array_creation_expression): Implement to call
16996         the overloaded New constructor.
16997
16998 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
16999
17000         * class.cs (TypeContainer::Constructors): Return member
17001         constructors instead of returning null.
17002
17003 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * typemanager.cs (InitCoreTypes): Initialize the various core
17006         types after we have populated the type manager with the user
17007         defined types (this distinction will be important later while
17008         compiling corlib.dll)
17009
17010         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
17011         on Expression Classification.  Now all expressions have a method
17012         `Resolve' and a method `Emit'.
17013
17014         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
17015         generation from working.     Also add some temporary debugging
17016         code. 
17017
17018 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
17019
17020         * codegen.cs: Lots of code generation pieces.  This is only the
17021         beginning, will continue tomorrow with more touches of polish.  We
17022         handle the fundamentals of if, while, do, for, return.  Others are
17023         trickier and I need to start working on invocations soon.
17024
17025         * gen-treedump.cs: Bug fix, use s.Increment here instead of
17026         s.InitStatement. 
17027
17028         * codegen.cs (EmitContext): New struct, used during code
17029         emission to keep a context.   Most of the code generation will be
17030         here. 
17031
17032         * cs-parser.jay: Add embedded blocks to the list of statements of
17033         this block.  So code generation proceeds in a top down fashion.
17034
17035 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
17036
17037         * statement.cs: Add support for multiple child blocks.
17038
17039 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * codegen.cs (EmitCode): New function, will emit the code for a
17042         Block of code given a TypeContainer and its ILGenerator. 
17043
17044         * statement.cs (Block): Standard public readonly optimization.
17045         (Block::Block constructors): Link children. 
17046         (Block::Child): Child Linker.
17047         (Block::EmitVariables): Emits IL variable declarations.
17048
17049         * class.cs: Drop support for MethodGroups here, delay until
17050         Semantic Analysis.
17051         (Method::): Applied the same simplification that I did before, and
17052         move from Properties to public readonly fields.
17053         (Method::ParameterTypes): Returns the parameter types for the
17054         function, and implements a cache that will be useful later when I
17055         do error checking and the semantic analysis on the methods is
17056         performed.
17057         (Constructor::GetCallingConvention): Renamed from CallingConvetion
17058         and made a method, optional argument tells whether this is a class
17059         or a structure to apply the `has-this' bit.
17060         (Method::GetCallingConvention): Implement, returns the calling
17061         convention. 
17062         (Method::Define): Defines the type, a second pass is performed
17063         later to populate the methods.
17064
17065         (Constructor::ParameterTypes): implement a cache similar to the
17066         one on Method::ParameterTypes, useful later when we do semantic
17067         analysis. 
17068
17069         (TypeContainer::EmitMethod):  New method.  Emits methods.
17070
17071         * expression.cs: Removed MethodGroup class from here.
17072
17073         * parameter.cs (Parameters::GetCallingConvention): new method.
17074
17075 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
17076
17077         * class.cs (TypeContainer::Populate): Drop RootContext from the
17078         argument. 
17079
17080         (Constructor::CallingConvention): Returns the calling convention.
17081         (Constructor::ParameterTypes): Returns the constructor parameter
17082         types. 
17083
17084         (TypeContainer::AddConstructor): Keep track of default constructor
17085         and the default static constructor.
17086
17087         (Constructor::) Another class that starts using `public readonly'
17088         instead of properties. 
17089
17090         (Constructor::IsDefault): Whether this is a default constructor. 
17091
17092         (Field::) use readonly public fields instead of properties also.
17093
17094         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
17095         track of static constructors;  If none is used, turn on
17096         BeforeFieldInit in the TypeAttributes. 
17097
17098         * cs-parser.jay (opt_argument_list): now the return can be null
17099         for the cases where there are no arguments. 
17100
17101         (constructor_declarator): If there is no implicit `base' or
17102         `this', then invoke the default parent constructor. 
17103
17104         * modifiers.cs (MethodAttr): New static function maps a set of
17105         modifiers flags into a MethodAttributes enum
17106         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
17107         MethodAttr, TypeAttr to represent the various mappings where the
17108         modifiers are used.
17109         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
17110
17111 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
17112
17113         * parameter.cs (GetParameterInfo): Fix bug where there would be no
17114         method arguments.
17115
17116         * interface.cs (PopulateIndexer): Implemented the code generator
17117         for interface indexers.
17118
17119 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
17120
17121         * interface.cs (InterfaceMemberBase): Now we track the new status
17122         here.  
17123
17124         (PopulateProperty): Implement property population.  Woohoo!  Got
17125         Methods and Properties going today. 
17126
17127         Removed all the properties for interfaces, and replaced them with
17128         `public readonly' fields. 
17129
17130 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
17131
17132         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
17133         initialize their hashtables/arraylists only when they are needed
17134         instead of doing this always.
17135
17136         * parameter.cs: Handle refs and out parameters.
17137
17138         * cs-parser.jay: Use an ArrayList to construct the arguments
17139         instead of the ParameterCollection, and then cast that to a
17140         Parameter[] array.
17141
17142         * parameter.cs: Drop the use of ParameterCollection and use
17143         instead arrays of Parameters.
17144
17145         (GetParameterInfo): Use the Type, not the Name when resolving
17146         types. 
17147
17148 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
17151         and instead use public readonly fields.
17152
17153         * class.cs: Put back walking code for type containers.
17154
17155 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
17156
17157         * class.cs (MakeConstant): Code to define constants.
17158
17159         * rootcontext.cs (LookupType): New function.  Used to locate types 
17160
17161
17162 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
17163
17164         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
17165         this System.Reflection code is.  Kudos to Microsoft
17166
17167         * typemanager.cs: Implement a type cache and avoid loading all
17168         types at boot time.  Wrap in LookupType the internals.  This made
17169         the compiler so much faster.  Wow.  I rule!
17170
17171         * driver.cs: Make sure we always load mscorlib first (for
17172         debugging purposes, nothing really important).
17173
17174         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
17175         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
17176
17177         * rootcontext.cs: Lookup types on their namespace;  Lookup types
17178         on namespaces that have been imported using the `using' keyword.
17179
17180         * class.cs (TypeContainer::TypeAttr): Virtualize.
17181         (Class::TypeAttr): Return attributes suitable for this bad boy.
17182         (Struct::TypeAttr): ditto.
17183         Handle nested classes.
17184         (TypeContainer::) Remove all the type visiting code, it is now
17185         replaced with the rootcontext.cs code
17186
17187         * rootcontext.cs (GetClassBases): Added support for structs. 
17188
17189 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
17190
17191         * interface.cs, statement.cs, class.cs, parameter.cs,
17192         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
17193         Drop use of TypeRefs, and use strings instead.
17194
17195 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
17196
17197         * rootcontext.cs: 
17198
17199         * class.cs (Struct::Struct): set the SEALED flags after
17200         checking the modifiers.
17201         (TypeContainer::TypeAttr): new property, returns the
17202         TypeAttributes for a class.  
17203
17204         * cs-parser.jay (type_list): Oops, list production was creating a
17205         new list of base types.
17206
17207         * rootcontext.cs (StdLib): New property.
17208         (GetInterfaceTypeByName): returns an interface by type name, and
17209         encapsulates error handling here.
17210         (GetInterfaces): simplified.
17211         (ResolveTree): Encapsulated all the tree resolution here.
17212         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
17213         types. 
17214
17215         * driver.cs: Add support for --nostdlib, to avoid loading the
17216         default assemblies.
17217         (Main): Do not put tree resolution here. 
17218
17219         * rootcontext.cs: Beginning of the class resolution.
17220
17221 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * rootcontext.cs: Provide better error reporting. 
17224
17225         * cs-parser.jay (interface_base): set our $$ to be interfaces.
17226
17227         * rootcontext.cs (CreateInterface): Handle the case where there
17228         are no parent interfaces.
17229
17230         (CloseTypes): Routine to flush types at the end.
17231         (CreateInterface): Track types.
17232         (GetInterfaces): Returns an array of Types from the list of
17233         defined interfaces.
17234
17235         * typemanager.c (AddUserType): Mechanism to track user types (puts
17236         the type on the global type hash, and allows us to close it at the
17237         end). 
17238
17239 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
17242         RecordInterface instead.
17243
17244         * cs-parser.jay: Updated to reflect changes above.
17245
17246         * decl.cs (Definition): Keep track of the TypeBuilder type that
17247         represents this type here.  Not sure we will use it in the long
17248         run, but wont hurt for now.
17249
17250         * driver.cs: Smaller changes to accomodate the new code.
17251
17252         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
17253         when done. 
17254
17255         * rootcontext.cs (CreateInterface):  New method, used to create
17256         the System.TypeBuilder type for interfaces.
17257         (ResolveInterfaces): new entry point to resolve the interface
17258         hierarchy. 
17259         (CodeGen): Property, used to keep track of the code generator.
17260
17261 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
17262
17263         * cs-parser.jay: Add a second production for delegate_declaration
17264         with `VOID'.
17265
17266         (enum_body): Put an opt_comma here instead of putting it on
17267         enum_body or enum_member_declarations so we can handle trailing
17268         commas on enumeration members.  Gets rid of a shift/reduce.
17269
17270         (type_list): Need a COMMA in the middle.
17271
17272         (indexer_declaration): Tell tokenizer to recognize get/set
17273
17274         * Remove old targets.
17275
17276         * Re-add the parser target.
17277
17278 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17279
17280         * cs-parser.jay: Add precendence rules for a number of operators
17281         ot reduce the number of shift/reduce conflicts in the grammar.
17282
17283 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
17284
17285         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
17286         and put it here.
17287
17288         Get rid of old crufty code.
17289
17290         * rootcontext.cs: Use this to keep track of the parsed
17291         representation and the defined types available to the program. 
17292
17293         * gen-treedump.cs: adjust for new convention.
17294
17295         * type.cs: Split out the type manager, and the assembly builder
17296         from here. 
17297
17298         * typemanager.cs: the type manager will live here now.
17299
17300         * cil-codegen.cs: And the code generator here. 
17301
17302 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
17303
17304         * makefile: Fixed up for easy making.
17305
17306 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17307
17308         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
17309         the 
17310
17311         (unary_expression): Expand pre_increment_expression and
17312         post_decrement_expression to reduce a shift/reduce.
17313
17314 2001-07-11  Simon Cozens
17315
17316         * cs-tokenizer.cs: Hex numbers should begin with a 0.
17317
17318         Improve allow_keyword_as_indent name.
17319
17320 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
17321
17322         * Adjustments for Beta2. 
17323
17324 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
17325
17326         * decl.cs: Added `Define' abstract method.
17327         (InTransit): new property, used to catch recursive definitions. 
17328
17329         * interface.cs: Implement `Define'. 
17330
17331         * modifiers.cs: Map Modifiers.constants to
17332         System.Reflection.TypeAttribute flags.
17333
17334         * class.cs: Keep track of types and user-defined types.
17335         (BuilderInit): New method for creating an assembly
17336         (ResolveType): New function to launch the resolution process, only
17337         used by interfaces for now.
17338
17339         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
17340         that are inserted into the name space. 
17341
17342 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
17343
17344         * ARGH.  I have screwed up my tree so many times due to the use of
17345         rsync rather than using CVS.  Going to fix this at once. 
17346
17347         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
17348         load types.
17349
17350 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * Experiment successful: Use System.Type rather that our own
17353         version of Type.  
17354
17355 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
17356
17357         * cs-parser.jay: Removed nsAliases from here.
17358
17359         Use new namespaces, handle `using XXX;' 
17360
17361         * namespace.cs: Reimplemented namespace handling, use a recursive
17362         definition of the class.  Now we can keep track of using clauses
17363         and catch invalid using clauses.
17364
17365 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * gen-treedump.cs: Adapted for all the renaming.
17368
17369         * expression.cs (Expression): this class now has a Type property
17370         which returns an expression Type.
17371
17372         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
17373         `Type', as this has a different meaning now in the base
17374
17375 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
17376
17377         * interface.cs, class.cs: Removed from all the sources the
17378         references to signature computation, as we can not do method
17379         signature computation during the parsing time, as we are not
17380         trying to solve at that point distinguishing:
17381
17382         class X {
17383                 void a (Blah x) {}
17384                 void a (NS.Blah x) {}
17385         }
17386
17387         Which depending on the context might be valid or not, as we do not
17388         know if Blah is the same thing as NS.Blah at that point.
17389
17390         * Redid everything so the code uses TypeRefs now instead of
17391         Types.  TypeRefs are just temporary type placeholders, that need
17392         to be resolved.  They initially have a pointer to a string and the
17393         current scope in which they are used.  This is used later by the
17394         compiler to resolve the reference to an actual Type. 
17395
17396         * DeclSpace is no longer a CIR.Type, and neither are
17397         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
17398         are all DeclSpaces, but no Types. 
17399
17400         * type.cs (TypeRefManager): This implements the TypeRef manager,
17401         which keeps track of all the types that need to be resolved after
17402         the parsing has finished. 
17403
17404 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
17405
17406         * ARGH.  We are going to have to store `foreach' as a class rather
17407         than resolving it, as we need to verify error 1579 after name
17408         resolution.   *OR* we could keep a flag that says `This request to
17409         IEnumerator comes from a foreach statement' which we can then use
17410         to generate the error.
17411
17412 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
17413
17414         * class.cs (TypeContainer.AddMethod): we now add methods to the
17415         MethodGroup instead of the method hashtable.  
17416
17417         * expression.cs: Add MethodGroup abstraction, which gets us one
17418         step closer to the specification in the way we handle method
17419         declarations.  
17420
17421         * cs-parser.jay (primary_expression): qualified_identifier now
17422         tried to match up an identifier to a local variable reference or
17423         to a parameter reference.
17424
17425         current_local_parameters is now a parser global variable that
17426         points to the current parameters for the block, used during name
17427         lookup.
17428
17429         (property_declaration): Now creates an implicit `value' argument to
17430         the set accessor.
17431
17432 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * parameter.cs: Do not use `param' arguments as part of the
17435         signature, per the spec.
17436
17437 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
17438
17439         * decl.cs: Base class for classes, structs and interfaces.  This
17440         is the "Declaration Space" 
17441
17442         * cs-parser.jay: Use CheckDef for checking declaration errors
17443         instead of having one on each function.
17444
17445         * class.cs: Factor out some code for handling error handling in
17446         accordance to the "Declarations" section in the "Basic Concepts"
17447         chapter in the ECMA C# spec.
17448
17449         * interface.cs: Make all interface member classes derive from
17450         InterfaceMemberBase.
17451
17452 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
17453
17454         * Many things: all interfaces are parsed and generated in
17455         gen-treedump.  Support for member variables, constructors,
17456         destructors, properties, constants is there.
17457
17458         Beginning of the IL backend, but very little done, just there for
17459         testing purposes. 
17460
17461 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
17462
17463         * cs-parser.jay: Fix labeled statement.
17464
17465         * cs-tokenizer.cs (escape): Escape " and ' always.
17466         ref_line, ref_name: keep track of the line/filename as instructed
17467         by #line by the compiler.
17468         Parse #line.
17469
17470 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
17471
17472         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
17473         to match the values in System.CodeDOM.
17474
17475         Divid renamed to Divide.
17476
17477         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
17478         statements. 
17479         (Statements.set): remove.
17480
17481         * System.CodeDOM/CodeCatchClause.cs: always have a valid
17482         statements. 
17483
17484         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
17485         falseStatements always have valid values. 
17486
17487         * cs-parser.jay: Use System.CodeDOM now.
17488