d8989572c583e094d6d659b5dfef3d60007fd05f
[mono.git] / mcs / mcs / ChangeLog
1 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2
3         * typemanager.cs (CSharpSignature): One more missing build-in types
4         replacement.
5         More tricks for non-mono runtime.
6
7 2007-06-05  Raja R Harinath  <harinath@gmail.com>
8
9         * statement.cs (Block.CheckError136_InParents): Remove.
10         (Block.AddVariable): Use GetParameterInfo instead.
11         (ToplevelBlock.ProcessArguments): Likewise.
12
13 2007-06-04  Raja R Harinath  <rharinath@novell.com>
14
15         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
16         information too.
17         (ToplevelBlock.GetParameterInfo): Split out of ...
18         (ToplevelBlock.GetParameterRefernce): ... this.
19         (ToplevelBlock.ParameterMap): Remove.
20         * expression.cs (ParameterReference): Update to use
21         ToplevelParameterInfo.
22
23         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
24         regression.
25
26         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
27         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
28
29         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
30         (ToplevelBlock.ProcessParameters) ... here.
31         (ToplevelBlock..ctor): Invoke it.
32
33         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
34         new parameters.
35
36         * statement.cs (IKnownVariable): New interface.
37         (LocalInfo): Implement it.
38         (ToplevelParameterInfo): New class.
39         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
40         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
41         GetKnownVariableInfo.
42
43 2007-06-03  Raja R Harinath  <harinath@gmail.com>
44
45         Partly speed up CS0136 error checks.
46         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
47         'recurse' parameter.
48         (Block.DoCheckError136): Only check errors in parameters.  Move
49         local variable checks ...
50         (Block.AddVariable): ... here, and ...
51         (ToplevelBlock.ResolveMeta): ... here.
52
53 2007-06-02  Raja R Harinath  <harinath@gmail.com>
54
55         * statement.cs (Block.IsChildOf): Remove.
56
57         * statement.cs (Statement.Clone): Move special case code ...
58         (Block.CloneTo): ... here.
59
60 2007-05-29  Raja R Harinath  <rharinath@novell.com>
61
62         * statement.cs (ToplevelBlock.container): Remove field.  It's
63         redundant with 'Parent'.
64         (ToplevelBlock.ContainerBlock): Remove accessor.
65         (ToplevelBlock..ctor): Update to changes.  Register anonymous
66         child with parent here, ...
67         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
68         current_block.
69         (start_anonymous): Don't save current_block.
70         (top_current_block): Remove.
71
72         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
73         (Block.Resolve): Update to changes.
74         (Block..ctor): Move setting of "correct" 'Toplevel'
75         and 'Explicit' fields to ...
76         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
77
78 2007-05-27  Raja R Harinath  <harinath@gmail.com>
79
80         Kill Block.Implicit
81         * statement.cs (Block.Implicit): Remove.
82         (Block): Update to changes.
83         * flowanalysis.cs: Likewise.
84
85         Mildly speed up CheckInvariantMeaningInBlock
86         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
87         Recursively call AddKnownVariable to all enclosing blocks.
88         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
89         Remove recursive calls.
90         (Block): Update to changes.
91
92         New ExplicitBlock invariants
93         * statement.cs (Block.Explicit): New field.  It points to the
94         immediately enclosing non-implicit block.
95         (Block..ctor): Maintain the invariant.
96         * cs-parser.jay: Take advantage of invariant.
97
98         Introduce ExplicitBlock
99         * statement.cs (ExplicitBlock): New.
100         (ToplevelBlock): Derive from it.
101         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
102         sense of flag.
103         (Block.Implicit): Update to changes.
104         * cs-parser.jay: Update to changes.
105
106         Remove unused field
107         * codegen.cs (EmitContext.IsLastStatement): Remove.
108         * statement.cs (Block.DoEmit): Update to changes.
109
110 2007-05-25  Raja R Harinath  <rharinath@novell.com>
111
112         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
113         modifying current_block directly.
114
115 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
116         
117         * class.cs: Implemented automatic properties (C# 3.0)
118           Thanks to Marek for the help.
119
120 2007-05-23  Raja R Harinath  <rharinath@novell.com>
121
122         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
123         variable as assigned, note also that all its components are
124         assigned too.
125         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
126
127 2007-05-19  Marek Safar  <marek.safar@gmail.com>
128
129         * anonymous.cs, class.cs: Emit Compiler generated attribute when
130         member is marked as compiler generated.
131         
132         * decl.cs (MemberCore): Refactored ModFlags into property.
133
134         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
135         (Check): Check only accessibility modifiers.
136
137 2007-05-18  Raja R Harinath  <rharinath@novell.com>
138
139         Track all assignable slots in one bit array
140         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
141         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
142         logic from VariableMap constructor here.  Use the same 'offset'
143         variable that's later used for computing offsets of local
144         variables.
145         * flowanalysis.cs (UsageVector.parameters): Remove.
146         (UsageVector): Update to changes.
147         (VariableMap): Remove.
148
149         Avoid creating ParameterMap in every block
150         * statement.cs (Block.ParameterMap): Move ...
151         (ToplevelBlock.ParameterMap): ... here.
152         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
153         only once.
154         * flowanalysis.cs (FlowBranching.param_map): Remove.
155         (FlowBranching.UsageVector): Update to changes.
156         (FlowBranchingToplevel.CheckOutParameters): Likewise.
157
158         * statement.cs (Block.CloneTo): Clone Toplevel field too.
159
160         * expression.cs (ParameterReference): Distinguish between block
161         where parameter was referenced and declared.
162
163 2007-05-18  Marek Safar  <marek.safar@gmail.com>
164
165         * flowanalysis.cs, statement.cs: Put back improved error handling.
166
167 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
168         
169         * assign.cs:
170         * expression.cs:
171           Imporved object and collection initialization (C# 3.0).
172
173 2007-05-15  Marek Safar  <marek.safar@gmail.com>
174
175         A fix for bug #81380
176         * expression.cs (Is.DoResolve): Only value types have constant `is'
177         behaviour.
178
179 2007-05-15  Raja R Harinath  <rharinath@novell.com>
180
181         * statement.cs (ToplevelBlock.child): Remove.
182
183 2007-05-15  Raja R Harinath  <harinath@gmail.com>
184
185         Rationalize ResolveMeta: refactoring
186         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
187         out constant handling code into ...
188         (Block.DoResolveConstants): ... this.
189
190         Rationalize ResolveMeta: kill local_map
191         * statement.cs (Block.local_map, Block.LocalMap): Remove.
192         (Block.AssignableSlots): New.
193         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
194         for locals -- move code from VariableMap here.  Avoid unnecessary
195         allocations.
196         * flowanalysis.cs (FlowBranching.local_map): Remove.
197         (FlowBranching..ctor): Use Block.AssignableSlots.
198         (VariableMap): Remove unused constructors.
199
200 2007-05-11  Raja R Harinath  <rharinath@novell.com>
201
202         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
203
204 2007-05-11  Marek Safar  <marek.safar@gmail.com>
205
206         * typemanager.cs (IsFriendAssembly): Should not be called for building
207         assembly.
208
209 2007-05-09  Marek Safar  <marek.safar@gmail.com>
210
211         * literal.cs (NullConstant): Print null in all cases.
212         
213         * expression.cs (Binary.ResolveOperator): Implemented delegate
214          comparison based on C# 2.0 changes.
215
216 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
217
218         This code is contributed under the MIT X11 license
219         
220         The following enables support for several C# 3.0 language features:
221         
222         * cs-tokenizer.cs: Added support for the "var" keyword.
223         
224         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
225           Added VarExpr class to facilitate type inferencing.
226         
227         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
228           to support anonymous types.
229         
230         * assign.cs: Added support for type inferencing and initialization.
231         
232         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
233         
234         * expression.cs: Added implicit array support to ArrayCreation.
235           Added 5 types and 1 interface:
236           
237           IInitializable                Implementing classes can inject initializing
238                                         statements after object instantiation.
239           
240           Initializer                   Stores data for object initialization.
241           
242           AnonymousType                 An expression for anonymous types.
243           
244           AnonymousTypeParameter        Stores data about an anonymous type's field.
245           
246           NewInitialize                 An expression for object initialization.
247           
248           CollectionInitialize          An expression for collection initialization.
249         
250         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
251           statements.
252
253 2007-05-06  Marek Safar  <marek.safar@gmail.com>
254
255         A fix for bug #81500
256         * cs-tokenizer.cs: Add special handling for coalescing operator.
257
258 2007-05-06  Marek Safar  <marek.safar@gmail.com>
259
260         A fix for bug #81529
261         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
262         its value from base class until it is redefined.
263
264 2007-05-02  Raja R Harinath  <rharinath@novell.com>
265
266         Fix regression in cs0631-3.cs
267         * cs-parser.jay (operator_declarator): Add opt_attributes to error
268         fallback.  Make error fallback catch more cases.
269
270 2007-05-01  Miguel de Icaza  <miguel@novell.com>
271
272         * cs-parser.jay: Allow parameters in operator declarations to have
273         attributes. 
274
275 2007-04-27  Miguel de Icaza  <miguel@novell.com>
276
277         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
278         exists. 
279
280         * lambda.cs (ContextualReturn.Resolve): An expression is valid
281         inside the ContextualReturn, it does not have to be an
282         ExpressionStatement. 
283
284 2007-04-24  Miguel de Icaza  <miguel@novell.com>
285
286         * lambda.cs (ContextualReturn.Resolve): if the return type is not
287         set, set it.
288
289 2007-04-23  Miguel de Icaza  <miguel@novell.com>
290
291         * anonymous.cs (AnonymousContainer): split the virtual Resolve
292         method in two methods: ResolveNoDefine and Resolve.
293
294         ResolveNoDefine will stop just after ResolveTopBlock has been
295         called.   
296
297         Resolve will then continue by creating a method and issuing the
298         call to method.Define ().
299
300         (AnonymousMethod): Split and implement the new Resolve and
301         ResolveNoDefine as well.
302
303         * lambda.cs (LambdaExpression): Split the anonymous method
304         resolution code into a separate routine (CoreCompatibilityTest)
305         from DoCompatibleTest.
306
307         (LambdaExpression.TryBuild): New method, this method tries to
308         build the LambdaExpression with the given set of types to be used
309         as the types for the various parameters of the lambda expression. 
310
311         If the compilation succeed with the given types, the infered type
312         of the Anonymous method is returned, otherwise null is returned.
313
314 2007-04-23  Marek Safar  <marek.safar@gmail.com>
315
316         A fix for bug #81414
317         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
318
319 2007-04-22  Miguel de Icaza  <miguel@novell.com>
320
321         * cs-tokenizer.cs: Change various identifiers here from the
322         camelCasing to the recommended Linux-like style for instance
323         variables from the Coding Guidelines. 
324
325 2007-04-19  Martin Baulig  <martin@ximian.com>
326
327         * convert.cs
328         (Convert.ImplicitReferenceConversionCore): Allow conversions from
329         System.Enum to System.ValueType.
330
331 2007-04-13  Martin Baulig  <martin@ximian.com>
332
333         Rewrote implicit reference conversions.  We need to distinguish
334         between implicit reference conversions (13.1.4) and implicit
335         boxing conversions (13.1.5).
336
337         According to the spec, there's an an implicit conversion
338         "From a one-dimensional array-type S[] to IList<T> and base
339         interfaces of this interface, provided there is an implicit
340         reference conversion from S to T."  Note that this does not
341         include boxing conversions.
342
343         * convert.cs
344         (Convert.ImplicitTypeParameterBoxingConversion): New method.
345         (Convert.ImplicitReferenceConversion): Split into
346         ImplicitReferenceConversionCore() and
347         ImplicitBoxingConversionExist().
348         (Convert.ImplicitReferenceConversionExists): Use the new
349         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
350
351 2007-04-12  Martin Baulig  <martin@ximian.com>
352
353         * convert.cs (Convert.ImplicitReferenceConversion): Move the
354         `TypeManager.null_type' checks up to the top of the method.
355
356 2007-04-11  Marek Safar  <marek.safar@gmail.com>
357
358         A fix for bug #81350
359         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
360         extension methods.
361
362 2007-04-11  Martin Baulig  <martin@ximian.com>
363
364         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
365         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
366         to make this work for generic classes; fixes #79561.
367
368 2007-04-11  Martin Baulig  <martin@ximian.com>
369
370         * expression.cs (As): Add support for nullable types; fixes #79371.
371
372 2007-04-11  Martin Baulig  <martin@ximian.com>
373
374         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
375         `type.FullName' is null; fixes #80243.
376
377 2007-04-11  Martin Baulig  <martin@ximian.com>
378
379         * expression.cs (Invocation.IsApplicable): Don't modify the method
380         if type inference succeeded, but the method was not applicable.
381         Fixes #81250.
382
383 2007-04-10  Marek Safar  <marek.safar@gmail.com>
384
385         A fix for bug #81324
386         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
387         internal and external namespaces containers.
388
389 2007-04-10  Martin Baulig  <martin@ximian.com>
390
391         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
392         TypeManager.DropGenericMethodArguments() so we also call
393         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
394
395 2007-04-10  Martin Baulig  <martin@ximian.com>
396
397         * iterators.cs (Iterator.CreateIterator): Don't crash if
398         `method.ReturnType' is null.  This happens if something went wrong
399         while resolving that typ (we already reported an error in this case).
400
401 2007-04-10  Martin Baulig  <martin@ximian.com>
402
403         * expression.cs (New.DoResolve): Don't call CheckComImport() on
404         generic interfaces; report the CS0144 directly.
405
406 2007-04-10  Martin Baulig  <martin@ximian.com>
407
408         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
409         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
410
411 2007-04-10  Martin Baulig  <martin@ximian.com>
412
413         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
414
415 2007-04-09  Raja R Harinath  <rharinath@novell.com>
416
417         A better fix
418         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
419         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
420
421         Fix #81338
422         * statement.cs (For.Resolve): If resolution fails, use
423         KillFlowBranching.
424
425 2007-04-08  Marek Safar  <marek.safar@gmail.com>
426
427         * anonymous.cs (MakeName): Make faster and zero-based.
428         (VerifyExplicitParameterCompatibility): Back to mode where generic
429         parameter is ignored.
430         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
431
432         * class.cs (EmitType): Method can emit another new method.
433
434         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
435
436         * driver.cs: Updated.
437
438         * lambda.cs: Reuse predefined empty parameters.
439
440         * parameter.cs: Updated
441
442         * support.cs: Implemented InflateTypes.
443
444         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
445         (InitSystemCore): Introduced to isolate 3.0 dependencies.
446
447 2007-04-03  Martin Baulig  <martin@ximian.com>
448
449         Fix #80632.
450
451         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
452         version of TypeManager.IsOverride() which also works with generic
453         types.  
454
455 2007-04-03  Martin Baulig  <martin@ximian.com>
456
457         Fix #81044.
458
459         * convert.cs
460         (Convert.ExplicitReferenceConversion): We need to cast when
461         converting from IList<T> to S[].
462
463 2007-04-01  Marek Safar  <marek.safar@gmail.com>
464
465         * decl.cs (FindExtensionMethods): Consider all candidates with same name
466         at this level.
467         
468         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
469
470 2007-03-31  Marek Safar  <marek.safar@gmail.com>
471
472         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
473         argument and return type inferring.
474
475         * codegen.cs (InferReturnType): Flag whether return can be inferred.
476         (ReturnType): Turned to property.
477
478         * statement.cs (Return): Implemented return type inferring.
479
480         * support.cs (ReflectionParameters): Use local types if possible.
481
482 2007-03-30  Raja R Harinath  <rharinath@novell.com>
483
484         * flowanalysis.cs (FlowBranching.Reachability): Remove.
485         (FlowBranching.UsageVector): Update to changes.
486
487         Prepare to kill 'Reachability'
488         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
489         argument of constructor.
490
491 2007-03-29  Raja R Harinath  <rharinath@novell.com>
492
493         Prepare to kill 'Reachability'
494         * flowanalysis.cs (UsageVector.is_unreachable): New.
495         (UsageVector): Update to maintain 'is_unreachable' in parallel to
496         'reachability', and verify they're consistent.
497
498         Fix #81121
499         * expression.cs (New.EmitStatement): Handle type parameters here too.
500
501 2007-03-29  Martin Baulig  <martin@ximian.com>
502
503         Fix #79148.
504
505         * anonymous.cs
506         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
507         CompilerGeneratedClass.
508         (ScopeInfo.EmitScopeInstance): Make this protected.
509         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
510         `ec.CurrentAnonymousMethod.Scope == Scope'.
511
512         * statement.cs (Block.ScopeInfo): Make this a property.
513
514 2007-03-27  Raja R Harinath  <harinath@gmail.com>
515
516         Prepare to kill 'Reachability'
517         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
518         (FlowBranching.UsageVector.Reachability): Remove property.
519         (FlowBranching.UsageVector.IsUnreachable): New property.
520         (FlowBranching.UsageVector.ResetBarrier): New.
521         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
522         * codegen.cs, statement.cs: Update to changes.
523
524 2007-03-27  Martin Baulig  <martin@ximian.com>
525
526         Fix #81209.
527
528         * decl.cs
529         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
530         generic types.
531
532 2007-03-26  Raja R Harinath  <rharinath@novell.com>
533
534         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
535         instead of TriState.  Remove all mention of TriState.
536
537         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
538         replaced by a boolean.  Add boolean 'is_unreachable' field, check
539         and maintain invariants.
540
541 2007-03-25  Marek Safar  <marek.safar@gmail.com>
542
543         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
544
545 2007-03-25  Marek Safar  <marek.safar@gmail.com>
546
547         * expression.cs: Stop using obsolete 2.0 opcodes.
548
549 2007-03-25  Marek Safar  <marek.safar@gmail.com>
550
551         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
552         one of the latests Martin's fixes.
553
554 2007-03-23  Miguel de Icaza  <miguel@novell.com>
555
556         * expression.cs: On BigEndian systems, swap the bytes, temporary
557         solution until we get a new bitconverter class.
558
559 2007-03-23  Martin Baulig  <martin@ximian.com>
560
561         Fix #81158.
562
563         * decl.cs (MemberCache.AddMembers): Add generic methods both as
564         "Method" and "Method`1".  Normally, a cache lookup is done on the
565         "Method" form (ie. without the generic arity), but this one makes
566         lookups on the full form work as well.
567
568 2007-03-22  Raja R Harinath  <rharinath@novell.com>
569
570         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
571         unused properties.
572
573 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
574         * class.cs: 
575         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
576         ordered_member_list, to TypeBuilder to store members to be defined
577         in the order they were parsed in.
578         - ordered_explicit_member_list contains all properties indexers
579           and methods that are defined as explicit implementation of an
580           interface or base class.
581         - ordered_member_list contains all properties indexers and methods
582           that are not defined as explicit implementation of an interface
583           or base class.
584
585         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
586         functionality in these removed classes has been replaced with 
587         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
588         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
589
590         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
591         to CheckForDuplications inside GetMethod and SetMethod Define Method
592         to handle method property and indexer name conflicts.
593
594         Fixes #79434
595
596         All code is contributed under the MIT/X11 license.
597
598 2007-03-20  Martin Baulig  <martin@ximian.com>
599
600         * class.cs (TypeContainer.Interfaces): Removed; they're now
601         included in `TypeContainer.Types'.
602
603 2007-03-20  Martin Baulig  <martin@ximian.com>
604
605         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
606
607         * class.cs (TypeContainer.CreateType): New public method.  This is
608         now called before DefineType() to create the TypeBuilders.
609         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
610         has already been created by CreateType().
611         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
612         don't resolve our base classes here; this has been moved into
613         DefineBaseTypes().  We're now called from CreateType().
614         (TypeContainer.DefineBaseTypes): New private method; resolve our
615         base classes here.  We're now called from DefineType().
616
617         * rootcontext.cs
618         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
619         our types first to create all the TypeBuilders.  After that, call
620         TypeContainer.DefineType() on all the types which'll resolve their
621         base classes and setup the resolve order.
622
623 2007-03-20  Martin Baulig  <martin@ximian.com>
624
625         * class.cs (TypeContainer.Enums): Removed; they're now included in
626         `TypeContainer.Types'.  
627
628 2007-03-20  Martin Baulig  <martin@ximian.com>
629
630         * class.cs
631         (TypeContainer.DefineType): Don't call ResolveMembers() here.
632         (TypeContainer.DoResolveMembers): Call DefineType() on our
633         `compiler_generated' classes; moved here from DefineNestedTypes().
634
635         * rootcontext.cs
636         (RootContext.ResolveTree): Call ResolveMembers() on all
637         TypeContainer's in the `type_container_resolve_order'.
638
639 2007-03-19  Marek Safar  <marek.safar@gmail.com>
640
641         * class.cs: Use corlib to handle InternalMethodImplAttribute.
642
643 2007-03-17  Marek Safar  <marek.safar@gmail.com>
644
645         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
646         implementation flags.
647
648 2007-03-17  Marek Safar  <marek.safar@gmail.com>
649
650         * class.cs: More optimizations for type parameters.
651
652 2007-03-15  Marek Safar  <marek.safar@gmail.com>
653
654         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
655
656         * ecore.cs, parameter.cs: More common code for both corlibs.
657
658         * typemanager.cs (IsGenericMethod): Simplified.
659
660 2007-03-15  Raja R Harinath  <rharinath@novell.com>
661
662         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
663         'returns'.
664         * statement.cs, iterators.cs, lambda.cs: Update to changes.
665
666         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
667         unconditionally.  Simplify explanation.
668         (Try.Resolve, Using.Resolve): Likewise.
669
670 2007-03-15  Martin Baulig  <martin@ximian.com>
671
672         Fix #80731.
673
674         * decl.cs (DeclSpace): If we're a partial class, use our
675         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
676
677 2007-03-15  Raja R Harinath  <rharinath@novell.com>
678
679         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
680         'throws'.
681         (FlowBranching.UsageVector): Update to changes.
682         (FlowBranching.MergeSiblings): Likewise.
683         * statement.cs: Likewise.
684
685 2007-03-15  Martin Baulig  <martin@ximian.com>
686
687         Fix #79302.
688
689         * decl.cs
690         (MemberCache): Added a special .ctor for type parameters.
691
692         * typemanager.cs
693         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
694         `MemberCache'.  
695
696 2007-03-09  Martin Baulig  <martin@ximian.com>
697
698         * enum.cs (Enum): Make this a TypeContainer.
699         (EnumMember): Derive from `Const'.
700
701         * const.cs
702         (Const.DoResolveValue): New protected virtual method; move most of
703         the functionality of ResolveValue() here so we can override it in
704         `EnumMember'.
705         (Const.CreateConstantReference): Make this virtual.
706
707         * class.cs (Kind): Add `Kind.Enum'.
708         (TypeContainer.Emit): Don't emit the enums here; they're already
709         in the `RootContext.typecontainer_resolve_order'.
710
711         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
712         here; they're already in the `typecontainer_resolve_order'.
713
714         * ecore.cs (EnumConstant.ConvertImplicitly): Add
715         TypeManager.DropGenericTypeArguments().
716
717         * typemanager.cs
718         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
719         (TypeManager.IsEnumType): Likewise.
720         (TypeManager.EnumToUnderlying): Likewise.
721         (TypeManager.IsEqual): Add support for enums.
722
723 2007-03-12  Raja R Harinath  <rharinath@novell.com>
724
725         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
726         DefaultParameterValueAttribute to be undefined, say if System.dll
727         is not referenced.
728
729 2007-03-11  Marek Safar  <marek.safar@gmail.com>
730
731         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
732         any mscorlib.
733
734 2007-03-10  Marek Safar  <marek.safar@gmail.com>
735
736         * class.cs, parameter.cs: Unified parameters verification.
737
738 2007-03-08  Martin Baulig  <martin@ximian.com>
739
740         * cs-parser.jay (constructor_header): Pass the location to the
741         newly created TopLevelBlock.
742
743 2007-03-07  Martin Baulig  <martin@ximian.com>
744
745         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
746
747 2007-03-06  Miguel de Icaza  <miguel@novell.com>
748
749         * convert.cs (ExplicitReferenceConversionExists): Sync this method
750         with the changes from David, fixes the build.
751
752 2007-03-05  David Mitchell  <dmitchell@logos.com>
753
754         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
755         and its base interfaces to a one-dimensional array type S[],
756         provided there is an implicit or explicit reference conversion
757         from S to T.
758
759 2007-03-03  Marek Safar  <marek.safar@gmail.com>
760
761         * cs-tokenizer.cs: Implemented basic linq grammar.
762
763         * driver.cs: Set linq lang version on demand.
764
765 2007-02-26  Marek Safar  <marek.safar@gmail.com>
766
767         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
768
769 2007-02-25  Marek Safar  <marek.safar@gmail.com>
770
771         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
772         (Fixes #80455)
773
774         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
775         here.
776         Check property and event extern attributes.
777
778         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
779         charset.
780
781 2007-02-24  Marek Safar  <marek.safar@gmail.com>
782
783         A fix for bug #80407
784         * ecore.cs: Don't report ambiguity error when methods have same parent.
785
786 2007-02-23  Marek Safar  <marek.safar@gmail.com>
787
788         A fix for bug #80878
789         * class.cs, cs-parser.jay: Event property can host anonymous methods.
790
791 2007-02-22  Marek Safar  <marek.safar@gmail.com>
792
793         * attribute.cs: Enable ExtensionAttribute presence test.
794
795 2007-02-22  Marek Safar  <marek.safar@gmail.com>
796
797         * class.cs: Warn about missing GetHashCode only when Equals is override.
798
799         * decl.cs: Check accessibility of type arguments.
800
801         * typemanager.cs: Correctly report nullable array.
802
803 2007-02-20  Marek Safar  <marek.safar@gmail.com>
804
805         * class.cs, report.cs: Capture more details when things go wrong.
806
807 2007-02-20  Marek Safar  <marek.safar@gmail.com>
808
809         A fix for bug #80650
810         * cs-parser.jay: Anonymous container starts at constructor declaration
811         and not at block beginning because it has to be usable in constructor
812         initializer.
813
814         * statement.cs: Use context location and not block one for error reporting.
815
816 2007-02-18  Marek Safar  <marek.safar@gmail.com>
817
818         A fix for bug #78712
819         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
820         too.
821
822 2007-02-18  Marek Safar  <marek.safar@gmail.com>
823
824         A fix for bug #80493 by Atsushi Enomoto
825         * cs-parser.jay: Ignore invalid attribute target.
826
827 2007-02-18  Marek Safar  <marek.safar@gmail.com>
828  
829         * cs-tokenizer.cs: Ignore '\0' as white space character.
830
831 2007-02-17  Miguel de Icaza  <miguel@novell.com>
832
833         * cs-parser.jay: Add support for lambda expressions to the mcs
834         compiler as well.
835
836         * lambda.cs: Only clone when we are probing, not on the final call
837         (Compatible is the final call). 
838
839         * statement.cs (CloneContext): Introduce class to provide block
840         remapping during clone.
841
842         All statements Clone themselves now.
843
844         (Clone): special handling for blocks, when we clone a block, we
845         register the block inside this routine, as children of the block
846         might trigger a lookup. 
847         
848         * expression.cs: Add support for CloneContext in all expressions. 
849         
850 2007-02-17  Marek Safar  <marek.safar@gmail.com>
851  
852         A fix for bug #80493
853         * statement.cs: Report ambiguous warning when interfaces are not related.
854
855 2007-02-15  Marek Safar  <marek.safar@gmail.com>
856
857         C# 3.0 extension methods.
858
859         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
860         cannot be used directly.
861
862         * class.cs (Class.Emit): Emit extension attribute if any class method
863         is extension method.
864         (Method.Define): Add basic extension method validation conditions.
865         (Method.Emit): Emit extension attribute for method.
866
867         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
868         extension method exists. Currently we follow same approach as Microsoft
869         does, emit even if a method or a class are private but this can change
870         later.
871
872         * cs-parser.jay: Add handling of `this' keyword in method parameters
873         context.
874
875         * decl.cs (DeclSpace.IsStaticClass): New property.
876         (MemberCache.FindExtensionMethods): Looks for extension methods with
877         defined name and extension type.
878
879         * doc.cs: Updated after OverloadResolve changes.
880
881         * driver.cs: Add new soft reference to System.Core.dll.
882
883         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
884         (ExtensionMethodGroupExpr): Represents group of extension methods.
885
886         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
887         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
888         to MethodGroupExpr and made non-static for easier customization.
889         (Invocation.DoResolve): Add extension method lookup when no standard
890         method was found.
891         (MemberAccess.DoResolve): Try extension methods if no member exists.
892
893         * modifiers.cs: Add METHOD_EXTENSION modifier.
894
895         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
896         as well as candidate extension type.
897         (ComputeNamespaces): When assembly constains extension methods registers
898         them.
899         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
900         extension method lookup.
901         (Namespace.LookupExtensionMethod): Looks for extension method in this
902         namespace.
903         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
904         find a method which matches name and extensionType.
905
906         * parameter.cs (Parameter): Add This modifer.
907         (HasExtensionMethodModifier): New property.
908         (Resolve): Add extension parameter check.
909         (ModFlags): turned to property to exclude this modifier as it is not real
910         parameter modifier.
911         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
912
913         * support.cs (ParameterData): Add ExtensionMethodType.
914         (ReflectionParameters): Implemented ExtensionMethodType interface property.
915
916         * typemanager.cs: Add type and ctor extension attribute type.
917
918 2007-02-15  Miguel de Icaza  <miguel@novell.com>
919
920         * report.cs (DisableErrors, EnableErrors): used to prevent error
921         output when we are "trying" to compile various methods with
922         different types. 
923
924         * ecore.cs (Expression): Add Clone method that calls the virtual
925         CloneTo method.  The current CloneTo method in Expression throws
926         an exception so we can track down all the places where this must
927         be implemented (not using abstract, because that would be a lot of
928         up-front-work before we can start testing the implementation
929         idea). 
930
931         Important: we only need Clone capabilities for expressions created
932         by the parser, as the expressions we will be cloning are
933         expressions in the pre-resolved state.   This vastly simplifies
934         the work required. 
935         
936         (SimpleName): Add CloneTo that does nothing.
937         (EmptyCast): Add CloneTo.
938         
939         * expression.cs (Binary): Implement CloneTo.
940         (Invocation.IsApplicable): Store the current ec in
941         EmitContext.TempEc and restore it on return.  This is used so we
942         do not have to sprinkle hundres of methods with an extra
943         EmitContext, we know that the only user is the lambda expression
944         ImplicitConversionExists code. 
945         
946         (Argument): Add Cloning capabilities.
947         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
948         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
949         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
950         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
951         IndexerAccess): Add Clone capability.
952
953         (LocalVariableReference, This): TODO: needs cloned Block mapping.
954
955         (Argument): Add cloning capability.
956
957         * assign.cs (Assign): Implement CloneTo.
958
959         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
960         
961         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
962         version by calling Convert with the EmitContext (that we are
963         currently storing in ec, this is not great, but will do for now,
964         to avoid passing EmitContext parameters to hundreds of functions
965         that do not need them now).
966
967         (SetExpression): Remove, it is not needed.
968         
969         (ContextualReturn): Implement CloneTo.
970
971         * statement.cs (Statement): Implement cloning infrastructure,
972         similar to expressions.
973
974         (Block): Partial implementation of Clone for statements.
975
976         (Return): Implement clone.
977         
978         * constant.cs (Constant.CloneTo): New method, does nothing.
979
980         * codegen.cs (TempEc): Add a static EmitContext as a temporary
981         solution, until we decide how to exactly do this.  
982         
983 2007-02-14  Marek Safar  <marek.safar@gmail.com>
984  
985         A fix for bug #80493
986         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
987         a property is override we need to use second accessor.
988
989 2007-02-13  Marek Safar  <marek.safar@gmail.com>
990  
991         A fix for bug #80418
992         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
993         methods.
994
995 2007-02-13  Marek Safar  <marek.safar@gmail.com>
996
997         Another fix for bug #80749
998         * pending.cs: Abstract class has priority over interfaces.
999
1000 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1001
1002         Another fix for bug #80749
1003         * pending.cs: Abstract class has priority over interfaces.
1004
1005 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1006
1007         Another fix for bug #80749
1008         * pending.cs: Abstract class has priority over interfaces.
1009
1010 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1011
1012         Another fix for bug #80749
1013         * pending.cs: Abstract class has priority over interfaces.
1014
1015 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1016
1017         * class.cs Better error message.
1018
1019         * driver.cs: Add shorter versions of -optimize option.
1020
1021 2007-02-13  Martin Baulig  <martin@ximian.com>
1022
1023         * class.cs (Constructor.Emit): Check the return value of
1024         ec.ResolveTopBlock() and return on error.
1025
1026 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1027
1028         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1029         message to fix error message regression.
1030
1031 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1032
1033         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1034
1035 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1036
1037         A fix for bug #80749
1038         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1039         its parent container.
1040
1041         * class.cs (DefineFieldInitializers): Each initializer can has different
1042         resolve context.
1043
1044         * const.cs: Updated.
1045
1046 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1047
1048         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1049         now all the heavy lifting to check that embedded statements or
1050         expressions have the right form is done in the ContextualReturn.
1051
1052         (ContextualReturn): New class.  
1053
1054         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1055         method that can be invoked to report 201, so we do not replicate
1056         this everywhere.
1057
1058         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1059         
1060         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1061         treating tabs as spaces. 
1062
1063 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1064
1065         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1066         * assign.cs: Use full implicit conversion for right side check.
1067
1068 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1069
1070         * statement.cs (Switch): Switch over boolean type is not standardized.
1071
1072 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1073
1074         A fix for bug #80755
1075         * decl.cs (FindBaseEvent): Don't use method cache for events.
1076
1077 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1078
1079         * cs-parser.jay: Better syntax error handling.
1080
1081         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1082         instead of underlying type value.
1083
1084 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1085
1086         * driver.cs: Check define identifier before is registered.
1087
1088         * namespace.cs: Use existing error message.
1089
1090         * report.cs: New warning.
1091
1092 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1093
1094         A fix for bug #80742
1095         * expression.cs: Delegate Invoke method can be called directly.
1096
1097 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1098
1099         A fix for bug #80676
1100         * class.cs (IsEntryPoint): The Main method can have params modifier.
1101
1102 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1103
1104         * parameter.cs (Parameter, Parameters): Add Clone method.
1105
1106         * anonymous.cs (Compatible): Turn method into virtual method, so
1107         LambdaExpression can implement a different behavior.
1108
1109         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1110         out the basic checking here, so it can be used by
1111         LambdaExpressions.
1112         
1113         * lambda.cs: Introduce "Compatible" function that will do the
1114         heavy lifting.
1115
1116 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1117
1118         * attribute.cs: Unified one error message.
1119
1120         * class.cs (Class): Use type attributes and not properties to test static
1121         class.
1122         (IsEntryPoint): Don's pass local variable.
1123
1124         * convert.cs: Removed duplicate check.
1125
1126         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1127
1128         * driver.cs: Don't crash when soft reference does not exist.
1129
1130         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1131         (UsingEntry): Removed redundant allocation.
1132
1133         * parameter.cs: Add fast path for type parameters.
1134
1135         * support.cs: Don't allocate attribute when it's not used.
1136
1137 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1138
1139         * anonymous.cs
1140         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1141         this into a virtual method, so we can override it in LambdaExpression.
1142
1143         * driver.cs: Improve diagnostics in case of failure. 
1144
1145         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1146         write a function that is slightly more complex and that parses:
1147
1148         type identifier [, type identifier]* )
1149
1150         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1151         this expression:
1152
1153                 (canEmpty ? i >= 0 : i > 0)
1154
1155 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1156
1157         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1158         exception on possibly valid code.
1159
1160 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1161
1162         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1163         Push/PopPosition.
1164         (parse_opt_type_arguments): Remove.  It's almost the same as
1165         parse_less_than.
1166         (parse_namespace_or_typename): Use parse_less_than.
1167
1168 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1169
1170         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1171         this bug took a few hours to find, because the state saved and
1172         restored by PushPosition and PopPosition was ignoring the state of
1173         parse_generic_less_than.
1174
1175         I can also now remove the handling of OP_LT and OP_GT, this solves
1176         the big mistery.
1177         
1178         * cs-tokenizer.cs: store the location for the ARROW token, we use
1179         that in the parser.
1180
1181         (PushPosition, PopPosition): save/restore also `current_token',
1182         restore `parse_generic_less_than' (was missing).
1183
1184         (parse_opt_type_arguments): use parse_type, not
1185         parse_namespace_or_typename to parse types.
1186
1187         * lambda.cs: Empty new file, will eventually have the lambda
1188         expression implementation.
1189
1190         * lambda.test: used to test the internal tokenizer. 
1191
1192         * report.cs (FeatureIsNotISO1): Rename from
1193         FeatureIsNotStandardized, because it was about the language level
1194         (1 vs 2) it was not about standarization.
1195
1196         (FeatureRequiresLINQ): New.
1197
1198         * support.cs (SeekableStreamReader): Only require that the reader
1199         is a TextReader, not a StreamReader, so we can plug StringReader. 
1200
1201         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1202         given position in the input stream the following tokens can be
1203         parsed as a type followed by an identifier.
1204
1205         (is_punct): after a '(' if parse_type_and_parameter returns true,
1206         then return a special token OPEN_PARENS_LAMBDA which is used to
1207         avoid reduce/reduce errors in the grammar for the
1208         lambda_expression rules.
1209
1210         (parse_type): implement a type parser inside the
1211         tokenizer, the parser only returns true or false depending on
1212         whether the input at a given position can be parsed as a type.
1213
1214         (peek_token): new method used during type parsing.
1215
1216 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1217
1218         Fix #80531
1219         * anonymous.cs (ScopeInfo.InflateParameters): New.
1220         (AnonymousContainer.Resolve): Use it to redirect types of
1221         delegate parameters.
1222
1223 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1224
1225         Fix #80530
1226         * expression.cs (Error_InvalidArguments): Don't use two different
1227         messages for CS1503.  Use ExtraInformation and
1228         SymbolRelatedToPreviousError instead.
1229
1230         Fix #80358
1231         * decl.cs (DeclSpace.initialize_type_params): Don't access
1232         'type_params' of a partial class directly.
1233
1234 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1235
1236         * constant.cs: Removed a handful of out-of-range checks that were
1237         not necessary. 
1238
1239 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1240
1241         * expression.cs (CheckUselessComparison): Add additional check for char
1242         constants.
1243
1244         * namespace.cs: Fixed typo.
1245
1246 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1247
1248         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1249         gone, instead we inline the test, preventing the needless casts to
1250         longs, ulongs and doubles for the parameters, avoiding calls to
1251         methods that overchecked stuff, and instead inlined things
1252         nicely. 
1253
1254 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1255
1256         * cs-parser.jay: Better parameter error handling.
1257
1258 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1259
1260         A fix for bug #80368, #80522
1261         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1262         whether array initializer contains constants only.
1263         (ArrayCreation.Emit): Use better formula to decide when
1264         are array initializers for static initialization.
1265         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1266         have to emit even constants otherwise they are pre-initialized.
1267
1268 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1269             Raja R Harinath  <rharinath@novell.com>
1270
1271         Fix emit order of 'get' vs. 'set'.
1272         * support.cs (Accessors): New.
1273         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1274         Note the order in which accessors are declared in the source.
1275         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1276         Refactored from Property.Define and Indexer.Define.
1277         (PropertyBase.DefineAccessors): New helper that calls the above in
1278         appropriate order as noted by the parser.
1279         (Property.Define, Indexer.Define): Update to changes.
1280         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1281
1282 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1283
1284         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1285         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1286         there's an implicit conversion from the current type to the target
1287         type before converting the underlying constant.
1288
1289 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1290
1291         * const.cs (ResolveValue): Updated after constant conversion was made more
1292         generic.
1293
1294         * constant.cs (GetAttributableValue): constant to object conversion is
1295         used for attributes only.
1296         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1297         constant conversions.
1298         (LongConstant.ConvertImplicitly): Ditto.
1299
1300         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1301         (ImplicitConversionStandard): Handle constant conversion as extra step.
1302         It solves the issue when constant conversion was called indirectly like
1303         inside array initializer and constant folding was skipped.
1304
1305         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1306         this change.
1307
1308         * statement.cs(ImplicitConversionStandard): Updated after constant
1309         conversion was made more generic.
1310
1311 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1312
1313         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1314         Constraints, solves the problem where the compiler incorrectly
1315         reported that a type parameter was not constrained to a class (Bug
1316         80518)
1317
1318 2007-01-14  Marek Habersack  <grendello@gmail.com>
1319
1320         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1321
1322 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1323
1324         A fix for bug #80368
1325         * assign.cs (FieldInitializer): New class implements field
1326         initializer statement.
1327
1328         * attribute.cs: Update after FieldMember rename.
1329
1330         * class.cs (PropertyBasedMember): New common class for property based
1331         types.
1332         (InterfaceMemberBase): New base class for all members which can be used as
1333         an interface members.
1334         (MethodCore): Moved really common code to InterfaceMemberBase.
1335         (Method.Define): Equal and GetHasCode detection is relevant for methods
1336         only.
1337         (MethodData.Define): Don't assume that public event implements an
1338         interface automatically.
1339         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1340         modifier is used.
1341         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1342         (FieldMember): Merged with FieldBase.
1343         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1344         event extern modifier can be used.
1345         (EventField.EventFieldAccessor): Moved event field specific code here.
1346         (Event.AllowedModifiers): Even event can be extern.
1347         (Event.FindOutBaseMethod): New override specific to events.
1348         (Indexer.parameters): Reintroduce parameters because base class holds
1349         only properties common data.
1350         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1351         need do extra parameters check.
1352
1353         * const.cs: Update after FieldMember rename.
1354
1355         * decl.cs (MemberCache.FindBaseEvent): New method.
1356
1357         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1358         to reflect that indexer is now derived from PropertyBased.
1359
1360         * ecore.cs (GetMemberType): Made public.
1361         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1362         obsolete event.
1363
1364         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1365         
1366         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1367         (RegisterEvent): Removed.
1368         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1369         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1370
1371 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1372
1373         Fix #80249
1374         * statement.cs (CollectionForeach.TryType): Prefer generic
1375         GetEnumerator over non-generic variant.  Fix code to follow comments.
1376
1377 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1378
1379         Fix #80446
1380         * support.cs (ReflectionParameter): Don't use an invalid index on
1381         the generic parameter data.
1382
1383 2007-01-08  Miguel de Icaza  <miguel@novell.com>
1384
1385         * driver.cs: Just add a tiny bit of infrastructure.
1386
1387 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1388
1389         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1390         where field type is struct from current assembly.
1391         
1392         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1393         it is possible.
1394
1395 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1396
1397         A fix for bug #80381
1398         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1399         the core types.
1400
1401         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1402         messages.
1403         (Namespace.LookupType): Always use core types from corlib when speficied.
1404
1405         * report.cs: A new warning.
1406
1407         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1408         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1409         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1410
1411         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1412         (InitCoreTypes): Set expression type of object_type and value_type
1413         immediately after lookup.
1414
1415 2007-01-01  Miguel de Icaza  <miguel@novell.com>
1416
1417         * cs-tokenizer.cs: Accept Pc class characters (Connector
1418         Punctuation) as valid identifiers.  Fixes #78259
1419
1420         * expression.cs (Invocation.DoResolve): Moved the check for the
1421         use of `this' for doing method calls to the Invocation resolution
1422         step, after overload resolution has taken place instead of doing
1423         the check at the low-level `This.DoResolve' level.
1424
1425         The `This.DoResolve'(appens before overload resolution, so it has
1426         no way of knowing if the method that will be called will be
1427         instace or static, triggering an erroneous report for cs0188 (Bug
1428         78113).
1429
1430         We now do the check for instance method invocations after we know
1431         what method will be called.
1432
1433         (This.CheckThisUsage): Move the actual use of this structure
1434         checking into its own method and expose it. 
1435
1436         * Everywhere that called Error_ValueCannotBeConverted: pass a new
1437         EmitContext.
1438
1439         Exceptions: Null.ConvertImplicitly,
1440         Constant.ImplicitConversionRequired as there are too many call
1441         sites for passing the ec. 
1442
1443         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1444         EmitContext, if the value is null, then we do not try to provide
1445         the extra information from the error (If a userdefined conversion
1446         exists, as UserDefinedConversion requires a non null-EmitContext).
1447
1448         Fixes: #80347
1449
1450 2006-12-30  Raja R Harinath  <rharinath@novell.com>
1451
1452         * flowanalysis.cs (MyBitVector): Document some invariants.
1453         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1454         introduced below, and add a couple of others, 
1455
1456 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1457
1458         * attribute.cs (GetMethodObsoleteAttribute): Uses new
1459         GetPropertyFromAccessor and GetEventFromAccessor.
1460         
1461         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1462         overrides non-obsolete one.
1463         (Indexer.Define): Error message has been moved to the parser.
1464
1465         * cs-parser.jay: Better syntax errors handling.
1466
1467         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1468         when an invocation has no arguments.
1469
1470         * ecore.cs: Removed not used caching.
1471
1472         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1473         implementation.
1474
1475         * report.cs: Add a new warning.
1476
1477         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1478
1479         * typemanager.cs (enumeration_type): Removed.
1480         (CSharpSignature): Reuses IsSpecialMethod.
1481         (IsEqual): Hack for MS BCL.
1482         (GetPropertyFromAccessor): New method.
1483         (GetEventFromAccessor): New method.
1484         (IsSpecialMethod): Fixed to handle more cases.
1485
1486 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1487
1488         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1489         Made white spaces array static.
1490
1491         * ecore.cs (RemoveGenericArity): Optimized.
1492
1493         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1494         10 times faster).
1495         (MyBitVector.initialize_vector): Simplified.
1496
1497 2006-12-22  Miguel de Icaza  <miguel@novell.com>
1498
1499         * ecore.cs: Am not entirely happy with this hack, but it seems to
1500         address the issue in 80257 (a small test case for
1501         CreativeDocs.NET). 
1502
1503         I set the MethodGroupExpr.Type to an internal compiler type
1504         (itself in this case) to force the resolution to take place.   Why
1505         it does not take place with a null is beyond me.
1506
1507 2006-12-20  Marek Safar  <marek.safar@gmail.com>
1508
1509         A fix for bug #80288
1510         * expression.cs (ResolveOperator): Consider user defined conversion for
1511         logical and operator too.
1512         (EmitBranchable): Optimization for logical and when full constant folding
1513         could not be applied but one operand is constant.
1514
1515 2006-12-19  Marek Safar  <marek.safar@gmail.com>
1516
1517         * class.cs (GetClassBases): Write 5 times every day, will never use
1518         FullName for error reporting.
1519
1520         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1521
1522 2006-12-19  Martin Baulig  <martin@ximian.com>
1523
1524         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1525         the symbol file info here.
1526
1527 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1528
1529         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1530         of `elseif' is taking then following sections are not taking.
1531         Fixes an issue reported on mono mailing list.
1532
1533 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1534
1535         A fix for bug #80300
1536         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1537         a caller is not taking.
1538
1539 2006-12-18  Raja R Harinath  <rharinath@novell.com>
1540
1541         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1542         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1543         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1544         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1545         * class.cs: Update to changes.
1546
1547 2006-12-17  Marek Safar  <marek.safar@gmail.com>
1548
1549         A fix for bug #79934
1550         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1551         partial container.
1552
1553         * class.cs (ResolveMembers): Register an iterator in current container and
1554         not in shared one.
1555
1556 2006-12-16  Raja R Harinath  <rharinath@novell.com>
1557
1558         Fix test-543.cs
1559         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1560         satisfy a params annotated parameter.
1561
1562 2006-12-16  Marek Safar  <marek.safar@gmail.com>
1563
1564         A fix for bug #77014
1565         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1566         paramters correctly and not rely on hacks in Parameters class.
1567         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1568         at any possition.
1569         (Invocation.VerifyArgumentsCompat): Ditto.
1570         (Invocation.EmitArguments): Changed to correctly emit params arguments at
1571         any possition.
1572
1573         * parameter.cs (HasParams): Don't assume that params is the last one.
1574
1575         * support.cs (ReflectionParameters.ctor): Look for params attribute
1576         correctly.
1577         (ReflectionParameters.ParameterType): Removed hack when we returned last
1578         parameter for out of range parameters.
1579         (ParameterName, ParameterModifier): Ditto.
1580
1581 2006-12-14  Marek Safar  <marek.safar@gmail.com>
1582
1583         A fix for bug #79987
1584         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1585         when assembly is not CLS compliant but type is. I have no idea why is this
1586         allowed.
1587
1588         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1589
1590 2006-12-13  Miguel de Icaza  <miguel@novell.com>
1591
1592         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1593         in struct constructors, they are basically no-ops.
1594
1595 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1596
1597         * cs-tokenizer.cs (Position): Save preprocessor status too.
1598
1599 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1600
1601         A fix for bug #77794
1602         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1603
1604 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1605
1606         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1607         Fixes #69299.
1608         (pp_expr): Report error for an invalid expression.
1609         (handle_preprocessing_directive): Simplified; add more error checking.
1610
1611 2006-12-11  Marek Safar  <marek.safar@gmail.com>
1612
1613         A fix for bug #74939
1614         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1615         directives handling.
1616
1617 2006-12-10  Marek Safar  <marek.safar@gmail.com>
1618
1619         A fix for bugs #80093, and #75984
1620         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1621         logic, it seems to me as it worked before "by coincidence".
1622         (xtoken): Simplified to use reworked handle_preprocessing_directive.
1623         (cleanup): Enabled endif check.
1624
1625 2006-12-09  Marek Safar  <marek.safar@gmail.com>
1626
1627         A fix for bug #80162
1628         * statement.cs (CollectionForeach.TryType): Generics and non-generics
1629         enumerators are never ambiguous.
1630
1631 2006-12-08  Raja R Harinath  <rharinath@novell.com>
1632
1633         Fix #80060
1634         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1635
1636 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1637
1638         A fix for bug #80144
1639         * class.cs (EventProperty.Define): Explicit implementation means
1640         that an even is used.
1641
1642 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1643
1644         Fixes the operators implementation (part II)
1645
1646         * cfold.cs (DoConstantNumericPromotions): Renamed to
1647         DoBinaryNumericPromotions and simplified.
1648         (BinaryFold): Couple of conversion fixes; simplified.
1649
1650         * constant.cs, ecore.cs, literal.cs
1651         (ToType): Renamed to ConvertImplicitly.
1652         (Reduce): Renamed to ConvertExplicitly.
1653
1654         * class.cs, convert.cs: Updated.
1655
1656         * expression.cs: TryReduce doesn't throw an exception.
1657
1658 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1659
1660         A fix for bug #80108
1661         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1662         compatible.
1663
1664 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1665
1666         Fixes unary operators implementation (part I)
1667         Also fixes #80026
1668
1669         * cfold.cs (Error_CompileTimeOverflow): Made internal
1670
1671         * const.cs (IConstant): Changed to use reference to constant and
1672         not constant itself.
1673         Updated IConstant implementations.
1674
1675         * constant.cs (CreateConstant): New factory method.
1676         Updated IConstant implementation.
1677
1678         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1679
1680         * ecore.cs: Updated to use CreateConstantReference.
1681
1682         * enum.cs: Reflects IConstant changes.
1683
1684         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1685
1686         * literal.cs (NullConstant): Change to be independently usable.
1687
1688 2006-11-29  Martin Baulig  <martin@ximian.com>
1689
1690         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1691         we need to emit the scope initializer before calling the base .ctor.
1692
1693         * anonymous.cs: Merged back from the new anonymous methods branch.
1694         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1695
1696         * expression.cs (ParameterReference.DoResolveBase): Create a
1697         "normal" ScopeInfo when capturing parameters rather than using the
1698         root scope; this makes things work with anonymous methods having
1699         parameters.
1700
1701         * statement.cs
1702         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1703
1704 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1705
1706         A fix for bug #79987
1707         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1708         check to a base class.
1709         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1710         only when assembly has missing attribute.
1711         * report.cs: Update.
1712
1713 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1714
1715         * cs-tokenizer.cs: Merged with gmcs version.
1716
1717 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1718
1719         * cs-tokenizer.cs,
1720         * cs-parser.jay: Better error message when partial keyword is misplaced.
1721
1722 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1723
1724         A fix for bug #79810
1725         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1726         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1727         a RuntimeWrappedException by default.
1728
1729 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1730
1731         A fix for bug #79843
1732         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1733         implementation.
1734         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1735
1736 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1737
1738         * driver.cs, namespace.cs: Uses faster IndexOf version.
1739
1740 2006-11-17  Marek Safar  <marek.safar@gmail.com>
1741
1742         A fix for bug #79941
1743         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1744         operators.
1745         (Operator.Define): Implicit/Explicit operator of same type is duplicate
1746         even if internal name is different.
1747         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1748         (UserDefinedConversion): Simplified as the operators cannot be internal.
1749         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1750         conversions.
1751         (MethodLookup): Replaced EmitContext with parentType.
1752         * expression.cs: Updated.
1753
1754 2006-11-09  Raja R Harinath  <rharinath@novell.com>
1755
1756         * driver.cs (BadAssembly): Handle all the ugliness of
1757         DefineDynamicAssembly.
1758
1759 2006-11-08  Raja R Harinath  <rharinath@novell.com>
1760
1761         Address parts of #58244 -- most of what's left is in the runtime
1762         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
1763         CS1509 error checks, and handle them for all assembly loads, not
1764         just the first invocation.
1765         (LoadModule): Likewise.  Move handling of 'adder_method' ...
1766         * codegen.cs (AssemblyClass.AddModule): ... here.
1767
1768 2006-11-02  Marek Safar  <marek.safar@gmail.com>
1769
1770         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1771         IEnumerable<T> is ambiguous.
1772
1773 2006-10-31  Marek Safar  <marek.safar@gmail.com>
1774
1775         A fix for bug #67689
1776         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1777         GetEnumerator is ambiguous.
1778
1779         * report.cs: Add new warning.
1780
1781 2006-10-29  Marek Safar  <marek.safar@gmail.com>
1782
1783         A fix for bug #78602
1784         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1785         to protected member can be nested type.
1786
1787 2006-10-28  Marek Safar  <marek.safar@gmail.com>
1788
1789         A fix for bug #78965
1790         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1791         to protected member must derive from current type.
1792
1793 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1794
1795         assign.cs: Reuses error method.
1796
1797         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1798         instead of type for constants.
1799         (Expression.Error_ValueAssignment): Common error method.
1800
1801         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1802         for any assignment.
1803
1804 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1805
1806         A fix for bug #79081
1807         * expression.cs (MemberAccess.DoResolve): Check nested type
1808         accessibility.
1809
1810 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1811
1812         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1813
1814 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1815
1816         A fix for bug #76591
1817         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1818
1819 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1820
1821         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1822         type forwarder of the same type multiple times.
1823
1824 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1825
1826         Fix #78820
1827         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1828         instance as an rvalue, even when we later resolve as an lvalue.
1829
1830 2006-10-25  Martin Baulig  <martin@ximian.com>
1831
1832         * anonymous.cs: Fix #79673.
1833
1834 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1835
1836         A fix for bug #79666
1837         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1838         ignored when is optimized (= default value) as its value is already set.
1839
1840 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1841
1842         A fix for bug #79724
1843         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1844         TypeContainer for type lookup.
1845
1846 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1847
1848         A fix for bug #79231
1849         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1850         * expression.cs (OverloadResolve): Always convert type name for
1851         an error message.
1852         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1853         other member.
1854
1855 2006-10-18  Martin Baulig <martin@ximian.com>
1856
1857         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1858
1859 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1860
1861         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1862         an int32, but requesting an int64 from the conversion
1863
1864 2006-10-12  Martin Baulig  <martin@ximian.com>
1865
1866         * anonymous.cs
1867         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1868         
1869 2006-10-12  Martin Baulig  <martin@ximian.com>
1870
1871         * statement.cs
1872         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1873
1874 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1875
1876         * convert.cs: Remove broken code: I was doing the "Existance"
1877         tests for Implicit conversions.
1878
1879 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1880
1881         * convert.cs: Added one missing case in
1882         ImplicitStandardConversionExists uint64 to intptr.
1883
1884         Fixes #59800
1885         
1886         * typemanager.cs (uintptr_type): another core known type.   
1887
1888         * ecore.cs (OperatorCast): routine used to do cast operations that
1889         depend on op_Explicit.  We could change some of the Decimal
1890         conversions to use this.
1891
1892         This one has a probe mechanism that checks both types for an op_
1893         which it coudl be used to eliminate two classes: CastToDecimal
1894         and CastFromDecimal.
1895
1896         * convert.cs: Implement the conversions documented in #59800
1897         
1898 2006-10-10  Martin Baulig  <martin@ximian.com>
1899
1900         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1901         before RootScope.ResolveMembers().
1902
1903         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1904         `CurrentType' if appropriate.
1905
1906 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1907
1908         A fix for bug #78568
1909         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1910         when contains binary operators.
1911         * cs-parser.jay: Updated.
1912
1913 2006-10-09  Martin Baulig  <martin@ximian.com>
1914
1915         * delegate.cs
1916         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1917         moved that into Define() and also do the other type parameter
1918         checks there.  Fixes #79094.  Added gtest-292.cs.
1919
1920         * expression.cs
1921         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1922         since that doesn't include type parameters; don't use `Ldelema'
1923         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1924
1925 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1926
1927         A fix for #77796
1928         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1929         conversion is allowed.
1930
1931 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1932
1933         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1934         error reporting when no error occurs.
1935
1936 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1937
1938         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1939         does not exist.
1940
1941 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1942
1943         Fix #79584
1944         * class.cs (DefineTypeBuilder): Check circular dependencies before
1945         setting the parent of the TypeBuilder.
1946         (CheckRecursiveDefinition): Don't use 'BaseType', since
1947         it may not be valid until after DefineTypeBuilder.  Use
1948         'base_type' instead.
1949
1950 2006-10-04  Martin Baulig  <martin@ximian.com>
1951
1952         Merged the Anonymous Methods patch.
1953
1954         * anonymous.cs, iterators.cs: The new anonymous methods code.
1955
1956         * statement.cs (Variable): New public abstract class.
1957         (LocalInfo.Variable): New public property.
1958         (LocalInfo.ResolveVariable): New public method.
1959         (Block.Flags): Add `IsIterator'.
1960         (Block.AddVariable): Improved the CS0136 check.
1961         (Block.AnonymousChildren): New public property.
1962         (Block.AddAnonymousChild): New public method.
1963         (ToplevelBlock): Update to use the new anonymous method framework.
1964         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1965         `ToplevelBlock'; this is required to correctly implement the
1966         CS0136 check.
1967         (Fixed, Using): Use `TemporaryVariable' instead of directly
1968         creating the `LocalBuilder'.
1969
1970         * parameter.cs (Parameter.ResolveVariable): New public method.
1971         (Parameters.ResolveVariable): Likewise.
1972
1973         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1974
1975         * class.cs (TypeContainer): Replaced the `iterators' list and
1976         corresponding methods with a list of `CompilerGeneratedClass'es.
1977         (TypeContainer.ResolveMembers): New public method.
1978         (Method): `IIteratorContainer' has been replaced by
1979         `IAnonymousHost'.
1980
1981         * expression.cs (VariableReference): New public abstract base
1982         class for `LocalVariableReference', `ParameterReference' and
1983         `This'.
1984
1985         * codegen.cs (EmitContext): Removed `capture_context',
1986         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1987         (EmitContext.EmitThis): Removed.
1988
1989         * cs-parser.jay: Replace `iterator_container' with
1990         `anonymous_host'.       
1991
1992 2006-10-04  Martin Baulig  <martin@ximian.com>
1993
1994         * generic.cs (GenericMethod): Don't make this abstract.
1995         (Constraints.Clone): Added dummy implementation.
1996
1997 2006-10-04  Raja R Harinath  <harinath@gmail.com>
1998
1999         Fix #79577
2000         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2001         'declspaces'.  Avoid allocating arrays willy-nilly.
2002
2003         Fix #79553
2004         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2005         cases out of the switch.
2006
2007 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2008
2009         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2010         message when non-generic type is used with the type arguments.
2011         * expression.cs: Updated.
2012
2013 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2014
2015         Fix #79013
2016         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2017         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2018         Change semantics slightly.  Don't insist on having only one
2019         temporary EmptyExpression -- just throttle the creation of new ones.
2020
2021         Fix #79451
2022         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2023         non-interfaces too.  If no methods are found, don't try to create
2024         a MethodGroupExpr.
2025
2026 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2027
2028         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2029         generic type.
2030
2031         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2032         us produce better error message.
2033
2034 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2035
2036         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2037         of the `|' operator.
2038
2039         * report.cs: A new warning added.
2040
2041 2006-09-27  Martin Baulig  <martin@ximian.com>
2042
2043         * generic.cs (GenericMethod): Don't make this abstract.
2044
2045 2006-09-27  Martin Baulig  <martin@ximian.com>
2046
2047         * report.cs
2048         (InternalErrorException): Added overloaded ctor taking a params array.
2049
2050 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2051
2052         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2053         Fixed the cases when same error was reported twice.
2054
2055         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2056         now report symbol information.
2057
2058 2006-09-25  Martin Baulig  <martin@ximian.com>
2059
2060         * class.cs: Completely unified with the gmcs version.
2061
2062 2006-09-25  Martin Baulig  <martin@ximian.com>
2063
2064         * typemanager.cs (TypeManager.IsNullableType): New public function.
2065         (TypeManager.IsNullableTypeOf): Likewise.
2066         (TypeManager.IsNullableValueType): Likewise.
2067
2068         * class.cs (MethodCore): Added the `GenericMethod' argument from
2069         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2070
2071 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2072
2073         * convert.cs: Unify with gmcs version.
2074
2075 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2076
2077         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2078         verify them as well.
2079
2080         * report.cs: New warning.
2081
2082 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2083
2084         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2085         for anonymous block with out argument.
2086
2087 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2088
2089         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2090         not used private events only.
2091
2092 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2093
2094         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2095
2096         * const.cs (Const.Define): Check for constant type.
2097         (Const.IsConstantTypeValid): Looks for valid constant types.
2098
2099         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2100
2101         * ecore.cs (EmptyConstantCast): New common class for all constant based
2102         EmptyCast(s).
2103
2104         * expression.cs (Is.DoResolve): Handle null constant especially.
2105         (New.DoResolve): Check for new void().
2106         (MemberAccess.DoResolve): Cope with all kind of nulls.
2107
2108         * literal.cs (NullConstant): Uses EmptyConstantCast.
2109         (NullDefault): Based on EmptyConstantCast.
2110         (NullLiteral): Uses EmptyConstantCast.
2111
2112         * statement.cs (Block.ResolveMeta): Check for constant type.
2113
2114 2006-09-22  Martin Baulig  <martin@ximian.com>
2115
2116         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2117
2118 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2119
2120         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2121         not the null type.
2122
2123         Fix part of #79451
2124         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2125         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2126         code slightly.
2127
2128 2006-09-22  Martin Baulig  <martin@ximian.com>
2129
2130         * ecore.cs: Merged with the gmcs version.
2131
2132         * generic.cs (ConstructedType): New dummy class.
2133         (TypeArguments): Don't make this abstract.
2134
2135         * typemanager.cs
2136         (TypeManager.IsGenericTypeDefinition): New method.
2137         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2138
2139 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2140
2141         * expression.cs (ComposedCast): Check for arrays of TypedReference
2142         before creating the type, not after.
2143
2144 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2145
2146         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2147         after ToType change.
2148
2149         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2150         when constant must be implicitly convertible.
2151
2152         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2153
2154         * ecore.cs (NullCast): Derives from NullConstant.
2155
2156         * expression.cs (Is.DoResolve): Removed useless variables.
2157         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2158         (New.Constantify): Add enum support.
2159         (MemberAccess.DoResolve): Add warning when accessing null constant or
2160         variable.
2161
2162         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2163         property.
2164
2165         * literal.cs (NullConstant): New abstract class with common
2166         functionality for all null specializations.
2167         (NullDefault): Represents default(X) when result can be
2168         reduced to null.
2169         (NullLiteral): Updated.
2170
2171         * report.cs: Add new warning.
2172
2173 2006-09-21  Martin Baulig  <martin@ximian.com>
2174
2175         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2176
2177 2006-09-21  Martin Baulig  <martin@ximian.com>
2178
2179         * generic.cs (GenericConstraints): New dummy class.
2180         (Constraints): Likewise.
2181         (TypeParameter): Likewise.
2182         (TypeParameterName): Likewise.
2183         (GenericMethod): Likewise.
2184
2185         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2186
2187         * decl.cs: Merged with the gmcs version.
2188
2189 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2190
2191         * generic.cs (TypeParameter): Implement IMemberContainer.
2192         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2193
2194         * rootcontext.cs: Unify with gmcs version.
2195
2196         * report.cs: Unify with gmcs version.
2197         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2198         from gmcs/generics.cs.
2199         * generics.cs (TypeParameter): New dummy class.
2200
2201         * support.cs: Unify with gmcs version.
2202
2203 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2204
2205         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2206         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2207
2208         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2209         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2210         * mcs.exe.sources: Add generic.cs.
2211
2212         * codegen.cs: Unify with gmcs version.
2213
2214         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2215         (EmitContext): Add GenericDeclContainer implementation.
2216         * decl.cs (MemberCore, DeclSpace): Likewise.
2217         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2218
2219         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2220         MCS TypeManager has a corresponding dummy method.
2221
2222 2006-09-19  Martin Baulig  <martin@ximian.com>
2223
2224         * expression.cs: Completely merged with the gmcs version.
2225
2226 2006-09-19  Martin Baulig  <martin@ximian.com>
2227
2228         * expression.cs (Invocation): Merged with the gmcs version.
2229         (ArrayAccess.GetStoreOpcode): Likewise.
2230
2231 2006-09-19  Martin Baulig  <martin@ximian.com>
2232
2233         * typemanager.cs
2234         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2235         (TypeManager.IsGenericMethodDefinition): Likewise.
2236
2237 2006-09-19  Martin Baulig  <martin@ximian.com>
2238
2239         * typemanager.cs
2240         (TypeManager.IsEqual): Moved the gmcs implementation here.
2241         (TypeManager.DropGenericTypeArguments): Likewise.
2242         (TypeManager.DropGenericMethodArguments): Likewise.
2243         (TypeManager.GetTypeArguments): Moved here from gmcs.
2244         (TypeManager.HasGenericArguments): Likewise.
2245
2246 2006-09-19  Martin Baulig  <martin@ximian.com>
2247
2248         * expression.cs (Binary): Merged with the gmcs version.
2249
2250 2006-09-19  Martin Baulig  <martin@ximian.com>
2251
2252         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2253
2254 2006-09-19  Martin Baulig  <martin@ximian.com>
2255
2256         * typemanager.cs: Merged with the gmcs version.
2257
2258 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2259
2260         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2261         * driver.cs: Likewise.
2262
2263 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2264
2265         A fix for #79401
2266         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2267         only if parent type is class.
2268         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2269         update.
2270
2271 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * cs-parser.jay,
2274         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2275         keywords are used.
2276         * typemanager.cs(CSharpName): Converts NullType to null.
2277
2278 2006-09-15  Martin Baulig  <martin@ximian.com>
2279
2280         * typemanager.cs
2281         (TypeManager.GetMethodName): Added mcs implementation.
2282         (TypeManager.IsEqual): Likewise.
2283
2284         * ecore.cs
2285         (SimpleName.RemoveGenericArity): Added dummy implementation.
2286
2287         * pending.cs: Merged with the gmcs version.     
2288
2289 2006-09-15  Martin Baulig  <martin@ximian.com>
2290
2291         * statement.cs: Merge with the gmcs version.
2292
2293 2006-09-15  Martin Baulig  <martin@ximian.com>
2294
2295         * statement.cs (Switch): Merge with the gmcs implementation
2296         (without nullables), which is newer.
2297
2298 2006-09-15  Martin Baulig  <martin@ximian.com>
2299
2300         * statement.cs (Block.Variables): Make this public.
2301         (ToplevelBlock.Parameters): Make this a property.
2302         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2303
2304 2006-09-15  Martin Baulig  <martin@ximian.com>
2305
2306         * namespace.cs: Merge with the gmcs version.
2307
2308 2006-09-15  Martin Baulig  <martin@ximian.com>
2309
2310         * decl.cs (MemberName): Minor code cleanups.
2311
2312 2006-09-15  Martin Baulig  <martin@ximian.com>
2313
2314         * parameter.cs: Merge with the gmcs version.
2315
2316 2006-09-15  Martin Baulig  <martin@ximian.com>
2317
2318         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2319         and an error in mcs.
2320
2321 2006-09-15  Martin Baulig  <martin@ximian.com>
2322
2323         * flowanalysis.cs: Merged from GMCS; added the generics code into
2324         a `GMCS_SOURCE' conditional so we can share this file.
2325
2326 2006-09-08  Martin Baulig  <martin@ximian.com>
2327
2328         * typemanager.cs (TypeManager.interlocked_type): New public field.
2329         (TypeManager.int_interlocked_compare-exchange): New public field.
2330         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2331         enumerator types here and call InitGenericCoreTypes().
2332         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2333         after calling InitEnumUnderlyingTypes().
2334
2335         * rootcontext.cs
2336         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2337         `classes_second_stage'. 
2338
2339 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2340
2341         * assign.cs, ecore.cs, expression.cs: Share error message text.
2342         * class.cs (FieldMember.Define): Check for varible of static type.
2343         * driver.cs (LoadAssembly): Uses error output for errors.
2344         * statement.cs: Updated.
2345
2346 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2347
2348         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2349         type instance.
2350
2351 2006-09-07  Martin Baulig  <martin@ximian.com>
2352
2353         * driver.cs
2354         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2355
2356 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2357
2358         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2359         
2360 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2361
2362         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2363         #52019 and #79064, the use of the \uXXXX sequence in source code
2364         to represent unicode characters.
2365
2366 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2367
2368         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2369         support.
2370         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2371
2372 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2373
2374         * assign.cs: Catch attempts to assign to a method groups in += and
2375         report as 1656
2376
2377 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2378
2379         A fix for #79056
2380         * cs-parser.jay: Don't destroy current array type by typeof of array's.
2381
2382 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
2383
2384         * class.cs (Method.Define): Issue a warning when generic method looks like
2385         an entry point.
2386         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2387         as well.
2388
2389 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
2390  
2391         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2392         looking for ctor.
2393         * decl.cs (MemberCache.FindMembers): When container is interface we need to
2394         search all base interfaces as a member can be ambiguous.
2395         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2396         Constructor member type filter. 
2397         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2398         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2399         reporting for returned memberinfos.
2400         * report.cs: Updated.
2401         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2402         version to work on all runtimes.
2403         (TypeManager.RealMemberLookup): Removed members filtering.
2404
2405 2006-08-08  Raja R Harinath  <rharinath@novell.com>
2406
2407         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2408         (PropertyExpr.EmitAssign): Likewise.
2409         * expression.cs (Indirection.EmitAssign): Likewise.
2410         (LocalVariableReference.EmitAssign): Likewise.
2411         (ParameterReference.EmitAssign): Likewise.
2412         (Invocation.EmitArguments): Likewise.
2413         (ArrayAccess.EmitAssign): Likewise.
2414         (IndexerAccess.EmitAssign): Likewise.
2415         (This.EmitAssign): Likewise.
2416         (ConditionalLogicalOperator.Emit): Likewise.
2417
2418         Fix #79026
2419         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
2420         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
2421         leave it in after returning it.
2422         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
2423
2424 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
2425
2426         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2427         message.
2428
2429 2006-08-03  Raja R Harinath  <rharinath@novell.com>
2430
2431         Fix cs0146-3.cs and cs0146-4.cs.
2432         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2433         enclosing types don't depend on the current type.
2434
2435 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2436
2437         Fix #77963
2438         * class.cs (TypeContainer.DoDefineMembers): Use
2439         FindBaseMemberWithSameName on Parent, since we're interested in
2440         whether we hide inherited members or not.
2441         (FindBaseMemberWithSameName): Make slightly more robust.
2442
2443         Fix the non-generic testcase from #77396
2444         * decl.cs (DeclSpace.DeclContainer): Remove override.
2445
2446         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2447         declspaces for doppelgangers too.
2448         (UsingEntry): Implement IResolveContext.
2449         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
2450         'this' as the resolve context.
2451         (LocalAliasEntry): Likewise.
2452
2453         Implement parts of #77403
2454         * roottypes.cs (RootDeclSpace): New.  Used to represent the
2455         toplevel declaration space.  Each namespace declaration introduces
2456         a "partial" root declaretion space.
2457         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2458         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2459         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2460         from 'current_namespace.SlaveDeclSpace'.
2461         (namespace_declaration): Likewise.
2462         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2463         check.  It can't happen now.
2464         * decl.cs (DeclSpace.LookupType): Likewise.
2465         * driver.cs (MainDriver): Sanity check.
2466
2467 2006-08-01  Raja R Harinath  <rharinath@novell.com>
2468
2469         * decl.cs (DeclSpace.FindNestedType): Remove.
2470         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2471         LookupTypeContainer to get the container of the nested type.
2472         * class.cs (TypeContainer.FindNestedType): Make non-override.
2473
2474 2006-07-31  Raja R Harinath  <rharinath@novell.com>
2475
2476         * decl.cs (DeclSpace.PartialContainer): Move field from ...
2477         * class.cs (TypeContainer.PartialContainer): ... here.
2478         (TypeContainer.AddBasesForPart): New helper.
2479         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
2480         instead.
2481         * cs-parser.jay (current_class): Convert to DeclSpace.
2482         (struct_declaration, interface_declaration, class_declaration):
2483         Use AddBasesForPart instead of .Bases directly.
2484         * const.cs, iterators.cs: Update to changes.
2485
2486 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2487
2488         * class.cs (TypeContainer.AddMemberType): Rename from
2489         AddToTypeContainer.
2490         (TypeContainer.AddMember): Rename from AddToMemberContainer.
2491         (AddTypeContainer): New.  Combine AddClassOrStruct and
2492         AddInterface.
2493         (AddPartial): Update.  Add 'is_partial' argument.
2494         * roottypes.cs: Update to changes.
2495         * cs-parser.jay (push_current_class): New helper for handling
2496         current_container and current_class.
2497         (struct_declaration, interface_declaration, class_declaration):
2498         Use it.
2499
2500 2006-07-26  Raja R Harinath  <rharinath@novell.com>
2501
2502         * roottypes.cs: Rename from tree.cs.
2503
2504         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2505         * tree.cs (Tree, ITreeDump): Remove types.
2506         * rootcontext.cs (tree, Tree): Remove fields.
2507         (root, ToplevelTypes): New.
2508         * *.cs: Update to rename.
2509
2510         * tree.cs (Tree.RecordDecl): Remove.
2511         (RootTypes.AddToTypeContainer): Record the toplevel type in its
2512         namespace here.
2513         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2514
2515 2006-07-23  Raja R Harinath  <harinath@gmail.com>
2516
2517         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2518         DoFlowAnalysis and OmitStructFlowAnalysis here.
2519         (ec.With): Rename from WithUnsafe and generalize.
2520         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
2521         (ec.WithFlowAnalyis): New.
2522         * ecore.cs, expression.cs, statement.cs: Update.
2523
2524 2006-07-22  Raja R Harinath  <harinath@gmail.com>
2525
2526         * statement.cs (Block.ResolveMeta): Simplify slightly.
2527
2528         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
2529         multiple boolean fields.  Convert InUnsafe, constant_check_state,
2530         check_state to flags.
2531         (CheckState, ConstantCheckState): Update.
2532         (InUnsafe): New read-only property.
2533         (FlagsHandle): Rename from CheckStateHandle and convert to handle
2534         arbitrary flags.
2535         (WithUnsafe): New helper similar to WithCheckState.
2536         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2537         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2538
2539 2006-07-21  Raja R Harinath  <rharinath@novell.com>
2540
2541         Make comparisons use the same IL irrespective of whether they're
2542         in a 'checked' or 'unchecked' context: one of the issues in #78899
2543         * codegen.cs (EmitContext.CheckState): Make read-only property.
2544         (EmitContext.ConstantCheckState): Likewise.
2545         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2546         helper that implement a save/restore stack for CheckState
2547         values.  This is the only way to change check-state.
2548         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2549         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2550         (CheckedExpr.EmitBranchable): New forwarding method.
2551         (UnCheckedExpr): Likewise.
2552         * statement.cs (Block.ResolveMeta): Use WithCheckState.
2553         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2554         (Checked.Resolve, checked.DoEmit): Likewise.
2555
2556 2006-07-20  Miguel de Icaza  <miguel@novell.com>
2557
2558         * anonymous.cs: Cache the resolved anonymous delegate, and return
2559         this so that the ResolveTopBlock is only triggered once, not
2560         twice.
2561
2562         Currently we trigger ResolvetopBlock twice due to a first pass of
2563         argument check compatibility, and a second pass that does the
2564         actual resolution.   
2565         
2566 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2567
2568         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2569         modifiers.
2570         * rootcontext.cs (Reset): Add helper_classes.
2571
2572 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2573
2574         A fix for #78860
2575         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2576         correctly.
2577
2578 2006-07-13  Miguel de Icaza  <miguel@novell.com>
2579
2580         * statement.cs (Lock): Handle expressions of type
2581         TypeManager.null_type specially.  Fixes #78770
2582
2583 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2584
2585         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2586         to an event.
2587
2588 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2589
2590         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2591         for accessors as well.
2592         * ecore.cs (EventExpr): Add AccessorTable.
2593
2594 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
2595
2596         A fix for #78738
2597         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2598         for CS0122 where appropriate.
2599         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2600         level attributes.
2601         (Filter): Assembly can be null in the case of top level attributes.
2602
2603 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2604
2605         A fix for #78690
2606
2607         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2608         is done at global level.
2609
2610 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2611
2612         A fix for #77002, Implemented TypeForwarder support.
2613
2614         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2615         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2616         * typemanager.cs (): Add type_forwarder_attr_type.
2617
2618 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2619
2620         * report.cs: Add CS0469 warning.
2621
2622 2006-06-21  Martin Baulig  <martin@ximian.com>
2623
2624         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2625         the `try'-block, so we also report CS0016 etc. there.
2626
2627 2006-06-21  Martin Baulig  <martin@ximian.com>
2628
2629         * delegate.cs
2630         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2631
2632 2006-06-21  Martin Baulig  <martin@ximian.com>
2633
2634         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2635         also report CS1686 for parameters.
2636
2637 2006-06-21  Martin Baulig  <martin@ximian.com>
2638
2639         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2640         instead of an error if the value is not implicitly convertible to
2641         the switch types; fixes #77964.
2642
2643 2006-06-21  Raja R Harinath  <rharinath@novell.com>
2644
2645         Fix #78673
2646         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2647         FieldBuilder is null.
2648
2649         Fix #78662
2650         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2651         'left' and 'right' before error-checking.
2652
2653 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
2654
2655         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2656         Fixed bug #78601.
2657         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2658         (FieldExpr.DoResolve): likewise.
2659         (PropertyExpr.InstanceResolve): likewise.
2660         (EventExpr.InstanceResolve): likewise. 
2661
2662 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2665         attribute applicable tests for attribute argument.
2666
2667 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2668
2669         Fix #78079
2670         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2671         (Binary.OverloadResolve_PredefinedIntegral): New.
2672         (Binary.OverloadResolve_PredefinedFloating): New.
2673         (Binary.OverloadResolve_PredefinedString): New.
2674         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2675         Follow the standard more closely, and treat numeric promotions in
2676         terms of overload resolution.
2677         (Binary.CheckShiftArguments): Simplify.
2678
2679 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2680
2681         * flowanalysis.cs (MyBitVector): Simplify representation.
2682         (MyBitVector.Clone): Avoid allocating BitArray.
2683         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2684         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2685         (*): Update.  Change all references to MyBitVector.And and
2686         MyBitVector.Or to &= and |=.
2687
2688 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2689
2690         Fix cs0231-[34].cs.
2691         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2692         to param arguments too.
2693
2694 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2695
2696         * cs-parser.jay: Catch another parsing form for arglist being
2697         followed by other arguments.  Fixes #78313.
2698
2699 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2700
2701         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2702         checking of out parameters to ...
2703         (FlowBranchingToplevel.Merge): ... here.
2704         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2705         set, propagate the origin upward, and only complain if there was
2706         no other error.
2707         (FlowBranchingException.AddContinueOrigin): Likewise.
2708         (FlowBranchingException.AddReturnOrigin): Likewise.
2709         (FlowBranchingException.AddGotoOrigin): Likewise.       
2710
2711 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2712
2713         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2714         unreachable, skip it.
2715         (FlowBranchingException.Merge): Always propagate jumps, even if
2716         the finally block renders subsequent code unreachable.
2717
2718 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2719
2720         Fix #77601
2721         * statement.cs (Goto.Resolve): Move responsibility for resolving
2722         'goto' to FlowBranching.AddGotoOrigin.
2723         (Goto.SetResolvedTarget): New.  Callback to set the
2724         LabeledStatement that's the target of the goto.
2725         (Goto.DoEmit): Use Leave instead of Br when crossing an
2726         unwind-protect boundary.
2727         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2728         LookupLabel and adjust to new semantics.
2729         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2730         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2731         Goto.SetResolvedTarget to update target.
2732         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2733         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2734         AddBreakOrigin & co.  Delay propagation until ...
2735         (FlowBranchingException.Merge): ... this.
2736
2737         * statement.cs (Block.Resolve): Always depend on flow-branching to
2738         determine unreachability.  Kill workaround that originally emitted
2739         only one statement after an "unreachable" label (see infloop in
2740         test-515.cs).
2741
2742         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2743         This is still "wrong", but anything better would probably need a
2744         multi-pass algorithm.
2745         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2746         usage vector.  Force current usage vector to be reachable, to
2747         optimistically signify backward jumps.
2748         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2749         detected.
2750         (FlowBranchingLabeled.Merge): New.  If no backward jump was
2751         detected, return the original salted-away usage vector instead,
2752         updated with appropriate changes.  Print unreachable warning if
2753         necessary.
2754         * statement.cs (Block.Resolve): Don't print unreachable warning on
2755         a labeled statement.
2756
2757 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
2758
2759         * driver.cs: Pass filename without path to AssemblyBuilder's 
2760         AddResourceFile. Fixes bug #78407.
2761
2762 2006-05-17  Raja R Harinath  <rharinath@novell.com>
2763
2764         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2765         * flowanalysis.cs (FlowBranchingLabeled): ... here.
2766         (FlowBranching.MergeChild): Overwrite
2767         reachability information from Labeled branchings too.
2768
2769 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2770
2771         * statement.cs (Goto.Resolve): Merge jump origins here ...
2772         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2773
2774         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2775         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
2776         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
2777         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2778         here, ...
2779         * statement.cs (Goto.Resolve): ... not here.
2780         (Goto.Emit): Remove CS1632 check.
2781
2782 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
2783
2784         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2785         error message.
2786
2787 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2788
2789         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2790         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2791         (FlowBranchingException.Label): Likewise.
2792
2793         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
2794         given value.
2795         (MyBitVector.Or): Use it to avoid losing information (Count).
2796         (FlowBranching.MergeOrigins): Likewise.
2797
2798         * flowanalysis.cs (UsageVector.IsDirty): Remove.
2799         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2800         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2801         (UsageVector.ToString): Simplify.
2802         (UsageVector.MergeSiblings): Move here from ...
2803         (FlowBranching.Merge): ... here.
2804         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2805         not a MyBitVector.
2806
2807 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2808
2809         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2810         null bitvector is treated as all-true.
2811
2812         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2813         (MyBitVector): Rationalize invariants.  'vector != null' implies
2814         that we have our own copy of the bitvector.  Otherwise,
2815         'InheritsFrom == null' implies all inherited bits are true.
2816
2817 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2818
2819         * statement.cs (LocalInfo): Add IsConstant.
2820         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2821         local variable for constants.
2822
2823 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2824
2825         * flowanalysis.cs (MyBitVector.Empty): New.
2826         (MyBitVector): Don't allow InheritedFrom to be null.
2827         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2828         (UsageVector, FlowBranching): Update to changes.
2829
2830         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2831         recursion.  The 'Parent == null' condition isn't sufficient for
2832         anonymous methods.
2833         (FlowBranching.AddBreakOrigin): Likewise.
2834         (FlowBranching.AddContinueOrigin): Likewise.
2835         (FlowBranching.AddReturnOrigin): Likewise.
2836         (FlowBranching.StealFinallyClauses): Likewise.
2837         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2838         (FlowBranching.CheckOutParameters): Likewise.
2839         (FlowBranchingToplevel): Terminate all the above recursions here.
2840         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2841         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2842
2843         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2844         toplevel block.
2845         (FlowBranchingToplevel): New.  Empty for now.
2846         (FlowBranching.MergeTopBlock): Update.
2847         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2848         branching for the anonymous delegate.
2849         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2850
2851         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2852         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2853         information at the start of the merge.  Reorganize.
2854
2855 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2856
2857         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2858
2859 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2860
2861         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2862         to newly introduced ctor.
2863
2864         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2865         message to one place.
2866         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2867         global namespace.
2868
2869 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2870
2871         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2872
2873         * ecore.cs (Expression.ResolveAsConstant): Updated.
2874
2875         * statement.cs (ResolveMeta): Updated.
2876
2877 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2878
2879         * cs-parser.jay: __arglist cannot be used in initializer.
2880
2881 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2882
2883         A fix for #77879
2884         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2885         private types.
2886
2887 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2888
2889         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2890         (LabeledStatement): Add 'name' parameter.
2891         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2892         (Block.AddLabel): Update to changes.
2893         * cs-parser.jay (labeled_statement): Likewise.
2894
2895         * flowanalysis.cs (BranchingType.Labeled): New.
2896         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2897         (FlowBranchingLabeled): New.  Does nothing for now, but will
2898         eventually handle 'goto' flows.
2899         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2900         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2901         that's terminated ...
2902         (Block.Resolve): ... here.
2903
2904         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2905         (UsageVector.MergeFinallyOrigins): Likewise.
2906         (FlowBranching.InTryOrCatch): Likewise.
2907         (FlowBranching.AddFinallyVector): Likewise.
2908         (FlowBranchingException): Update to changes.
2909
2910         Fix #78290
2911         * statement.cs (Return.Resolve): Move error checking to ...
2912         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2913         (FlowBranchingException): Handle return origins like break and
2914         continue origins.
2915         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2916
2917 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2918
2919         A fix for #76122
2920         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2921         filter.
2922
2923 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2924
2925         A fix for #77543
2926         * class.cs (MethodData.Define): Do public accessor check only when method
2927         implements an interface.
2928
2929 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2930
2931         Remove special handling of 'break'
2932         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2933         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2934         (UsageVector.Break): Remove.
2935         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2936         reachability.
2937         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2938
2939         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2940         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2941
2942 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2943
2944         A fix for #75726
2945         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2946         be the interface member.
2947
2948 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2949
2950         A fix for #60069
2951         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2952         for emitting small (int) values.
2953
2954 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2955
2956         Fix #59427
2957         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2958         control-flow passes through the 'finally' after merging-in all the
2959         control-flows from 'try' and the 'catch' clauses.
2960
2961         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2962         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2963         always true at the only non-recursive entry point.
2964         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2965         FlowBranchingBreakable.
2966         (FlowBranchingLoop): Remove.
2967         * statement.cs (Return.DoResolve): Update to changes.
2968
2969         Fix #76471, #76665
2970         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2971         (FlowBranching.CreateBranching): Handle it: create a
2972         FlowBranchingContinuable.
2973         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2974         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2975         except that it handles the 'continue' command.
2976         (FlowBranching.UsageVector.MergeOrigins): Rename from
2977         MergeBreakOrigins.
2978         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2979         except that it overrides AddContinueOrigin.
2980         (FlowBranchingException): Override AddContinueOrigin, similar to
2981         AddBreakOrigin.
2982         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2983         Create a new branching around the embedded statement.
2984         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2985         control flow after the embedded statement.
2986         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2987
2988         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2989         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2990         FlowBranchingBreakable.
2991         (FlowBranchingSwitch): Remove.
2992
2993         Fix test-503.cs
2994         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
2995         error reporting to ...
2996         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2997         Rename from 'AddBreakVector'.  Add new location argument.  Return
2998         a bool indicating whether the 'break' crosses an unwind-protect.
2999         (FlowBranchingException.AddBreakOrigin): Add.
3000         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3001         flowbranching after updating with the effects of the 'finally'
3002         clause.
3003         (FlowBranchingBreakable): New common base class for
3004         FlowBranchingLoop and FlowBranchingSwitch.
3005
3006         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3007         embedded statement.
3008         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3009
3010 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3011
3012         * statement.cs (Do.Resolve): If the loop is infinite, set the
3013         barrier.
3014         (While.Resolve, For.Resolve): Set a barrier after the embedded
3015         statement.  There's no direct control flow that goes from the end
3016         of the embedded statement to the end of the loop.
3017         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3018         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3019         above ensure that the reachability is correctly computed.
3020
3021         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3022         (UsageVector.MergeBreakOrigins): If the current path is
3023         unreachable, treat it as if all parameters/locals are initialized.
3024         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3025         infinite loops before merging-in break origins.
3026
3027         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3028         (Reachability.Reachable): Split part into ...
3029         (Reachability.Unreachable): ... this.  Simplify.
3030         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3031
3032         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3033         (Reachability.SetThrowsSometimes): Likewise.
3034         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3035         TriState.Always, use corresponding property.
3036         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3037         (Block.Resolve): Likewise.  Remove some redundant checks.
3038
3039 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3040
3041         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3042         (Reachability.Meet): Don't bother checking AlwaysThrows --
3043         barrier is always set.
3044         (FlowBranchingBlock.Merge): Likewise.
3045
3046 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3047
3048         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3049         checks for unreachable.
3050
3051 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3052
3053         A fix for #77980
3054         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3055
3056         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3057         whether field is really assigned.
3058
3059 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3060
3061         * flowanalysis.cs (Reachability): Make 4-argument constructor
3062         private.
3063         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3064         (Reachability.Always): Rename from the highly misleading
3065         'Reachability.Never'.
3066         (FlowBranching.Merge): Update to changes.  Mark an impossible
3067         situation with a 'throw'.
3068         (*): Update to changes.
3069
3070 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3071
3072         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3073         Remove 'Undefined'.
3074         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3075         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3076         (*): Update to changes.
3077         * statement.cs: Update to changes.
3078
3079 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3080
3081         A fix for #78049
3082         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3083
3084 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3085
3086         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3087         dummy UsageVector.
3088
3089         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3090         argument to two arguments: an usage-vector and a bool.  Move call
3091         to FlowBranching.Merge () ...
3092         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3093
3094         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3095         handling of loop and switch reachability to ...
3096         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3097
3098 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3099
3100         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3101         handling to FlowBranchingLoop.InLoop.
3102         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3103
3104 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3105
3106         A fix for #78115
3107         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3108         anonymous method is allowed from AnonymousContainer here.
3109
3110         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3111
3112 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3113
3114         Fix #78156
3115         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3116
3117 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3118
3119         A fix for #49011.
3120         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3121         (DoubleConstant.Reduce): Ditto.
3122
3123 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3124
3125         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3126         Remove 'lvalue_right_side' argument.  Move parts to ...
3127         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3128         (LocalVariable.DoResolveLValue): ... these.
3129
3130 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3131
3132         Fix cs1655.cs
3133         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3134         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3135         (LocalVariableReference.DoResolveBase): Use it to implement new
3136         CS1655 check.
3137         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3138         (Argument.Resolve): Simplify.  Move CS1510 check ...
3139         * ecore.cs (Expression.ResolveLValue): ... here.
3140         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3141         (PropertyExpr.DoResolveLValue): Likewise.
3142         (FieldExpr.Report_AssignToReadonly): Likewise.
3143         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3144         LValueMemberAccess or LValueMemberOutAccess on instance depending
3145         on it.
3146         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3147         DoResolve as appropriate.
3148
3149 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3150
3151         Fix #75800
3152         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3153         implicit conversions on 'out' and 'ref' arguments.
3154
3155         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3156         improve clarity.  Remove dead code.
3157
3158         Fix #66031
3159         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3160         (Catch.Resolve): Resolve VarBlock if it exists.
3161
3162 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3163
3164         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3165         twice, this was some residual code, the enumerator was emitted
3166         properly in the two branche of if later.
3167
3168 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3169
3170         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3171         cast is never an lvalue.
3172         (Cast.DoResolve, Cast.ResolveRest): Combine.
3173         (Argument.Emit): Simplify slightly.  Move 'Expr is
3174         IMemoryLocation' check ...
3175         (Argument.Resolve): ... here.
3176         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3177
3178         Simplifications.  Fix cs0191-2.cs
3179         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3180         CS1649 and CS1651 to ...
3181         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3182         the actual selection of the error code and message to a lookup
3183         table.  Add a dummy return value to simplify callsites.
3184         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3185         readonly fields of other instances of the same type.  Move CS0197
3186         warning from ...
3187         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3188         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3189         resolution of an out or ref argument.  The code simplification
3190         above uses this invariant.
3191
3192 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3193
3194         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3195         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3196         CheckMarshallByRefAccess.  Drop parameter.
3197         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3198         warning.
3199         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3200         InstanceExpression.
3201         * report.cs (AllWarnings): Add CS1690.
3202         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3203         for ref access too.
3204         (LocalVariableReference.DoResolveBase): Update.
3205
3206 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3207
3208         * class.cs (MethodOrOperator): Moved common parts from method class.
3209         detect obsolete attributes.
3210         (Method.Define): Simplified as it reuses code from base.
3211         (Constructor.ValidAttributeTargets): Fixed issue found during
3212         refactoring.
3213         (Destructor.ValidAttributeTargets): Fixed issue found during
3214         refactoring.
3215         (Operator): Finished refactoring set off by #78020. Operator class is now
3216         ordinary method class.
3217
3218         * anonymous.cs: Updated.
3219
3220         * decl.cs (DeclSpace): Add IsGeneric
3221
3222 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3223
3224         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3225
3226 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3227
3228         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3229         detect obsolete attributes.
3230         (Method.CreateEmitContext): Moved to MethodOrOperator.
3231
3232 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3233
3234         A fix for #78048.
3235         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3236         customized exception to make crash detection easier.
3237         (MethodOrOperator): Started to work on new base class for methods and
3238         operators.
3239         (Method): Derives from MethodOrOperator.
3240         (Constructor.Emit): Emits its own attributes.
3241         (AbstractPropertyEventMethod.Emit): Ditto.
3242         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3243         patch.
3244         (Operator.Emit): It's temporary more tricky than should be.
3245         
3246         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3247
3248         * report.cs (InternalErrorException): Add ctor with inner exception.
3249
3250 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3251
3252         A fix for #76744.
3253         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3254         only not visible.
3255
3256 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3257
3258         A fix for #77916.
3259         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3260         array.
3261
3262 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3263
3264         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3265         attribute is present and Guid not.
3266         (Interface.ApplyAttributeBuilder): Ditto.
3267
3268         * attribute.cs: Add error message.
3269
3270 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3271
3272         A fix for #78020.
3273
3274         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3275         sources (it's composite) so hold them in extra array as they are used in
3276         Emit phase only. It worked in the previous versions by mistake.
3277         (Attribute.Emit): Emit attribute for more owners when exist.
3278
3279         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3280         it has now different behaviour.
3281
3282 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3283
3284         * constant.cs (Constant.IsDefaultInitializer): New method.
3285
3286         * class.cs: Updated.
3287
3288         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3289         re-initialize default values. It saves KBs almost for every assembly.
3290         Thanks Zoltan for the idea.
3291         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3292         (ArrayCreation.DoResolve): Resolve only once.
3293         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3294         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3295
3296 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3297
3298         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3299         From #77961.
3300
3301 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3302
3303         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3304         in an embedded statement too.
3305
3306 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3307
3308         Fix #77958
3309         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3310
3311 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3312
3313         A fix for #77966.
3314
3315         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3316         was not specified.
3317
3318         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3319
3320 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3321
3322         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3323         phase.
3324
3325         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3326         LocalTemporary change.
3327
3328         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3329         TypeContainer.
3330         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3331         initializers optimization.
3332         (ClassOrStruct.TypeAttr): Moved from modifiers.
3333         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3334         (FieldBase.ResolveInitializer): Resolves initializer.
3335         (FieldBase.HasDefaultInitializer): New property.
3336
3337         * cs-parser.jay: Removed message.
3338
3339         * expression.cs (CompilerGeneratedThis): New specialization.
3340
3341         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3342
3343 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3344
3345         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3346
3347 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3348
3349         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3350         be now EnumConstants only.
3351
3352 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3353
3354         * attribute.cs, driver.cs: Reset more caches.
3355
3356 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3357
3358         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3359
3360 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3361
3362         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3363         for easier reuse. Updated all overrides.
3364         (IntegralConstant): New base class for all integral constants.
3365         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3366         of the constant range, report custom error.
3367         (UIntConstant.Reduce): Fixed uint conversion.
3368
3369         * ecore.cs, literal.cs: Reduce updates.
3370
3371 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3372
3373         A fix for #75813.
3374
3375         * class.cs (Constructor.Define): Removed extra if for default ctors.
3376         A patch from Atsushi Enomoto.
3377
3378 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3379
3380         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3381         GetAttributableValue.
3382
3383         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3384         when required.
3385
3386         * convert.cs (ImplicitConversionRequired): Error message moved to
3387         DoubleLiteral.
3388
3389         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3390         automatic implicit conversion of an output value.
3391         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3392
3393         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3394         conversion.
3395         (TypeOf.GetAttributableValue): Add extra handling for object type.
3396
3397         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3398         special error message.
3399
3400 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
3401
3402         * class.cs (Constructor.Emit): Don't crash when struct ctor is
3403         InternalCall.
3404         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3405         compatible with MS runtime.
3406
3407 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
3408
3409         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3410         attribute arguments here.
3411
3412         * class.cs (Indexer.Define): The check was moved to attribute class.
3413
3414 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
3415
3416         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3417         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3418         easier.
3419
3420 2006-03-22  Raja R Harinath  <rharinath@novell.com>
3421
3422         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
3423         mcs to keep code differences small.
3424         * attribute.cs (Attribute.GetParameterDefaultValue): New.
3425         * typemanager.cs (parameter_default_value_attribute_type): New.
3426         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
3427         CS1908 check.
3428
3429 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3430
3431         * expression.cs (StringConcat.Append): Reverted back to no warning state.
3432
3433 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3434
3435         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3436
3437         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3438         the blocks too.
3439
3440 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
3441
3442         * doc-bootstrap.cs : fix build.
3443
3444 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3445
3446         * expression.cs (StringConcat.Append): Issue a warning when empty string
3447         is going to append.
3448
3449 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3450
3451         * assign.cs (CompoundAssign.ResolveSource): Removed.
3452
3453         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3454         clean up.
3455
3456         * class.cs (TypeContainer.FindMethods): Removed.
3457         (TypeContainer.CheckMemberUsage): Made static.
3458
3459         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3460
3461         * constant.cs (CheckRange): Removed unused type argument.
3462         (CheckUnsigned): Removed unused type argument.
3463
3464         * cs-parser.jay: Updated after MemberAccess clean up.
3465         Uses Length for empty string test.
3466
3467         * cs-tokenizer.cs: Uses Length for empty string test.
3468         (IsCastToken): Made static.
3469         (is_hex): Made static.
3470         (real_type_suffix): Made static.
3471
3472         * decl.cs (SetupCache): Made static.
3473         (OnGenerateDocComment): Removed unused ds argument.
3474
3475         * delegate.cs (VerifyDelegate): Removed unused argument.
3476
3477         * doc.cs: Uses Length for empty string test.
3478
3479         * driver.cs: Uses Length for empty string test.
3480
3481         * enum.cs (IsValidEnumType): Made static
3482
3483         * expression.cs (EnumLiftUp): Removed unused argument.
3484         (ResolveMethodGroup): Ditto.
3485         (BetterConversion): Ditto.
3486         (GetVarargsTypes): Ditto.
3487         (UpdateIndices): Ditto.
3488         (ValidateInitializers): Ditto.
3489         (MemberAccess.ctor): Ditto.
3490         (GetIndexersForType): Ditto.
3491
3492         * flowanalysis.cs: (MergeFinally): Removed unused argument.
3493
3494         * iterators.cs: Updated after MemberAccess clean up.
3495
3496         * location.cs: Uses Length for empty string test.
3497
3498         * namespace.cs: Uses Length for empty string test.
3499
3500          * report.cs (CheckWarningCode): Made static.
3501
3502         * statement.cs (LabeledStatement): Removed unused argument.
3503
3504         * typemanager.cs (FilterNone): Removed.
3505
3506 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3507
3508         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3509         obsolete.
3510
3511         * class.cs: Updated.
3512
3513 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3514
3515         * cs-parser.jay.cs: __arglist is not allowed for delegates.
3516
3517 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3518
3519         A fix for #77822.
3520
3521         * expression.cs (VerifyArgumentsCompat): Reverted to double error
3522         reporting, it's more tricky than I thought.
3523
3524 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3525
3526         A fix for #77816.
3527
3528         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
3529         host container.
3530         (AnonymousMethod.ImplicitStandardConversionExists): New method.
3531         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3532         Add more error reporting; Fixed issue with params.
3533
3534         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3535
3536         * cs-parser.jay: AnonymousMethod requires host container.
3537
3538         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3539
3540 2006-03-18  Raja R Harinath  <harinath@gmail.com>
3541
3542         * class.cs: Change 'TypeContainer ds' constructor argument to
3543         'DeclSpace parent'.  Some classes were missed below due to
3544         different naming convention.
3545
3546         * class.cs (MemberCore.Parent): Delete.  This makes the
3547         ParentContainer changes below enforceable by the compiler.
3548
3549         Treat pointers to enclosing declaration space as 'DeclSpace', not
3550         'TypeContainer'.
3551         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3552         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3553
3554         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3555         of TypeContainer.
3556         (Block.AddThisVariable): Likewise.
3557         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3558         (AbstractPropertyEventMethod.Emit): Likewise.
3559         (AbstractPropertyEventMethod.EmitMethod): Likewise.
3560         (GetMethod.Define, SetMethod.Define): Likewise.
3561         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3562         (DelegateMethod.EmitMethod): Likewise.
3563
3564         Fix regression test-partial-13.cs.
3565         Rationalize use of PartialContainer.  Ensure that the partial
3566         class semantics can be tied to type-correctness, i.e., any
3567         violation will cause a compile error.
3568         * class.cs, const.cs: Access all fields that belong to class
3569         TypeContainer via ParentContainer.  Arguments of EmitContexts and
3570         Resolve()-like functions still use 'Parent'.
3571
3572         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3573         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3574         (PropertyMethod.CheckModifiers): Remove unused argument.
3575         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3576         DeclSpace.
3577
3578 2006-03-17  Raja R Harinath  <harinath@gmail.com>
3579
3580         Make semantics of PartialContainer simpler.
3581         * decl.cs (DeclSpace.IsPartial): Remove.
3582         * class.cs (TypeContainer.IsPartial): Likewise.
3583         (TypeContainer..ctor): Set PartialContainer to point to self.
3584         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3585         (TypeContainer.FindNestedType): Likewise.
3586         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
3587
3588 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
3589
3590         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3591
3592 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3593
3594         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3595         classes.
3596
3597 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3598
3599         * class.cs (Operator.Define): An error for base conversion was not
3600         reported correctly.
3601
3602 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3603
3604         * iterator.cs : yield break is allowed in try statement which has
3605           catch clauses. Fixed bug #77767.
3606
3607 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3608
3609         A fix for #77593, #77574.
3610
3611         * class.cs (MethodCore.CheckBase): Another if for operator.
3612
3613 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
3614
3615         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3616         were not resolved
3617
3618         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3619         (DelegateCreation.ImplicitStandardConversionExists): New method for just
3620         conversion test.
3621         
3622         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3623         not needed.
3624
3625         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3626         Updated after another emitcontext usage was clean up. It should help us to
3627         synchronize with gmcs easier.
3628
3629 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
3630
3631         A fix for #77353.
3632
3633         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3634         (Event.Define): ditto
3635         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3636
3637         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3638         Removed redundant code and set NewSlot for Invoke method too.
3639
3640         * parameter.cs (Parameters.ctor): Add custom, type ctor.
3641         (Parameters.MergeGenerated): New method. Use this method when you merge
3642         compiler generated argument with user arguments.
3643
3644 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
3645
3646         * attribute.cs (ResolveAsTypeTerminal): Removed.
3647
3648         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3649         specialization for predefined types; 30% speed up.
3650         Finally placed obsolete check to right place.
3651         (Expression.ResolveType): Removed.
3652
3653         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3654         Updated after ResolveType was removed.
3655
3656         * expression.cs (Cast.ctor): Check void cast.
3657         (Binary.ResolveAsTypeTerminal): Is never type.
3658         (Conditional.ResolveAsTypeTerminal): Is never type.
3659
3660         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3661
3662 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3663
3664         Fix #77679.
3665         * expression.cs (ParameterReference.DoResolveBase): Change return
3666         type to bool.
3667         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3668         Update.
3669
3670         Fix #77628.
3671         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3672
3673         Fix #77642.
3674         * typemanager.cs (GetFullNameSignature): Don't nullref on
3675         protected accessors.
3676
3677 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3678
3679         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3680         these two separated members to simplify the code.
3681         (Attribute.Resolve): Refactored to use new fields and methods.
3682         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3683         implemented obsolete attribute checking.
3684         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3685         implemented obsolete checking again. It look line never ending quest ;-)
3686         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3687
3688         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3689
3690         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3691
3692         *class.cs (Property.Define): Add RegisterProperty call.
3693
3694         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3695         argument groups (only 2).
3696
3697         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3698         encoding expression to arguments.
3699         (Expression.ExprClassToResolveFlags): Just turned to property.
3700
3701         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3702         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3703         optimized as well as implemented support for zero-length attributes.
3704
3705         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3706         Add caching of PropertyInfo's.
3707
3708 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3709
3710         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3711         error multiple times.
3712
3713 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3714
3715         New partial class implementation.
3716         A fix for #77027, #77029, #77403
3717
3718         * attribute.cs (Attributable): Made attributes protected.
3719
3720         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3721         the replacements of ClassPart and PartialContainer.
3722         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3723         (TypeContainer.AddInterface): Ditto.
3724         (TypeContainer.AddPartial): The main method for partial classes. It checks
3725         for errors and merges ModFlags and attributes. At the end class is added to
3726         partial_parts list.
3727         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3728         required here.
3729         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3730         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3731         from the rest of partial classes.
3732         (TypeContainer.GetClassBases): Simplified.
3733         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3734         DefineType.
3735         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3736         (TypeContainer.HasExplicitLayout): Uses Flags now.
3737         (PartialContainer): Removed.
3738         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3739         (StaticClass): Was merged with Class.
3740         (Class.GetClassBases): class and static class bases are verified here.
3741         (Class.TypeAttr): Added static attributes when class is static.
3742         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3743         (MemberBase): In some cases we need to call parent container for partial
3744         class. It should be eliminated but it's not easy now.
3745
3746         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3747
3748         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3749         partial classed to accumulate class comments.
3750         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3751
3752         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3753
3754         * driver.cs (MainDriver): Tree.GetDecl was removed.
3755
3756         * modifiers.cs (Modifiers): Add partial modifier.
3757
3758         * tree.cs (Tree.decl): Removed.
3759         (RootTypes): Started to use this class more often for root types
3760         specializations.
3761
3762 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3763
3764         A fix for #77615
3765
3766         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3767         external interface does not have an attribute.
3768
3769 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3770
3771         Another prerequisites for new partial classs implementation.
3772         
3773         * attribute.cs (Attribute.Equal): Implemented.
3774         (Attribute.Emit): Changed as attributes can be applied more than twice.
3775         (Attributes.Emit): Check for duplicate attributes here.
3776
3777         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3778         as a parameter, clean-up.
3779
3780 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3781
3782         A fix for #77485
3783
3784         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3785         contains obsolete attribute check which can in some cases look for base
3786         type of current class which is not initialized yet.
3787         (TypeContainer.BaseType): Replacement of ptype.
3788
3789         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3790
3791 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3792
3793         First of prerequisites for new partial classs implemention.
3794         
3795         * attribute.cs (Attributable): Extended by ResolveContext;
3796         Attributes finally have correct context for resolving in all cases.
3797         (AttachTo): Attribute owner is assigned here.
3798
3799         * codegen.cs (IResolveContext): Introduce new interface to hold
3800         all information needed in resolving phase.
3801         (EmitContext): Implements IResolveContext; more clean-up needed here.
3802         
3803         * decl.cs (MemberCore): Implemented IResolveContext.
3804
3805         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3806         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3807         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3808         Refactored to use new IResolveContext instead of EmitContext; cleanup
3809
3810 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3811
3812         * codegen.cs (EmitScopeInitFromBlock): check here the
3813         capture_context, there is no need to make two calls to the
3814         EmitContext. 
3815
3816         * anonymous.cs: Add some debugging messages that might help me
3817         track other instances of this problem in the future (the
3818         regression of test 467).
3819
3820         * cs-parser.jay: track the variable block, as we need to initalize
3821         any captured variables declared in this block for the "catch"
3822         portion of the "Try" statement.
3823
3824         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3825         scope initialization for captured variables. 
3826
3827         Also, move the emit for the variables after the block location has
3828         been marked.
3829
3830 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3831
3832         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3833
3834 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3835
3836         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3837         commit yesterday, the initialization for the roots is necessary.
3838         What is not necessary is the scope activation.
3839
3840 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3841
3842         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3843         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3844         CS0206 checks.
3845         (Argument.Resolve): Remove CS0206 checks.
3846
3847 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3848
3849         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3850         scopes for all the roots, the scopes will now be emitted when the
3851         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3852
3853         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3854         code.  This reduces a lot of existing cruft.
3855         
3856         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3857         that the ScopeInfo is generated as we enter the scope, not at the
3858         time of use, which is what we used to do before.
3859
3860         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3861         every time a Block is about to be emitted if we have a
3862         CaptureContext. 
3863
3864 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3865
3866         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3867         (Reset): Update.
3868         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3869
3870         * typemanager.cs (cons_param_array_attribute): Make private.
3871         (Reset): Set it to null.
3872         (InitCoreHelpers): Don't initialize it.
3873         (ConsParamArrayAttribute): New.  Initialize it as needed.
3874         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3875
3876 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3877
3878         * expression.cs: There might be errors reported during the
3879         selection of applicable methods.  If there are errors, do not
3880         continue execution as it will lead the compiler to crash.
3881
3882 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3883
3884         * expression.cs: Member access is not allowed on anonymous
3885         methods.  Fixes #77402.
3886
3887 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3888
3889         Fix #77401
3890         * cs-parser.jay (VariableDeclaration): Don't set
3891         current_array_type to null.
3892         (field_declaration, event_declaration, declaration_statement):
3893         Set it to null here.
3894
3895 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3896
3897         * typemanager.cs (GenericParameterPosition): New.
3898         * doc.cs: Use it.
3899
3900 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3901
3902         * doc.cs : To process "include" elements, first we should create
3903           another list than XmlNodeList, because it could result in node
3904           removal, which could result in that the XmlNodeList gives up
3905           yielding next node.
3906
3907           (Also made code identical to gmcs again.)
3908
3909 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3910
3911         * ecore.cs: Introduce an error report that we were not catching
3912         before, if not silent, we must report the error.  Gonzalo ran into
3913         it.
3914
3915 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3916
3917         A fix for bug: #76957
3918         
3919         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3920         ComputeMethodHost before creating the method, this is a new
3921         requirement. 
3922
3923         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3924         that this method references (RegisterScope).  The actual scope
3925         where the method is hosted is computed with the ComputeMethodHost
3926         before we create the method.
3927
3928         Moved the Deepest routine here.
3929
3930         (AnonymousContainer.ComputeMethodHost): New routine used to
3931         compute the proper ScopeInfo that will host the anonymous method.
3932
3933         (ScopeInfo): Deal with multiple roots.  The problem was that we
3934         did not have a unique root where all ScopeInfos could be hanged
3935         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3936         of roots.  
3937
3938         Remove AdjustMethodScope which is now computed at the end.  Remove
3939         LinkScope which did a partial link, instead link all ScopeInfos
3940         before code generation from the new "LinkScopes" routine. 
3941
3942         Simplify all the Add* routines as they no longer need to maintain
3943         the tree, they just need to record that they are using variables
3944         from a ScopeInfo.
3945
3946         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3947         routines to produce the forest of ScopeInfo trees.
3948
3949         * class.cs (TypeContainer.AppendMethod): This is just like
3950         AddMethod, but ensures that an interface implementation method
3951         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3952         methods, but at the end.
3953
3954         We use this functionality to ensure that the generated MoveNext
3955         method in the iterator class is resolved/emitted before the
3956         enumerator methods created.   
3957
3958         This is required because the MoveNext method computes the right
3959         ScopeInfo for the method.  And the other methods will eventually
3960         need to resolve and fetch information computed from the anonymous
3961         method. 
3962
3963 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3964             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3965
3966         Fix rest of #76995.
3967         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3968         the 'aliases' hash.
3969         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3970         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3971
3972 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3973
3974         Fix #76656, cs0231-2.cs.
3975         * cs-parser.jay (formal_parameter_list): Make error case catch
3976         more issues.
3977         (parenthesized_expression_0): Add CS1026 check.
3978         (invocation_expression): Remove unused { $$ = lexer.Location }.
3979
3980 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3981
3982         Fix #76824.
3983         * cs-parser.jay (statement_expression): Don't list out the
3984         individual statement-expressions.  Convert syntax error into
3985         CS0201 check.
3986
3987 2006-01-16  Raja R Harinath  <rharinath@novell.com>
3988
3989         Fix #76874.
3990         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3991         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
3992         CheckIntermediateModification.
3993         (FieldExpr.DoResolve): Add new two-argument version that
3994         allows us to resolve the InstanceExpression as an lvalue.
3995         The one-argument variant is now just a wrapper.
3996         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3997         Resolve the lhs as an lvalue if the it has a value type.
3998         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3999         from Assign.DoResolve.
4000         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4001         resolved as an lvalue.
4002         (PropertyExpr.DoResolve): Update.
4003         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4004         has a value type.  Move CS1612 check here from
4005         CheckIntermediateModification.
4006         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4007         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4008         'right_side' of a ResolveLValue on an 'out' argument.
4009         (EmptyExpression.LValueMemberAccess): New.  Used as the
4010         'right_side' of a propagated ResolveLValue on a value type.
4011         (LocalVariableReference.DoResolveBase): Recognize
4012         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4013         Add CS1654 check.
4014         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4015         EmptyExpression.Null.
4016
4017 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4018
4019         * typemanager.cs : added IsGenericParameter(). In mcs it always
4020           return false.
4021         * doc.cs : for generic parameters, use GenericParameterPosition,
4022           not FullName.
4023
4024 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4025
4026         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4027
4028 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4029
4030         This fixes the problem where we used ldfld instead of ldflda to
4031         load the "THIS" pointer on captured parameters, when THIS is a
4032         value type.  See bug #77205.
4033         
4034         * iterators.cs (CapturedThisReference.Emit): Pass false to
4035         EmitThis (we do not need the address).
4036
4037         * codegen.cs (EmitThis): it needs to know whether we need the
4038         address of `this' or not.  This is used by value types.  
4039
4040         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4041         every other call passes false.
4042
4043 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4044
4045         Fix #77221.
4046         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4047         GetOverride.
4048         * expression.cs (Invocation.OverloadResolve): Update.
4049         (Invocation.DoResolve): Avoid double resolution of invocation.
4050
4051 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4052
4053         Fix #77180.
4054         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4055         unary negation of floating point types as 0-expr; negation cannot
4056         overflow in floating point types.
4057
4058         Fix #77204.
4059         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4060         on operands of 'void' type.
4061
4062         Fix #77200.
4063         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4064         and ExclusiveOr for boolean constants too.
4065
4066 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4067
4068         Fix #75636.
4069         * expression.cs (Invocation.OverloadResolve): Replace reflected
4070         override methods with their base virtual methods, rather than
4071         skipping over them.
4072         * typemanager.cs (TypeManager.GetOverride): New.
4073
4074 2006-01-05  Jb Evain  <jbevain@gmail.com>
4075
4076         * class.cs (Property.Define, Indexer.Define): do not tag the
4077         properties as SpecialName | RTSpecialName.
4078
4079 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4080
4081         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4082         doing a low-level comparission of parameter types.  It was lacking
4083         a check for __argslist. 
4084
4085 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4086
4087         * expression.cs (ParameterReference.DoResolveBase): Allow
4088         reference parameters if they are local to this block. 
4089
4090         This allows the ref and out parameters of a delegate to be used in
4091         an anonymous method, for example:
4092
4093         delegate void set (out int x);
4094
4095         set s = delegate (out int x){
4096                 x = 0;
4097         };
4098
4099         This is used by functionality introduced late in the C# language.
4100         
4101         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4102         method that take ref and out parameters. 
4103
4104         Fixes #77119 which was a late change in the spec.
4105
4106 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4107
4108         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4109         parent if its the same scope.  Fixes #77060.
4110
4111 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4112
4113         * driver.cs: Report the case of no source files and no -out:
4114         argument provided.
4115
4116 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4117
4118         Fix #77035.
4119         * expression.cs (ComposedCast.GetSignatureForError): Define.
4120
4121 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4122
4123         Fix #76995
4124
4125         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4126         ListDictionary, to contain the ExternAliasEntry entries (in
4127         addition to the NamespaceEntry.aliases hashtable). This field is
4128         shared between the original entry and its doppelganger (bodyless 
4129         copy of it).
4130         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4131         extern_aliases field.
4132         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4133         lookup in extern_aliases.
4134
4135 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4136
4137         Fix #77006.
4138         * class.cs (TypeContainer.Mark_HasEquals): New.
4139         (TypeContainer.Mark_HasGetHashCode): New.
4140         (ClassPart): Override them.
4141         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4142
4143         Fix #77008.
4144         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4145         'parent' argument to the base constructor.
4146
4147         Remove all mention of TypeContainer from decl.cs.
4148         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4149         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4150         (DeclSpace.DeclSpace): Likewise.
4151         (DeclSpace.DefineMembers): Remove unused argument.
4152         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4153         debugging check -- we don't care if the debug code throws an
4154         InvalidCastException instead of an InternalErrorException.
4155         * class.cs (TypeContainer.DefineMembers): Update to changes.
4156         (TypeContainer.DoDefineMembers): Likewise.
4157         (TypeContainer.GetMethods): Likewise.
4158         (PropertyMember.Define): Likewise.
4159         (MemberBase.Parent): New property that forwards to
4160         MemberCore.Parent, but ensures that we get a TypeContainer.
4161         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4162         (RootContext.PopulateTypes): Likewise.  Remove special case code
4163         for !RootContext.StdLib: DefineMembers is idempotent.
4164
4165 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4166
4167         * convert.cs (ExplicitConversionCore): Check the return value from
4168         ExplicitConversionCore which can return null on failure.  Fixes #76914
4169
4170 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4171
4172         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4173
4174 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4175
4176         * doc.cs : The search for referenced namespace was insufficient to
4177           get global one as it used to do. Fixed bug #76965.
4178
4179 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4180
4181         * doc.cs : check name in cref in the last phase that whether it is
4182           namespace or not.
4183
4184 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4185
4186         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4187           Mono.C5.
4188
4189 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4190
4191         * doc.cs : so it turned out that we cannot skip override check for 
4192           interface members. Fixed bug #76954.
4193
4194 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4195
4196         * cs-tokenizer.cs : fixed bug #75984:
4197           - #warning and #error should not be handled when the source line
4198             is disabled.
4199           - #line is not checked strictly when the source line is disabled.
4200           - #define and #undef is on the other hand checked strictly at any
4201             state.
4202
4203 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4204
4205         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4206           CS1027 report.
4207
4208 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4209
4210         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4211
4212         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4213         event initializers.
4214         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4215         (FieldBase.Initializer): Initializer is now optional.
4216         (EventField.Define): Only event field can have initializer.
4217
4218         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4219
4220         * const.cs (Const): Reuse initializer.
4221
4222         * cs-parser.jay: Updated after FieldBase changes.
4223         Added current_array_type to simplify array initializers.
4224
4225         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4226
4227         * expression.cs, iterators.cs: Updated.
4228
4229         * namespace.cs (NamespaceEntry): Made UsingFound private.
4230
4231 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4232
4233         * parameterCollection.cs: Obsolete, removed.
4234         * parser.cs: Obsolete, removed.
4235
4236 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4237
4238         Fix #76849.
4239         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4240
4241         * enum.cs (Enum.Define): Set obsolete context here.
4242
4243 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4244
4245         * doc.cs :
4246           - FindDocumentedMember() now expects 1) paramList as null
4247             when "we don't have to check the number of parameters" and
4248             2) Type.EmptyTypes when "there is no arguments".
4249           - Introduced FoundMember struct to hold the exact type which was
4250             used to find the documented member (the above change broke
4251             test-xml-044; it might be better just to use DeclaringType than
4252             what MS does, like this change does, but it depends on usage.)
4253
4254 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4255
4256         * doc.cs : documented member might be from DeclaringType for nested
4257           types. Fixed bug #76782.
4258
4259 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4260
4261         * anonymous.cs: Have the param code handle leaving copies on the
4262         stack etc. Allows anonymous params to take part in the assignment
4263         code (++, +=, etc). Fixes bug #76550
4264
4265         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4266         it down to the anon code.
4267
4268         * iterators.cs: Use dummy var here
4269
4270         * codegen.cs: Handle new vars
4271
4272 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4273
4274         Fix #76849.
4275         * class.cs (MethodData.Define): Set proper Obsolete context.
4276
4277         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4278         obsolete context.
4279         (FieldExpr.DoResolve): Ditto.
4280
4281 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4282
4283         Fix #76849.
4284         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4285         parent is not obsolete.
4286
4287 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4288
4289         * doc.cs : (FindDocumentedMember) find parameterless members first
4290           and get CS0419 in the early stage. Fixed first case of bug #76727.
4291
4292 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4293
4294         Fix #76859.
4295         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4296         no error was reported.
4297
4298         *expression.cs (Binary.DoResolve): left can be null.
4299
4300 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4301
4302         Fix #76783.
4303         * class.cs (MethodData.Emit): Parameters should be labeled first.
4304
4305 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4306
4307         Fix #76761.
4308         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4309
4310 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4311
4312         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4313
4314         * class.cs (MethodCore): Parameter clean up.
4315         (IMethodData): Added ParameterInfo.
4316         (MethodData): Parameter clean up.
4317         (Indexer.Define): Parameter clean up.
4318
4319         * anonymous.cs,
4320         * codegen.cs,
4321         * cs-parser.jay,
4322         * decl.cs,
4323         * doc.cs,
4324         * ecore.cs,
4325         * flowanalysis.cs,
4326         * iterators.cs,
4327         * pending.cs,
4328         * statement.cs,
4329         * typemanager.cs: Parameter clean up.
4330
4331         * delegate.cs (Define): Get rid of duplicated code.
4332
4333         * expression.cs (ParameterReference): Removed useless parameters
4334         and simplified.
4335         (Invocation): Ditto.
4336
4337         * parameter.cs (ParamsParameter): New class, params specialization.
4338         (ArglistParameter): Attemp to separate arglist.
4339         (Parameter): Refactored to be reusable and faster.
4340         (Parameter.Modifier): Made understandable.
4341         (Parameters): Changed to be used as a class for `this' assembly
4342         parameters. Refactored to use new specialized classes.
4343
4344         * support.cs (ParameterData): Added Types property.
4345         (InternalParameters): Deleted.
4346
4347 2005-08-20  Martin Baulig  <martin@ximian.com>
4348
4349         Merging this patch from GMCS to fix #75867.
4350
4351         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4352         scope if we don't already have it.
4353
4354 2005-11-17  Martin Baulig  <martin@ximian.com>
4355
4356         * anonymous.cs
4357         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4358         inherit the scope from our parent.  Fixes #76653.
4359
4360 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4361
4362         * doc.cs : the previous patch does not actually fix the bug.
4363           PropertyInfo override check is now implemented and really fixed it.
4364         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4365
4366 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4367
4368         * doc.cs : apply "override filter" also to properties.
4369           Fixed bug #76730.
4370
4371 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4372
4373         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4374           no need to check overrides. For classes, omit those results from 
4375           interfaces since they must exist in the class. Fixed bug #76726.
4376
4377 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4378
4379         * typemanager.cs : (GetFullNameSignature) differentiate indexers
4380           with different parameters. Fixed the second problem in #76685.
4381
4382 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4383
4384         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4385           get expected 'protected' access in CheckValidFamilyAccess()).
4386           Fixed bug #76692.
4387
4388 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4389
4390         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4391           Fixed bug #76705.  CS1569 was incorrectly commented out.
4392
4393 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4394
4395         * doc.cs : use Invocation.IsOverride() to do real override check.
4396         * expression.cs : made Invocation.IsOverride() internal.
4397
4398 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4399
4400         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4401           TypeBuilder.FindMembers() and filter overriden base members out.
4402           Fixed bug #76990.
4403
4404 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4405
4406         * doc.cs : ref/out parameters are represented as '@' (instead of
4407           '&' in type FullName). Fixed bug #76630 (additionally crefs).
4408
4409 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4410
4411         * doc.cs : when there was no '.' in cref to methods in doc comment,
4412           then parameters were missing in the output. Fixed bug #76691.
4413
4414 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4415
4416         * driver.cs : don't output docs when there is an error.
4417           Fixed bug #76693.
4418
4419 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4420
4421         * doc.cs :
4422           Now it should detect indexers. Fixed primary concern in bug #76685.
4423           Fixed CS0419 message to not show the identical member signature in
4424           the message.
4425
4426 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4427
4428         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4429           instead of Type.FindMembers() since it does not handle events.
4430           Fixed bug #71604.
4431
4432 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
4433
4434         * codegen.cs: Fixed typo (speficied -> specified).
4435
4436 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4437
4438         Fix #76369.
4439         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4440
4441 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4442
4443         * attribute.cs: Changed error message.
4444
4445         * cs-tokenizer.cs: One more check.
4446
4447 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4448
4449         * statement.cs (Block.Resolve): Ignore empty statement.
4450
4451 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4452
4453         * report.cs: Made error/warning methods more strict to avoid
4454         their misuse.
4455
4456         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4457         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4458         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4459         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4460
4461 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
4462
4463         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4464         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4465
4466         * class.cs (TypeContainer.IsComImport): New property.
4467         (Constructor.Define): Create proper ctor for ComImport types.
4468
4469         * expression.cs (New.CheckComImport): Fixed.
4470
4471 2005-11-07  Miguel de Icaza  <miguel@novell.com>
4472
4473         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4474         that a parameter has been captured does not mean that we do not
4475         have to do the rest of the processing.  This fixes the second part
4476         of #76592.  If there was another anonymous method capturing
4477         values in the past, the Scope would never be set for the second
4478         method that captured the same parameter.
4479
4480         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4481         properly manipulate the stack.   Second part of fix for #76592.
4482
4483         * expression.cs (New): Add support for invoking "new" on
4484         interfaces that have been flagged with the ComImport attribute and
4485         the CoClass.  Fixes #76637 
4486
4487         * statement.cs (Try.DoEmit): When a variable is captured, do not
4488         try to emit the vi.LocalBuilder variable as it has been captured.
4489         Create a temporary variable and store the results on the
4490         FieldBuilder.  Fixes #76642
4491
4492 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
4493
4494         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4495
4496         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4497
4498         * expression.cs (Binary.DoResolve): Added && optimalization.
4499     
4500         * typemanager.cs (AddUserType): Removed useless argument.
4501
4502 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
4503
4504         * statement.cs (Block.variables): Uses ListDictionary.
4505
4506 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4507
4508         Fix #75969.
4509         * class.cs (PartialContainer.EmitType): Customized to emit
4510         security attributes.
4511         (ClassPart.ApplyAttributeBuilder): Transform security attribute
4512         for partial classes.
4513
4514 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4515
4516         Fix #76599.
4517         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4518         access has to be fixed.
4519         
4520         * typemanager.cs (IsUnmanagedType): Wrong common field type.
4521
4522 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
4523
4524         Fix #76590.
4525         * ecore.cs (NullCast.Reduce): Implemented.
4526
4527         * expression.cs (ArrayCreation.CheckIndices): Correcly check
4528         constant type.
4529         
4530         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4531         properly.
4532         (Foreach.Resolve): Catch null properly.
4533
4534 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4535  
4536         * cs-tokenizer.cs: Warning text fix.
4537
4538         * driver.cs: AllWarningNumbers exposed on public interface.
4539
4540         * report.cs (): Reviewed warning numbers.
4541         (IsValidWarning): Use binary search.
4542
4543 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4544  
4545         * driver.cs: Implemeted resource visibility.
4546         (Resources): New class for code sharing between /res: and
4547         /linkres:
4548  
4549 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
4550
4551         Fix #76568.
4552         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4553         folding.
4554         
4555         * convert (Convert.ImplicitReferenceConversion): NullCast holds
4556         contants only.
4557         
4558         * ecore.cs (NullCast): Child is contant only.
4559         
4560         * literal.cs (NullLiteral.Reduce): null can be converted to any
4561         reference type.
4562
4563 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
4564
4565         * driver.cs: Use Encoding.Default as default code page instead
4566           of ISO-28591.
4567
4568 2005-10-27  Raja R Harinath  <rharinath@novell.com>
4569
4570         Fix #76085.
4571         * expression.cs (Invocation.Error_InvalidArguments): Handle
4572         __arglist parameters.
4573         (Invocation.VerifyArgumentsCompat): Likewise.
4574         * support.cs (ReflectionParameters.GetSignatureForError): Print
4575         __arglist parameters.
4576         (InternalParamters.GetSignatureForError): Likewise.
4577         * parameter.cs (Parameters.GetSignatureForError): Likewise.
4578
4579 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
4580
4581         * attribute.cs (GetPropertyValue): Made public.
4582
4583         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4584         Resolve.
4585         Add new property WrapNonExceptionThrows to handle 2.0 assembly
4586         attribute.
4587         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4588         is not defined.
4589         
4590         * driver.cs: Reflect method name change.
4591         
4592         * statement.cs (Try.Resolve): Warn when try has both general
4593         exception handlers.
4594         
4595         * typemanager.cs: runtime_compatibility_attr_type new predefined
4596         type.
4597
4598 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4599
4600         Fix #76419.
4601         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4602         treat it as an empty parameter list.
4603
4604 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4605
4606         Fix #76271.     
4607         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4608         ResolveAsTypeStep silent.
4609         * statement.cs (Block.AddConstant): Mark block as used.
4610         (Block.ResolveMeta): Avoid piling on error messages
4611         if a constant initializer resolution fails.
4612
4613 2005-10-25  Raja R Harinath  <rharinath@novell.com>
4614
4615         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4616         Remove.
4617         (NamespaceEntry.VerifyAllUsing): New.
4618         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
4619         behaviour.  Delegates actual resolution of alias to ...
4620         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
4621         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4622         Update.
4623         * driver.cs (Driver.MainDriver): Update.
4624         
4625         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4626         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4627         property.
4628         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4629         Remove.
4630         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4631         RootNamespace.DefineNamespacesForAll.
4632
4633 2005-10-24  Raja R Harinath  <harinath@gmail.com>
4634
4635         * typemanager.cs (assemblies, external_aliases, modules)
4636         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4637         (ComputeNamespaces, GetRootNamespace): Remove extra staging
4638         overhead.  Move resposibility ...
4639         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
4640         * driver.cs, attribute.cs, codegen.cs: Update to changes.
4641
4642 2005-10-23  Raja R Harinath  <harinath@gmail.com>
4643
4644         * namespace.cs (RootNamespace.all_namespaces): Renamed from
4645         cached_namespaces.  Improve usage.
4646         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4647         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4648         Move from GlobalRootNamespace and simplify.
4649         (RootNamespace.Global): Make instance variable.
4650         (RootNamespace.RootNamespace): Add "alias name" parameter.
4651         (GlobalRootNamespace): Simplify drastically.
4652         (Namespace.Lookup): Don't use GetNamespace.
4653         * typemanager.cs (GetRootNamespace): Rename from
4654         ComputeNamespaceForAlias.
4655         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4656
4657 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4658
4659         * anonymous.cs (AnonymousContainer): Don't crash when container
4660         doesn't exist.
4661
4662 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4663
4664         * expression.cs (Binary.DoResolve): Warn when comparing same
4665         values.
4666
4667 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4668
4669         Fix #76486.
4670         * expression.cs (Binary.DoResolve): It looks like there are no
4671         convetsion rules in enum context.
4672
4673 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4674
4675         Add support for extern alias qualifiers.
4676         * typemanager.cs: Move some LookupTypeReflection code
4677         to namespace.cs, to have cleaner code. Added some methods
4678         to help us keep track of the extern aliased references.
4679         * driver.cs: Add suport for extern alias assemblies on command
4680         line and check for their warnings/errors. Also keep track of the
4681         extern aliased assemblies.
4682         * namespace.cs: Move the global functionality of Namespace
4683         to GlobalRootNamespace/RootNamespace. Now the global namespace
4684         is GlobalRootNamespace.Globa. Also the code moved from 
4685         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4686         Finally added LocalAliasEntry (AliasEntry before) and
4687         ExternAliasEntry, to handle alias statements.
4688         * cs-parser.jay: Add support in the grammar for extern alias
4689         statement.
4690         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4691         Update callings to Namespace (now in GlobalRootNamespace).
4692
4693 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4694
4695         Fix #76371.
4696         * class.cs (TypeContainer.DefineType): Move updating of
4697         topological sort earlier in the code.
4698         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4699
4700 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4701
4702         Fix #76273.
4703         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4704         
4705         * constant.cs (Constant.TryReduce): Moved from Cast class.
4706         (Reduce): Made little bit more OO and fixed missing conversions.
4707         
4708         * ecore.cs (Reduce): Implemented.
4709         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4710         
4711         * literal.cs (Reduce): Implemented.
4712         
4713         * class.cs: Reverted Miguel's wrong commit.
4714
4715 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4716
4717         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4718
4719 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4720
4721         * cs-parser.jay, expression.cs : CS0214 was missing error location
4722           for constants. Fixed bug #76404.
4723
4724 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4725
4726         Fix #76370.
4727         * convert.cs (ExplicitConversionCore): Fixed object->enum
4728         conversion.
4729
4730 2005-10-10  Raja R Harinath  <rharinath@novell.com>
4731
4732         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4733         InstanceExpression.
4734         (PropertyExpr.EmitCall): Likewise.
4735         * expression.cs (Invocation.EmitArguments): Handle case where
4736         arguments == null.
4737         (Invocation.EmitCall): Avoid allocating temporary variable if
4738         there are no arguments.
4739
4740 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4741
4742         Fix #76323.
4743         * convert.cs (ImplicitConversionStandard): Move conversion of
4744         void* to arbitrary pointer types ...
4745         (ExplicitConversionStandard): .. here.
4746         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4747         error to always print typenames.
4748
4749 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4750
4751         * convert.cs (GetConversionOperator): Rename from
4752         GetConversionOperators.  Move operator selection code from ...
4753         (UserDefinedConversion): ... here.
4754
4755 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * convert.cs (ExplicitConversionCore): Removed duplicate enum
4758         conversion.
4759
4760 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
4761
4762         * assign.cs (Assign.DoResolve): Error method changed.
4763
4764         * cfold.cs (DoConstantNumericPromotions): Error method changed.
4765         
4766         * const.cs (ResolveValue): Reset in_transit immediately.
4767         
4768         * constant.cs: Error method changed.
4769         
4770         * convert.cs: Removed useless location parameter.
4771         (ExplicitNumericConversion): Don't do double enum check.
4772         (ExplicitConversionCore): Renamed from ExplicitConversion.
4773         (ExplicitUnsafe): Extracted from ExplicitConversion.
4774         (ExplicitConversion): Uses for error reporting.
4775         
4776         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4777         error messages.
4778         (ResolveBoolean): Uses common error method.
4779         (CastToDecimal): Get rid of ec.
4780         (CastFromDecimal): Optimized.
4781         (ConvCast): Get rid of ec.
4782         
4783         * enum.cs (ResolveValue): Reset in_transit immediately.
4784         (Emit): Return after first error.
4785         
4786         * expression.cs: Convert changes.
4787         
4788         * literal.cs: Error method changed.
4789         
4790         * statement.cs: Error method changed.
4791
4792 2005-10-03  Raja R Harinath  <rharinath@novell.com>
4793
4794         * support.cs (SeekableStreamReader.Position): Don't error out when
4795         the requested position is just beyond the end of the current
4796         buffered data.
4797
4798 2005-09-28  Raja R Harinath  <rharinath@novell.com>
4799
4800         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
4801         try to keep in sync with the byte count of the underlying Stream.
4802         However, this limits us to a window size of 2048 characters: i.e.,
4803         the maximum lookahead of our lexer/parser can be 2048 characters.
4804
4805 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4806
4807         Fix #76255.
4808         * driver.cs: Fix compilation files with full root path.
4809
4810 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4811
4812         * report.cs (SymbolRelatedToPreviousError): Format the output so
4813         it does not use an open parenthesis that is never closed. 
4814
4815         * driver.cs: Follow coding guidelines
4816
4817 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4818
4819         Fix #72930.
4820         * const.cs (Const.ResolveValue): Check for assigning non-null
4821         value to reference type.
4822
4823 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * anonymous.cs: Implemented ExprClassName.
4826         
4827         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4828         delegate.
4829         
4830         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4831         check.
4832         
4833         * class.cs (StaticClass.DefineContainerMembers): Report protected
4834         members as error.
4835         
4836         * codegen.cs: if(ed) PRODUCTION.
4837         
4838         * convert.cs (Error_CannotImplicitConversion): Better error
4839         distinction.
4840         
4841         * cs-parser.jay: More error checks.
4842         
4843         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4844         
4845         * driver.cs (CSCParseOption): Enabled wrong option check.
4846         
4847         * ecore.cs (Expression.ExprClassName): Turned to property.
4848         (MemberExpr.CheckIntermediateModification): For checking boxed
4849         value types     modification.
4850         
4851         * statement.cs (Fixed.Resolve): Expression type must be
4852         convertible to fixed type.
4853         (CollectionForeach.GetEnumeratorFilter,TryType):
4854         Small refactoring for easier error checking.
4855
4856 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4857
4858         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4859         attributes.
4860         
4861         * class.cs (GeneratedBaseInitializer): New class for customization
4862         compiler generated initializers.
4863         (MemberBase.DoDefine): Check Obsolete attribute here.
4864         (FieldMember.DoDefine): Ditto.
4865         
4866         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4867         constants.
4868         
4869         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4870         (MemberCore.GetObsoleteAttribute): Removed argument.
4871         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4872         (MemberCore.CheckObsoleteType): New helper.
4873         
4874         * delegate.cs,
4875         * enum.cs,
4876         * statement.cs: Updates after MemberCore changes.
4877         
4878         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4879         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4880         
4881         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4882         obsolete attribute for compiler construct.
4883         (As.DoResolve): Cache result.
4884         
4885         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4886
4887 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4888
4889         Fix #76133.
4890         * expression.cs (This.VerifyFixed): In a value type T, the type of
4891         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4892         value type R, 'this' is treated as a value parameter.
4893
4894 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4895
4896         * statement.cs (Lock): Use the TemporaryVariable class instead of
4897         manually using local variables as those do not work when variables
4898         are captured.
4899
4900         * ecore.cs: Moved the TemporaryVariable class from being a nested
4901         class inside Foreach to be a public class that can be employed in
4902         other places. 
4903
4904 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4905
4906         * cs-parser.jay: interface_accessors replaced by
4907         accessor_declarations.
4908
4909         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4910         location.
4911         
4912         * statement.cs (GotoCase.Resolve): Convert null constant to
4913         null case.
4914         (SwitchLabel.ResolveAndReduce): Ditto.
4915         (SwitchLabel.NullStringCase): Custom null stamp.
4916         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4917         
4918         typemanager.cs (CSharpSignature): Don't skip first argument
4919         for full names.
4920
4921 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4922
4923         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4924
4925         * location.cs (InEmacs): in this mode, do not report column
4926         location as it confuses Emacs.
4927
4928 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4929
4930         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4931         expression.cs, iterators.cs, literal.cs: Store constants and
4932         literals location.
4933         
4934         * class.cs (MemberBase.ShortName): Pass location.
4935         
4936         * cs-parser.jay: Some location fixes.
4937         
4938         * ecore.cs (Expression.Location): Made virtual.
4939
4940 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4941
4942         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4943         if the underlying types are the same, otherwise we need to produce
4944         code that will do the proper cast.
4945
4946         This was exposed by Marek's constant rewrite which produced
4947         invalid code for the call site:
4948
4949         enum X : long { a }
4950         void Method (X v) {}
4951
4952         Method ((X) 5)
4953
4954         This fixes test-49.cs
4955
4956 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4957
4958         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4959           Type/Object should be allowed as well. Fixed bug #75968.
4960
4961 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4962
4963         * expression.cs : (Binary.DoResolve): when one is enum constant and
4964           another is constant 0, then return enum one *as enum type*.
4965           Fixed bug 74846.
4966
4967 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4968
4969         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4970         internal.
4971
4972         Fix #75941.
4973         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4974         flow-branching for LocalVariableReferences in case we were invoked
4975         from a MemberAccess.
4976         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4977         Carved out of ...
4978         (LocalVariableReference.DoResolveBase): ... this.
4979         (MemberAccess.Resolve): Do the check that was disabled during
4980         SimpleNameResolve.
4981
4982 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4983
4984         * class.cs :
4985           (PartialContainer.Create): check abstract/sealed/static strictly
4986           but abstract/sealed can exist only at one side. Fixed bug #75883.
4987
4988 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4989
4990         Fix #75945.
4991         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4992         specified, don't default to UnmanagedType.I4.
4993
4994 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4995
4996         * expression.cs : conditional operator should check possibly
4997           incorrect assign expression. Fixed bug #75946.
4998
4999 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5000
5001         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5002           Reverting the change. gmcs is much complex than mcs on this matter.
5003
5004 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5005
5006         * cs-tokenizer.cs : To read another token ahead of the actual 
5007           consumption, use new SavedToken and cache token instead of moving
5008           back the stream with SeekableStreamReader (it seemed problematic).
5009         * cs-parser.jay,
5010           driver.cs : Thus use StreamReader directly.
5011         * support.cs : Thus removed SeekableStreamReader.
5012
5013 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5014
5015         Fix #75934.
5016         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5017         (ScopeInfo.EmitScopeType): Use it to construct field names from
5018         names of captured locals.
5019
5020         Fix #75929.
5021         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5022         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5023         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5024         (ExplicitConversion): Remove enum cases already handled by
5025         implicit conversion.  Move implicit conversion check to the beginning.
5026         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5027         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5028         Don't treat System.Enum as a struct.
5029
5030 2005-08-30  Jb Evain  <jbevain@gmail.com>
5031
5032         * attribute.cs: handles as expression in parameters.
5033
5034 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5035
5036         Fix #75802.
5037         * class.cs (TypeContainer.VerifyClsName): Don't use a
5038         PartialContainer when verifying CLS compliance.
5039         (AbstractPropertyEventMethod): Set Parent here, ...
5040         (PropertyMethod): ... not here.
5041
5042 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5043
5044         * attribute.cs : escaped attribute name should not be allowed to be
5045           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5046
5047 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5048
5049         Fix #75927.
5050         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5051         when converting a long constant to unsigned long.
5052         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5053         detect where IsApplicable and VerifyArgumentsCompat disagree.
5054
5055 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5056         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5057
5058         Fix #75848.
5059         * class.cs (TypeContainer.CanElideInitializer): New helper.
5060         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5061         can safely emitting the initializer of a field.
5062
5063 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5064
5065         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5066           allowed inside a switch (without loop). Fixed bug #75433.
5067
5068 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5069
5070         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5071         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5072
5073 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5074
5075         * driver.cs : kinda reverting the default encoding changes (not exact 
5076           revert since I noticed that "codepage:reset" might not work fine).
5077
5078 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5079
5080         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5081           Location. Now getter and setter store location correctly.
5082           (errors/cs0111-12.cs now reports the expected location.)
5083
5084 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5085
5086         * driver.cs : Use default encoding on the environment.
5087           Removed (now that) extra parameter for SeekableStreamReader.
5088         * support.cs : (SeekableStreamReader) third .ctor() argument for
5089           StreamReader is not required (always true). preamble size could
5090           be acquired in simpler and safe way.
5091
5092 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5093
5094         * cs-parser.jay: report CS0642 at warning level 3
5095           and report CS0642 for an if else statement also
5096           fixes bug #74745. Patch by John Luke (and a bit
5097           modified by me).
5098           Removed extra CS0642 warning check for "while",
5099           "for" and "fixed".
5100         * statement.cs: In Block.Resolve(), CS0642 check
5101           is reimplemented to check a sequence of an empty
5102           statement and a block.
5103
5104           Both fix bug #66777.
5105
5106 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5107
5108         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5109         detection until I fix it.
5110         
5111         * cs-tokenizer.cs: Changed error message.
5112         
5113         * cs-parser.jay: Fixed 2 error locations.
5114         
5115         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5116         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5117         properties.
5118         
5119         * enum.cs (GetSignatureForError): Fixed.
5120         
5121         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5122         method detection.
5123         
5124         * class.cs,
5125         * typemanager.cs (RegisterProperty): Removed.
5126         
5127         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5128
5129 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5130
5131         Fix #75874.
5132         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5133         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5134
5135 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5136
5137         * expression.cs : tiny fix is required for not warning positive ulong.
5138           See test-441.cs.
5139
5140 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5141
5142         * expression.cs : add CS0652 check for constant and integral
5143           expression. Fixed bug #53974.
5144
5145 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5146
5147         * expression.cs : in DoNumericPromotions(), check if there is implicit
5148           conversion overload for string (to check CS0034). Fixed bug #52492.
5149
5150 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5151
5152         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5153
5154 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5155
5156         * ecore.cs : report location when it is *not* Null.
5157
5158 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5159
5160         * codegen.cs,
5161           ecore.cs,
5162           flowanalysis.cs,
5163           expression.cs:
5164           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5165           correctly. Fixed bug #75721.
5166
5167 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5168
5169         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5170         loop that performs 'min (pos, char_count)'.
5171
5172         Fix #75862.
5173         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5174         converted value in Operator.OnesComplement.
5175
5176 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5177
5178         * anonymous.cs: If the anon method is pulled into a helper class,
5179         it needs to be `internal' not `private'. Fixes runtime behavior on
5180         msft. bug #75704
5181
5182 2005-08-20  Martin Baulig  <martin@ximian.com>
5183
5184         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5185         scope if we don't already have it.
5186
5187         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5188         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5189         fixes #75867.
5190
5191 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5192
5193         Fix #75803
5194         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5195         is a partial class.
5196
5197 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5198
5199         The big constants rewrite
5200         Fix #75746, #75685 and more
5201         As a side effect saved 1MB for MWF ;-)
5202         
5203         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5204         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5205         enum based for corlib compilation.
5206         
5207         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5208         subtractions.
5209         
5210         * class.cs (FixedField.Define): Use ResolveAsConstant.
5211         
5212         * const.cs (IConstant): Interface constants and enums.
5213         (Const.ResolveValue): New method for constant resolvning.
5214         (ExternalConstant): Constants from imported assemblies.
5215         
5216         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5217         conversion; like enums.
5218         (Constant.ToType): Converts this constant to different type.
5219         (Constant.Increment): Adds 1.
5220         
5221         * convert.cs (ImplicitConversionRequired): Simplified.
5222         
5223         * cs-parser.jay: Create EnumMember directly.
5224         
5225         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5226         
5227         * doc.cs (GenerateEnumDocComment): Removed.
5228         
5229         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5230         (ConvertIntLiteral): Removed.
5231         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5232         
5233         * enum.cs (EnumMember): Implement IConstant.
5234         (Enum.IsValidEnumConstant): Removed.
5235         (Enum.GetNextDefaultValue): Removed.
5236         (Enum.FindMembers): Updated.
5237         (Enum.GenerateDocComment): Iterate enum members.
5238         
5239         * expression.cs (Cast.TryReduce): Handle enums correctly.
5240         (New.Constantify): Made public.
5241         (MemberAccess.DoResolve): Removed contant specific if(s).
5242         
5243         * literal.cs (NullLiteral): Implement new abstract methods.
5244         
5245         * statement.cs (GotoCase.Resolve): Use new constant methods.
5246         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5247         
5248         * typemanager.cs (LookupEnum): Removed.
5249         (IsEnumType): Fixed to work with corlib.
5250         (RegisterConstant): Removed.
5251         (LookupConstant): Removed.
5252         (GetConstant): Changed to work with IConstant.
5253
5254 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5255
5256         * location.cs : Fixed overflown (>255) column number.
5257
5258 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5259
5260         First cut of the qualified-alias-member feature.
5261         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5262         token.
5263         * cs-parser.jay (DOUBLE_COLON): New token.
5264         (namespace_or_type_name): Add rule for recognizing
5265         qualified-alias-members.
5266         (primary_expression): Likewise.
5267         (element_access): Allow QualifiedAliasMember as a possible
5268         type-bearing expression.
5269         (local_variable_type, local_variable_pointer_type): Likewise.
5270         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5271         aliases in the current and enclosing namespace declarations.
5272         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5273         * decl.cs (MemberName.is_double_colon): New.
5274         (MemberName.MemberName): Add new constructor for alias-member.
5275         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5276         * expression.cs (QualifiedAliasMember): New expression type.
5277
5278 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5279
5280         * location.cs : it borked when no argument was specified.
5281
5282 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5283
5284         * location.cs : tiny ToString() format fix.
5285
5286 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5287
5288         * statement.cs : oops, it was missing.
5289
5290 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5291
5292         A set of fixes for precise line/column location.
5293
5294         * location.cs :
5295           "token" field now holds a file/line "delta", a line number offset 
5296           from the segment, and a column number. See also:
5297           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5298           December/009508.html
5299           Removed static IsNull. Use instance IsNull property instead.
5300         * cs-tokenizer.cs :
5301           For some tokens it stores Location. For Identifier it stores
5302           LocatedToken which is a pair of string name and location.
5303           Column numbers are adjusted only at getChar().
5304         * report.cs :
5305           Use Location.ToString() for reporting (it now contains column).
5306         * cs-parser.jay :
5307           Largely modified to use LocatedToken instead of
5308           string (IDENTIFIER), and to acquire Location from some tokens.
5309         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5310           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5311           codegen.cs :
5312           Now MemberName holds Location. DeclSpace.ctor() receives Location
5313           as a parameter. Removed extra parameters to all derived classes.
5314           Replaced Location.IsNull() with instance property.
5315         * assign.cs, expression.cs :
5316           Added .ctor() overload that omits Location.
5317         * attribute.cs :
5318           Added "nameEscaped" flag that indicates the identifier was escaped
5319           in the source file. This fixes bug #57047.
5320
5321 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5322
5323         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5324         New method, looking for lo-case imported cls type.
5325
5326         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5327         here.
5328
5329         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5330
5331         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5332
5333         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5334         all_imported_types.
5335         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5336
5337         Optimized to save 3.5 MB for SWF compilation.
5338
5339 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5340
5341         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5342         (PartialContainer.Create): Moved logic AddToContainer.
5343         (PartialContainer.MarkForDuplicationCheck): Shares name.
5344         
5345         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5346         place.
5347         
5348         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5349         initialization.
5350         (Namespace.GetSignatureForError): New method.
5351         
5352         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5353         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5354
5355 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5356
5357         Fix #75669.
5358         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5359         member lookup rather than qualifier_type, since qualifier_type can
5360         be null.
5361
5362 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5363
5364         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5365         enum member.
5366
5367 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5368
5369         * statement.cs: Copy the local exception into the exception
5370         captured local.  Fixes 75674
5371
5372 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5373
5374         Fix #75658.
5375         * expression.cs (Invocation.OverloadResolve): Don't report error
5376         CS1501 if error CS1502 has been reported.
5377         (New.DoResolve): Delegate CS1501 reporting to
5378         Invocation.OverloadResolve.
5379
5380         Fix #75656.
5381         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5382         invariant-meaning-in-block property in an enclosing block if
5383         necessary.
5384
5385 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
5386
5387         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5388         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5389         (Switch.CheckSwitch): Just save 50kb for SWF.
5390
5391 2005-07-27  Martin Baulig  <martin@ximian.com>
5392
5393         * anonymous.cs (CaptureContext.AddField): Added
5394         `AnonymousContainer am' argument; compute its toplevel scope if
5395         it's not already computed.  Fixes #75649.
5396
5397 2005-07-26  Raja R Harinath  <rharinath@novell.com>
5398
5399         Fix #75628.
5400         * class.cs (Constructor.Emit): Reset block to null if the block
5401         resolve fails.
5402
5403 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5404
5405         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5406
5407 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5408
5409         * class.cs (MethodData.Define): Check whether accessor implementing
5410         interface is public.
5411
5412         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5413
5414 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
5415
5416         Fix #57245
5417         * namespace.cs (LookupType): Moved same type check to...
5418         
5419         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5420         with the same name.
5421
5422 2005-07-21  Raja R Harinath  <rharinath@novell.com>
5423
5424         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5425         already found a typebuilder.
5426         * class.cs (MethodCore.IsDuplicateImplementation): Compare
5427         MemberNames, not strings.
5428
5429         * const.cs (Error_ExpressionMustBeConst): 
5430         Rename from Error_EpressionMustBeConst.
5431         * const.cs, class.cs, statement.cd: Update.
5432
5433 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
5434
5435         Fix #65573
5436
5437         * const.cs (Const.LookupConstantValue): Report missing contant expression
5438         everytime.
5439         (Error_EpressionMustBeConstant): Only one error method.
5440
5441         * class.cs, statement.c: Updated.
5442
5443 2005-07-20  Raja R Harinath  <rharinath@novell.com>
5444
5445         * statement.cs (Block.Flags): Add back HasVarargs.
5446         (Block.flags): Make protected.
5447         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5448
5449         * typemanager.cs (types, typecontainers, user_types): Remove.
5450         (UserTypes, TypeContainers): Likewise.
5451         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5452         (CleanUp, Reset): Update.
5453         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
5454         (GetNestedType): Use Type.GetNestedType.
5455         (CoreLookupType): Take two arguments, the namespace and the
5456         basename of the type.  Update to use the Namespace.Lookup
5457         mechanism.
5458         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5459         (RealMemberLookup): Use IsNestedChildOf instead of playing with
5460         string concatenation and substring matches.
5461         * class.cs, enum.cs, delegate.cs: Update to changes.
5462
5463 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5466         Expression and made virtual.
5467
5468         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5469         (ImplicitStandardConversionExists): Fixed `byte' typo ?
5470
5471         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5472
5473         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5474         error message.
5475
5476         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5477         change.
5478
5479 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
5480
5481         Fix #57707
5482         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5483         AssemblyCultureAttribute is not used on executable.
5484
5485         * rootcontext.cs,
5486         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5487
5488 2005-07-16  Raja R Harinath  <rharinath@novell.com>
5489
5490         Fix #60638.
5491         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5492         New.  Reports CS0252/CS0253.
5493         Mostly taken from preliminary patch by Duncak Mak.
5494         (Binary.DoResolveOperator): Store results of operator lookup.
5495         Use them to detect if we need to warn about unintended reference
5496         comparisons.
5497
5498 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5499
5500         Fix #72969.
5501         * namespace.cs (Namespace.Lookup): Add back location parameter.
5502         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
5503         * delegate.cs, ecore.cs, expression.cs: Update to changes.
5504
5505         * codegen.cs (EmitContext.DeclSpace): Make readonly.
5506         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5507         (Namespace.LookupType): ... this.
5508         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5509         of namespaces.
5510         * typemanager.cs (LookupTypeReflection): Remove buggy code that
5511         purported to handle pointers.
5512         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5513         CoreLookupType.
5514
5515 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
5516
5517         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5518         type as namespace.
5519
5520 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5521
5522         * namespace.cs (Namespace.Lookup): Drop location parameter.
5523         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
5524         (NamespaceEntry.Lookup): ... this.
5525         (NamespaceEntry.Error_AmbiguousTypeReference):
5526         Move here from DeclSpace.
5527         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5528         names ...
5529         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5530         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5531         Move to NamespaceEntry.
5532         * delegate.cs, expression.cs: Update to changes.
5533
5534 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
5535
5536         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5537         CheckAttributeType and refactored.
5538         (Attribute.ResolvePossibleAttributeType): Changed to reuse
5539         ResolveAsTypeTerminal error handling.
5540         (ResolveAsTypeTerminal): Introduced because of global attributes extra
5541         handling.
5542         (GetSignatureForError): Print errors in same way.
5543
5544         * class.cs,
5545         * codegen.cs: Reflect attribute GetSignatureForError change.
5546
5547         * ecore.cs,
5548         * expression.cs: Add silent parameter to ResolveAsTypeStep.
5549
5550         * namespace.cs (UsingEntry): Refactored to make fields private.
5551
5552         * assign.cs,
5553         statement.cs: Error_UnexpectedKind has extra parameter.
5554
5555 2005-07-14  Raja R Harinath  <rharinath@novell.com>
5556
5557         * ecore.cs (IAlias): Remove.
5558         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
5559         that implement the interface.
5560         * namespace.cs (Namespace): Likewise.
5561         (Namespace.declspaces): Renamed from 'defined_names'.
5562         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
5563         DeclSpace instead of an IAlias.
5564         * tree.cs (Tree.AddDecl): Update.
5565
5566 2005-07-12  Raja R Harinath  <rharinath@novell.com>
5567
5568         * statement.cs (Block.Flags); Remove HasVarargs.
5569         (Block.HasVarargs): Move to ToplevelBlock.
5570         (Block.ThisVariable, Block.AddThisVariable): Likewise.
5571         (Block.Variables): Make protected.  Initialize variable hashtable
5572         if necessary.
5573         (Block.AddVariable): Update.
5574         (Block.Resolve): Update to changes.
5575         (ToplevelBlock.HasVarargs): New boolean.
5576         (ToplevelBlock.ThisVariable): Move here from Block.
5577         (ToplevelBlock.AddThisVariable): Likewise.
5578         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
5579         * expression.cs (This.ResolveBase): Update to changes.
5580         (ArglistAccess.DoResolve): Likewise.
5581
5582 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5583
5584         Fix #75321
5585         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5586
5587         * class.cs (TypeContainer.VerifyMembers): Distinguish between
5588         not used and not used & assigned.
5589         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5590
5591 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5592
5593         Fix #75053
5594         * expression.cs (Is.DoResolve): null is never provided type.
5595
5596 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5597
5598         Fix #52496
5599         * cs-parser.jay: Less strict event error rule to catch more errors.
5600
5601 2005-07-08  Martin Baulig  <martin@ximian.com>
5602
5603         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5604         gettter (allowed) or setter (not allowed).
5605
5606         * class.cs (Accessor): Implement IIteratorContainer.
5607         (Accessor.Yields): New public field.
5608         (PropertyBase.PropertyMethod.Define): Handle iterators on a
5609         per-accessor basis.
5610
5611         * cs-parser.jay
5612         (get_accessor_declaration, set_accessor_declaration): Set the
5613         `yields' flag on the accessor, not the property.
5614         (property_declaration): Do the iterators check on a per-accessor
5615         basis and not for the whole property.
5616
5617 2005-07-08  Martin Baulig  <martin@ximian.com>
5618
5619         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5620         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5621
5622 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
5623
5624         Fix #74975
5625         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5626         (ExtractSecurityPermissionSet): Cope with self referencing security
5627         attributes properly.
5628
5629         * driver.cs (SetOutputFile): Made public property OutputFile.
5630
5631 2005-07-07  Raja R Harinath  <rharinath@novell.com>
5632
5633         Fix #75486.
5634         * class.cs (TypeContainer.first_nonstatic_field): Rename from
5635         has_nonstatic_fields.  Make into a FieldBase pointer.
5636         (TypeContainer.AddField): Add CS0282 check.
5637         (TypeContainer.EmitType): Update.
5638
5639 2005-07-06  Miguel de Icaza  <miguel@novell.com>
5640
5641         * cs-tokenizer.cs (consume_identifier): Do not create strings to
5642         compare if they start with __.
5643
5644 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5645
5646         * statement.cs (Switch.SwitchGoverningType): Only look at
5647         UserCasts that don't need implicit standard conversions to one of
5648         the allowed switch types (Fixes test-322.cs).
5649         (LocalInfo.Resolve): Re-enable sanity-test.
5650
5651 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
5652
5653         * cs-tokenizer.cs (consume_identifier): Detect double undescores
5654         
5655         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5656         
5657         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5658
5659 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5660
5661         Fix #75472.
5662         * ecore.cs (SimpleName.GetSignatureForError): Add.
5663         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5664         (MemberAccess.GetSignatureForError): Add.
5665
5666 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5667  
5668         The big error and warning messages review.
5669         
5670         * anonymous.cs,
5671         * assign.cs,
5672         * attribute.cs,
5673         * class.cs,
5674         * codegen.cs,
5675         * convert.cs,
5676         * cs-parser.jay,
5677         * cs-tokenizer.cs,
5678         * decl.cs,
5679         * delegate.cs,
5680         * doc.cs,
5681         * driver.cs,
5682         * ecore.cs,
5683         * enum.cs,
5684         * expression.cs,
5685         * flowanalysis.cs,
5686         * iterators.cs,
5687         * literal.cs,
5688         * location.cs,
5689         * modifiers.cs,
5690         * namespace.cs,
5691         * parameter.cs,
5692         * pending.cs,
5693         * report.cs,
5694         * rootcontext.cs,
5695         * statement.cs,
5696         * support.cs,
5697         * tree.cs,
5698         * typemanager.cs: Updated.
5699         
5700         * class.cs: (MethodCore.SetYields): Moved here to share.
5701         (PropertyMethod.Define): Moved iterator setup here.
5702         
5703         * iterators.cs: Add orig_method to have full access to parent
5704         container.
5705
5706 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5707
5708         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5709         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5710         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5711         variable of struct type.
5712         * expression.cs (Unary.ResolveOperator): Update to change.
5713         (Indirection.VerifyFixed): Likewise.
5714         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5715         (ParameterReference.VerifyFixed): Value parameters are fixed.
5716         (This.VerifyFixed): Treat 'this' as a value parameter.
5717         * statement.cs (LocalInfo.IsFixed): Remove.
5718
5719 2005-07-01  Martin Baulig  <martin@ximian.com>
5720
5721         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5722         `ec.EmitThis ()' to get the correct scope.
5723
5724 2005-07-01  Martin Baulig  <martin@ximian.com>
5725
5726         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5727         instance is a ParameterReference; fixes #75299.
5728
5729 2005-07-01  Martin Baulig  <martin@ximian.com>
5730
5731         Reverted Marek's latest patch (r46725):
5732         - it contains structural changes which are neither mentioned in
5733           the ChangeLog nor explained anywhere; for example the additional
5734           argument of EmitContext's and Iterator's .ctor's and the
5735           TypeContainer.DefineMembers() change.
5736         - structural changes like this should go in in seperate patches
5737           and not be hidden in a huge patch which just seems to affect
5738           warnings and errors.
5739           a big and hard to understand patch.
5740         - it breaks iterators and causes regressions, for instance in
5741           test-iter-03.cs.      
5742
5743 2005-06-30  Raja R Harinath  <rharinath@novell.com>
5744
5745         Fix #75412.
5746         * expression.cs (Indexers.map): Remove.
5747         (Indexers.Append): Filter out inaccessible setters and getters.
5748         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5749
5750         Fix #75283.
5751         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
5752         Refactored from ...
5753         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5754         (FieldExpr.Emit, PropertyExpr.Emit): Update.
5755         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5756         * expression.cs (Invocation.EmitCall): Add CS0120 check.
5757
5758 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
5759
5760         Fix #75322
5761         * class.cs (FieldBase.GetInitializerExpression): One more field
5762         for backup.
5763
5764 2005-06-28  Miguel de Icaza  <miguel@novell.com>
5765
5766         * pending.cs: Do not define a proxy if the base method is virtual,
5767         it will be picked up by the runtime (bug 75270).
5768
5769 2005-06-08  Martin Baulig  <martin@ximian.com>
5770
5771         The big Iterators rewrite :-)
5772
5773         * iterators.cs: Rewrite this to use the anonymous methods framework.
5774
5775         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5776         before the TypeContainers; see 2test-21.cs.
5777
5778         * class.cs
5779         (TypeContainer.DefineType): Don't create a new EmitContext if we
5780         already have one (this only happens if we're an Iterator).
5781         (TypeContainer.Define): Also call Define() on all our iterators.
5782         (Method.CreateEmitContext): Added support for iterators.
5783
5784         * anonymous.cs
5785         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5786         (AnonymousContainer.CreateMethodHost): Moved here from
5787         AnonymousMethod and made abstract.
5788         (AnonymousContainer.CreateScopeType): New abstract method.
5789         (AnonymousContainer.IsIterator): New public property.
5790         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5791         get the ScopeTypeBuilder rather than manually defining it here. 
5792         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5793         iterators here.
5794
5795         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5796         before RootContext.DefineTypes().
5797
5798         * codegen.cs (EmitContext.RemapToProxy): Removed.
5799         (EmitContext.CurrentAnonymousMethod): Changed type from
5800         AnonymousMethod -> AnonymousContainer.
5801         (EmitContext.ResolveTopBlock): Protect from being called twice.
5802         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5803         (EmitContext.EmitThis): Removed the iterators hacks; use the
5804         anonymous methods framework for that.
5805
5806         * statement.cs
5807         (ToplevelBlock.Container): Make this a property, not a field.
5808         (ToplevelBlock.ReParent): New public method; move the
5809         ToplevelBlock into a new container.
5810         (Foreach.TemporaryVariable): Simplify.
5811
5812 2005-06-05  Martin Baulig  <martin@ximian.com>
5813
5814         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5815         (Block.AddTemporaryVariable): New public method; creates a new
5816         `LocalInfo' for a temporary variable.
5817         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5818         variables here.
5819         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5820         non-iterator variables.
5821
5822 2005-06-05  Martin Baulig  <martin@ximian.com>
5823
5824         * statement.cs (Foreach.TemporaryVariable): Create the
5825         LocalBuilder in the Emit phase and not in Resolve since in some
5826         situations, we don't have an ILGenerator during Resolve; see
5827         2test-19.cs for an example.
5828
5829 2005-06-04  Martin Baulig  <martin@ximian.com>
5830
5831         **** Merged r45395 from GCS ****
5832
5833         The big Foreach rewrite - Part II.
5834
5835         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5836         with `PropertyInfo ienumerator_getcurrent'.
5837
5838         * codegen.cs (VariableStorage): Removed.
5839
5840         * statement.cs
5841         (Foreach): Derive from Statement, not ExceptionStatement.
5842         (Foreach.CollectionForeach): New nested class.  Moved all the code
5843         dealing with collection foreach here.
5844         (Foreach.ForeachHelperMethods): Removed.
5845         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5846
5847 2005-05-23  Martin Baulig  <martin@ximian.com>
5848
5849         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5850         don't need to.  Fix #75014.
5851
5852 2005-05-20  Martin Baulig  <martin@ximian.com>
5853
5854         Merged r44808 from GMCS.
5855
5856         * class.cs (TypeContainer.CircularDepException): Removed.
5857         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5858         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5859         (CS0146) and interface (CS0529) dependencies here.
5860
5861 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5862
5863         * expression.cs (Invocation.EmitCall): Fix initialization
5864         'this_call' to reflect current behaviour.  Fix indentation.
5865
5866         * convert.cs (FindMostEncompassedType): Add two trivial special
5867         cases (number_of_types == 0 || number_of_types == 1).
5868         (FindMostEncompasingType): Likewise.
5869
5870 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5871
5872         Some cleanups preparing for the fix of #75283.
5873         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5874         error testing.
5875         (EventExpr.InstanceResolve): Likewise.
5876         (EventExpr.DoResolve): Remove redundant checks.
5877
5878 2005-06-10  Duncan Mak  <duncan@novell.com>
5879
5880         * cs-tokenizer.cs (process_directives): New flag for controlling
5881         the processing of preprocessor directives.
5882         (x_token): After seeing a '#', return Token.NONE instead of going
5883         to handle_preprocessing_directive() when not processing
5884         directives. This avoids unnecessary processing during the token peek in
5885         is_punct().
5886
5887         This fixes #74939.
5888
5889         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5890         the existing error reporting methods instead of Report.Error.
5891
5892         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5893         after Raja's rewrite.
5894
5895 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5896
5897         * class.cs: Small fix.
5898
5899 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5900
5901         Fix #75160.
5902         * class.cs (GetPartialBases): Fix return value check of
5903         part.GetClassBases.
5904
5905 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5906
5907         Ensure that partial classes are registered in their enclosing
5908         namespace.  Initial part of fix of #75160.
5909         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5910         Register declspace with namespace here, not in
5911         DeclSpace.RecordDecl.
5912         * cs-parser.jay: Pass namespace to RecordDecl.
5913         * class.cs (PartialContainer.Create): Likewise.
5914         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5915         called.
5916         * decl.cs (Declspace.RecordDecl): Remove.
5917         * namespace.cs (NamespaceEntry.DefineName): Remove.
5918
5919 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5920
5921         * rootcontext.cs: Reset TargetExt as well.
5922
5923 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5924
5925         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5926         -langversion:ISO-1.
5927
5928 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5929
5930         Fix #75080, cs0119.cs.
5931         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5932         of ...
5933         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5934         allowing ExprClass.Type and ExprClass.Namespace for
5935         ResolveFlags.VariableOrValue.
5936         (Expression.Resolve) [1-argument variant]: Change default resolve
5937         flags based on language version.
5938         (Expression.Error_UnexpectedKind): Use a simple string array
5939         rather than an ArrayList.
5940         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5941         not ExprClass.Type.
5942         (TypeOfVoid.DoResolve): Likewise.
5943         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5944         flags argument -- it always has the same value.
5945
5946 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5947
5948         Fix #75081.
5949         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5950         Use it in the error message.
5951         * assign.cs, expression.cs, statement.cs: Update.
5952
5953 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5954
5955         Fix #75088.
5956         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5957         the "almostMatchedMember" case too.
5958         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5959         that failed the accessibility checks to 'almost_match'.
5960
5961 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5962
5963         * attribute.cs: Use internal MethodBuilder methods to set
5964         ExactSpelling and SetLastError on PInvoke methods, instead
5965         of passing them via charset.  Fixes #75060.
5966
5967 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5968
5969         * parameter.cs (Parameter): Remove TODO comment.
5970         (Parameter.DefineParameter): Remove Location parameter.
5971         (Parameters.LabelParameters): Likewise.
5972         * class.cs (Constructor.Emit): Update to change.
5973         (MethodData.Emit): Likewise.
5974         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5975         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5976
5977 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5978
5979         * parameter.cs,
5980           Removed Parameters.Location and added Parameter.Location instead.
5981           Removed Location parameter from Emit() and GetSignature().
5982         * anonymous.cs,
5983           class.cs,
5984           cs-parser.jay,
5985           delegate.cs,
5986           iterators.cs,
5987           statement.cs :
5988           Modified all related calls.
5989
5990 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5991
5992         Improve user-defined conversion handling.
5993         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5994         applicable operators.
5995         (AddConversionOperators): New.  Helper for GetConversionOperators.
5996         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5997         there is only one most encompassed/encompassing type.
5998         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5999         "applicable operator" handling.
6000         (UserConversion): Move cache here from GetConversionOperators.
6001         Directly cache the chosen operator, rather than the whole
6002         MethodGroup.
6003         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6004         case.  Allow conversion of decimal to sbyte and byte too.
6005         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6006         New static methods.  Used to avoid allocating EmptyExpressions in
6007         convert.cs.
6008
6009 2005-05-24  Duncan Mak  <duncan@novell.com>
6010
6011         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6012         another class, used in Convert.ExplicitNumericConversion.
6013         (CastToDecimal): New class, similar to above, but casts to
6014         System.Decimal, used in Convert.ImplicitNumericConversion and also
6015         in explicit convesion from double/float to decimal.
6016
6017         * convert.cs (ImplicitNumericConversion): Handle implicit
6018         conversions to System.Decimal.
6019         (ExplicitNumericConversion): handle explicit conversions to
6020         System.Decimal.
6021
6022         This fixes #68711.
6023         
6024 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6025
6026         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6027         know the type at this stage, just break through.   Fixes #75008 
6028
6029 2005-05-19  Martin Baulig  <martin@ximian.com>
6030
6031         * delegate.cs
6032         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6033         to disable error reporting.
6034
6035         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6036         here since we don't want to report an error; see the new test-336.cs.
6037
6038 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6039
6040         * statement.cs (ToplevelBlock.GetParameterReference)
6041         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6042         Move here from class Block.
6043         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6044         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6045
6046 2005-05-18  Martin Baulig  <martin@ximian.com>
6047
6048         Fix #74978.
6049
6050         * flowanalysis.cs
6051         (FlowBranching.Reachability): Add non-static public And() and Or()
6052         methods.
6053         (FlowBranchingSwitch): New class; do the `break_origins' thing
6054         like in FlowBranchingLoop.
6055         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6056         reachability, not just locals and parameters.
6057         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6058         switch; MergeBreakOrigins() now takes care of that.
6059
6060 2005-05-18  Martin Baulig  <martin@ximian.com>
6061
6062         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6063         a loop and may leave it, reset the barrier; fixes #74974.
6064
6065 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6066         
6067         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6068         is back.
6069         
6070         * cs-parser.jay: Catch more lexical errors.
6071         
6072         * report.cs: Add one more Error method.
6073         
6074         * rootcontext.cs,
6075         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6076
6077 2005-05-17  Martin Baulig  <martin@ximian.com>
6078
6079         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6080         #70970. 
6081
6082 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6083
6084         Fix test-382.cs.  Emit values of decimal constants.
6085         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6086         Carved out of ...
6087         (TypeContainer.AddField): ... this.
6088         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6089         with initializers to include 'Const's.
6090         (ClassPart.RegisterFieldForInitialization): Forward to
6091         PartialContainer.
6092         * const.cs (Const.Const): Pass initializer to base class.
6093         (Const.Define): In case of decimal constants, register them for
6094         initialization in a static constructor.
6095
6096 2005-05-14  Martin Baulig  <martin@ximian.com>
6097
6098         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6099         do not call ResolveUnreachable() on unreachable statements in
6100         here, see the comment in the source code.
6101
6102 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6103
6104         Fix #74934.
6105         * expression.cs (BinaryResolveOperator): If one of the operands of
6106         an equality comparison is 'null' and the other is a pointer type,
6107         convert the null to a NullPointer.
6108         * convert.cs (ImplicitReferenceConversion): If the expression is a
6109         NullLiteral and the target type is a pointer type, return a
6110         NullPointer instead.
6111         (ImplicitConversionStandard): Likewise.
6112
6113 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6114         
6115         * cs-parser.jay: Set readonly context based on special constructs.
6116         
6117         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6118         readonly variable error handling.
6119         
6120         * rootcontext.cs (EmitCode): Don't verify members when error
6121         occurred.
6122         
6123         * statement.cs (LocalInfo): Add reaodnly context information.
6124         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6125
6126 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6127
6128         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6129         for #74041 to initialize 'resolved' to false only for explicit
6130         blocks.  Fixes #74873.
6131
6132 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6133
6134         Fix #74920.
6135         * typemanager.cs (unmanaged_enclosing_types): New.
6136         (IsUnmanagedType): Avoid infloops by using
6137         'unmanaged_enclosing_types' to talk with recursive invocations.
6138
6139 2005-05-13  Martin Baulig  <martin@ximian.com>
6140
6141         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6142         instance variable, not a local.  Fix #74873.
6143         (Block.ResolveUnreachable): Set it to true here.
6144
6145 2005-05-11  Duncan Mak  <duncan@novell.com>
6146
6147         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6148         continuing to process for 'arg'.
6149         (handle_preprocessing_directive): Check the argument of the #endif
6150         directive and report error CS1025 if there are any trailing
6151         characters.
6152
6153         According to the C# spec, having even whitespace after the #endif
6154         directive is illegal; however, because we call arg.TrimEnd ()
6155         beforehand, we have the same behavior as csc, allowing whitespace
6156         after the directive.
6157
6158         Fixes #74892.
6159
6160 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6161
6162         Fix #74863.
6163         
6164         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6165         (Constructor.GetObsoleteAttribute): Implemented correctly.
6166
6167 2005-05-10  Martin Baulig  <martin@ximian.com>
6168
6169         * support.cs (ReflectionParameters.ParameterModifier): Use
6170         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6171         and `ParameterAttributes.In'.  Fixes #74884.
6172
6173 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6174
6175         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6176         
6177         * expression.cs (Argument.GetParameterModifier): Turned to property.
6178         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6179         
6180         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6181         its C# equivalent.
6182         
6183 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6184
6185         Fix #74852.
6186         * decl.cs (MemberCache.AddMethods): Register override methods,
6187         rather than non-override methods.
6188         * typemanager.cs (RegisterOverride): New.
6189         (IsOverride): Update.
6190
6191 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6192
6193         Fix #73105.
6194         
6195         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6196         recursive declaration.
6197         
6198         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6199         
6200 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6201
6202         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6203         
6204         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6205
6206 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6207
6208         Fix #74797.
6209         * decl.cs (DeclSpace.FamilyAccessible): 
6210         Use TypeManager.IsNestedFamilyAccessible.
6211
6212         Fix reopened #64812.
6213         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6214         internal'.
6215
6216 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6217             Abin Thomas  <projectmonokochi@rediffmail.com>
6218             Anoob V E  <projectmonokochi@rediffmail.com>
6219             Harilal P R  <projectmonokochi@rediffmail.com>
6220
6221         Fix #64812.
6222         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6223         allow access to all static members.
6224
6225 2005-05-04  Martin Baulig  <martin@ximian.com>
6226
6227         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6228
6229 2005-05-04  Martin Baulig  <martin@ximian.com>
6230
6231         Fix #74655.
6232
6233         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6234         section at the end; make things work if `default' is not the last
6235         section.        
6236
6237 2005-05-04  Martin Baulig  <martin@ximian.com>
6238
6239         Fix #70400.
6240
6241         * statement.cs (Switch): Replaced the `got_default' field with a
6242         `default_section' one.
6243         (Switch.CheckSwitch): Set `default_section' here.
6244         (Switch.Resolve): If we're a constant switch and the constant is
6245         not found, use the default section.
6246
6247 2005-05-03  Martin Baulig  <martin@ximian.com>
6248
6249         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6250
6251         * statement.cs (Foreach.ArrayForeach): New nested class.
6252         (Foreach.TemporaryVariable): New nested class.
6253         (Foreach.EmitArrayForeach): Removed; this is now in the new
6254         ArrayForeach class.
6255
6256 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6257
6258         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6259         more conservative.
6260         (VerifyPendingMethods): Revert change below.
6261
6262         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6263         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6264         that used to trigger warning -28.  Remove warning -28.
6265         * expression.cs (Invocation.OverloadResolve): Use
6266         TypeManager.IsOverride to distinguish override methods.
6267
6268         Fix #74773.
6269         * pending.cs (VerifyPendingMethods): If a base type implements the
6270         requested interface, don't bother checking individual methods of
6271         the base type.  As a side-effect, this prevents the creation of
6272         unnecessary proxies.
6273
6274 2005-05-02  Martin Baulig  <martin@ximian.com>
6275
6276         Fix #70182.
6277
6278         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6279         Also `And' the locals if the old vector is null.
6280         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6281         null; in this case we basically reset all the variables.        
6282
6283 2005-05-02  Martin Baulig  <martin@ximian.com>
6284
6285         Fix #74529.
6286
6287         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6288         Added `FlowBranching branching' argument; always `and' the
6289         variables instead of `or'ing them unless we're an infinite loop.
6290
6291         * statement.cs (While.Resolve): Create a new sibling unless we're
6292         infinite.       
6293
6294 2005-05-02  Martin Baulig  <martin@ximian.com>
6295
6296         Fix #70140.
6297
6298         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6299         arguments; use it instead of creating a new TopLevelBlock.
6300         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6301         our ConstructorInitializer.
6302
6303         * statement.cs
6304         (TopLevelBlock.TopLevelBranching): New public property.
6305         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6306         and create our `TopLevelBranching'.
6307
6308         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6309         anonymous method host, use `block.TopLevelBranching' rather than
6310         creating a new branching.
6311
6312 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6313
6314         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6315         a ScopeInfo, if any of the current children is a child of the new
6316         entry, move those children there.
6317
6318 2005-04-30  Martin Baulig  <martin@ximian.com>
6319
6320         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6321         at the beginning of a SwitchSection.  Fix #73335.
6322
6323 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6324
6325         Fix #74378
6326         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6327         
6328         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6329         (FieldExpr.DoResolve): Obsolete members are ignored for field
6330         initializers.
6331         
6332 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6333
6334         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6335         of arrays detection.
6336
6337         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6338         verification.
6339         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6340
6341         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6342         arrays report.
6343
6344 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6345
6346         * cs-parser.jay: Use the prefered version of -unsafe in error
6347         message.
6348
6349 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6350
6351         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6352         circumstances.
6353
6354 2005-04-20  John Luke  <john.luke@gmail.com>
6355
6356         * driver.cs: fix typo in error message, --outout to --output
6357
6358 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6359
6360         * codegen.cs (InRefOutArgumentResolving): New field.
6361         
6362         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6363         fields outside contructor.
6364         
6365         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6366         
6367 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6368
6369         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6370         parameter code was not completed ever, so it was not as up-to-date
6371         as local variables.  Must finish it.
6372
6373         The bug fix was to compare the Toplevel of the block, not the
6374         current block.  Thanks for Ben for pointing this out. 
6375
6376 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6377
6378         * decl.cs (AddMethods): Use the declaring type of the problem
6379         method to determine if we want to squash a warning.
6380
6381 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
6382
6383         * attribute.cs: Removed debug output.
6384
6385         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6386         
6387         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6388         Report.Stderr.
6389         
6390 2005-04-18  Raja R Harinath  <rharinath@novell.com>
6391
6392         Fix #74481.
6393         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6394         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6395         all null comparisons against reference types.
6396
6397 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
6398
6399         Fix# 74565
6400         * class.cs (TypeContainer.CircularDepException) New nested
6401         exception class.
6402         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6403         (TypeContainer.DefineType): Removed error, reset InTransit before
6404         exit.
6405         (Class.DefineType): Throw exception when is in Transit.
6406         Catch exception and report error.
6407         (Struct.DefineType): Throw exception when is in Transit.
6408         Catch exception and report error.
6409         (Interface.DefineType): Throw exception when is in Transit.
6410         Catch exception and report error.
6411
6412         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6413         handle nested exception handlers.
6414
6415         * flowanalysis.cs (InTryWithCatch): New method, search for try with
6416         a catch.
6417
6418         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6419         InFinally and InCatch storage.
6420
6421         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6422         (Catch.Resolve): Set and Restore ec.InCatch.
6423         (Try.Resolve): Set and Restore ec.InFinally.
6424         (Try.HasCatch): True when try has catch.
6425
6426 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
6427
6428         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6429           for the same event member, so exclude such cases from warning 419.
6430           Fixed bug #74633.
6431
6432 2005-04-16  Miguel de Icaza  <miguel@novell.com>
6433
6434         * expression.cs (Binary.ResolveOperator): Apply patch from John
6435         Luke to fix bug 59864: operators &, | and ^ on enumerations
6436         require that the same enum type on both sides.
6437
6438         * driver.cs: Add warnings to old flag usage, this is to assist
6439         people who produce Makefiles and hope that the Makefiles will be
6440         used on Windows.
6441
6442         * class.cs (TypeContainer.EmitType): Moved the definition of the
6443         special $PRIVATE$ field from the resolve phase to the Emit phase.
6444         During resolve we do not know if we are a struct with
6445         HasExplicitLayout, we know this only after the attributes for the
6446         type are emitted.
6447
6448         Set the FieldOffset to zero on the dummy field that we create for
6449         the class.   Fixes 74590.
6450
6451 2005-04-16  Raja R Harinath  <rharinath@novell.com>
6452
6453         Fix #73834.
6454         * ecore.cs (PropertyExpr.resolved): New.
6455         (DoResolve): Use it to handle a case of double resolution here.
6456         Handle a case of identical-name-and-type-name.
6457         * expression.cs (ArrayCreation.CheckIndices): Avoid double
6458         resolution by storing the results of expression resolution back
6459         into the "probes" array.
6460
6461 2005-04-15  Raja R Harinath  <rharinath@novell.com>
6462
6463         Fix cs0208-7.cs and cs0208-8.cs.
6464         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6465         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
6466         error reporting to point out the reason a struct is not unmanaged.
6467
6468 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6469
6470         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
6471           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6472
6473 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6474
6475         Fix #74528.
6476         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6477         IdenticalNameAndTypeName here.
6478         (EventExpr.InstanceResolve): Likewise.
6479
6480 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
6481
6482         C# 2.0 DefaultCharSetAttribute implementation
6483         
6484         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6485         which allows us to set GlobalNamespace for every resolve.
6486         (Attribute.ResolveArguments): Cut from Resolve.
6487         (Attribute.GetCharSetValue): Returns CharSet named argument.
6488         (Attribute.DefinePInvokeMethod): Gets default charset from
6489         module settings.
6490         (GlobalAttribute.ResolveAsTypeStep): Override.
6491         (GlobalAttribute.ResolveArguments): Override.
6492         
6493         * class.cs (TypeAttr): Is protected.
6494         
6495         * codegen.cs (ModuleClass.DefaultCharSet): New member.
6496         (ModuleClass.DefaultCharSetType): New memeber.
6497         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6498         
6499         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6500         charset from module.
6501         
6502         * delegate.cs (TypeAttr): Override.
6503         (Delegate.DefineType): Use this TypeAttr.
6504         
6505         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6506         at very early stage (before types are defined) to resolve model
6507         module attributes. It will probably not work with corlib but it
6508         should be ok.
6509         
6510         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6511         charset from module.
6512         
6513         * typemanager.cs (default_charset_type): New type.
6514
6515 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6516
6517         * decl.cs (MemberCache.AddMethods): Don't warn if
6518         System.Object.Finalize has buggy MethodAttributes.
6519
6520         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6521         removed below.
6522
6523 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6524
6525         * doc.cs : detect ambiguous reference to overloaded members.
6526           Fixed bug #71603. MS 1.1 csc does not detect it.
6527
6528 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6529
6530         * doc.cs : delegates must not be referenced with parameters.
6531           Fixed bug #71605.
6532
6533 2005-04-12  Miguel de Icaza  <miguel@novell.com>
6534
6535         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6536
6537 2005-04-10  Miguel de Icaza  <miguel@novell.com>
6538
6539         * driver.cs (MainDriver): Stop processing if the CLS stage found
6540         errors. 
6541
6542         (CompilerCallableEntryPoint.InvokeCompiler): Always
6543         reset after execution;   Take a TextWriter argument for the
6544         output.
6545
6546         * report.cs: Use the error stream instead of hardcoding stderr. 
6547
6548 2005-04-09  Miguel de Icaza  <miguel@novell.com>
6549
6550         * class.cs: Reduce code paths to test, too small of an
6551         optimization to make it worth the extra testing.  Always perform
6552         it. 
6553
6554 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6555
6556         Fix #74510.
6557         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6558         operators that had errors reported on them.
6559
6560 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
6561
6562         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6563         argument types.
6564         (Attribute.Resolve): Add named argument type checking.
6565         
6566         * class.cs (FixedField.Define): Use IsPrimitiveType
6567         
6568         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6569         
6570         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6571         unsafe parameter types.
6572         
6573         * statement.cs (Using.ResolveExpression): Add better error description.
6574         
6575         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6576         
6577 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6578
6579         Fix #74484.
6580         * attribute.cs (Attribute.GetAttributeUsage): Resolve
6581         AttributeUsageAttribute in the emitcontext of the attribute class,
6582         not in the emitcontext of the attributable entity it was attached to.
6583         * cs-parser.jay: Use 'current_class', not 'current_container',
6584         when creating a GlobalAttribute.
6585
6586 2005-04-08  Alp Toker  <alp@atoker.com>
6587
6588         * pending.cs: The fix to #58413 failed to compile methods implementing
6589         interfaces with/without params modifiers and vice versa, even though
6590         params modifiers aren't part of the signature. Make the modifier check
6591         less strict as in csc.
6592
6593 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
6594             Anoob V E  <projectmonokochi@rediffmail.com>
6595             Harilal P R  <projectmonokochi@rediffmail.com>
6596
6597         Fix #58413.
6598         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6599         modifiers of pending methods.
6600         (PendingImplementation.PendingImplementation): Initialize it.
6601         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6602         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6603         with ParameterData.  Add check for modifiers.
6604         * class.cs (MethodData.Define): Update to changes.
6605
6606 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6607
6608         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6609
6610 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
6611
6612         * class.cs (PropertyMethod.Define): Check private accessor in abstract
6613         property.
6614         
6615         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6616         
6617         * rootcontext.cs,
6618         * typemanager.cs: Registered RequiredAttributeAttribute.
6619         
6620 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
6621
6622         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6623         Warning CS0169 is back at level 3.
6624         (IMethodData.SetMemberIsUsed): New method.
6625         
6626         * decl.cs (IsUsed): New value; moved from FieldBase.Status
6627         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6628         
6629         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6630
6631         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6632         contants.
6633         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6634         is used.
6635         
6636         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6637         is used.
6638         
6639         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6640         to avoid the problems with nested types.
6641
6642 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
6643             Anoob V.E  <projectmonokochi@rediffmail.com>
6644             Harilal P.R  <projectmonokochi@rediffmail.com>
6645             Raja R Harinath  <rharinath@novell.com>
6646
6647         Fix #73820.
6648         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6649         attribute.
6650         * typemanager (GetConstructor): Make public.
6651
6652 2005-04-05  John Luke  <john.luke@gmail.com>
6653             Raja R Harinath  <rharinath@novell.com>
6654
6655         Fix #62232.
6656         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6657         struct too.  Return false quicker in a few cases.
6658         (VerifyUnManaged): Use it.
6659
6660 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6661
6662         Fix #74041.
6663         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6664         not 'unreachable_seen'.
6665
6666 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6667
6668         * attribute.cs (Attribute.GetValue): Removed unused.
6669         
6670         * codegen.cs (CodeGen.TrimExt): Removed unused.
6671         
6672         * cs-parser.jay (output): Removed unused.
6673         
6674         * cs-tokenizer.cs (hex_digits): Removed unused.
6675         
6676         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6677         
6678         * expression.cs (Indirection.LoadExprValue): Removed unused.
6679         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6680         
6681         * iterators.cs (Iterator.param_types): Removed unused.
6682         
6683         * statement.cs (Goto.block): Removed unused.
6684         (ToplevelBlock.did): Removed unused.
6685         (Switch.ResolveConstantSwitch): Removed unused.
6686
6687 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6688
6689         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6690         resetting thingy.
6691
6692 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6693
6694         Fix #74232 and cs0208-3.cs.
6695         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6696         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6697         unmanaged type.  Don't use FieldBuilders when 't' is a
6698         TypeBuilder.  Use ModFlags and MemberType fields.
6699         * class.cs (MemberBase.member_type): Rename from MemberType.
6700         (MemberBase.MemberType): New property.  Determines member_type on
6701         demand.
6702         (MemberBase.DoDefine): Don't initialize MemberType here.
6703         (FieldMember.Define): Likewise.
6704
6705 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6706
6707         Fix #74241
6708         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6709         Attributes are emitted there.
6710         
6711 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6712
6713         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6714         keyword in 'partial enum' too.
6715         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6716         is not allowed).
6717         Report from Kamil Skalski <nazgul@omega.pl>.
6718
6719         Fix #74309.
6720         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6721         have partial containers too.
6722
6723         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6724         in block' checks to Block.CheckInvariantMeaningInBlock.
6725         * statement.cs (Block.GetKnownVariableInfo): Make private.
6726         (Block.IsVariableUsedInChildBlock): Remove.
6727         (Block.IsVariableUsedInBlock): Likewise.
6728         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6729         conflicting declaration.
6730         (Block.AddVariable): Make error messages less long-winded and more
6731         specific.  Show location of conflicting declaration.
6732         * parameter.cs (Parameters.Location): New readonly property.
6733
6734 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6735
6736         Clean up semantics of invoking ResolveMemberAccess.
6737         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6738         can have an instance, ensure that we pass in a non-TypeExpression
6739         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6740         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6741         argument.  Update to changes and simplify.
6742         (FieldExpr.Emitinstance): Remove CS0120 check.
6743         (PropertyExpr.EmitInstance): Likewise.
6744         * expression.cs (Argument.Resolve): Likewise.
6745         (Invocation.DoResolve): Update to changes in semantics of
6746         InstanceExpression.
6747
6748 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6749
6750         Fix #74241
6751         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6752         customization.
6753         
6754         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6755
6756 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6757
6758         Fix difference in behaviour with commandline invocation.
6759         * driver.cs (Driver.Reset): New.
6760         (CompilerCallableEntryPoint): Call it.
6761
6762         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6763         variable" warnings if the boolean expression failed to resolve.
6764
6765 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6766
6767         * attribute.cs: Fix the union of several permissions when some of them
6768         are unrestricted (so the result isn't an unrestricted permission set).
6769         Fix #74036.
6770
6771 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6772
6773         * ecore.cs (MemberExpr): New class.  Convert from interface
6774         IMemberExpr.
6775         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6776         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6777         error checks.
6778         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6779         (MethodGroupExpr.IsExplicitImpl): Remove.
6780         (Expression.GetFieldFromEvent): Remove.
6781         (SimpleName.MemberStaticCheck): Remove.
6782         (SimpleName.DoSimpleNameResolve): Update to changes.
6783         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6784         (MemberAccess.IdenticalNameAndTypeName): Remove.
6785         (MemberAccess.error176): Move to MemberExpr.
6786         (MemberAccess.DoResolve): Update to changes.
6787         (BaseAccess.DoResolve): Likewise.
6788
6789 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6790
6791         C# 2.0 Conditional attribute class implementation
6792         
6793         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6794         Analyzes class whether it has attribute which has ConditionalAttribute
6795         and its condition is not defined.
6796         
6797         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6798         (Class.IsExcluded): New method. Search for at least one defined
6799         condition in ConditionalAttribute of attribute class.
6800
6801 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6802
6803         * ecore.cs (PropertyExpr): Derive from Expression, not
6804         ExpressionStatement.
6805         (PropertyExpr.EmitStatement): Remove.
6806
6807 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6808
6809         Fix #74060.
6810         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6811         internal field "value__" of an enum be private.  The examples for
6812         "value__" that I found on MSDN all used FieldAttributes.Private.
6813
6814         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6815         Don't mention IL method attribute names.
6816
6817         Fix #47991.  Remove a TODO.
6818         * statement.cs (Block.Toplevel): Make into a field.
6819         (Block.Parameters): Move into ToplevelBlock.
6820         (Block.known_variables): Rename from child_variable_names.
6821         (Block.Block): Remove variants that take Parameters.  Initialize
6822         'Toplevel' with the immediately surrounding toplevel block.
6823         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6824         LocalInfo parameter.
6825         (Block.GetKnownVariableInfo): New.
6826         (Block.IsVariableNameUsedInChildBlock): Update.
6827         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6828         the block, even though it may not be in scope.
6829         (Block.AddVariable): Remove Parameters parameter.  Use
6830         Toplevel.Parameters instead.
6831         (Block.AddConstant): Remove Parameters parameter.
6832         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6833         (Block.IsParamaterReference): Likewise.
6834         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6835         (ToplevelBlock.Parameters): New.  Moved from Block.
6836         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6837         initialize Parameters to a non-null value.
6838         * cs-parser.jay: Update to changes.
6839         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6840         simple names that mean different things in the same block.  Use
6841         Block.IsVariableNameUsedInBlock.
6842
6843 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6844
6845         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6846         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6847         GetTypeHandle.  It is possible for a reflected type to derive from
6848         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6849         System.Array during mscorlib compilation).
6850         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6851         contain a method_hash, don't create one either.  Don't create a
6852         deep copy of the base cache's method_hash.
6853         (MemberCache.SetupCache): Rename back from DeepCopy.
6854         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6855         already initialized.  If we see an override function, add its
6856         underlying base virtual function to the member_hash too.
6857
6858         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6859
6860 2005-03-26  Raja R Harinath  <harinath@acm.org>
6861
6862         Fix #73038.
6863         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6864         fails to resolve, ensure that the LHS is still resolved as an
6865         lvalue.
6866
6867 2005-03-25  Raja R Harinath  <harinath@acm.org>
6868
6869         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6870         ec.ContainerType.
6871         (Enum.current_ec): Remove.
6872         (Enum.LookupEnumValue): Remove EmitContext argument.
6873         Just uses the one created during DefineType.
6874         (Enum.FindMembers): Update.
6875         * expression.cs (MemberAccess.DoResolve): Update.
6876
6877 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6878
6879         * assign.cs (Assign.DoResolve): Check for CS1717 when
6880         source and target are same (uses Equals).
6881
6882         * expression.cs (LocalVariableReference, ParameterReference,
6883         This): Implemented Equals, GetHashCode.
6884
6885         * statement.cs (Block.GetParameterReference): Removed useless
6886         local variable.
6887
6888 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6889
6890         Fix cs0128.cs
6891         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6892         blocks before deciding whether the error is cs0136 or cs0128.
6893
6894         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6895         (using_alias_directive, using_namespace_directive): Pass
6896         MemberName, not an expression to Namespace.UsingAlias and
6897         Namespace.Using.
6898         (MakeName): Use the MemberName of the namespace.
6899         * namespace.cs (Namespace.MemberName): New.
6900         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6901         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6902         Likewise.
6903         * decl.cs (MemberName.Name): Make readonly.
6904         (MemberName.FromDotted): New "constructor".
6905         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6906         (MemberCore.Name): Compute from MemberName on demand.
6907         (MemberCore.SetMemberName): Provide a way to change the
6908         MemberName.
6909         (MemberCore.AddToContainer): Don't take a fullname parameter.
6910         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6911         fully qualified name of the container to the member name.
6912         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6913         only if the type is a member of the root container.
6914         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6915         MemberName.Left rather than searching for an embedded ".".
6916         (PartialContainer.CreatePart): Update to changes in RootContext.
6917         (MemberBase.ShortName): Turn into a property.  Use
6918         MemberCore.SetMemberName.
6919         (MemberBase.ExplicitInterfaceName): Remove.
6920         (MemberBase.UpdateMemberName): Remove.
6921         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6922         (PropertyBase.SetMemberName): New override.
6923         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6924         (Tree.GetDecl): New.
6925         (Tree.AllDecls): Rename from Decls.
6926         * attribute.cs, enum.cs, report.cs: Update to changes.
6927         * driver.cs (MainDriver): Use MemberName.FromDotted on
6928         RootContext.MainClass.
6929
6930 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6931
6932         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6933         checks.
6934
6935         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6936
6937 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6938
6939         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6940         property accessor modifiers.
6941
6942         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6943         fixed buffer attribute (CS1716).
6944         (PropertyMethod.HasCustomAccessModifier): When property accessor
6945         has custom modifier.
6946
6947         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6948         modifiers.
6949         (PropertyExpr.DoResolveLValue): Add CS0272.
6950
6951 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6952
6953         * convert.cs: When converting to a pointer, use the proper Conv.U
6954         or Conv.I depending on the source data type.
6955
6956         * cs-tokenizer.cs: Make the size for large decimal constants,
6957         fixes #72957.
6958
6959 2005-03-17  Martin Baulig  <martin@ximian.com>
6960
6961         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6962         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6963
6964 2005-03-17  Martin Baulig  <martin@ximian.com>
6965
6966         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6967         to bool so we can return an error condition.
6968         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6969         returned an error.
6970
6971 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6972
6973         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6974         attributes.
6975
6976 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6977
6978         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6979         Refactor to avoid traversing the list of assemblies, and to avoid
6980         string concatenation.
6981         * typemanager.cs (guid_attr_type): Remove.
6982         (negative_hits, pointers, references): Remove hashes.
6983         (type_hash): New.
6984         (GetConstructedType): New.  Uses type_hash to handle constructed
6985         types (arrays, references, pointers).
6986         (GetReferenceType, GetPointerType): Use it.
6987         (GetNestedType): New.  Uses type_hash to handle nested types of
6988         reflected types.
6989         (LookupType, LookupTypeDirect): Remove.
6990         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6991         'types' hash and LookupTypeReflection directly.
6992         (params_string, params_object): Use GetConstructedType.
6993         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6994         top-level types.
6995         (Namespace.Lookup): Use cached_types.
6996         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6997         provided by old TypeManager.LookupType.
6998         * rootcontext.cs (MakeFQN): Remove.
6999         * decl.cs (DeclSpace.MakeFQN): Likewise.
7000         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7001         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7002         TypeManager.GetConstructedType.
7003         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7004
7005 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7006
7007         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7008         indexers.
7009
7010         * cs-parser.jay: Reports CS1527 for any namespace element.
7011
7012         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7013         Added CS0407.
7014
7015         * expression.cs (ParameterReference.IsAssigned): Changed error to
7016         CS0269.
7017         (Error_WrongNumArguments): Moved CS0245 detection here.
7018
7019         * statement.cs (Return.Resolve): Add CS1622 report.
7020
7021 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7022
7023         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7024
7025 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7026
7027         * attribute.cs expression.cs: Get rid of some allocations.
7028
7029 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7030
7031         * doc.cs : just eliminate the latest change.
7032
7033 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7034
7035         * doc.cs : commented out the latest change. It breaks xml-030.cs
7036
7037 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7038
7039         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7040           fail. So invoke CreateType() in FindDocumentedType().
7041
7042 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7043
7044         * cs-tokenizer.cs : added IsKeyword().
7045         * doc.cs : Detect keyword incorrectly used as identifier.
7046           Allow identifiers prefixed by @.
7047
7048 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7049
7050         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7051         It caused exception in namespace resolving (again!).
7052         
7053         * class.cs (Class.ctor): Removed exit.
7054         (PropertyMethod.ctor): ditto.
7055         
7056         * codegen.cs (Codegen.Reset): Reset static data.
7057         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7058         
7059         * cs-tokenizer.cs (Cleanup): Removed.
7060         
7061         * driver.cs (GetSystemDir): Rewrote to one line command.
7062         It caused problem with unloaded dynamic modules.
7063         (UnixParseOption): Removed Exit.
7064         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7065         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7066         Now can be mcs used as library.
7067         
7068         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7069         empty location.
7070         
7071         * location.cs (Reset): Reset static data.
7072         
7073         * namespace.cs (Reset): Reset static data.
7074         
7075         * report.cs (Report.Reset): Reset static data.
7076         
7077         * rootcontext.cs (RootContext.Reset): Reset static data.
7078         
7079         * tree.cs (RootTypes.ctor): Use Location.Null
7080         
7081         * typemanager.cs (TypeManager.Reset): Reset static data.
7082         (CoreLookupType): Removed Exit.
7083         (TypeHandle.Reset): Reset static data.
7084         
7085 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7086
7087         Fix #73516.
7088         * typemanager.cs (ComputeNamespaces): Import namespaces from
7089         referenced modules too.
7090
7091 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7092
7093         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7094         than '.'.
7095
7096 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7097
7098         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7099         enclosing DeclSpace.  This ensures that a name-lookup populates
7100         more caches and there are fewer 'TypeExpression's.  Carve out
7101         nested type lookup into ...
7102         (LookupNestedTypeInHierarchy): ... this.
7103
7104 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7105
7106         Clean up a few partial-class semantics.  
7107         Fixes test-357.cs and cs1618-2.cs.
7108         * cs-parser.jay (struct_declaration): Use 'current_class' as
7109         parent of newly-created struct.  Remove call to Register ().
7110         Use 'pop_current_class' to complete handing the current struct.
7111         (interface_declaration): Likewise.
7112         (class_declaration): Likewise.
7113         (enum_declaration): Use 'current_class' as parent of newly created
7114         enum.
7115         (delegate_declaration): Likewise.
7116         (pop_current_class): New function.  This is used to handle closing
7117         up the 'current_class' and 'current_container', and pointing them
7118         to the enclosing class/container.
7119         (CSharpParser): Initialize 'current_class' too.
7120         * decl.cs (MemberCore): Add check for invariant: a partial
7121         container is not a parsed entity, and thus does not enclose any
7122         parsed members.
7123         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7124         (DeclSpace.BaseTypeExpr): Use it.
7125         (DeclSpace.LookupType): Add check for invariant.
7126         * class.cs (TypeContainer): Add check for invariant: a nested
7127         class should have the same NamespaceEntry as its enclosing class.
7128         (TypeContainer.EmitFieldInitializers): Make virtual.
7129         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7130         MemberCore.
7131         (TypeContainer.Register): Remove.
7132         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7133         null.  Use TypeResolveEmitContext for resolving base types and
7134         interfaces.  Move initialization of Parts.TypeBuilder here from
7135         ...
7136         (TypeContainer.DefineNestedTypes): ... here.
7137         (PartialContainer): Take a Namespace not a NamespaceEntry.
7138         (PartialContainer.Create): Don't use Register.  Call the
7139         appropriate Add... function directly.
7140         (ClassPart): Take both the PartialContainer and the enclosing
7141         class as constructor arguments.
7142         (ClassPart.EmitFieldInitializers): Override.
7143         (ClassPart.PartFindNestedTypes): Remove.
7144         (FieldBase.GetInitializerExpression): Resolve the initializer
7145         expression in the emit context of the enclosing class.
7146         * tree.cs (RootTypes): Remove Register ().
7147         
7148 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7149
7150         * cs-parser.jay: Removed CS0134.
7151         
7152         * driver.cs: Removed CS1901.
7153         
7154         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7155         for predefined types.
7156
7157 2005-03-07  Duncan Mak  <duncan@novell.com>
7158
7159         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7160         well. Fixes bug #73454.
7161
7162 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7163
7164         * cs-tokenizer.cs (xtoken): Add CS1035.
7165         
7166         * class.cs (MethodData.Define): Add CS0683.
7167         (FieldMember.ctor): Add CS0681.
7168
7169 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7170
7171         * ecore.cs (SimpleName.DoResolve): Rename from
7172         SimpleName.DoResolveAllowStatic.
7173         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7174         Pass 'intermediate' flag to MemberStaticCheck.
7175         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7176         of "intermediate" lookups via MemberAccess.
7177         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7178         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7179
7180 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7181
7182         Fix #73394.
7183         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7184         slipped in because of variable names that are identical to a
7185         builtin type's BCL equivalent ('string String;', 'int Int32;').
7186         (PropertyExpr.EmitInstance): Likewise.
7187
7188 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7189
7190         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7191         
7192         * report.cs (warning_ignore_table): Made public.
7193
7194 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7195
7196         Fix #73282.
7197         * class.cs (MethodData.Emit): Pass 'container' to
7198         container.GetObsoleteAttribute instead of 'container.Parent'.
7199
7200 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * cs-parser.jay: Add 1534 error test.
7203
7204         * iterators.cs (Yield.CheckContext): Add error 1629.
7205         (Iterator.ctor): Save unsafe modifier.
7206         (MoveNextMethod.DoEmit): Restore unsafe context.
7207
7208         * namespace.cs (UsingAlias): Better error message.
7209
7210 2005-03-03  Dan Winship  <danw@novell.com>
7211
7212         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7213         the warning message [#73219]
7214
7215 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7216
7217         Fix compile with MCS 1.0.0.0.
7218         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7219         w_restore to not depend on string constant folding.
7220
7221 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7222
7223         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7224         CS0246 check to users who passed 'silent = false'.
7225         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7226         check.
7227         (SimpleName.SimpleNameResolve): Update.
7228         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7229         (MemberAccess.IdenticalNameAndTypeName): Update.
7230         * doc.cs (FindDocumentedTypeNonArray): Update.
7231
7232 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7233
7234         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7235         * parameters.cs (ComputeAndDefineParameters): Remove.
7236         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7237         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7238         Use GetParameterInfo.
7239
7240 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7241
7242         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7243
7244 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7245
7246         Unify DeclSpace.LookupType and DeclSpace.FindType.
7247         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7248         is in charge of defining nested types on demand.
7249         (DeclSpace.LookupType): Use it when the current_type is a
7250         TypeBuilder.  Use LookupTypeDirect for reflected types.
7251         (DeclSpace.FindType): Remove.
7252         (DeclSpace.LookupInterfaceOrClass): Likewise.
7253         (DeclSpace.DefineTypeAndParents): Likewise.
7254         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7255         DeclSpace.LookupType.
7256         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7257         * typemanager.cs (LookupType): Simplify.
7258         (AddUserType): Remove type from negative_hits.
7259         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7260         * class.cs (TypeContainer.FindMembers): Move handling of nested
7261         types ...
7262         (TypeContainer.FindMembers_NestedTypes): ... here.
7263         (TypeContainer.FindNestedType): Implement override.
7264         (ClassPart.FindNestedType): Delegate to PartialContainer.
7265         (ClassPart.PartFindNestedType): Looks up the nested types of the
7266         part alone.
7267
7268 2005-03-02  Martin Baulig  <martin@ximian.com>
7269
7270         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7271         static constructor in static classes.
7272
7273 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7274
7275         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7276         sizeParamIndex is not specified.
7277
7278 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7279
7280         Fix #73117
7281         * report.cs (WarningMessage.IsEnabled): Missing null check.
7282
7283 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7284
7285         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7286         in the fields and not in the properties.
7287
7288 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7289
7290         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7291         fields as well.
7292
7293 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7294
7295         * attribute.cs: Small refactoring (improved robustness).
7296         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7297         (ValidateGuid): Removed.
7298         (Resolve): Removed referenced to above mentioned.
7299         (GetAttributeUsage): Made private and changed to work without
7300         class assistance.
7301         (GetIndexerAttributeValue): Don't crash.
7302         (GetConditionalAttributeValue): Ditto.
7303         (GetClsCompliantAttributeValue): Ditto.
7304         (ExtractSecurityPermissionSet): All attributes exceptions are
7305         error 648.
7306         (GetPropertyValue): New helper.
7307         (GetMethodImplOptions): New method.
7308         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7309         some missing properties.
7310         
7311         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7312         (Method.ApplyAttributeBuilder): Updated.
7313         
7314         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7315         exception.
7316
7317 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7318
7319         Fix #73052.
7320         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7321         non-simple types (array, pointer, reference).
7322
7323 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7324
7325         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7326
7327         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7328         for operators.
7329         (Method.CheckBase): Catch wrong destructor here.
7330         (MethodData.Define): Add errors 550, 668.
7331
7332         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7333
7334         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7335
7336         * pending.cs (VerifyPendingMethods): Add error 551.
7337
7338         * typemanager.cs (CSharpName): Next error report helper.
7339
7340 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7341
7342         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7343         attributes. Removed useless attribute double check.
7344         It saves almost 2MBs for corlib.
7345
7346 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7347
7348         Fix #72924.
7349         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7350         called twice in case of error.
7351
7352 2005-02-23  Chris Toshok  <toshok@ximian.com>
7353
7354         Fix compiler portions of #72827.
7355         * statement.cs (Block.Emit): call Begin/EndScope on the
7356         EmitContext instead of the ILGenerator.
7357
7358         * codegen.cs (EmitContext.BeginScope): new method, call
7359         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7360         we have one.)
7361         (EmitContext.BeginScope): same, but EndScope and CloseScope
7362
7363         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7364         offset and call the superclass's OpenScope(int) with it.
7365         (SymbolWriter.CloseScope): get the current il
7366         offset and call superclass's CloseScope(int) with it.
7367
7368 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7369
7370         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7371         CS1677 for out and ref as well.
7372
7373         * class.cs (Method.Define): Add error CS1599 detection.
7374         
7375         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7376         
7377         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7378         
7379         * delegate.cs (Delegate.Define): Add error CS1599 detection.
7380         
7381         * support.cs.cs (ModifierDesc): New helper method.
7382
7383 2005-02-23  Raja R Harinath  <rharinath@novell.com>
7384             Abin Thomas  <projectmonokochi@rediffmail.com>
7385             Anoob V E  <projectmonokochi@rediffmail.com>
7386             Harilal P R  <projectmonokochi@rediffmail.com>
7387
7388         Fix #57851, #72718.
7389         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7390         MemberLookup (used for error reporting) actually returns a result.
7391         Fix error report number (122, not 112).
7392
7393 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
7394             Anoob V E  <projectmonokochi@rediffmail.com>
7395             Harilal P R  <projectmonokochi@rediffmail.com>
7396
7397         Fix #71134.
7398         * pending.cs (PendingImplementation.GetAbstractMethods):
7399         Find NonPublic members too.
7400
7401 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
7402
7403         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7404         Fixed error 217.
7405         
7406         * class.cs (MethodCore.CheckMethodAgainstBase):
7407         Add error 239 report.
7408
7409 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7410
7411         Fix #68955.
7412         * expression.cs (Invocation.IsApplicable): Make public.
7413         (Invocation.IsParamsMethodApplicable): Likewise.
7414         * delegate.cs (Delegate.VerifyApplicability): Don't use
7415         Invocation.VerifyArgumentCompat for parameter applicability
7416         testing.  Use Invocation.IsApplicable and
7417         Invocation.IsParamsMethodApplicable.
7418
7419 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7420
7421         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7422         
7423         * class.cs (Operator.Define): Add error 217 report.
7424         
7425 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7426
7427         * namespace.cs (UsingEntry.Resolve): Undo change below.
7428
7429 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7430
7431         Fix #72756.
7432         * ecore.cs (Expression.MemberLookupFailed): Add argument to
7433         disable the error message when the extended MemberLookup also
7434         fails.
7435         (Expression.MemberLookupFinal): Update.
7436         (SimpleName.DoSimpleNameResolve): Update.
7437         * expression.cs (MemberAccess.ResolveNamespaceOrType):
7438         Don't use MemberLookupFinal.
7439         (New.DoResolve): Update.
7440         (BaseAccess.CommonResolve): Update.
7441
7442 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7443
7444         Fix #72732.
7445         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7446         occured previously, don't resolve again.
7447
7448 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7449
7450         Fix #69949
7451         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7452         argument. Call ResolveAttributeUsage for unresolved.
7453         when types doesn't match ctor arguments.
7454         
7455         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7456         for nested attribute classes.
7457         (Class.attribute_usage): Removed.
7458         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7459         for attribute class.
7460         
7461         * ecore.cs (IsAttribute): Removed.
7462         
7463         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7464         
7465         * rootcontext.cs (RegisterAttribute): Removed, attributes are
7466         now normal types.
7467         (attribute_types): Removed.
7468         (EmitCode): Global attributes are emited as the latest.
7469
7470 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
7471
7472         * class.cs (EmitFieldInitializers): Don't emit field initializer
7473         for default values when optimilization is on.
7474         
7475         * constant.cs (Constant.IsDefaultValue): New property.
7476         
7477         * driver.cs: Add /optimize handling.
7478         
7479         * constant.cs,
7480         * ecore.cs,
7481         * literal.cs: Implement new IsDefaultValue property.
7482         
7483         * rootcontext.cs (Optimize): New field, holds /optimize option.
7484
7485 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7486
7487         Fix crasher in re-opened #72347.
7488         * namespace.cs (Namespace.Lookup): Return null if
7489         DeclSpace.DefineType returns null.
7490
7491         Fix #72678.
7492         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7493
7494 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7495
7496         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
7497         now returns null if it cannot resolve to an lvalue.
7498         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7499         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7500         returned null.  Remove check for SimpleName.
7501         (EventExpr.DoResolveLValue): New.
7502         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7503         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
7504         error from ...
7505         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
7506         avoid CS0131 error.
7507         (Unary.ResolveOperator): Move CS0211 check ...
7508         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
7509         CS0131 error.
7510         (Unary.DoResolveLValue): Simplify.
7511         (AddressOf.DoResolveLValue): New.
7512         (ArrayAccess.DoResolveLValue): New.
7513
7514 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
7515
7516         * attribute.cs (Attribute.Resolve): Add arguments casting for
7517         when types doesn't match ctor arguments.
7518
7519 2005-02-16  Raja R Harinath  <rharinath@novell.com>
7520
7521         Fix parts of #63202.
7522         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7523         lookup of operator in base type.  Ensure that all checks happen
7524         when the operator resolves to an "op_..." method.
7525
7526 2005-02-15  Raja R Harinath  <rharinath@novell.com>
7527
7528         Fix #71992.
7529         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7530         'ignore_cs0104' parameter.  Pass it to ...
7531         (NamespaceEntry.Lookup): ... this.
7532         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7533         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7534         (TypeLookupExpression.DoResolveAsTypeStep): Update.
7535         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7536         Update.  Request that cs0104 errors be ignored.
7537         (ComposedCast.ResolveAsTypeStep): Update.
7538
7539 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7540
7541         Fix #59209.
7542         * expression.cs (Invocation.BetterFunction): Remove support for
7543         comparing virtual functions and their overrides.
7544         (Invocation.IsOverride): New.
7545         (Invocation.OverloadResolve): Don't consider 'override' functions
7546         during candidate selection.  Store them in a lookaside list.
7547         If the selected method is a 'virtual' function, use the list to
7548         find any overrides that are closer to the LHS type.
7549
7550 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
7551
7552         * expression.cs (New.DoResolve): Add complex core type reduction.
7553         (New.Constantify): Converts complex core type syntax like 'new int ()'
7554         to simple constant.
7555         
7556 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7557
7558         * decl.cs (EntryType.EntryType): New constructor to create an
7559         updated copy of a cache entry.
7560         (MemberCache.AddMethods): Use it.
7561         (MemberCache.ClearDeclaredOnly): Remove.
7562         (MemberCache.MemberCache): Update.
7563
7564 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7565
7566         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7567         variable.  This one is represents the actual low-level declaration
7568         of the method, as opposed to the semantic level `IsStatic'.   
7569
7570         An anonymous method which is hosted into a static method might be
7571         actually an instance method.  IsStatic would reflect the
7572         container, while MethodIsStatic represents the actual code
7573         generated.
7574
7575         * expression.cs (ParameterReference): Use the new MethodIsStatic
7576         instead of IsStatic.
7577
7578         * anonymous.cs (AnonymousMethod.Compatible): Pass the
7579         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7580         set on the current EmitContext. 
7581
7582         * expression.cs (Cast): Overload DoResolveLValue so we can pass
7583         resolve our casted expression as an LValue.  This triggers the
7584         proper LValue processing that is later required by Assign.
7585
7586         This fixes 72347.
7587
7588         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7589
7590 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
7591
7592         C# 2.0 Fixed buffer implementation
7593
7594         * anonymous.cs: Update after RegisterHelperClass renaming.
7595
7596         * attribute.cs (AttributeTester.fixed_buffer_cache):
7597         Cache of external fixed buffers.
7598         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7599         implementation if field is fixed buffer else null.
7600
7601         * class.cs
7602         (TypeContainer.AddField): Accept FieldMember instead of Field.
7603         (FieldBase.IsFieldClsCompliant): Extracted code from
7604         VerifyClsCompliance descendant customization.
7605         (FixedField): New class handles fixed buffer fields.
7606         (FixedFieldExternal): Keeps information about imported fixed
7607         buffer.
7608         (IFixedField): Make access to internal or external fixed buffer
7609         same.
7610
7611         * cs-parser.jay: Add fixed buffer parsing.
7612
7613         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7614         buffer.
7615
7616         * expression.cs (Indirection): Extended implementation to accept
7617         fixed buffer field.
7618         (PointerArithmetic.Emit): Get element from fixed buffer as well.
7619         (ElementAccess.MakePointerAccess): Get type as parameter.
7620         (DoResolve): Add fixed buffer field expression conversion.
7621         (DoResolveLValue): Ditto.
7622         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7623         (ArrayPtr): Derives from FixedBufferPtr.
7624         (ArrayPtr.Emit): Add extra emit for array elements.
7625
7626         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7627
7628         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7629         for compiler generated types.
7630         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7631
7632         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7633         and consume less memory.
7634         (Fixed.Resolve): Add fixed buffer case.
7635
7636         * typemanager.cs (compiler_generated_attr_ctor,
7637         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7638         (HasElementType): Add our own implementation to work on every
7639         runtime.
7640
7641 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7642
7643         * anonymous.cs (CaptureContext): Track whether `this' has been
7644         referenced.   
7645
7646         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7647         only captured `this' if it was implicitly done (instance
7648         methods/variables were used). 
7649
7650         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7651         `this' must be captured.
7652
7653 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7654  
7655         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7656         is null it means that there has been no need to capture anything,
7657         so we just create a sibling.
7658
7659         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7660
7661         Just a partial fix.  The other half is fairly elusive.
7662         
7663 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7664
7665         Fix #52586, cs0121-4.cs.
7666         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7667         and return a hashtable.
7668         (MemberCache.ClearDeclaredOnly): New.
7669         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7670         the method_hash of a base type too.
7671         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7672         type methods.  Overwrite entries with the same MethodHandle so
7673         that the ReflectedType is correct.  The process leaves in base
7674         virtual functions and their overrides as distinct entries.
7675         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7676         matters since it was boxed in a ArrayList before.
7677         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7678         modifier.
7679         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7680         case of a virtual function and its override (choose the overload
7681         as better).
7682         (Invocation.OverloadResolve): Avoid 'override' members during
7683         'applicable_type' calculation.
7684
7685 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7686
7687         Combine two near-redundant caches.
7688         * typemanager.cs (method_params): Rename from method_internal_params.
7689         (TypeManager.GetParameterData): New.  Replace
7690         Invocation.GetParameterData.
7691         (TypeManager.LookupParametersByBuilder): Remove.
7692         * expression.cs (Invocation.method_parameter_cache): Remove.
7693         (Invocation.GetParameterData): Remove.
7694         Update to changes.
7695         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7696         Update to changes.
7697
7698 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7699
7700         Fix #72015.
7701         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7702         TypeManager.multicast_delegate_type is null, resolve it by looking
7703         up "System.MulticastDelegate".
7704         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7705
7706 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7707             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7708             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7709
7710         Fix cs0164.cs.
7711         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7712         (LabeledStatement.AddReference): New.  Set 'referenced'.
7713         (Goto.Resolve): Use it.
7714
7715 2005-02-05  John Luke  <john.luke@gmail.com>
7716
7717         * driver.cs: remove duplicate -doc line in Usage ()
7718
7719 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7720
7721         * location.cs (Location.AddFile): Fix CS2002 error report.
7722
7723 2005-02-02  Martin Baulig  <martin@ximian.com>
7724
7725         * delegate.cs (Delegate.DefineType): Report an internal error if
7726         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7727         details.        
7728
7729 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7730
7731         Fix a crasher in a variant of #31984.
7732         * const.cs (Constant.CheckBase): New override that defers the
7733         new-or-override check in case the base type hasn't been populated
7734         yet.
7735         (Constant.Define): Ensure the new-or-override check is performed.
7736
7737 2005-02-01  Duncan Mak  <duncan@ximian.com>
7738
7739         * const.cs (LookupConstantValue): Check that `ce' is not null
7740         before calling GetValue ().
7741
7742 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7743
7744         Fix test-334.cs (#69519).
7745         * cs-parser.jay (using_alias_directive): Pass in an expression to
7746         NamespaceEntry.UsingAlias.
7747         (using_namespace_directive): Pass in an expression to
7748         NamespaceEntry.Using.
7749         (namespace_name): Don't flatten to a string.
7750         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7751         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7752         ResolveAsTypeStep.
7753         (NamespaceEntry.UsingEntry): Likewise.
7754         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7755         changes.
7756         (NamespaceEntry.LookupForUsing): Remove.
7757         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7758         names.
7759         (NamespaceEntry.Lookup): Remove support for dotted names.
7760
7761 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7762
7763         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7764         split into two.
7765         (NamespaceEntry.ImplicitParent): Compute on demand.
7766         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7767         parallels the current.
7768         (NamespaceEntry.LookupForUsing): Use it.
7769         (NamespaceEntry.Lookup): If the current namespace-entry is
7770         implicit, don't search aliases and using tables.
7771
7772 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7773
7774         Fix #31984.
7775         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7776         BaseCache here.
7777         (TypeContainer.BaseCache): Compute on demand.
7778         (TypeContainer.FindMembers): Define constants and types if they're
7779         not already created.
7780         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7781         check.
7782         * const.cs (Constant.Define): Make idempotent.
7783
7784 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7785
7786         * pending.cs: Produce better code (no nops produced by using Ldarg
7787         + value).
7788         
7789         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7790         i - 1' it should be arg + 1.
7791
7792         Fixes bug #71819.
7793
7794 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7795
7796         * attribute.cs (Attribute.CheckAttributeType): Make private
7797         non-virtual.
7798         (Attribute.ResolveType): Make virtual.
7799         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7800         handling of RootContext.Tree.Types.
7801
7802 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7803
7804         Update attribute-handling to use the SimpleName/MemberAccess
7805         mechanisms.
7806         * cs-parser.jay (attribute): Pass in an expression to the
7807         constructors of Attribute and GlobalAttribute.
7808         * attribute.cs (Attribute): Take an expression for the name.
7809         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7810         passed in attribute name expression.
7811         (Attribute.CheckAttributeType): Use it.
7812         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7813         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7814         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7815         argument to prevent error messages if the lookup fails.
7816
7817 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7818
7819         * expression.cs (Indirection): Implemented IVariable interface
7820         to support indirection in AddressOf operator.
7821         (PointerArithmetic.Emit): Add optimalization for case where
7822         result can be precomputed.
7823
7824 2005-01-26  Martin Baulig  <martin@ximian.com>
7825
7826         * class.cs (TypeContainer.AttributeTargets): Return the correct
7827         AttributeTargets depending on our `Kind' instead of throwing an
7828         exception; fixes #71632.
7829
7830 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7831
7832         Fix #71257
7833         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7834         constant members.
7835
7836 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7837
7838         Fix #71602.
7839         * expression.cs (MemberAccess.DoResolve): Don't complain with
7840         cs0572 when the LHS of a member access has identical name and type
7841         name.
7842
7843 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7844
7845         Fix #71651, #71675
7846         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7847         CreatePermission.
7848         Create custom PermissionSet only for PermissionSetAttribute.
7849
7850 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7851
7852         Fix #71649
7853         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7854         delegates in static class.
7855
7856 2005-01-24  Martin Baulig  <martin@ximian.com>
7857
7858         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7859         merging an implicit block, just use its reachability.
7860
7861         * statement.cs (Block.Resolve): Make the unreachable code check
7862         work wrt. implicit blocks; see test-337 from #63842.
7863
7864 2005-01-21  Alp Toker  <alp@atoker.com>
7865  
7866         * cs-parser.jay: destructor_declaration's container is PartialContainer
7867         not Class when partial types are used, so use Kind prop instead of
7868         'is'.
7869         
7870 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7871
7872         * cs-parser.jay: Improve error reporting when an interface
7873         declares new types.
7874
7875 2005-01-20  Dick Porter  <dick@ximian.com>
7876
7877         * support.cs: SeekableStreamReader fix from Sandor Dobos
7878         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7879         chars are read.  Fixes bug 70369.
7880
7881 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7882
7883         * cs-parser.jay (catch_clause): Simplify current_block handling
7884         somewhat.
7885
7886 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7887
7888         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7889         code with ImplicitStandardConversion to handle the implicit
7890         conversion of method groups into valid delegate invocations. 
7891
7892         The problem is that in parameter handling we were using this code
7893         path.  Fixes bug #64698
7894
7895 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7896
7897         * cs-parser.jay: Fix several infelicities.
7898         - Avoid assigning to the parser value stack.  Code like 
7899           '$3 = null' is unclean.  Synthesize a value for the code block
7900           instead. 
7901         - Avoid using oob_stack for storing location information.  Use ...
7902         (_mark_): ... this.  New (empty) rule.  Saves the current location
7903         in $$.
7904         (foreach_statement): Avoid using oob_stack for current_block
7905         handling.  Use technique used in for_statement and
7906         using_statement.  Synthesize a value for the code block to store
7907         additional intermediate information.
7908
7909 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7910
7911         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7912         of a different type is only allowed to private fields of a
7913         containing type, not on fields of a base class.
7914
7915         See test-174.cs and error cs0122-9.cs
7916
7917 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7918
7919         Fix test-335.cs (bug #58126).
7920         * cs-parser.jay (argument): Split out non-expression parts of the
7921         rule into 'non_simple_argument'.
7922         (invocation_expression): Support parenthesized invocations with
7923         multiple arguments, and with single non-simple arguments.
7924
7925 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7926
7927         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7928         places.
7929
7930 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7931
7932         Fix cs0038-1.cs, cs1640-6.cs.
7933         * ecore.cs (Expression.Resolve): Remove special-case for
7934         SimpleName in error-handling.
7935         (Expression.almostMatchedMembers): Relax access permission to
7936         protected.
7937         (Expression.MemberLookupFailed): Handle duplicates in
7938         almostMatchedMembers list.
7939         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7940         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7941         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7942         overload if the passed in MemberInfo is a MethodBase.
7943
7944 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7945
7946         Fix #70749
7947         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7948         for non-CAS & merge permission sets properly.
7949
7950 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7951
7952         Improve standard-compliance of simple name and member access 
7953         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7954         * ecore.cs (FullNamedExpression): New abstract base class 
7955         for Namespaces and TypeExpressions.
7956         (ResolveFlags.SimpleName): Remove.
7957         (SimpleName): Remove support for dotted names.
7958         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7959         DeclSpace.FindType and DeclSpace.LookupType.
7960         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7961         (Expression.ExprClassName): Make member function.
7962         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7963         a namespace.  Remove creation of dotted "SimpleName"s.
7964         (MemberAccess.DoResolve): Likewise.
7965         * decl.cs (DeclSpace.Cache): Make private.
7966         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7967         (DeclSpace.FindType): Update.
7968         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7969         FullNamedExpression.
7970         * namespace.cs (Namespace): Derive from FullNamedExpression
7971         so that it can be part of expression resolution.
7972         (Namespace.Lookup): Return an FullNamedExpression.
7973         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7974         namespace.
7975         * rootcontext.cs (NamespaceLookup): Remove.
7976         (LookupType): Move to DeclSpace.
7977         * attribute.cs (CheckAttributeType): Update.
7978         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7979         (FindDocumentedTypeNonArray): Likewise.
7980
7981 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7982
7983         Fix cs0509.cs, cs1632.cs.
7984         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7985         is the same as IsInterface.
7986         (TypeContainer.GetClassBases): Likewise.
7987         * statement.cs (LabeledStatement.ig): New field.
7988         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7989         label.
7990         (LabeledStatement.DoEmit): Check that the label was created with
7991         the same ILGenerator.
7992
7993 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7994
7995         Fix #71058
7996         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7997         accessors to its properties.
7998
7999         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8000         from accessors to property.
8001         
8002 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8003
8004         Fix #70722
8005         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8006         only for overrides.
8007         
8008 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8009
8010         * attribute.cs: Check for null and empty strings.  
8011
8012         I have lost another battle to Paolo.
8013
8014 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8015
8016         Fix #70942
8017         * class.cs (PropertyMethod): Set Parent field in ctors.
8018         (SetMethod.InternalParameters): Add unsafe switch hack.
8019         Override MarkForDuplicationCheck where it is appropriate.
8020
8021         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8022         It says whether container allows members with the same name.
8023         Base default is no.
8024         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8025         Removed is_method parameter.
8026
8027 2005-01-06  Duncan Mak  <duncan@ximian.com>
8028
8029         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8030         because the previous change led to incorrect reporting of CS1032
8031         ("Cannot define/undefine preprocessor symbols after first token in
8032         file"). Instead of using `tokens_seen' as the only flag that
8033         triggers CS1040, introduce `comments_seen'. This new flag is used
8034         to signify having seen comments on the current line, so it is
8035         unset after a newline.
8036
8037 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8038
8039         * doc.cs : When searching for a type, find nested type too.
8040           This fixes bug #71040.
8041
8042 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8043
8044         * doc.cs :
8045           - Warn missing member comment on those classes which also does not
8046             have doc comments. Fixed bug #71041.
8047           - Don't warn missing doc comment on default constructor.
8048             Fixed bug #71042.
8049
8050 2005-01-06  Duncan Mak  <duncan@ximian.com>
8051
8052         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8053         comments, set `tokens_seen' to true. This allows us to detect
8054         misplaced preprocessor directives (i.e. not at the beginning of
8055         the a line, nor after whitespaces). In that case, report error
8056         CS1040. This fixes bug #56460.
8057
8058         * cs-parser.jay (interface_member_declaration): Add checks for
8059         IsExplicitImpl, and report CS0541 error if an interface member is
8060         defined as an explicit interface declaration.
8061
8062 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8063
8064         Fix #70817
8065         * class.cs (PropertyMethod): Set Parent field in ctors.
8066         (SetMethod.InternalParameters): Add unsafe switch hack.
8067         
8068         * decl.cs (MemberCore.Parent): Cannot be readonly.
8069
8070 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8071
8072         * decl.cs (DeclSpace.ResolveType): Remove.
8073         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8074         Merge in code from ...
8075         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8076         * class.cs, enum.cs: Update to changes.
8077
8078 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8079
8080         * anonymous.cs: Ensure that we init the scope of our parent if it
8081         has not been initialized yet.
8082
8083 2004-12-30  Duncan Mak  <duncan@ximian.com>
8084
8085         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8086         if field.FieldBuilder is null. Fixes #70758.
8087
8088         * convert.cs: Fixed some typos and updated some of the comments.
8089         (ImplicitStandardConversionExists):
8090         (TryImplicitIntConversion): If `target_type' is an interface and
8091         the type of `ic' implements this interface, return true or a new
8092         BoxedCast instead of null. This fixes #70468.
8093
8094 2004-12-29  Duncan Mak  <duncan@ximian.com>
8095
8096         * expression.cs (Argument.Emit): Check that Expr is
8097         IMemoryLocation before casting to it, and report CS1510 otherwise.
8098
8099         This fixes #70402.
8100
8101 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8102
8103         * statement.cs (Block.ThisVariable): remove the recursion here, to
8104         make the --profile more sane.
8105
8106 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8107
8108         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8109         assembly, by JB Evain.
8110
8111 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8112
8113         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8114           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8115         "parent" refers to enclosing type/class.  "base" refers to superclass.
8116
8117 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8118
8119         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8120         Ensure that we only have GlobalAttributes.
8121         * attribute.cs (Attribute.Emit): Make non-virtual.
8122         (GlobalAttribute.Emit): Remove.
8123         (Attribute.Resolve): Make virtual.
8124         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8125         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8126         the argument. Don't create one.
8127         (Attribute.GetObsoleteAttribute): Likewise.
8128         (Attribute.GetClsCompliantAttributeValue): Likewise.
8129         * class.cs, decl.cs: Update to changes.
8130
8131 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8132
8133         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8134         
8135         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8136         
8137         * statement.cs (Foreach.Resolve): Add error 186 report.
8138
8139 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8140
8141         * expression.cs (Conditional.DoResolve): Add warning 429.
8142         
8143         * statement.cs (If.Resolve): Add warning 665.
8144
8145 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8146
8147         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8148         except when in the parser, and in GlobalAttribute.
8149         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8150         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8151         RootContext.Tree.Types.NamespaceEntry once work is done.
8152         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8153         and resets RootContext.Tree.Types.NamespaceEntry.
8154
8155 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8156
8157         * cs-parser.jay: Don't create a block for every variable.
8158
8159 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8160
8161         * location.cs: Provide extra information.
8162
8163         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8164         variables from the captured environment, it is the ldarg_0.
8165
8166 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8167
8168         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8169         find a conclusion.
8170         
8171         * class.cs: Changed warning level for 169 to avoid developer
8172         displeasure from warning flooding. It will be changed back when they
8173         fix most of current BCL warnings.
8174         
8175         * RootContext.cs: Pushed default WarningLevel to 3.
8176         
8177         * statement.cs: Removed unused variable.
8178
8179 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8180
8181         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8182         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8183         Add error 502 report.
8184         (StaticClass.DefineType): Add error 441 report.
8185         (Class.AllowedModifiersProp): New virtual property as temporary
8186         extension to AllowedModifiers.
8187         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8188         to share implementation with StaticClass and don't call virtual
8189         methods from ctor.
8190         
8191         * driver.cs (MainDriver): Add error 1558 test.
8192
8193         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8194         report. Moved error 36 test here.
8195
8196         * statement.cs (Throw.Resolve): Add error 724 report.
8197
8198         * typemanager.cs: Add out_attribute_type core type.
8199         
8200 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8201
8202         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8203         3018 report.
8204         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8205
8206         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8207         3017 report.
8208         
8209         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8210
8211         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8212         Add error 3023 report.
8213         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8214
8215         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8216         implementation.
8217
8218 2004-12-12  John Luke  <john.luke@gmail.com>
8219
8220         * driver.cs (AddArgs): take -- into account when
8221         adding arguments, fixes bug 65710 
8222
8223 2004-12-12  Martin Baulig  <martin@ximian.com>
8224
8225         * expression.cs (Unary.TryReduceNegative): Added support for
8226         SByteConstant and ByteConstant.
8227         (Unary.Reduce): Check error values from TryReduceNegative().
8228
8229 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8230
8231         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8232         and report exception as error 182.
8233
8234 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8235
8236         * driver.cs (Main): Fix message when there are warnings.
8237
8238 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8239
8240         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8241
8242 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8243
8244         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8245         Reduced number of warnings.
8246         
8247         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8248
8249 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8250
8251         * driver.cs: Removed message.
8252
8253         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8254
8255 2004-12-08    <vargaz@freemail.hu>
8256
8257         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8258
8259 2004-12-08  Martin Baulig  <martin@ximian.com>
8260
8261         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8262         instead of a CS3002 for properties and indexer.
8263
8264 2004-12-08  Martin Baulig  <martin@ximian.com>
8265
8266         * decl.cs (MemberName.ToString): Make this work again.
8267
8268 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8269
8270         * attribute.cs (Resolve): Add error 591 detection.
8271
8272         * class.cs (FieldMember.Define): Add error 1547 detection.
8273         (Indexer.Define): Add error 620 detection.
8274         (Operator.Define): Add error 590 detection.
8275
8276         * ecore.cs: Missing argument for error 79.
8277
8278         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8279         detection.
8280
8281 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8282
8283         Fix #70106
8284         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8285         only.
8286
8287 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8288
8289         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8290           Some operator comments were suppressed.
8291         * doc.cs : Implicit/explicit operator name in doc comments are like
8292           "op_Explicit(type)~returnType", so added suffix handling.
8293
8294 2004-12-07  Martin Baulig  <martin@ximian.com>
8295
8296         * decl.cs
8297         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8298         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8299         (DeclSpace.ec): New protected field; store the EmitContext here.
8300         (DeclSpace.EmitContext): New public property; moved here from
8301         `TypeContainer'.
8302         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8303         EmitContext.
8304
8305         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8306         (Enum.Emit): Don't create a new EmitContext.
8307
8308         * delegate.cs (Delegate.DefineType): Always create the
8309         EmitContext.
8310
8311         * iterators.cs (Iterators.DefineIterator): Create a new
8312         EmitContext and store it in `ec'.
8313
8314 2004-08-24  Martin Baulig  <martin@ximian.com>
8315
8316         * typemanager.cs
8317         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8318         this for accessibility checks.
8319         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8320         IsNestedFamilyAccessible.
8321         (TypeManager.IsSubclassOf): New method, do what the name actually
8322         says.   
8323
8324 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8325
8326         Fix crash on cs0657-17.cs.
8327         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8328         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8329         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8330         the case where the NamespaceEntry gets overwritten.
8331
8332 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8333
8334         Fixed #69195, #56821
8335         * ecore.cs (ResolveBoolean): Tiny refactoring.
8336
8337         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8338         of right expression resolving when left is false constant and
8339         operator is LogicalAnd OR true constant and operator is LogicalOr.
8340
8341         * statement.cs (ResolveUnreachable): Always reports warning.
8342
8343 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8344
8345         * class.cs: Distinguish between 1721 and 1722 (just a little help
8346         for the programmer).
8347
8348 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8349
8350         * delegate.cs: Only allow this on new versions of the language. 
8351
8352 2004-12-02  Duncan Mak  <duncan@ximian.com>
8353
8354         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8355         Expression class.
8356         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8357         here as a static method. Take an additional bool out parameter
8358         `must_do_cs1540_check' for signaling to InstanceResolve.
8359         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8360         member field from PropertyExpr class and made it an argument of
8361         the method instead.
8362         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8363         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8364         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8365         and `remove_accessor' as well as InstanceResolve: report CS0122
8366         where applicable.
8367
8368         Fixes #70129.
8369
8370 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8371
8372         Fix test-327.cs, test-328.cs, and put in early infrastructure
8373         for eventually fixing #52697.
8374         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8375         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8376         from other methods.
8377         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8378         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8379         (VerifyUsing, error246): Update.
8380         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8381         'NamespaceEntry.LookupNamespaceOrType'.
8382
8383 2004-12-03  Martin Baulig  <martin@ximian.com>
8384
8385         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8386         method as our child, call AnonymousMethod.Compatible() on it.
8387
8388 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8389
8390         Disable XML documentation support in 'basic' profile.
8391         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8392         Redirect XmlElement to System.Object.
8393         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8394         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8395         * mcs.exe.sources: Add doc-bootstrap.cs.
8396         * doc-bootstrap.cs: New file.  Contains empty stub implementation
8397         of doc.cs.
8398
8399 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8400
8401         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8402           comments are allowed.
8403
8404 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8405
8406         * delegate.cs: Add checks for subtypes in paramaters and return values
8407         in VerifyMethod () to add support for Covariance/Contravariance
8408         in delegates.
8409         
8410 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8411
8412         * report.cs: Remove extra closing parenthesis.
8413
8414         * convert.cs (Error_CannotImplicitConversion): If the name of the
8415         types are the same, provide some extra information.
8416
8417         * class.cs (FieldBase): Use an unused bit field from the field to
8418         encode the `has_offset' property from the FieldMember.  This saves
8419         a couple of Ks on bootstrap compilation.
8420
8421         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8422         method as our child, return the AnonymousMethod resolved
8423         expression.
8424
8425         * expression.cs (New.DoResolve): Allow return values from
8426         NewDelegate to also include AnonymousMethods.
8427
8428         Fixes #70150.
8429
8430 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8431
8432         Fix bug #70102
8433         * attribute.cs (Resolve): Improved implementation of params
8434         attribute arguments.
8435
8436         * support.cs (ParameterData): Add HasParams to be faster.
8437
8438 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8439
8440         all things are for /doc support:
8441
8442         * doc.cs: new file that supports XML documentation generation.
8443         * mcs.exe.sources: added doc.cs.
8444         * driver.cs:
8445           Handle /doc command line option.
8446           Report error 2006 instead of 5 for missing file name for /doc.
8447           Generate XML documentation when required, after type resolution.
8448         * cs-tokenizer.cs:
8449           Added support for picking up documentation (/// and /** ... */),
8450           including a new XmlCommentState enumeration.
8451         * cs-parser.jay:
8452           Added lines to fill Documentation element for field, constant,
8453           property, indexer, method, constructor, destructor, operator, event
8454           and class, struct, interface, delegate, enum.
8455           Added lines to warn incorrect comment.
8456         * rootcontext.cs :
8457           Added Documentation field (passed only when /doc was specified).
8458         * decl.cs:
8459           Added DocComment, DocCommentHeader, GenerateDocComment() and
8460           OnGenerateDocComment() and some supporting private members for
8461           /doc feature to MemberCore.
8462         * class.cs:
8463           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8464         * delegate.cs:
8465           Added overriden DocCommentHeader.
8466         * enum.cs:
8467           Added overriden DocCommentHeader and GenerateDocComment().
8468
8469 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8472         unwrapping the enumeration values, chain to
8473         DoConstantNumericPromotions again, so we can promote things to the
8474         fundamental types (takes care of enums that are bytes, sbytes).
8475
8476         Fixes bug #62054.
8477
8478 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8479
8480         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8481         Fix long-standing bug in type-lookup.  Use FindType instead of
8482         LookupType when ec.ResolvingTypeTree.
8483         (Attribute.ResolveType, Attribute.Resolve)
8484         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8485         Update to changes.
8486         (Attributes.Search): Remove internal version.  Update.
8487         (Attributes.SearchMulti): Update.
8488         (Attributes.GetClsCompliantAttribute): Remove.
8489         (Attributes.GetIndexerNameAttribute): Remove.
8490         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8491         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8492         * class.cs (Indexer.Define): Likewise.
8493
8494 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8495
8496         Fix bug #68790
8497         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8498         MarshallByReference members access.
8499
8500         * expression.cs: Use CheckMarshallByRefAccess;
8501         Better error CS0197 message.
8502
8503         * report.cs: Print whole related error message.
8504
8505 2004-11-30  Raja R Harinath  <rharinath@novell.com>
8506
8507         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8508         the current directory to help debugging.
8509
8510 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8511
8512         * class (GetClassBases): Better error 60 report.
8513         (EventProperty): Disabled warning 67 detection.
8514
8515 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8516
8517         Fix bug #60324
8518         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8519
8520         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8521         precise values.
8522
8523 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8524
8525         Fix bug #49488
8526         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8527
8528         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8529
8530 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8531
8532         * attribute.cs (Attribute.Resolve): Refine error reporting and
8533         report a cs0117 if the identifier does not exist, to distinguish
8534         from 0617 which is a miss-use of the actual identifier.
8535
8536         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8537         between cs0070 and cs0079.
8538
8539         * class.cs (MemberBase.DoDefine): When reporting a wrong
8540         accessibility level, we use MethodCore to compare instead of
8541         Method (this was a regression in some refactoring effort).
8542
8543         So now we correctly report cs0056 again.
8544
8545         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8546         testing the target_type (which was known to be object_type) and
8547         not the source type (which is anonymous_method).
8548
8549         Fixed reporting of error cs1660.
8550
8551         * expression.cs (UserCast.Source): Expose the underlying cast.
8552
8553         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8554         allowed types to find a match to int32 first (most common).
8555
8556         In addition, it ignores any ImplicitUserConversions that did an
8557         internal implicit conversion (as the switch statement allows only
8558         one integral conversion to exist).
8559
8560         * class.cs (PartialContainer.Create): rename `name' to
8561         `member_name' for clarity.  Then replace the string calls with a
8562         call to MemberName.GetPartialName, as now using
8563         MemberName.ToString is an error (this is due to the side effects
8564         it had, that were fixed in the past).
8565
8566         This will restore the error reporting on a number of partial class
8567         errors that were missusing this (and getting an exception as a
8568         results, which is now just a plain textual warning, because
8569         yyparse debug output would crash otherwise).
8570
8571 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8572
8573         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8574
8575 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8576
8577         * rootcontext.cs (LookupType): Make sure to cache lookups that
8578         don't give us a negative result. This saves about 5% of corlib
8579         compilation time.
8580
8581 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8582
8583         * report.cs (AbstractMessage.Print): messages are sent to stderr
8584
8585         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8586         non-interface in the list of interfaces (at this point, either
8587         parent was properly set, or a base class is being listed in the
8588         interfaces section).
8589
8590         This flags error 1722, and resolves the crash from bug 69259.
8591
8592 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8593
8594         * statement.cs (Using.EmitExpressionFinally): make this work right
8595         for valuetypes. Fixes 69926.
8596
8597 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8598
8599         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8600         converted to an enum" here, before we try to change the underlying
8601         type.  This code exists, but it is a different code path than the
8602         one used while encoding constants.
8603
8604         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8605         old bug: when converting from the null literal to a pointer,
8606         return an EmptyCast, not the NullLiteral.
8607
8608         This fixes #69921, the recent null_type changes probably made this
8609         bug more prominent.
8610
8611         (ImplicitReferenceConversionExists): In addition, resynchronized
8612         the code here, so it matches the same code in
8613         ImplicitReferenceConversionExists for the `from any class-type S
8614         to any interface-type T'.
8615         
8616
8617 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8618
8619         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8620
8621 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8622
8623         * cs-parser.jay: Use verbosity accordingly. 
8624
8625 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8626
8627         * expression.cs (Unary.ResolveOperator): Do not report warning;
8628         AddressOf reads from variable.
8629         
8630         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8631
8632 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8633
8634         Fix bug #69462
8635
8636         * attribute.cs (Attributable): Removed CheckTargets.
8637         (Attributes.Emit): Explicit attribute targets are tested here.
8638
8639         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8640         not enabled for interfaces.
8641
8642         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8643         (GetAssemblyName): Ouch next bug there.
8644
8645 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8646
8647         * expression.cs: Error 275 added.
8648         
8649 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8650
8651         Fix bug #69177 (Implemented decimal constant support)
8652
8653         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8654         (BinaryFold): Add DecimalConstant.
8655
8656         * const.cs (Define): Decimal constant 
8657         (is not constant.
8658         (ChangeType): Add decimal type handling.
8659         (LookupConstantValue): Don't set value for decimal type but
8660         emit DecimalConstantAttribute. Needed for constant optimization.
8661
8662         * constant.cs (ToDecimal): New method.
8663         (ConvertToDecimal): New method.
8664         (IntConstant): Implemented ConvertToDecimal.
8665         (DecimalConstant.Emit): Emit optimized version for decimals in
8666         int range.
8667
8668         * expression.cs (ResolveOperator): Changed order of constant
8669         reduction to work correctly with native types which have
8670         overloaded operators.
8671         (ResolveMemberAccess): Extract constant value from attribute
8672         for decimal type.
8673
8674         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8675
8676         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8677         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8678         (ChangeType): Decimal is special.
8679         (TypeToCoreType): Add decimal type.
8680
8681 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8682
8683         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8684         decimal types.
8685
8686 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8687
8688         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8689         test cs1667-5.cs.
8690
8691 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8692
8693         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8694
8695         * pending.cs (PendingImplementation): Grab only interfaces.
8696
8697 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8698
8699         * statement.cs (ForeachHelperMethods): Add location member and
8700         error 202 detection.
8701
8702 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8703
8704         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8705         automatically handled by executable.make.
8706         (PROGRAM): Make profile-specific.
8707
8708 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8709
8710         * expression.cs (DoResolveBase): Fixed wrong warning for out
8711         variables.
8712
8713 2004-11-18  Martin Baulig  <martin@ximian.com>
8714
8715         Merged latest changes into gmcs.  Please keep this comment in
8716         here, it makes it easier for me to see what changed in MCS since
8717         the last time I merged.
8718
8719 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8720
8721         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8722         (TypeHandle.GetMemberCache): New.
8723         (TypeHandle.TypeHandle): Update.
8724         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8725         (TypeManager.LookupParentInterfacesCache):
8726         Rename from LookupInterfaceCache.  Optimize slightly.
8727         (TypeManager.MemberLookup_FindMembers): Update.
8728         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8729         multi-type variant.
8730         (AddCacheContents): Rename from AddHashtable.
8731         * class.cs (TypeContainer.parent_container): Remove.
8732         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8733         (TypeContainer.DoDefineMembers): Don't initialize it.
8734         Update to name changes.
8735         
8736 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8737
8738         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8739         that factors the code to check access modifiers on override.  
8740
8741         (PropertyBase): Use the code here.
8742
8743         Patch from Lluis S'anchez, fixes bug #69361.
8744
8745 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8746
8747         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8748         routine that is used to report the use of a captured variable
8749         whose address has been taken.
8750
8751         There are two checks: one when variables are being captured and
8752         the other check is when the address of a variable is taken. 
8753         
8754         (because an anonymous methods might be resolved before *or* after
8755         the address has been taken) and 
8756
8757         * expression.cs (Conditional.DoResolve): Remove the special
8758         casing that Martin added to trueExpr and falseExpr being both
8759         NullLiteral.  We get the right behavior now just by introducing
8760         the null_type into the compiler. 
8761
8762         * convert.cs (ExplicitConversion): Change the code to use
8763         null_type instead of testing `expr is NullLiteral'.
8764         (ImplicitConversionStandard): use null_type too.
8765         (ImplicitReferenceConversionExists): use null_type too.
8766         (ImplicitReferenceConversion): use null_type too.
8767
8768         * literal.cs: The type of `NullLiteral' is now null_type instead
8769         of object_type. 
8770         (Resolve): Set the type here.
8771
8772         * typemanager.cs: Introduce null_type.
8773
8774 2004-11-17  Martin Baulig  <martin@ximian.com>
8775
8776         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8777         direction, like FindMembers() does.  Fixes #69546, testcase is in
8778         test-315.cs.    
8779
8780 2004-11-16  Martin Baulig  <martin@ximian.com>
8781
8782         This is based on a patch from Marek Safar, see bug #69082.
8783         Fixes bugs #63705 and #67130.
8784
8785         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8786         method; create a MemberCache for an interface type and cache the
8787         result.
8788
8789         * decl.cs (IMemberContainer.ParentContainer): Removed.
8790         (IMemberContainer.ParentCache): New property.
8791         (MemberCache.SetupCacheForInterface): Removed.
8792         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8793         to create a cache for an interface's "parent".
8794
8795         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8796         interfaces too.
8797
8798 2004-11-16  Martin Baulig  <martin@ximian.com>
8799
8800         Merged back from gmcs; these changes already went into gmcs a
8801         couple of weeks ago.
8802
8803         * typemanager.cs
8804         (TypeManager.AddUserType): Removed the `ifaces' argument.
8805         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8806         `TypeExpr []'.
8807         (TypeManager.AddUserInterface): Removed.
8808         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8809         `TypeExpr []'.
8810         (TypeManager.GetInterfaces): Likewise.
8811         (TypeManager.GetExplicitInterfaces): Likewise.
8812
8813         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8814
8815         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8816         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8817
8818 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8819
8820         * statement.cs: Avoid adding bools to a hashtable.
8821
8822 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8823
8824         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8825         calling an unsafe method from a safe location.
8826
8827 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8828
8829         Fix #69167
8830         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8831
8832 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8833
8834         * namespace.cs (VerifyUsing): use GetPartialName instead of
8835         ToString. 
8836
8837 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8838
8839         * statement.cs (Return.Resolve): Fix regression in typo: if
8840         `in_exc', we have to request a NeedReturnLabel, this was a typo
8841         introduced in the anonymous method check-in.  Fixes #69131.
8842
8843         * Indexers were using the ShortName when defining themselves,
8844         causing a regression in the compiler bootstrap when applying the
8845         patch from 2004-11-02 (first part), now they use their full name
8846         and the bug is gone.
8847
8848 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8849
8850         * driver.cs: Strip the path from the names of embedded resources. Fixes
8851         #68519.
8852
8853 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8854
8855         Fix error message regression: cs0104-2.cs.
8856         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8857         (AliasEntry.Resolve): Update.
8858         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8859         'silent' flag.
8860         (RootContext.LookupType): Update.
8861
8862 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8863
8864         * cs-parser.jay: Add support for handling accessor modifiers
8865         * class: Add support port accessor modifiers and error checking,
8866         define PropertyMethod.Define as virtual (not abstract anymore)
8867         * ecore.cs: Add checking for proeprties access with access modifiers
8868         * iterators.cs: Modify Accessor constructor call based in the modified
8869         constructor
8870 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8871
8872         * expression.cs (StringConcat): Handle being called twice,
8873         as when we have a concat in a field init with more than two
8874         ctors in the class
8875
8876 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8877
8878         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8879         special case explicit implementations, we should always produce
8880         the .property or .event declaration.
8881         
8882         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8883         since it will not return correct data if people use this
8884         unresolved in the presence of using statements (see test-313).
8885
8886         * class.cs (MethodData.Define): If we are an explicit interface
8887         implementation, set the method name to the full name of the
8888         interface plus the name of the method.  
8889
8890         Notice that using the method.MethodName.GetFullName() does not
8891         work, as it will only contain the name as declared on the source
8892         file (it can be a shorthand in the presence of using statements)
8893         and not the fully qualifed type name, for example:
8894
8895         using System;
8896
8897         class D : ICloneable {
8898                 object ICloneable.Clone ()  {
8899                 }
8900         }
8901
8902         Would produce a method called `ICloneable.Clone' instead of
8903         `System.ICloneable.Clone'.
8904
8905         * namespace.cs (Alias.Resolve): Use GetPartialName.
8906         
8907 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8908
8909         * cs-parser.jay: Add error 1055 report.
8910
8911 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8912
8913         * assign.cs (Assign.DoResolve): Only do the transform of
8914         assignment into a New if the types are compatible, if not, fall
8915         through and let the implicit code deal with the errors and with
8916         the necessary conversions. 
8917
8918 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8919
8920         * cs-parser.jay: Add error 1031 report.
8921
8922         * cs-tokenizer.cs: Add location for error 1038.
8923
8924 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8925
8926         * cs-parser.jay: Add error 1016 report.
8927
8928 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8929
8930         * cs-parser.jay: Add errors 1575,1611 report.
8931
8932 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8933
8934         * cs-parser.jay: Add error 1001 report.
8935
8936 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8937
8938         Fix #68850
8939         * attribute.cs (GetMarshal): Add method argument for
8940         caller identification.
8941
8942         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8943         agument for GetMarshal and RuntimeMissingSupport.
8944
8945 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8946
8947         * attribute.cs (ExtractSecurityPermissionSet): Removed
8948         TypeManager.code_access_permission_type.
8949
8950         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8951
8952 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8953
8954         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8955         for obsolete use of a variable here.   Fixes regression on errors
8956         cs0619-25 and cs0619-26.
8957
8958 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8959
8960         Fix #62358, implemented security attribute encoding.
8961
8962         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8963         Tests permitted SecurityAction for assembly or other types.
8964         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8965         data from SecurityPermissionAttribute to PermisionSet class.
8966
8967         * class.cs (ApplyAttributeBuilder): Added special handling
8968         for System.Security.Permissions.SecurityAttribute based types.
8969
8970         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8971         special handling for System.Security.Permissions.SecurityAttribute
8972         based types.
8973
8974         * enum.cs (ApplyAttributeBuilder): Added special handling
8975         for System.Security.Permissions.SecurityAttribute based types.
8976
8977         * parameter.cs (ApplyAttributeBuilder): Added special handling
8978         for System.Security.Permissions.SecurityAttribute based types.
8979
8980         * rootcontext.cs: Next 2 core types.
8981
8982         * typemanager.cs (TypeManager.security_permission_attr_type):
8983         Built in type for the SecurityPermission Attribute.
8984         (code_access_permission_type): Build in type.
8985
8986 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8987
8988         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8989         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8990         all of this information into
8991         EmitContext.EmitCapturedVariableInstance.
8992         
8993         * codegen.cs (EmitCapturedVariableInstance): move here the
8994         funcionality of emitting an ldarg.0 in the presence of a
8995         remapping.   This centralizes the instance emit code.
8996
8997         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8998         then emit a load of this: it means that we have reached the
8999         topmost ScopeInfo: the one that contains the pointer to the
9000         instance of the class hosting the anonymous method.
9001
9002         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9003         captures to the topmost CaptureContext.
9004
9005 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9006
9007         * expression.cs (LocalVariableReference): Move the knowledge about
9008         the iterators into codegen's EmitCapturedVariableInstance.
9009
9010 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9011
9012         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9013         all code paths return a value from an anonymous method (it is the
9014         same as the 161 error, but for anonymous methods).
9015
9016 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9017
9018         The introduction of anonymous methods in the compiler changed
9019         various ways of doing things in the compiler.  The most
9020         significant one is the hard split between the resolution phase
9021         and the emission phases of the compiler.
9022
9023         For instance, routines that referenced local variables no
9024         longer can safely create temporary variables during the
9025         resolution phase: they must do so from the emission phase,
9026         since the variable might have been "captured", hence access to
9027         it can not be done with the local-variable operations from the runtime.
9028         
9029         * statement.cs 
9030
9031         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9032         is a toplevel block.
9033
9034         (ToplevelBlock): A new kind of Block, these are the blocks that
9035         are created by the parser for all toplevel method bodies.  These
9036         include methods, accessors and anonymous methods.
9037
9038         These contain some extra information not found in regular blocks:
9039         A pointer to an optional CaptureContext (for tracking captured
9040         local variables and parameters).  A pointer to the parent
9041         ToplevelBlock.
9042         
9043         (Return.Resolve): Catch missmatches when returning a value from an
9044         anonymous method (error 1662).
9045         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9046         phase.
9047
9048         (Break.Resolve): ditto.
9049
9050         (SwitchLabel): instead of defining the labels during the
9051         resolution phase, we now turned the public ILLabel and ILLabelCode
9052         labels into methods called GetILLabelCode() and GetILLabel() that
9053         only define the label during the Emit phase.
9054
9055         (GotoCase): Track the SwitchLabel instead of the computed label
9056         (its contained therein).  Emit the code by using
9057         SwitchLabel.GetILLabelCode ().
9058
9059         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9060         whether the Local has been captured or not.
9061
9062         (LocalInfo.IsCaptured): New property, used to tell whether the
9063         local has been captured.
9064         
9065         * anonymous.cs: Vastly updated to contain the anonymous method
9066         support.
9067
9068         The main classes here are: CaptureContext which tracks any
9069         captured information for a toplevel block and ScopeInfo used to
9070         track the activation frames for various local variables.   
9071
9072         Each toplevel block has an optional capture context associated
9073         with it.  When a method contains an anonymous method both the
9074         toplevel method and the anonymous method will create a capture
9075         context.   When variables or parameters are captured, they are
9076         recorded on the CaptureContext that owns them, for example:
9077
9078         void Demo () {
9079              int a;
9080              MyDelegate d = delegate {
9081                  a = 1;
9082              }
9083         }
9084
9085         Here `a' will be recorded as captured on the toplevel
9086         CapturedContext, the inner captured context will not have anything
9087         (it will only have data if local variables or parameters from it
9088         are captured in a nested anonymous method.
9089
9090         The ScopeInfo is used to track the activation frames for local
9091         variables, for example:
9092
9093         for (int i = 0; i < 10; i++)
9094                 for (int j = 0; j < 10; j++){
9095                    MyDelegate d = delegate {
9096                         call (i, j);
9097                    }
9098                 }
9099
9100         At runtime this captures a single captured variable `i', but it
9101         captures 10 different versions of the variable `j'.  The variable
9102         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9103         recorded on a child.  
9104
9105         The toplevel ScopeInfo will also track information like the `this'
9106         pointer if instance variables were referenced (this is necessary
9107         as the anonymous method lives inside a nested class in the host
9108         type of the method). 
9109
9110         (AnonymousMethod): Expanded to track the Toplevel, implement
9111         `AnonymousMethod.Compatible' to tell whether an anonymous method
9112         can be converted to a target delegate type. 
9113
9114         The routine now also produces the anonymous method content
9115
9116         (AnonymousDelegate): A helper class that derives from
9117         DelegateCreation, this is used to generate the code necessary to
9118         produce the delegate for the anonymous method that was created. 
9119
9120         * assign.cs: API adjustments for new changes in
9121         Convert.ImplicitStandardConversionExists.
9122
9123         * class.cs: Adjustments to cope with the fact that now toplevel
9124         blocks are of type `ToplevelBlock'. 
9125
9126         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9127         insteda of standard blocks.
9128
9129         Flag errors if params arguments are passed to anonymous methods.
9130
9131         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9132         `CurrentAnonymousMethod' which points to the current Anonymous
9133         Method.  The variable points to the AnonymousMethod class that
9134         holds the code being compiled.  It is set in the new EmitContext
9135         created for the anonymous method.
9136
9137         (EmitContext.Phase): Introduce a variable and an enumeration to
9138         assist in enforcing some rules about when and where we are allowed
9139         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9140         only one that enfonces this right now).
9141
9142         (EmitContext.HaveCaptureInfo): new helper method that returns
9143         whether we have a CapturedContext initialized.
9144
9145         (EmitContext.CaptureVariable): New method used to register that a
9146         LocalInfo must be flagged for capturing. 
9147
9148         (EmitContext.CapturedParameter): New method used to register that a
9149         parameters must be flagged for capturing. 
9150         
9151         (EmitContext.CapturedField): New method used to register that a
9152         field must be flagged for capturing. 
9153
9154         (EmitContext.HaveCapturedVariables,
9155         EmitContext.HaveCapturedFields): Return whether there are captured
9156         variables or fields. 
9157
9158         (EmitContext.EmitMethodHostInstance): This is used to emit the
9159         instance for the anonymous method.  The instance might be null
9160         (static methods), this (for anonymous methods that capture nothing
9161         and happen to live side-by-side with the current method body) or a
9162         more complicated expression if the method has a CaptureContext.
9163
9164         (EmitContext.EmitTopBlock): Routine that drives the emission of
9165         code: it will first resolve the top block, then emit any metadata
9166         and then emit the code.  The split is done so that we can extract
9167         any anonymous methods and flag any captured variables/parameters.
9168         
9169         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9170         during this phase, the ILGenerator should not be used as labels
9171         and local variables declared here might not be accessible to any
9172         code that is part of an anonymous method.  
9173
9174         Exceptions to this include the temporary variables that are
9175         created by some statements internally for holding temporary
9176         variables. 
9177         
9178         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9179         metadata for a cb
9180
9181         (EmitContext.TemporaryReturn): This method is typically called
9182         from the Emit phase, and its the only place where we allow the
9183         ReturnLabel to be defined other than the EmitMeta.  The reason is
9184         that otherwise we would have to duplicate a lot of logic in the
9185         Resolve phases of various methods that today is on the Emit
9186         phase. 
9187
9188         (EmitContext.NeedReturnLabel): This no longer creates the label,
9189         as the ILGenerator is not valid during the resolve phase.
9190
9191         (EmitContext.EmitThis): Extended the knowledge in this class to
9192         work in anonymous methods in addition to iterators. 
9193
9194         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9195         code is necessary on the stack to access the instance to a local
9196         variable (the variable will be accessed as a field).
9197
9198         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9199         EmitContext.EmitAddressOfParameter): Routines to support
9200         parameters (not completed at this point). 
9201         
9202         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9203         will also remove the parameters.
9204
9205         * convert.cs (Convert): Define a `ConstantEC' which points to a
9206         null.  This is just to prefity some code that uses
9207         ImplicitStandardConversion code and do not have an EmitContext
9208         handy.
9209
9210         The idea is to flag explicitly that at that point in time, it is
9211         known that the conversion will not trigger the delegate checking
9212         code in implicit conversions (which requires a valid
9213         EmitContext). 
9214
9215         Everywhere: pass new EmitContext parameter since
9216         ImplicitStandardConversionExists now requires it to check for
9217         anonymous method conversions. 
9218
9219         (Convert.ImplicitStandardConversionExists): If the type of an
9220         expression is the anonymous_method_type, and the type is a
9221         delegate, we invoke the AnonymousMethod.Compatible method to check
9222         whether an implicit conversion is possible. 
9223
9224         (Convert.ImplicitConversionStandard): Only do implicit method
9225         group conversions if the language level is not ISO_1.
9226
9227         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9228         MethodInfo for the Invoke method.  used by Delegate and
9229         AnonymousDelegate.
9230
9231         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9232         method conversions if the target type is a delegate.
9233
9234         Removed extra debugging nops.
9235
9236         (LocalVariableReference): Turn the `local_info' into a public
9237         field. 
9238
9239         Add `prepared' field, the same hack used for FieldExprs to cope
9240         with composed assignments, as Local variables do not necessarily
9241         operate purely on the stack as they used to: they can be captured
9242         fields. 
9243
9244         Add `temp' for a temporary result, like fields.
9245
9246         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9247
9248         It now copes with Local variables that are captured and emits the
9249         proper instance variable to load it from a field in the captured
9250         case. 
9251
9252         (ParameterReference.DoResolveBase): During the resolve phase,
9253         capture parameters if we are in an anonymous method.
9254
9255         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9256         anonymous method, use the EmitContext helper routines to emit the
9257         parameter reference.
9258
9259         * iterators.cs: Set RemapToProxy to true/false during the
9260         EmitDispose class.
9261
9262         * parameters.cs (GetParameterByName): New helper method. 
9263
9264         * typemanager.cs (anonymous_method_type) a new type that
9265         represents an anonyous method.  This is always an internal type,
9266         used as a fencepost to test against the anonymous-methodness of an
9267         expression. 
9268         
9269 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9270
9271         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9272         561 report.
9273         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9274
9275 2004-10-18  Martin Baulig  <martin@ximian.com>
9276
9277         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9278         `Type' directly, but call ResolveType() on it.
9279         (Catch.Resolve): Likewise.
9280         (Foreach.Resolve): Likewise.
9281
9282 2004-10-18  Martin Baulig  <martin@ximian.com>
9283
9284         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9285         `Type' directly, but call ResolveType() on it.
9286         (Probe.DoResolve): Likewise.
9287         (ArrayCreation.LookupType): Likewise.
9288         (TypeOf.DoResolve): Likewise.
9289         (SizeOf.DoResolve): Likewise.
9290
9291 2004-10-18  Martin Baulig  <martin@ximian.com>
9292
9293         * expression.cs (Invocation.BetterFunction): Put back
9294         TypeManager.TypeToCoreType().
9295
9296 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9297
9298         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9299         the ResolveType.
9300
9301 2004-10-18  Martin Baulig  <martin@ximian.com>
9302
9303         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9304         `Type' directly, but call ResolveType() on it.
9305
9306 2004-10-18  Martin Baulig  <martin@ximian.com>
9307
9308         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9309         `Type' directly, but call ResolveType() on it.
9310         (MemberBase.DoDefine): Likewise.
9311
9312         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9313         `Type' directly, but call ResolveType() on it.
9314         (ComposedCast.DoResolveAsTypeStep): Likewise.
9315
9316         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9317         `Type' directly, but call ResolveType() on it.
9318
9319 2004-10-17  John Luke  <john.luke@gmail.com>
9320
9321         * class.cs (Operator.GetSignatureForError): use CSharpName
9322
9323         * parameter.cs (Parameter.GetSignatureForError): Returns
9324         correct name even if was not defined.
9325
9326 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9327
9328         Fix #65816.
9329         * class.cs (TypeContainer.EmitContext): New property.
9330         (DefineNestedTypes): Create an emitcontext for each part.
9331         (MethodCore.DoDefineParameters): Use container's emitcontext.
9332         Pass type array to InternalParameters.
9333         (MemberBase.DoDefine): Use container's emitcontext.
9334         (FieldMember.Define): Likewise.
9335         (Event.Define): Likewise.
9336         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9337         Pass type array to InternalParameters.
9338         (SetIndexerMethod.GetParameterInfo): Likewise.
9339         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9340         * delegate.cs (Define): Pass emitcontext to
9341         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9342         array to InternalParameters.
9343         * expression.cs (ParameterReference.DoResolveBase): Pass
9344         emitcontext to GetParameterInfo.
9345         (ComposedCast.DoResolveAsTypeStep): Remove check on
9346         ec.ResolvingTypeTree.
9347         * parameter.cs (Parameter.Resolve): Change argument to
9348         EmitContext.  Use ResolveAsTypeTerminal.
9349         (Parameter.GetSignature): Change argument to EmitContext.
9350         (Parameters.ComputeSignature): Likewise.
9351         (Parameters.ComputeParameterTypes): Likewise.
9352         (Parameters.GetParameterInfo): Likewise.
9353         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9354         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9355         * support.cs (InternalParameters..ctor): Remove variant that takes
9356         a DeclSpace.
9357         * typemanager.cs (system_intptr_expr): New.
9358         (InitExpressionTypes): Initialize it.
9359
9360 2004-10-12  Chris Toshok  <toshok@ximian.com>
9361
9362         * cs-parser.jay: fix location for try_statement and catch_clause.
9363
9364 2004-10-11  Martin Baulig  <martin@ximian.com>
9365
9366         * report.cs: Don't make --fatal abort on warnings, we have
9367         -warnaserror for that.
9368
9369 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9370
9371         More DeclSpace.ResolveType avoidance.
9372         * decl.cs (MemberCore.InUnsafe): New property.
9373         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9374         with newly created EmitContext.
9375         (FieldMember.Define): Likewise.
9376         * delegate.cs (Delegate.Define): Likewise.
9377         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9378         only if normal name-lookup fails.
9379         (TypeExpr.DoResolve): Enable error-checking.
9380         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9381         (SizeOf.DoResolve): Likewise.
9382         (ComposedCast.DoResolveAsTypeStep): Likewise.
9383         (StackAlloc.DoResolve): Likewise.
9384         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9385         (Block.Unsafe): New property.
9386         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9387         (Unsafe): Set 'unsafe' flag of contained block.
9388         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9389         (Fixed.Resolve): Likewise.
9390         (Catch.Resolve): Likewise.
9391         (Using.ResolveLocalVariableDecls): Likewise.
9392         (Foreach.Resolve): Likewise.
9393
9394 2004-10-05  John Luke <john.luke@gmail.com>
9395
9396         * cs-parser.jay: add location to error CS0175
9397
9398 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * ecore.cs (Expression.Constantity): Add support for turning null
9401         into a constant.
9402
9403         * const.cs (Const.Define): Allow constants to be reference types
9404         as long as the value is Null.
9405
9406 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9407
9408         * namespace.cs (NamespaceEntry.Using): No matter which warning
9409         level is set, check if this namespace name has already been added.
9410
9411 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9412
9413         * expression.cs: reftype [!=]= null should always use br[true,false].
9414         # 67410
9415
9416 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9417
9418         Fix #67108
9419         * attribute.cs: Enum conversion moved to 
9420         GetAttributeArgumentExpression to be applied to the all
9421         expressions.
9422
9423 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9424
9425         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9426         * class.c (TypeContainer.DefineType): Flag error if
9427         base types aren't accessible due to access permissions.
9428         * decl.cs (DeclSpace.ResolveType): Move logic to
9429         Expression.ResolveAsTypeTerminal.
9430         (DeclSpace.ResolveTypeExpr): Thin layer over
9431         Expression.ResolveAsTypeTerminal.
9432         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9433         Refactor code into NestedAccess.  Use it.
9434         (DeclSpace.NestedAccess): New.
9435         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9436         argument to silence errors.  Check access permissions.
9437         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9438         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9439         (Cast.DoResolve): Likewise.
9440         (New.DoResolve): Likewise.
9441         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9442         (TypeOf.DoResolve): Likewise.
9443
9444         * expression.cs (Invocation.BetterConversion): Return the Type of
9445         the better conversion.  Implement section 14.4.2.3 more faithfully.
9446         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9447         section 14.4.2.2 explicit.
9448         (Invocation.OverloadResolve): Update.
9449         (Invocation): Remove is_base field.
9450         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9451         (Invocation.Emit): Likewise.
9452
9453 2004-09-27  Raja R Harinath  <rharinath@novell.com>
9454
9455         * README: Update to changes.
9456
9457 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9458
9459         * cs-parser.jay: Reverted 642 warning fix.
9460
9461 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9462
9463         Fix bug #66615
9464         * decl.cs (FindMemberWithSameName): Indexer can have more than
9465         1 argument.
9466
9467 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9468
9469         * expression.cs (LocalVariableReference.DoResolveLValue):
9470         Do not report warning 219 for out values.
9471         (EmptyExpression.Null): New member to avoid extra allocations.
9472
9473 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9474
9475         * cs-parser.jay: Fix wrong warning 642 report.
9476
9477         * cs-tokenizer.cs (CheckNextToken): New helper;
9478         Inspect next character if is same as expected.
9479
9480 2004-09-23  Martin Baulig  <martin@ximian.com>
9481
9482         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9483         (Convert.ImplicitReferenceConversionExists): Likewise.
9484
9485 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9486
9487         * class.cs (Operator.Define): Add error 448 and 559 report.
9488
9489 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9490
9491         * class.cs (MemberBase.IsTypePermitted): New protected
9492         method for checking error CS0610.
9493
9494 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9495
9496         * class.cs (TypeContainer.HasExplicitLayout): New property
9497         Returns whether container has StructLayout attribute set Explicit.
9498         (FieldMember): New abstract class for consts and fields.
9499         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9500         (Field): Reuse FieldMember.
9501
9502         * const.cs (Const): Reuse FieldMember.
9503
9504         * rootcontext.cs: EmitConstants call moved to class.
9505
9506 2004-09-22  Martin Baulig  <martin@ximian.com>
9507
9508         Thanks to Peter Sestoft for this bug report.
9509
9510         * expression.cs (Conditional): If both the `trueExpr' and the
9511         `falseExpr' is a NullLiteral, return a NullLiteral.
9512
9513 2004-09-22  Martin Baulig  <martin@ximian.com>
9514
9515         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9516         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9517         for the "get_Current" call.
9518
9519 2004-09-22  Martin Baulig  <martin@ximian.com>
9520
9521         Marek and me just fixed one of our oldest bugs: #28562 :-)
9522
9523         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9524
9525         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9526         we're an EnumConstant, just return that.
9527         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9528         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9529         to get the value which'll actually be written into the attribute.
9530         However, we have to use GetValue() to access the attribute's value
9531         in the compiler.        
9532
9533 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9534
9535         * constant.cs (Constant.IsNegative): New abstract property
9536         IsNegative.
9537
9538         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9539         (StackAlloc.DoResolve): Reused IsNegative.
9540
9541 2004-09-21  Martin Baulig  <martin@ximian.com>
9542
9543         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9544         if we're used in an iterator, we may be called from different
9545         methods.
9546
9547         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9548         we actually have an exception block.
9549
9550 2004-09-20  John Luke <jluke@cfl.rr.com>
9551
9552         * class.cs, cs-parser.jay: Improve the error report for 1520:
9553         report the actual line where the error happens, not where the
9554         class was declared.
9555
9556         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9557         Pass location information that was available elsewhere.
9558
9559 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
9560
9561         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9562         runtime to delay sign assemblies.
9563
9564 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * cs-parser.jay: Do not report the stack trace, this is barely
9567         used nowadays.
9568
9569 2004-08-22  John Luke  <john.luke@gmail.com>
9570  
9571         * driver.cs : check that a resource id is not already used
9572         before adding it, report CS1508 if it is, bug #63637
9573
9574 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9575
9576         * ecore.cs: Removed dead code.
9577
9578 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
9579
9580         * class.cs: Do not report warning CS0067 on the interfaces.
9581
9582 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9583
9584         * cs-parser.jay: Add error 504 report.
9585
9586 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9587
9588         * rootcontext.cs: WarningLevel is 4 by default now.
9589
9590         * statement.cs (Fixed.Resolve): Do not null
9591         VariableInfo.
9592
9593 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9594
9595         Fixed bug #55780
9596         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9597         deep search when property is not virtual.
9598         (PropertyExpr.ResolveAccessors): Make one call for both
9599         accessors.
9600
9601 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9602
9603         Fixed bug #65766
9604         * statement.cs: Error 152 report constains also location.
9605
9606 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9607
9608         Fixed bug #65766
9609         * const.cs: Explicitly set constant as static.
9610
9611 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9612
9613         Fixed bug #64226
9614         * cs-parser.jay: Add error 1017 report.
9615
9616 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9617
9618         Fixed bug #59980, #64224
9619         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9620
9621         * typemanager.cs (IsSpecialMethod): Simplified
9622
9623 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9624
9625         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9626         condition with better params.
9627
9628 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9629
9630         Fixed bug #65238
9631         * attribute.cs (Resolve): Property has to have both
9632         accessors.
9633
9634 2004-09-14  Martin Baulig  <martin@ximian.com>
9635
9636         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9637
9638 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9639
9640         Fixed bug #61902
9641         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9642         called and is obsolete then this member suppress message
9643         when call is inside next [Obsolete] method or type.
9644
9645         * expression.cs: Use TestObsoleteMethodUsage member.
9646
9647 2004-09-14  Martin Baulig  <martin@ximian.com>
9648
9649         * cs-parser.jay: Sync a bit with the GMCS version.
9650
9651 2004-09-14  Martin Baulig  <martin@ximian.com>
9652
9653         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9654         (CSharpParser.yacc_verbose_flag): New public field.
9655
9656         * genericparser.cs: Removed.
9657
9658 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9659
9660         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9661
9662 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9663
9664         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9665
9666 2004-09-10  Martin Baulig  <martin@ximian.com>
9667
9668         Backported my MemberName changes from GMCS into MCS.
9669
9670         - we are now using a special `MemberName' class instead of using
9671         strings; in GMCS, the `MemberName' also contains the type
9672         arguments.
9673
9674         - changed the grammar rules a bit:
9675           * the old `member_name' is now a `namespace_or_type_name':
9676             The rule is that we use `namespace_or_type_name' everywhere
9677             where we expect either a "member name" (GetEnumerator) or a
9678             "member name" with an explicit interface name
9679             (IEnumerable.GetEnumerator).
9680             In GMCS, the explicit interface name may include type arguments
9681             (IEnumerable<T>.GetEnumerator).
9682           * we use `member_name' instead of just `IDENTIFIER' for
9683             "member names":
9684             The rule is that we use `member_name' wherever a member may
9685             have type parameters in GMCS.       
9686
9687         * decl.cs (MemberName): New public class.
9688         (MemberCore.MemberName): New public readonly field.
9689         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9690         (DeclSpace): Likewise.
9691
9692         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9693         * enum.cs (Enum.ctor): Likewise.
9694
9695         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9696         MemberName.     
9697         (AliasEntry.ctor): Take a MemberName, not an Expression.
9698         (AliasEntry.UsingAlias): Likewise.
9699
9700         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9701         (IMethodData.MemberName): Changed type from string to MemberName.
9702         (MemberBase.ExplicitInterfaceName): Likewise.
9703         (AbstractPropertyEventMethod.SetupName): Make this private.
9704         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9705         argument; compute the member name here.
9706         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9707         on the `member.MemberName' and the `prefix'.
9708
9709         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9710         not `type_name'.
9711         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9712         thus, we get a `MemberName' instead of a `string'.  These
9713         declarations may have type parameters in GMCS.
9714         (interface_method_declaration, delegate_declaration): Likewise.
9715         (class_declaration, interface_declaration): Likewise.
9716         (method_header): Use `namespace_or_type_name' instead of
9717         `member_name'.  We may be an explicit interface implementation.
9718         (property_declaration, event_declaration): Likewise.
9719         (member_name): This is now just an `IDENTIFIER', not a
9720         `namespace_or_type_name'.
9721         (type_name, interface_type): Removed.
9722         (namespace_or_type_name): Return a MemberName, not an Expression.
9723         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9724         call GetTypeExpression() on the MemberName to get an expression.
9725         (IndexerDeclaration.interface_type): Changed type from string to
9726         MemberName.
9727         (MakeName): Operate on MemberName's instead of string's.
9728
9729 2004-09-13  Raja R Harinath  <rharinath@novell.com>
9730
9731         Fix bug #55770.
9732         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9733         (NamespaceEntry.Lookup): Add new argument to flag if we want the
9734         lookup to avoid symbols introduced by 'using'.
9735         * rootcontext.cs (NamespaceLookup): Update.
9736
9737 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9738
9739         * class.cs (TypeContainer.DoDefineMembers): Do not call
9740         DefineDefaultConstructor for static classes.
9741
9742 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9743
9744         * attribute.cs (Attribute.Resolve): Add error 653 report.
9745
9746         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9747         report.
9748         (Method.ApplyAttributeBuilder): Add error 685 report.
9749         (Operator.Define): Add error 564 report.
9750
9751         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9752
9753         * expression.cs (Invocation.DoResolve): Add error
9754         245 and 250 report.
9755
9756         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9757         error 674 report.
9758
9759 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9760
9761         * class.cs (ConstructorInitializer.Resolve):
9762         Wrong error number (515->516).
9763
9764 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9765
9766         * class.cs (Indexer.Define): Add error 631 report.
9767
9768 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9769
9770         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9771
9772 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9773
9774         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9775
9776 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9777
9778         * cs-parser.jay: Added error CS0241 report.
9779
9780 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9781
9782         * cs-parser.jay (fixed_statement): Introduce a scope for the
9783         declaration in the 'fixed' statement.
9784
9785 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9786
9787         * cs-parser.jay: Added CS0230 error report.
9788
9789 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9790
9791         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9792
9793 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9794
9795         * expression.cs (Argument.Resolve): Added error CS0192 and
9796         CS0199 report.
9797
9798 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9799
9800         C# 2.0 #pragma warning feature
9801
9802         * cs-tokenizer.cs (PreProcessPragma): New method; 
9803         Handles #pragma directive.
9804
9805         * report.cs (WarningRegions): New class; Support
9806         class for #pragma warning directive. It tests whether
9807         warning is enabled for a given line.
9808
9809 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9810
9811         * const.cs: Add more descriptive error report, tahnks to
9812         Sebastien. 
9813
9814 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9815
9816         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9817
9818 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9819
9820         * expression.cs: Apply patch from Ben: Remove dead code from
9821         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9822         as that code just threw an exception anwyays.
9823
9824         * const.cs: Remove the call to the turnintoconstant, for details
9825         see bug: #63144
9826         
9827         * literal.cs: The type of the null-literal is the null type;  So
9828         we use a placeholder type (literal.cs:System.Null, defined here)
9829         for it.
9830
9831         * expression.cs (Conditional.DoResolve): Remove some old code that
9832         is no longer needed, conversions have been fixed.
9833
9834         (ArrayCreationExpression.DoResolve): Return false if we fail to
9835         resolve the inner expression.
9836
9837 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9838
9839         Fix test-290.cs.
9840         * cs-parser.jay (delegate_declaration): Record a delegate
9841         declaration as a type declaration.
9842         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9843
9844 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * parameter.cs: Do not crash if the type can not be resolved. 
9847
9848         * expression.cs: Report errors with unsafe pointers, fixes #64896
9849
9850 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9851
9852         * expression.cs: Pointer arith always needs to do a conv.i
9853         if the operand is a long. fix 65320
9854
9855 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9856
9857         Fixed cs0619-37.cs, cs0619-38.cs
9858
9859         * enum.cs (GetObsoleteAttribute): Removed.
9860
9861         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9862         on Enum member is double staged. The first is tested member
9863         and then enum.
9864
9865 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9866
9867         Fixed #56986, #63631, #65231
9868
9869         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9870         adds member to name container.
9871         (TypeContainer.AddToTypeContainer): New method, adds type to
9872         name container.
9873         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9874         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9875         AddOperator): Simplified by reusing AddToMemberContainer.
9876         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9877         instead of field.
9878         (Method.CheckForDuplications): Fixed implementation to test all
9879         possibilities.
9880         (MemberBase): Detection whether member is explicit interface
9881         implementation is now in constructor.
9882         (MemberBase.UpdateMemberName): Handles IndexerName.
9883         (Accessor): Changed to keep also location information.
9884         (AbstractPropertyEventMethod): Is derived from MemberCore.
9885         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9886         will be emited or not.
9887         (PropertyBase.AreAccessorsDuplicateImplementation):
9888         Tests whether accessors are not in collision with some method.
9889         (Operator): Is derived from MethodCore to simplify common
9890         operations.
9891
9892         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9893         must be performed.
9894         (DeclSpace.AddToContainer): Adds the member to defined_names
9895         table. It tests for duplications and enclosing name conflicts.
9896
9897         * enum.cs (EnumMember): Clean up to reuse the base structures
9898
9899 2004-09-03  Martin Baulig  <martin@ximian.com>
9900
9901         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9902         into TypeContainer, to make partial classes work again.
9903
9904 2004-09-03  Martin Baulig  <martin@ximian.com>
9905
9906         * rootcontext.cs (RootContext.V2): Removed.
9907
9908 2004-03-23  Martin Baulig  <martin@ximian.com>
9909
9910         * expression.cs (Invocation.OverloadResolve): Added `bool
9911         may_fail' argument and use it instead of the Location.IsNull() hack.
9912
9913 2004-09-03  Martin Baulig  <martin@ximian.com>
9914
9915         Merged latest changes into gmcs.  Please keep this comment in
9916         here, it makes it easier for me to see what changed in MCS since
9917         the last time I merged.
9918
9919 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9920
9921         Fix #61128.
9922         * expression.cs (BetterConversion): Don't allow either conversion 
9923         to be null.  Remove redundant implicit conversion test when 'q ==
9924         null' -- when this function is invoked, we already know that the
9925         implicit conversion exists.
9926         (BetterFunction): Assume that 'best' is non-null.  Remove
9927         redundant reimplementation of IsApplicable when 'best' is null.
9928         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9929         number of arguments.
9930         (IsAncestralType): Extract from OverloadResolve.
9931         (OverloadResolve): Make robust to the MethodGroupExpr being
9932         unsorted.  Implement all the logic of Section 14.5.5.1, and
9933         support overloading of methods from multiple applicable types.
9934         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9935
9936         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9937         (RealError, Warning): Append type of report to related symbol.
9938
9939 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9940
9941         * enum.cs: Fixed CLS-Compliance checks for enum members.
9942         Error tests cs3008-8.cs, cs3014-8.cs
9943
9944 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9945
9946         Fixed bug #62342, #63102
9947         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9948         like ImplementMethod.
9949
9950 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9951
9952         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9953         Fixed bug #65170.
9954
9955 2004-09-02  Martin Baulig  <martin@ximian.com>
9956
9957         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9958         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9959         on the MethodBase.
9960
9961 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9962
9963         C# 2.0 Static classes implemented
9964
9965         * class.cs (TypeContainer): instance_constructors,
9966         initialized_fields, initialized_static_fields,
9967         default_constructor, base_inteface_types are protected to be
9968         accessible from StaticClass.
9969         (TypeContainer.DefineDefaultConstructor): New virtual method
9970         for custom default constructor generating
9971         (StaticClass): New class to handle "Static classes" feature.
9972
9973         * cs-parser.jay: Handle static keyword on class like instance
9974         of StaticClass.
9975
9976         * driver.cs: Added "/langversion" command line switch with two
9977         options (iso-1, default).
9978
9979 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9980
9981         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9982
9983 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9984
9985         * delegate.cs: Style.
9986
9987 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9988
9989         * delegate.cs: Add seperate instance expr field for miguel.
9990
9991 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9992
9993         * PointerArithmetic (Resolve): make sure we are not doing
9994         pointer arith on void*. Also, make sure we are resolved
9995         by not setting eclass until resolve.
9996
9997         All callers: Make sure that PointerArithmetic gets resolved.
9998
9999 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10000
10001         * ArrayCreation (LookupType): If the type does not resolve 
10002         to an array, give an error.
10003
10004 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10005
10006         * statement.cs (Try.Resolve): Fixed bug #64222
10007
10008 2004-08-27  Martin Baulig  <martin@ximian.com>
10009
10010         * class.cs
10011         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10012         crash here.     
10013
10014 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10015
10016         * ecore.cs (Constantify): Get underlying type via
10017         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10018         Windows in special cases.
10019
10020 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10021
10022         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10023         for obtaining also private methods.
10024         (GetRemoveMethod): Used GetRemoveMethod (true)
10025         for obtaining also private methods.
10026
10027 2004-08-24  Martin Baulig  <martin@ximian.com>
10028
10029         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10030         MethodAttributes.HideBySig for operators.
10031
10032 2004-08-23  Martin Baulig  <martin@ximian.com>
10033
10034         Back to the old error reporting system :-)
10035
10036         * report.cs (Message): Removed.
10037         (Report.MessageData, ErrorData, WarningData): Removed.
10038         (Report.Error, Warning): Back to the old system.
10039
10040 2004-08-23  Martin Baulig  <martin@ximian.com>
10041
10042         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10043
10044         * class.cs (TypeContainer.ParentContainer): New public virtual
10045         method; replaces the explicit interface implementation.
10046         (ClassPart.ParentContainer): Override.
10047
10048 2004-08-23  Martin Baulig  <martin@ximian.com>
10049
10050         * statement.cs (Switch): Added support for constant switches; see
10051         #59428 or test-285.cs.
10052
10053 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10054
10055         Fixed bug #62740.
10056         * statement.cs (GetEnumeratorFilter): Removed useless
10057         logic because C# specs is strict. GetEnumerator must be
10058         public.
10059
10060 2004-08-22  Martin Baulig  <martin@ximian.com>
10061
10062         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10063         a switch and may break, reset the barrier.  Fixes #59867.
10064
10065 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10066
10067         CLS-Compliance speed up (~5% for corlib)
10068
10069         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10070         New method. Tests container for CLS-Compliant names
10071
10072         * class.cs (TypeContainer.VerifyClsName): New method.
10073         Checks whether container name is CLS Compliant.
10074         (Constructor): Implements IMethodData.
10075
10076         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10077         low-case table for CLS Compliance test.
10078         (MemberCache.VerifyClsParameterConflict): New method.
10079         Checks method parameters for CS3006 error.
10080
10081         * enum.cs (EnumMember): Is derived from MemberCore.
10082         (Enum.VerifyClsName): Optimized for better performance.
10083
10084 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10085
10086         * report.cs: Renamed Error_T to Error and changed all
10087         references.
10088
10089 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10090
10091         * class.cs (TypeContainer.IndexerArrayList): New inner class
10092         container for indexers.
10093         (TypeContainer.DefaultIndexerName): New constant for default
10094         indexer name. Replaced all "Item" with this constant.
10095         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10096
10097         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10098         DefaultMemberAttribute constructor.
10099
10100 2004-08-05  Martin Baulig  <martin@ximian.com>
10101
10102         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10103         Fix bug #59429.
10104
10105 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10106
10107         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10108         multi platforms problem.
10109
10110         * compiler.csproj: Included shared files.
10111
10112 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10113
10114         Fix bug 60333, 55971 in the more general way
10115         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10116         Added arg_type argument for constant conversion.
10117         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10118
10119 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10120
10121         Fix bug #59760
10122         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10123         OperatorArrayList, MethodCoreArrayList for typecontainer
10124         containers. Changed class member types to these new types.
10125         (MethodArrayList.DefineMembers): Added test for CS0659.
10126
10127 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10128
10129         * cfold.cs: Synchronize the folding with the code in expression.cs
10130         Binary.DoNumericPromotions for uint operands.
10131
10132         * attribute.cs: Revert patch from Raja, it introduced a regression
10133         while building Blam-1.2.1 (hard to isolate a test case).
10134
10135 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10136
10137         Fix for #55382
10138         * class.cs:
10139         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10140         name collision.
10141         (MethodCore.parent_method): New member. The method we're overriding
10142         if this is an override method.
10143         (MethodCore.CheckBase): Moved from Method class and made common.
10144         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10145         private.
10146         (MethodCore.CheckForDuplications): New abstract method. For custom
10147         member duplication search in a container
10148         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10149         method and its return type.
10150         (Event.conflict_symbol): New member. Symbol with same name in the
10151         parent class.
10152
10153         * decl.cs:
10154         (MemberCache.FindMemberWithSameName): New method. The method
10155         is looking for conflict with inherited symbols.
10156
10157 2004-08-04  Martin Baulig  <martin@ximian.com>
10158
10159         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10160
10161         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10162
10163 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10164
10165         * report.cs (Message): New enum for better error, warning reference in
10166         the code.
10167         (MessageData): New inner abstract class. It generally handles printing of
10168         error and warning messages.
10169         Removed unused Error, Warning, Message methods.
10170
10171 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10172
10173         Fix for cs0592-8.cs test
10174         * attribute.cs
10175         (Attributable.ValidAttributeTargets): Made public.
10176         (Attribute.ExplicitTarget): New member for explicit target value.
10177         (Attribute.CheckTargets): Now we translate explicit attribute
10178         target to Target here.
10179
10180 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10181
10182         * ecore.cs (MethodGroupExpr): new IsBase property.
10183
10184         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10185
10186         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10187         rather than an instance expr.
10188
10189         (DelegateCreation.Emit): Use the method group rather than
10190         the instance expression. Also, if you have base.Foo as the
10191         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10192
10193         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10194
10195         (NewDelegate.DoResolve): Only check for the existance of Invoke
10196         if the method is going to be needed. Use MethodGroupExpr.
10197
10198         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10199
10200         * expression.cs: For pointer arith., make sure to use
10201         the size of the type, not the size of the pointer to
10202         the type.
10203
10204 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10205
10206         Fix for #60722
10207         * class.cs (Class): Added error CS0502 test.
10208
10209 2004-08-03  John Luke  <jluke@cfl.rr.com>
10210             Raja R Harinath  <rharinath@novell.com>
10211
10212         Fix for #60997.
10213         * attribute.cs (Attribute.complained_before): New flag.
10214         (Attribute.ResolveType, Attribute.Resolve),
10215         (Attribute.DefinePInvokeMethod): Set it.
10216         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10217         
10218 2004-08-03  Martin Baulig  <martin@ximian.com>
10219
10220         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10221         use a user-defined operator; we still need to do numeric
10222         promotions in case one argument is a builtin type and the other
10223         one has an implicit conversion to that type.  Fixes #62322.
10224
10225 2004-08-02  Martin Baulig  <martin@ximian.com>
10226
10227         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10228         (LocalInfo.IsThis): New public property.
10229         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10230
10231 2004-08-01  Martin Baulig  <martin@ximian.com>
10232
10233         * class.cs (TypeContainer.GetClassBases): Don't set the default
10234         here since we may get called from GetPartialBases().
10235         (TypeContainer.DefineType): If GetClassBases() didn't return a
10236         parent, use the default one.
10237
10238 2004-07-30  Duncan Mak  <duncan@ximian.com>
10239
10240         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10241
10242 2004-07-30  Martin Baulig  <martin@ximian.com>
10243
10244         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10245
10246         * class.cs (SourceMethod): New public class, derive from the
10247         symbol writer's ISourceMethod.
10248         (Method): Use the new symbol writer API.
10249
10250         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10251         as argument and use the new symbol writer.
10252
10253         * location.cs
10254         (SourceFile): Implement the symbol writer's ISourceFile.
10255         (Location.SymbolDocument): Removed.
10256         (Location.SourceFile): New public property.
10257
10258         * symbolwriter.cs: Use the new symbol writer API.
10259
10260 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10261
10262         * Makefile (install-local): Remove.  Functionality moved to
10263         executable.make.
10264
10265 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10266
10267         * Makefile: Install mcs.exe.config file together with mcs.exe.
10268         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10269         correct runtime version.
10270         
10271 2004-07-25  Martin Baulig  <martin@ximian.com>
10272
10273         * class.cs
10274         (TypeContainer.RegisterOrder): Removed, this was unused.
10275         (TypeContainer, interface_order): Removed.
10276         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10277         TypeContainer as argument since we can also be called with a
10278         `PartialContainer' for a partial class/struct/interface.
10279         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10280         of checking whether we're an `Interface' - we could be a
10281         `PartialContainer'.
10282         (PartialContainer.Register): Override; call
10283         AddClass()/AddStruct()/AddInterface() on our parent.
10284
10285         * cs-parser.jay (interface_member_declaration): Add things to the
10286         `current_container', not the `current_class'.
10287
10288         * rootcontext.cs (RegisterOrder): The overloaded version which
10289         takes an `Interface' was unused, removed.
10290
10291         * typemanager.cs (TypeManager.LookupInterface): Return a
10292         `TypeContainer', not an `Interface'.
10293         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10294         contain a `PartialContainer' for an interface, so check it's
10295         `Kind' to figure out what it is.
10296
10297 2004-07-25  Martin Baulig  <martin@ximian.com>
10298
10299         * class.cs (Class.DefaultTypeAttributes): New public constant.
10300         (Struct.DefaultTypeAttributes): Likewise.
10301         (Interface.DefaultTypeAttributes): Likewise.
10302         (PartialContainer.TypeAttr): Override this and add the
10303         DefaultTypeAttributes.
10304
10305 2004-07-25  Martin Baulig  <martin@ximian.com>
10306
10307         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10308         we can just use the `Parent' field instead.
10309
10310 2004-07-25  Martin Baulig  <martin@ximian.com>
10311
10312         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10313
10314 2004-07-25  Martin Baulig  <martin@ximian.com>
10315
10316         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10317         our parts before defining any methods.
10318         (TypeContainer.VerifyImplements): Make this virtual.
10319         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10320         on our PartialContainer.
10321
10322 2004-07-25  Martin Baulig  <martin@ximian.com>
10323
10324         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10325
10326         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10327         argument, we can just use the `Parent' field instead.
10328
10329         * class.cs
10330         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10331         (MemberBase.DoDefine): Likewise.
10332
10333 2004-07-24  Martin Baulig  <martin@ximian.com>
10334
10335         * decl.cs (MemberCore.Parent): New public field.
10336         (DeclSpace.Parent): Moved to MemberCore.
10337
10338         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10339         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10340         parent's .ctor.
10341         (FieldBase, Field, Operator): Likewise.
10342         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10343         (EventField, Event): Likewise.
10344
10345 2004-07-23  Martin Baulig  <martin@ximian.com>
10346
10347         * class.cs (PartialContainer): New public class.
10348         (ClassPart): New public class.
10349         (TypeContainer): Added support for partial classes.
10350         (TypeContainer.GetClassBases): Splitted some of the functionality
10351         out into GetNormalBases() and GetPartialBases().
10352
10353         * cs-tokenizer.cs (Token.PARTIAL): New token.
10354         (Tokenizer.consume_identifier): Added some hacks to recognize
10355         `partial', but only if it's immediately followed by `class',
10356         `struct' or `interface'.
10357
10358         * cs-parser.jay: Added support for partial clases.
10359
10360 2004-07-23  Martin Baulig  <martin@ximian.com>
10361
10362         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10363         a `DeclSpace' and also made it readonly.
10364         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10365         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10366         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10367
10368         * cs-parser.jay: Pass the `current_class', not the
10369         `current_container' (at the moment, this is still the same thing)
10370         to a new Method, Property, Event, Indexer or Constructor.
10371
10372 2004-07-23  Martin Baulig  <martin@ximian.com>
10373
10374         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10375         and removed the `current_interface' one.
10376         (struct_declaration, class_declaration, interface_declaration):
10377         Set `current_class' to the newly created class/struct/interface;
10378         set their `Bases' and call Register() before parsing their body.
10379
10380 2004-07-23  Martin Baulig  <martin@ximian.com>
10381
10382         * class.cs (Kind): New public enum.
10383         (TypeContainer): Made this class abstract.
10384         (TypeContainer.Kind): New public readonly field.
10385         (TypeContainer.CheckDef): New public method; moved here from
10386         cs-parser.jay.
10387         (TypeContainer.Register): New public abstract method.
10388         (TypeContainer.GetPendingImplementations): New public abstract
10389         method.
10390         (TypeContainer.GetClassBases): Removed the `is_class' and
10391         `is_iface' parameters.
10392         (TypeContainer.DefineNestedTypes): Formerly known as
10393         DoDefineType().
10394         (ClassOrStruct): Made this class abstract.
10395
10396         * tree.cs (RootTypes): New public type. 
10397
10398 2004-07-20  Martin Baulig  <martin@ximian.com>
10399
10400         * tree.cs (Tree.RecordNamespace): Removed.
10401         (Tree.Namespaces): Removed.
10402
10403         * rootcontext.cs (RootContext.IsNamespace): Removed.
10404
10405         * cs-parser.jay (namespace_declaration): Just create a new
10406         NamespaceEntry here.
10407
10408 2004-07-20  Martin Baulig  <martin@ximian.com>
10409
10410         * statement.cs (ExceptionStatement): New abstract class.  This is
10411         now used as a base class for everyone who's using `finally'.
10412         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10413         our local variables before using them.
10414
10415         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10416         virtual method.  This is used by Yield.Resolve() to "steal" an
10417         outer block's `finally' clauses.
10418         (FlowBranchingException): The .ctor now takes an ExceptionStatement
10419         argument.
10420
10421         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10422         version which takes an ExceptionStatement.  This version must be
10423         used to create exception branchings.
10424
10425         * iterator.cs
10426         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10427         (Iterator.EmitMoveNext): Added exception support; protect the
10428         block with a `fault' clause, properly handle 'finally' clauses.
10429         (Iterator.EmitDispose): Run all the `finally' clauses here.
10430
10431 2004-07-20  Martin Baulig  <martin@ximian.com>
10432
10433         * iterator.cs: This is the first of a set of changes in the
10434         iterator code.  Match the spec more closely: if we're an
10435         IEnumerable, then GetEnumerator() must be called.  The first time
10436         GetEnumerator() is called, it returns the current instance; all
10437         subsequent invocations (if any) must create a copy.
10438
10439 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * expression.cs: Resolve the constant expression before returning
10442         it. 
10443
10444 2004-07-19  Martin Baulig  <martin@ximian.com>
10445
10446         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10447         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10448         the return type of the new EmitContext.
10449
10450 2004-07-18  Martin Baulig  <martin@ximian.com>
10451
10452         * class.cs (Property.Define): Fix iterators.
10453
10454         * iterators.cs (Iterator.Define): Moved the
10455         `container.AddInterator (this)' call here from the .ctor; only do
10456         it if we resolved successfully.
10457
10458 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
10459
10460         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10461         `true' for preprocessing directives that we parse.  The return
10462         value indicates whether we should return to regular tokenizing or
10463         not, not whether it was parsed successfully.
10464
10465         In the past if we were in: #if false ... #line #endif, we would
10466         resume parsing after `#line'.  See bug 61604.
10467
10468         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10469         building: IsEnumType should return true only for enums, not for
10470         enums or System.Enum itself.  This fixes #61593.
10471
10472         Likely what happened is that corlib was wrong: mcs depended on
10473         this bug in some places.  The bug got fixed, we had to add the
10474         hack, which caused bug 61593.
10475
10476         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10477         that was a workaround for the older conditions.
10478
10479 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
10480
10481         * assign.cs: IAssignMethod has a new interface, as documented
10482         inline. All assignment code now uses this new api.
10483
10484         * ecore.cs, expression.cs: All classes which implement
10485         IAssignMethod now use the new interface.
10486
10487         * expression.cs (Invocation): add a hack to EmitCall so that
10488         IndexerAccess can be the target of a compound assignment without
10489         evaluating its arguments twice.
10490
10491         * statement.cs: Handle changes in Invocation api.
10492
10493 2004-07-16  Martin Baulig  <martin@ximian.com>
10494
10495         * iterators.cs: Rewrote this.  We're now using one single Proxy
10496         class for both the IEnumerable and the IEnumerator interface and
10497         `Iterator' derives from Class so we can use the high-level API.
10498
10499         * class.cs (TypeContainer.AddIterator): New method.
10500         (TypeContainer.DoDefineType): New protected virtual method, which
10501         is called from DefineType().
10502         (TypeContainer.DoDefineMembers): Call DefineType() and
10503         DefineMembers() on all our iterators.
10504         (TypeContainer.Emit): Call Emit() on all our iterators.
10505         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10506
10507         * codegen.cs (EmitContext.CurrentIterator): New public field.
10508
10509 2004-07-15  Martin Baulig  <martin@ximian.com>
10510
10511         * typemanager.cs
10512         (TypeManager.not_supported_exception_type): New type.   
10513
10514 2004-07-14  Martin Baulig  <martin@ximian.com>
10515
10516         * iterators.cs: Use real error numbers.
10517
10518 2004-07-14  Martin Baulig  <martin@ximian.com>
10519
10520         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10521         requires this to be a System.Collection.IEnumerable and not a
10522         class implementing that interface.
10523         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10524
10525 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10526
10527         * class.cs: Fixed previous fix, it broke some error tests.
10528
10529 2004-07-12  Martin Baulig  <martin@ximian.com>
10530
10531         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10532         Fixes #61293.
10533
10534 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * assign.cs (LocalTemporary): Add new argument: is_address,If
10537         `is_address' is true, then the value that we store is the address
10538         to the real value, and not the value itself.
10539         
10540         * ecore.cs (PropertyExpr): use the new local temporary
10541         stuff to allow us to handle X.Y += z (where X is a struct)
10542
10543 2004-07-08  Martin Baulig  <martin@ximian.com>
10544
10545         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10546         not always return, just like we're doing in Using.Resolve().
10547
10548 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10549
10550         * cs-parser.jay (fixed_statement): flag this as Pinned.
10551
10552 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10553
10554         * typemanager.cs (TypeManager): Removed MakePinned method, this
10555         mechanism is replaced with the .NET 2.x compatible mechanism of
10556         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10557
10558         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10559         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10560         `IsFixed' property which has a different meaning.
10561
10562 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10563
10564         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10565         visible from inside a nested class, not just the names of the
10566         immediately enclosing class.
10567         Fix for bug #60730.
10568
10569 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10570
10571         * expression.cs (BetterConversion): Remove buggy special-case
10572         handling of "implicit constant expression conversions".  At this
10573         point, we already know that the conversion is possible -- we're
10574         only checking to see which is better.
10575
10576 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10577
10578         * cs-parser.jay: Added error CS0210 test.
10579
10580 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10581
10582         * cs-parser.jay: Added error CS0134 test.
10583
10584 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10585
10586         Fix bug #52507
10587         * cs-parser.jay: Added error CS0145 test.
10588
10589 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10590
10591         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10592
10593 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10594         
10595         * expression.cs (StackAlloc.Resolve): The argument may not
10596         be a constant; deal with this case.
10597         
10598 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10599
10600         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10601         GetIndexerAttributeValue.
10602         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10603
10604         * class.cs (Indexer.Define): Added error tests for CS0415,
10605         CS0609.
10606
10607 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10608
10609         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10610         property code.
10611
10612 2004-06-23  Martin Baulig  <martin@ximian.com>
10613
10614         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10615         neither return nor throw, reset the barrier as well.  Fixes #60457.
10616
10617 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10618
10619         * class.cs : EventAttributes is now set to None by default.
10620           This fixes bug #60459.
10621
10622 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10623
10624         Fix bug #60219
10625         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10626         Don't throw exception but return null (it's sufficient now).
10627
10628 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10629
10630         * typemanager.cs (GetArgumentTypes): Faster implementation.
10631
10632 2004-06-18  Martin Baulig  <martin@ximian.com>
10633
10634         * attribute.cs (Attribute.Resolve): Check whether we're an
10635         EmptyCast which a Constant child.  Fixes #60333.
10636
10637 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10638
10639         * statement.cs (EmitCollectionForeach): Account for the fact that
10640         not all valuetypes are in areas which we can take the address of.
10641         For these variables, we store to a temporary variable. Also, make
10642         sure that we dont emit a `callvirt' on a valuetype method.
10643
10644 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10645
10646         * expression.cs (StackAlloc.DoReSolve): Added test for
10647         negative parameter (CS0247).
10648
10649 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10650
10651         Fix bug #59792
10652         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10653
10654 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10655
10656         Fix bug #59781
10657         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10658         ulong.
10659
10660 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10661
10662         Fix bug #58254 & cs1555.cs, cs1556.cs
10663         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10664
10665 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10666
10667         * cs-parser.jay: Added error CS1669 test for indexers.
10668
10669 2004-06-11  Martin Baulig  <martin@ximian.com>
10670
10671         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10672         call this twice: for params and varargs methods.
10673
10674 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10675
10676         * class.cs:
10677         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10678
10679 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10680
10681         * attribute.cs (Attribute.GetValidTargets): Made public.
10682
10683         * class.cs: 
10684         (AbstractPropertyEventMethod): New class for better code sharing.
10685         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10686         CS1667 report.
10687         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10688
10689 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10690
10691         Fix bug #59477.
10692         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10693         that the call to Resolve is part of a MemberAccess.
10694         (Expression.Resolve): Use it for SimpleName resolution.
10695         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10696         Add 'intermediate' boolean argument.
10697         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10698         error message when the SimpleName can be resolved ambiguously
10699         between an expression and a type.
10700         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10701         public.
10702         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10703         call on the left-side.
10704
10705 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10706
10707         * class.cs:
10708         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10709
10710 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10711
10712         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10713
10714 2004-06-11  Martin Baulig  <martin@ximian.com>
10715
10716         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10717         varargs methods if applicable.
10718
10719 2004-06-11  Martin Baulig  <martin@ximian.com>
10720
10721         * expression.cs (Invocation.EmitCall): Don't use
10722         `method.CallingConvention == CallingConventions.VarArgs' since the
10723         method could also have `CallingConventions.HasThis'.
10724
10725 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10726
10727         * class.cs (Event.GetSignatureForError): Implemented.
10728         Fixed crash in error test cs3010.cs
10729
10730 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
10731
10732         * cs-tokenizer.cs: Change the way we track __arglist to be
10733         consistent with the other keywords.
10734
10735 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
10736
10737         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10738         tomorrow.
10739
10740 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
10741
10742         * codegen.cs: Check that all referenced assemblies have a strongname
10743         before strongnaming the compiled assembly. If not report error CS1577.
10744         Fix bug #56563. Patch by Jackson Harper.
10745         * typemanager.cs: Added a method to return all referenced assemblies.
10746         Fix bug #56563. Patch by Jackson Harper.
10747
10748 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10749
10750         * class.cs:
10751         (Method.ApplyAttributeBuilder): Moved and added conditional
10752         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10753
10754         * delegate.cs:
10755         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10756
10757 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10758
10759         Fixed #59640
10760         * class.cs: (EventField.attribute_targets): Changed default target.
10761
10762 2004-06-08  Martin Baulig  <martin@ximian.com>
10763
10764         * expression.cs (Invocation.EmitCall): Enable varargs methods.
10765
10766 2004-06-08  Martin Baulig  <martin@ximian.com>
10767
10768         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10769
10770 2004-06-07  Martin Baulig  <martin@ximian.com>
10771
10772         Added support for varargs methods.
10773
10774         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10775         keyword.
10776
10777         * cs-parser.jay: Added support for `__arglist'.
10778
10779         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10780
10781         * expression.cs (Argument.AType): Added `ArgList'.
10782         (Invocation): Added support for varargs methods.
10783         (ArglistAccess): New public class.
10784         (Arglist): New public class.
10785
10786         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10787
10788         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
10789         a method's top-level block if the method has varargs.
10790
10791         * support.cs (ReflectionParameters, InternalParameters): Added
10792         support for varargs methods.    
10793
10794 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
10795
10796         * class.cs: Provide location in indexer error report.
10797
10798         * driver.cs: Use standard names.
10799
10800         * namespace.cs: Catch the use of using after a namespace has been
10801         declared also on using aliases.
10802
10803 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10804
10805         Bug #50820.
10806         * typemanager.cs (closure_private_ok, closure_invocation_type)
10807         (closure_qualifier_type, closure_invocation_assembly)
10808         (FilterWithClosure): Move to ...
10809         (Closure): New internal nested class.
10810         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10811         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10812         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10813         (MemberLookup, MemberLookupFailed): Use it.
10814         * expression.cs (New.DoResolve): Treat the lookup for the
10815         constructor as being qualified by the 'new'ed type.
10816         (Indexers.GetIndexersForTypeOrInterface): Update.
10817
10818 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10819
10820         * attribute.cs
10821         (GetConditionalAttributeValue): New method. Returns
10822         condition of ConditionalAttribute.
10823         (SearchMulti): New method.  Returns all attributes of type 't'.
10824         Use it when attribute is AllowMultiple = true.
10825         (IsConditionalMethodExcluded): New method.
10826
10827         * class.cs
10828         (Method.IsExcluded): Implemented. Returns true if method has conditional
10829         attribute and the conditions is not defined (method is excluded).
10830         (IMethodData): Extended interface for ConditionalAttribute support.
10831         (PropertyMethod.IsExcluded): Implemented.
10832
10833         * decl.cs
10834         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10835
10836         * expression.cs
10837         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10838         on the method.
10839
10840 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10841
10842         * expression.cs (ArrayCreationExpression): Make this just an
10843         `expression'. It can't be a statement, so the code here was
10844         dead.
10845
10846 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10847
10848         Fixed #59072
10849         * typemanager.cs (GetFullNameSignature): New method for
10850         MethodBase types.
10851
10852 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10853
10854         Fixed #56452
10855         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10856         Use this method when MethodBuilder is null.
10857         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10858         Added test for error CS0626 (MONO reports error for this situation).
10859         (IMethodData.GetSignatureForError): Extended interface.
10860
10861 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10862
10863         * attribute.cs
10864         (AttributeTester.GetObsoleteAttribute): Returns instance of
10865         ObsoleteAttribute when type is obsolete.
10866
10867         * class.cs
10868         (TypeContainer.VerifyObsoleteAttribute): Override.
10869         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10870         (MethodCode.VerifyObsoleteAttribute): Override.
10871         (MemberBase.VerifyObsoleteAttribute): Override.
10872
10873         * decl.cs
10874         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10875         and report proper error.
10876
10877         *delegate.cs
10878         Delegate.VerifyObsoleteAttribute): Override.
10879
10880         * ecore.cs
10881         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10882         and report proper error.
10883         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10884
10885         * enum.cs
10886         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10887         and enum member.
10888
10889         * expression.cs
10890         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10891         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10892         Added test for ObsoleteAttribute.
10893
10894         * statement.cs
10895         (Catch): Derived from Statement.
10896
10897 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10898  
10899         Fixed bug #59071 & cs0160.cs
10900  
10901         * statement.cs (Try.Resolve): Check here whether order of catch
10902         clauses matches their dependencies.
10903
10904 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10905
10906         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10907         caused a regression: #59343.  Referencing nested classes from an
10908         assembly stopped working.
10909
10910 2004-05-31  Martin Baulig  <martin@ximian.com>
10911
10912         MCS is now frozen for beta 2.
10913
10914 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10915
10916         * convert.cs: add a trivial cache for overload operator resolution.
10917
10918 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10919
10920         * decl.cs: If possible, use lookuptypedirect here. We can only do
10921         this if there is no `.' after the namespace. Avoids using
10922         LookupType, which does lots of slow processing.
10923         (FindNestedType) New method, does what it says :-).
10924         * namespace.cs: use LookupTypeDirect.
10925         * rootcontext.cs: use membercache, if possible.
10926         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10927
10928 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10929
10930         * expression.cs:
10931         According to the spec, 
10932
10933         In a member access of the form E.I, if E is a single identifier,
10934         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10935         field, property, localvariable, or parameter with the same type as
10936         the meaning of E as a type-name (§3.8), then both possible
10937         meanings of E are permitted.
10938
10939         We did not check that E as a simple-name had the same type as E as
10940         a type name.
10941
10942         This trivial check gives us 5-7% on bootstrap time.
10943
10944 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10945
10946         * expression.cs (Invocation.OverloadResolve): Avoid the
10947         use of hashtables and boxing here by allocating on demand.
10948
10949 2004-05-30  Martin Baulig  <martin@ximian.com>
10950
10951         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10952         we're doing a silent lookup.  Don't try to lookup nested types in
10953         TypeManager.object_type (thanks to Ben Maurer).
10954
10955 2004-05-30  Martin Baulig  <martin@ximian.com>
10956
10957         Committing a patch from Ben Maurer.
10958
10959         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10960
10961 2004-05-29  Martin Baulig  <martin@ximian.com>
10962
10963         * class.cs (IMethodData.ShouldIgnore): New method.
10964
10965         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10966         `Location' argument, we don't need it anywhere.  Use
10967         `IMethodData.ShouldIgnore ()' instead of
10968         `MethodData.GetMethodFlags ()'.
10969         (TypeManager.AddMethod): Removed.
10970         (TypeManager.AddMethod2): Renamed to AddMethod.
10971
10972 2004-05-29  Martin Baulig  <martin@ximian.com>
10973
10974         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10975
10976         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10977         converting from a class type S to an interface type and we already
10978         have an object on the stack, don't box it again.  Fixes #52578.
10979
10980 2004-05-29  Martin Baulig  <martin@ximian.com>
10981
10982         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10983         Added support for `params' parameters.  Fixes #59267.
10984
10985 2004-05-29  Martin Baulig  <martin@ximian.com>
10986
10987         * literal.cs (NullPointer): Provide a private .ctor which sets
10988         `type' to TypeManager.object_type.  Fixes #59048.
10989
10990 2004-05-29  Martin Baulig  <martin@ximian.com>
10991
10992         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10993         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10994
10995         * ecore.cs (EventExpr.instance_expr): Make the field private.
10996
10997 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10998
10999         Fixed bug #50080 & cs0214-2.cs
11000         * expression.cs (Cast.DoResolve): Check unsafe context here.
11001         
11002         * statement.cs (Resolve.DoResolve): Likewise.
11003
11004 2004-05-26  Martin Baulig  <martin@ximian.com>
11005
11006         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11007
11008         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11009         (RootContext.LookupType): Pass down the `silent' flag.
11010
11011 2004-05-25  Martin Baulig  <martin@ximian.com>
11012
11013         * expression.cs
11014         (MethodGroupExpr.IdenticalTypeName): New public property.
11015         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11016         expression actually refers to a type.
11017
11018 2004-05-25  Martin Baulig  <martin@ximian.com>
11019
11020         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11021         for #56176 and made it actually work.
11022
11023 2004-05-25  Martin Baulig  <martin@ximian.com>
11024
11025         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11026         (FieldExpr, PropertyExpr): Override and implement
11027         CacheTemporaries.  Fixes #52279.
11028
11029 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11030
11031         * location.cs: In the new compiler listing a file twice is a
11032         warning, not an error.
11033
11034 2004-05-24  Martin Baulig  <martin@ximian.com>
11035
11036         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11037         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11038
11039 2004-05-24  Martin Baulig  <martin@ximian.com>
11040
11041         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11042         walking the `using' list.  Fixes #53921.
11043
11044 2004-05-24  Martin Baulig  <martin@ximian.com>
11045
11046         * const.cs (Const.LookupConstantValue): Added support for
11047         EmptyCast's; fixes #55251.
11048
11049 2004-05-24  Martin Baulig  <martin@ximian.com>
11050
11051         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11052         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11053         which does the CS0135 check.  The reason is that we first need to
11054         check whether the variable actually exists.
11055
11056 2004-05-24  Martin Baulig  <martin@ximian.com>
11057
11058         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11059         than RootContext.LookupType() to find the explicit interface
11060         type.  Fixes #58584.
11061
11062 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11063
11064         * Makefile: Simplify.  Use executable.make.
11065         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11066
11067 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11068
11069         * decl.cs:
11070         * enum.cs:
11071         Use the invariant culture when doing String.Compare for CLS case
11072         sensitivity.
11073         
11074 2004-05-23  Martin Baulig  <martin@ximian.com>
11075
11076         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11077         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11078
11079         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11080         
11081 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11082
11083         * class.cs (MemberBase.Define): Reuse MemberType member for 
11084         resolved type. Other methods can use it too.
11085
11086 2004-05-23  Martin Baulig  <martin@ximian.com>
11087
11088         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11089         the variable also exists in the current block (otherwise, we need
11090         to report a CS0103).  Fixes #58670.
11091
11092 2004-05-23  Martin Baulig  <martin@ximian.com>
11093
11094         * flowanalysis.cs (Reachability.Reachable): Compute this
11095         on-the-fly rather than storing it as a field.
11096
11097 2004-05-23  Martin Baulig  <martin@ximian.com>
11098
11099         * flowanalysis.cs (Reachability.And): Manually compute the
11100         resulting `barrier' from the reachability.      
11101        
11102 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11103
11104         Fix bug #57835
11105         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11106         instance of ObsoleteAttribute when symbol is obsolete.
11107
11108         * class.cs
11109         (IMethodData): Extended interface for ObsoleteAttribute support.
11110
11111 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11112
11113         * attribute.cs: Fix bug #55970
11114
11115 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11116
11117         Fix bug #52705
11118         * attribute.cs
11119         (GetObsoleteAttribute): New method. Creates the instance of
11120         ObsoleteAttribute.
11121         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11122         ObsoleteAttribute when member is obsolete.
11123         (AttributeTester.Report_ObsoleteMessage): Common method for
11124         Obsolete error/warning reporting.
11125
11126         * class.cs
11127         (TypeContainer.base_classs_type): New member for storing parent type.
11128
11129         * decl.cs
11130         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11131         for this MemberCore.
11132
11133 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11134
11135         * attribute.cs, const.cs: Fix bug #58590
11136
11137 2004-05-21  Martin Baulig  <martin@ximian.com>
11138
11139         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11140         out parameters if the end of the method is unreachable.  Fixes
11141         #58098. 
11142
11143 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11144
11145         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11146         Hari was right, why extra method.
11147
11148 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11149
11150         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11151
11152 2004-05-20  Martin Baulig  <martin@ximian.com>
11153
11154         Merged this back from gmcs to keep the differences to a minumum.
11155
11156         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11157         instead of a Declspace.
11158         (Attribute.ResolveType): Likewise.
11159         (Attributes.Search): Likewise.
11160         (Attributes.Contains): Likewise.
11161         (Attributes.GetClsCompliantAttribute): Likewise.
11162
11163         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11164         argument.
11165         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11166         DeclSpace.
11167
11168 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11169
11170         Fix bug #58688 (MCS does not report error when the same attribute
11171         is assigned twice)
11172
11173         * attribute.cs (Attribute.Emit): Distinction between null and default.
11174
11175 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11176
11177         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11178         of a top-level attribute without an attribute target.
11179         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11180         Make non-static.
11181         (Attribute.Conditional_GetConditionName), 
11182         (Attribute.Obsolete_GetObsoleteMessage): Update.
11183         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11184         part of ScanForIndexerName.
11185         (Attribute.CanIgnoreInvalidAttribute): New function.
11186         (Attribute.ScanForIndexerName): Move to ...
11187         (Attributes.ScanForIndexerName): ... here.
11188         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11189         (Attributes.Search): New internal variant that can choose not to
11190         complain if types aren't resolved.  The original signature now
11191         complains.
11192         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11193         complaints suppressed.
11194         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11195         only if it not useful.
11196         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11197         top-level for attributes that are shared between the assembly
11198         and a top-level class.
11199         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11200         * class.cs: Update to reflect changes.
11201         (DefineIndexers): Fuse loops.
11202         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11203         a couple more variants of attribute names.
11204
11205 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11206
11207         Fix bug #52585 (Implemented explicit attribute declaration)
11208
11209         * attribute.cs:
11210         (Attributable.ValidAttributeTargets): New abstract method. It gets
11211         list of valid attribute targets for explicit target declaration.
11212         (Attribute.Target): It holds target itself.
11213         (AttributeSection): Removed.
11214         (Attribute.CheckTargets): New method. It checks whether attribute
11215         target is valid for the current element.
11216
11217         * class.cs:
11218         (EventProperty): New class. For events that are declared like
11219         property (with add and remove accessors).
11220         (EventField): New class. For events that are declared like field.
11221         class.cs
11222
11223         * cs-parser.jay: Implemented explicit attribute target declaration.
11224
11225         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11226         Override ValidAttributeTargets.
11227
11228         * parameter.cs:
11229         (ReturnParameter): Class for applying custom attributes on 
11230         the return type.
11231         (ParameterAtribute): New class. Class for applying custom
11232         attributes on the parameter type.
11233
11234 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11235
11236         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11237         definitions. 
11238
11239         (Method): Allow UNSAFE here.
11240
11241         * modifiers.cs: Support unsafe reporting.
11242
11243 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11244
11245         * decl.cs: Fix bug #58478.
11246
11247 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11248
11249         * statement.cs: When checking for unreachable code on an EmptyStatement,
11250         set the location. Fixes bug #58488.
11251
11252 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11253
11254         * driver.cs: Add -pkg handling.
11255
11256         From Gonzalo: UseShelLExecute=false
11257
11258 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11259
11260         * attribute.cs:
11261         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11262         for attribute.
11263         (Attribute.IsClsCompliaceRequired): Moved to base for better
11264         accesibility.
11265         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11266         when attribute is AttributeUsageAttribute.
11267         (Attribute.GetValidTargets): Simplified.
11268         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11269         attribute for this type.
11270         (Attribute.ApplyAttributes): Method renamed to Emit and make
11271         non-static.
11272         (GlobalAttributeSection): New class for special handling of global
11273         attributes (assembly, module).
11274         (AttributeSection.Emit): New method.
11275
11276         * class.cs: Implemented Attributable abstract methods.
11277         (MethodCore.LabelParameters): Moved to Parameter class.
11278         (Accessor): Is back simple class.
11279         (PropertyMethod): Implemented Attributable abstract class.
11280         (DelegateMethod): Implemented Attributable abstract class.
11281         (Event): New constructor for disctintion between normal Event
11282         and Event with accessors.
11283
11284         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11285
11286         * codegen.cs, const.cs, decl.cs, delegate.cs:
11287         (CommonAssemblyModulClass): Implemented Attributable abstract class
11288         and simplified.
11289
11290         * enum.cs: Implement IAttributeSupport interface.
11291         (EnumMember): New class for emum members. Implemented Attributable
11292         abstract class
11293
11294         * parameter.cs:
11295         (ParameterBase): Is abstract.
11296         (ReturnParameter): New class for easier [return:] attribute handling.
11297
11298         * typemanager.cs: Removed builder_to_attr.
11299
11300 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11301
11302         Fix bug #57151.
11303         * attribute.cs (Attribute.GetPositionalValue): New function.
11304         * class.cs (TypeContainer.VerifyMembers): New function.
11305         (TypeContainer.Emit): Use it.
11306         (ClassOrStruct): New base class for Class and Struct.
11307         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11308         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11309         class.
11310         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11311         then each non-static field should have a FieldOffset attribute.
11312         Otherwise, none of the fields should have a FieldOffset attribute.
11313         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11314         and FieldOffset attributes.
11315         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11316         (TypeManager.field_offset_attribute_type): New core types.
11317         (TypeManager.InitCoreTypes): Initialize them.
11318
11319 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11320
11321         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11322         Return correct type.
11323         From bug #58270.
11324
11325 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11328         be implicitly converted to ulong.
11329         
11330         * expression.cs: The logic for allowing operator &, | and ^ worked
11331         was wrong, it worked before because we did not report an error in
11332         an else branch.  Fixes 57895.
11333
11334         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11335         allow volatile fields to be reference types.
11336
11337 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11338
11339         * driver.cs: Add support for /debug-
11340
11341 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11342
11343         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11344         Add a 'complain' parameter to silence errors.
11345         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11346         silently overlooked type-resolutions.
11347         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11348         to reflect changes.
11349         (Attributes.Search): New function.
11350         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11351         (Attributes.GetAttributeFullName): Remove hack.
11352         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11353         Update to reflect changes.
11354         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11355         Use Attributes.Search instead of nested loops.
11356
11357 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11358
11359         * decl.cs:
11360         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11361         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11362         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11363
11364         * report.cs: (Report.Warning): Renamed to Warning_T because of
11365         parameter collision.
11366
11367 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11368
11369         * expression.cs (MemberAccess.ResolveMemberAccess):
11370         Exit with non-zero status after Report.Error.
11371         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11372         Likewise.
11373         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11374
11375 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11376
11377         * support.cs: Don't hang when the file is empty.
11378
11379 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11380
11381         * support.cs: In SeekableStreamReader, compute the preamble size of the
11382           underlying stream. Position changes should take into account that initial
11383           count of bytes.
11384
11385 2004-05-03  Todd Berman  <tberman@sevenl.net>
11386
11387         * driver.cs: remove unused GetSysVersion function.
11388
11389 2004-05-03  Todd Berman  <tberman@sevenl.net>
11390
11391         * driver.cs: Remove the hack from saturday, as well as the hack
11392         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11393         link_paths to get that bit proper.
11394
11395 2004-05-01  Todd Berman  <tberman@sevenl.net>
11396
11397         * driver.cs: Try a LoadFrom before a Load, this checks the current
11398         path. This is currently a bug in mono that is be fixed, however, this
11399         provides a workaround for now. This will be removed when the bug
11400         is fixed.
11401
11402 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11403
11404         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11405         incomplete key pairs (#57941).
11406
11407 2004-05-01  Todd Berman  <tberman@sevenl.net>
11408
11409         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11410         from the GAC
11411
11412 2004-04-30  Jackson Harper  <jackson@ximian.com>
11413
11414         * codegen.cs: Open keys readonly.
11415         
11416 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11417
11418         * typemanager.cs: don't report cyclic struct layout when a struct
11419         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11420         which has 2 Pango.Rectangle fields.
11421
11422 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11423
11424         * expression.cs: Handle IntPtr comparisons with IL code
11425         rather than a method call.
11426
11427 2004-04-29  Martin Baulig  <martin@ximian.com>
11428
11429         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11430         the list of PropertyInfo's in class hierarchy and find the
11431         accessor.  Fixes #56013.
11432
11433 2004-04-29  Martin Baulig  <martin@ximian.com>
11434
11435         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11436
11437 2004-04-29  Martin Baulig  <martin@ximian.com>
11438
11439         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11440
11441         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11442
11443 2004-04-29  Martin Baulig  <martin@ximian.com>
11444
11445         * class.cs (ConstructorInitializer.Resolve): Check whether the
11446         parent .ctor is accessible.  Fixes #52146.
11447
11448 2004-04-29  Martin Baulig  <martin@ximian.com>
11449
11450         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11451
11452         * statement.cs (Using.EmitLocalVariableDecls): Use
11453         TypeManager.idisposable_type, not typeof (IDisposable).
11454         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11455
11456 2004-04-29  Martin Baulig  <martin@ximian.com>
11457
11458         * class.cs (Event.Define): Don't emit the field and don't set
11459         RTSpecialName and SpecialName for events on interfaces.  Fixes
11460         #57703. 
11461
11462 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11463
11464         Refactor Attribute.ApplyAttributes.
11465         * attribute.cs (Attributable): New base class for objects that can
11466         have Attributes applied on them.
11467         (Attribute): Make AttributeUsage fields public.
11468         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11469         (Attribute.IsInternalCall): New property.
11470         (Attribute.UsageAttr): Convert to a public read-only property.
11471         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11472         (Attribute.ResolveType, Attribute.Resolve)
11473         (Attribute.ScanForIndexerName): Update to reflect changes.
11474         (Attribute.CheckAttributeTarget): Re-format.
11475         (Attribute.ApplyAttributes): Refactor, to various
11476         Attributable.ApplyAttributeBuilder methods.
11477         * decl.cs (MemberCore): Make Attributable.
11478         * class.cs (Accessor): Make Attributable.
11479         (MethodData.ApplyAttributes): Use proper attribute types, not
11480         attribute names.
11481         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11482         (TypeContainer.ApplyAttributeBuilder)
11483         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11484         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11485         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11486         (Operator.ApplyAttributeBuilder): New factored-out methods.
11487         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11488         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11489         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11490         * parameter.cs (ParameterBase): New Attributable base class
11491         that can also represent Return types.
11492         (Parameter): Update to the changes.
11493
11494 2004-04-29  Jackson Harper  <jackson@ximian.com>
11495
11496         * driver.cs: Prefer the corlib system version when looking for
11497         assemblies in the GAC. This is still a hack, but its a better hack
11498         now.
11499         
11500 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11501
11502         * decl.cs, enum.cs: Improved error 3005 reporting.
11503   
11504         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11505         (related_symbols): New private member for list of symbols
11506         related to reported error/warning.
11507         
11508         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11509
11510 2004-04-29  Martin Baulig  <martin@ximian.com>
11511
11512         * ecore.cs (Expression.Constantify): If we're an enum and
11513         TypeManager.TypeToCoreType() doesn't give us another type, use
11514         t.UnderlyingSystemType.  Fixes #56178.  
11515
11516 2004-04-29  Martin Baulig  <martin@ximian.com>
11517
11518         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11519         interfaces and for each interface, only add members directly
11520         declared in that interface.  Fixes #53255.
11521
11522 2004-04-28  Martin Baulig  <martin@ximian.com>
11523
11524         * expression.cs (ConditionalLogicalOperator): Use a temporary
11525         variable for `left' to avoid that we evaluate it more than once;
11526         bug #52588.
11527
11528 2004-04-28  Martin Baulig  <martin@ximian.com>
11529
11530         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11531         `void[]' (CS1547).
11532
11533 2004-04-28  Martin Baulig  <martin@ximian.com>
11534
11535         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11536         void (CS1547).
11537
11538         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11539         whether the type is not void (CS1547).
11540
11541 2004-04-28  Martin Baulig  <martin@ximian.com>
11542
11543         * expression.cs (Unary.DoResolveLValue): Override this and report
11544         CS0131 for anything but Operator.Indirection.
11545
11546 2004-04-28  Martin Baulig  <martin@ximian.com>
11547
11548         Committing a patch from Ben Maurer; see bug #50820.
11549
11550         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11551         check for classes.
11552
11553         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11554         classes.        
11555
11556 2004-04-28  Martin Baulig  <martin@ximian.com>
11557
11558         Committing a patch from Ben Maurer; see bug #50820.
11559
11560         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11561         check for classes.
11562
11563         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11564         classes.        
11565
11566 2004-04-28  Martin Baulig  <martin@ximian.com>
11567
11568         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11569         (Block.AddLabel): Call DoLookupLabel() to only search in the
11570         current block.
11571
11572 2004-04-28  Martin Baulig  <martin@ximian.com>
11573
11574         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11575         comparing StringConstants and NullLiterals in Equality and Inequality.
11576
11577 2004-04-28  Jackson Harper  <jackson@ximian.com>
11578
11579         * driver.cs: Attempt to load referenced assemblies from the
11580         GAC. This is the quick and dirty version of this method that
11581         doesnt take into account versions and just takes the first
11582         canidate found. Will be good enough for now as we will not have more
11583         then one version installed into the GAC until I update this method.
11584
11585 2004-04-28  Martin Baulig  <martin@ximian.com>
11586
11587         * typemanager.cs (TypeManager.CheckStructCycles): New public
11588         static method to check for cycles in the struct layout.
11589
11590         * rootcontext.cs (RootContext.PopulateTypes): Call
11591         TypeManager.CheckStructCycles() for each TypeContainer.
11592         [Note: We only need to visit each type once.]
11593
11594 2004-04-28  Martin Baulig  <martin@ximian.com>
11595
11596         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11597
11598         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11599         success and added `out object value'.  Use a `bool resolved' field
11600         to check whether we've already been called rather than
11601         `ConstantValue != null' since this breaks for NullLiterals.
11602
11603 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11604
11605         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11606         setting of this flag, since the 'set' method may be non-public.
11607
11608 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11609
11610         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11611         check on current_vector.Block.
11612
11613 2004-04-27  Martin Baulig  <martin@ximian.com>
11614
11615         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11616         a field initializer.  Fixes #56459.
11617
11618 2004-04-27  Martin Baulig  <martin@ximian.com>
11619
11620         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11621         we're not attempting to use an indexer.  Fixes #52154.
11622
11623 2004-04-27  Martin Baulig  <martin@ximian.com>
11624
11625         * statement.cs (Return): Don't create a return label if we don't
11626         need it; reverts my change from January 20th.  Thanks to Ben
11627         Maurer for this.
11628
11629 2004-04-27  Martin Baulig  <martin@ximian.com>
11630
11631         According to the spec, `goto' can only leave a nested scope, but
11632         never enter it.
11633
11634         * statement.cs (Block.LookupLabel): Only lookup in the current
11635         block, don't recurse into parent or child blocks.
11636         (Block.AddLabel): Check in parent and child blocks, report
11637         CS0140/CS0158 if we find a duplicate.
11638         (Block): Removed this indexer for label lookups.
11639         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11640         this already does the error reporting for us.
11641
11642         * flowanalysis.cs
11643         (FlowBranching.UsageVector.Block): New public variable; may be null.
11644         (FlowBranching.CreateSibling): Added `Block' argument.
11645         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11646         label for the target of a `goto' and check whether we're not
11647         leaving a `finally'.
11648
11649 2004-04-27  Martin Baulig  <martin@ximian.com>
11650
11651         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11652         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11653         just for returns).
11654
11655 2004-04-27  Martin Baulig  <martin@ximian.com>
11656
11657         * statement.cs (Block.AddLabel): Also check for implicit blocks
11658         and added a CS0158 check.
11659
11660 2004-04-27  Martin Baulig  <martin@ximian.com>
11661
11662         * flowanalysis.cs (FlowBranchingLoop): New class.
11663         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11664         UsageVector's instead of an ArrayList.
11665         (FlowBranching.Label): Likewise.
11666         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11667         (FlowBranching.AddBreakVector): New method.
11668
11669 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11670
11671         * attribute.cs: Small regression fix: only convert the type if we
11672         the type is different, fixes System.Drawing build.
11673
11674 2004-04-27  Martin Baulig  <martin@ximian.com>
11675
11676         * attribute.cs (Attribute.Resolve): If we have a constant value
11677         for a named field or property, implicity convert it to the correct
11678         type.
11679
11680 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11681
11682         * statement.cs (Block.Block): Implicit blocks share
11683         'child_variable_names' fields with parent blocks.
11684         (Block.AddChildVariableNames): Remove.
11685         (Block.AddVariable): Mark variable as "used by a child block" in
11686         every surrounding block.
11687         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11688         been used in a child block, complain about violation of "Invariant
11689         meaning in blocks" rule.
11690         * cs-parser.jay (declare_local_variables): Don't use
11691         AddChildVariableNames.
11692         (foreach_statement): Don't create an implicit block: 'foreach'
11693         introduces a scope.
11694
11695 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11696
11697         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11698         converting from 0L to ulong.  Fixes 57522.
11699
11700 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11701
11702         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11703         derived class hides via 'new' keyword field from base class (test-242.cs).
11704         TODO: Handle this in the more general way.
11705         
11706         * class.cs (CheckBase): Ditto.
11707
11708 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11709
11710         * decl.cs (caching_flags): New member for storing cached values
11711         as bit flags.
11712         (MemberCore.Flags): New enum where bit flags for caching_flags
11713         are defined.
11714         (MemberCore.cls_compliance): Moved to caching_flags.
11715         (DeclSpace.Created): Moved to caching_flags.
11716
11717         * class.cs: Use caching_flags instead of DeclSpace.Created
11718         
11719 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11722         if we are only a derived class, not a nested class.
11723
11724         * typemanager.cs: Same as above, but do this at the MemberLookup
11725         level (used by field and methods, properties are handled in
11726         PropertyExpr).   Allow for the qualified access if we are a nested
11727         method. 
11728
11729 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11730
11731         * class.cs: Refactoring.
11732         (IMethodData): New inteface; Holds links to parent members
11733         to avoid member duplication (reduced memory allocation).
11734         (Method): Implemented IMethodData interface.
11735         (PropertyBase): New inner classes for get/set methods.
11736         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11737         (Event): New inner classes for add/remove methods.
11738         (Event.DelegateMethod): Implemented IMethodData interface.
11739
11740         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11741         EmitContext (related to class.cs refactoring).
11742
11743 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11744
11745         * delegate.cs (Delegate.VerifyApplicability): If the number of
11746         arguments are the same as the number of parameters, first try to
11747         verify applicability ignoring  any 'params' modifier on the last
11748         parameter.
11749         Fixes #56442.
11750
11751 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11752
11753         * class.cs (TypeContainer.AddIndexer): Use
11754         'ExplicitInterfaceName' to determine if interface name was
11755         explicitly specified.  'InterfaceType' is not initialized at this time.
11756         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11757         Indexers array is already in the required order.  Initialize
11758         'IndexerName' only if there are normal indexers.
11759         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11760         (TypeContainer.Emit): Emit DefaultMember attribute only if
11761         IndexerName is initialized.
11762         Fixes #56300.
11763
11764 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11765
11766         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11767         Fixes #57007
11768
11769 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11770
11771         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11772         attributes.
11773         Fix for #56456.
11774
11775         * attribute.cs (Attribute.Resolve): Check for duplicate named
11776         attributes.
11777         Fix for #56463.
11778
11779 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11780
11781         * iterators.cs (MarkYield): track whether we are in an exception,
11782         and generate code accordingly.  Use a temporary value to store the
11783         result for our state.
11784
11785         I had ignored a bit the interaction of try/catch with iterators
11786         since their behavior was not entirely obvious, but now it is
11787         possible to verify that our behavior is the same as MS .NET 2.0
11788
11789         Fixes 54814
11790
11791 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * iterators.cs: Avoid creating temporaries if there is no work to
11794         do. 
11795
11796         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11797         Enumerations, use TypeManager.EnumToUnderlying and call
11798         recursively. 
11799
11800         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11801         bug #57013
11802
11803         (This.Emit): Use EmitContext.EmitThis to emit our
11804         instance variable.
11805
11806         (This.EmitAssign): Ditto.
11807
11808         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11809         codepaths, we will move all the functionality into
11810         Mono.CSharp.This 
11811
11812         (FieldExpr.EmitAssign): Ditto.
11813
11814         This fixes several hidden bugs that I uncovered while doing a code
11815         review of this today.
11816
11817         * codegen.cs (EmitThis): reworked so the semantics are more clear
11818         and also support value types "this" instances.
11819
11820         * iterators.cs: Changed so that for iterators in value types, we
11821         do not pass the value type as a parameter.  
11822
11823         Initialization of the enumerator helpers is now done in the caller
11824         instead of passing the parameters to the constructors and having
11825         the constructor set the fields.
11826
11827         The fields have now `assembly' visibility instead of private.
11828
11829 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11830
11831         * expression.cs (Argument.Resolve): Check if fields passed as ref
11832         or out are contained in a MarshalByRefObject.
11833
11834         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11835         another compiler type.
11836
11837 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11838
11839         * class.cs (Indexer.Define): use the new name checking method.
11840         Also, return false on an error.
11841         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11842         (is_identifier_[start/part]_character): make static.
11843
11844 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11845
11846         * expression.cs (Binary.ResolveOperator): Do no append strings
11847         twice: since we can be invoked more than once (array evaluation)
11848         on the same concatenation, take care of this here.  Based on a fix
11849         from Ben (bug #56454)
11850
11851 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11852
11853         * codegen.cs: Fix another case where CS1548 must be reported (when 
11854         delay-sign isn't specified and no private is available #56564). Fix
11855         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11856         error when MCS is used on the MS runtime and we need to delay-sign 
11857         (which seems unsupported by AssemblyBuilder - see #56621).
11858
11859 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11860
11861         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11862         (TypeManager.ComputeNamespaces): Faster implementation for
11863         Microsoft runtime.
11864
11865         * compiler.csproj: Updated AssemblyName to mcs.
11866
11867 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11868
11869         * rootcontext.cs: Add new types to the boot resolution.
11870
11871         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11872         MulticastDelegate is not allowed.
11873
11874         * typemanager.cs: Add new types to lookup: System.TypedReference
11875         and ArgIterator.
11876
11877         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11878         check for TypedReference or ArgIterator, they are not allowed. 
11879
11880         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11881         makes us properly catch 1510 in some conditions (see bug 56016 for
11882         details). 
11883
11884 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11885
11886         * CryptoConvert.cs: update from corlib version
11887         with endian fixes.
11888
11889 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * class.cs (Indexer.Define): Check indexername declaration
11892
11893 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11894
11895         * attribute.cs (IsClsCompliant): Fixed problem with handling
11896         all three states (compliant, not-compliant, undetected).
11897
11898 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11899
11900         * attribute.cs (Attribute): Location is now public.
11901         (Resolve): Store resolved arguments (pos_values) in attribute class.
11902         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11903         (GetClsCompliantAttributeValue): New method that gets
11904         CLSCompliantAttribute value.
11905         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11906         if exists else null.
11907         (AttributeTester): New class for CLS-Compliant verification routines.
11908
11909         * class.cs (Emit): Add CLS-Compliant verification.
11910         (Method.GetSignatureForError): Implemented.
11911         (Constructor.GetSignatureForError): Implemented
11912         (Constructor.HasCompliantArgs): Returns if constructor has
11913         CLS-Compliant arguments.
11914         (Constructor.Emit): Override.
11915         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11916         is needed to test only parameters.
11917         (FieldBase.GetSignatureForError): Implemented.
11918         (TypeContainer): New member for storing base interfaces.
11919         (TypeContainer.FindMembers): Search in base interfaces too.
11920
11921         * codegen.cs (GetClsComplianceAttribute): New method that gets
11922         assembly or module CLSCompliantAttribute value.
11923         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11924         for assembly.
11925         (ModuleClass.Emit): Add error 3012 test.
11926
11927         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11928
11929         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11930         state for all decl types.
11931         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11932         if CLS-Compliant tests are required.
11933         (IsClsCompliaceRequired): New method. Analyze whether code
11934         must be CLS-Compliant.
11935         (IsExposedFromAssembly): New method. Returns true when MemberCore
11936         is exposed from assembly.
11937         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11938         value or gets cached value.
11939         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11940         is explicitly marked with CLSCompliantAttribute.
11941         (IsIdentifierClsCompliant): New abstract method. This method is
11942         used to testing error 3005.
11943         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11944         for identifier and parameters CLS-Compliant testing.
11945         (VerifyClsCompliance): New method. The main virtual method for
11946         CLS-Compliant verifications.
11947         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11948         null. I don't know why is null (too many public members !).
11949         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11950         and get value of first CLSCompliantAttribute that found.
11951
11952         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11953         (VerifyClsCompliance): Override and add extra tests.
11954
11955         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11956         clscheck- disable CLS-Compliant verification event if assembly is has
11957         CLSCompliantAttribute(true).
11958
11959         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11960         ApllyAttribute is now called in emit section as in the other cases.
11961         Possible future Emit integration.
11962         (IsIdentifierClsCompliant): New override.
11963         (VerifyClsCompliance): New override.
11964         (GetEnumeratorName): Returns full enum name.
11965
11966         * parameter.cs (GetSignatureForError): Implemented.
11967
11968         * report.cs (WarningData): New struct for Warning message information.
11969         (LocationOfPreviousError): New method.
11970         (Warning): New method. Reports warning based on the warning table.
11971         (Error_T): New method. Reports error based on the error table.
11972
11973         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11974         verifications are done here.
11975
11976         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11977
11978         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11979         CLSCompliantAttribute.
11980         (all_imported_types): New member holds all imported types from other
11981         assemblies.
11982         (LoadAllImportedTypes): New method fills static table with exported types
11983         from all referenced assemblies.
11984         (Modules): New property returns all assembly modules.
11985
11986 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11987
11988         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11989         throwing a parser error.
11990
11991         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11992         which removes the hardcoded get_/set_ prefixes for properties, as
11993         IL allows for the properties to be named something else.  
11994
11995         Bug #56013
11996
11997         * expression.cs: Do not override operand before we know if it is
11998         non-null.  Fix 56207
11999
12000 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12001
12002         * typemanager.cs: support for pinned variables.
12003
12004 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12005
12006         * decl.cs, typemanager.cs: Avoid using an arraylist
12007         as a buffer if there is only one result set.
12008
12009 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12010
12011         * expression.cs: Make sure you cant call a static method
12012         with an instance expression, bug #56174.
12013
12014 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12015
12016         * class.cs (IsDuplicateImplementation): Improve error reporting to
12017         flag 663 (method only differs in parameter modifier).
12018
12019         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12020         in preprocessor directives.
12021
12022         * location.cs (LookupFile): Allow for the empty path.
12023
12024         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12025         better approach for some of that patch, but its failing with the
12026         CharSet enumeration.  For now try/catch will do.
12027
12028         * typemanager.cs: Do not crash if a struct does not have fields.
12029         Fixes 56150.
12030
12031 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12032
12033         * expression.cs: cs0213, cant fix a fixed expression.
12034         fixes 50231.
12035
12036 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12037
12038         * cs-parser.jay: detect invalid embeded statements gracefully.
12039         bug #51113.
12040
12041 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12042
12043         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12044         As a regex:
12045         s/
12046         the invocation type may not be a subclass of the tye of the item/
12047         The type of the item must be a subclass of the invocation item.
12048         /g
12049
12050         Fixes bug #50820.
12051
12052 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12053
12054         * attribute.cs: Added methods to get a string and a bool from an
12055         attribute. Required to information from AssemblyKeyFileAttribute,
12056         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12057         * codegen.cs: Modified AssemblyName creation to include support for
12058         strongnames. Catch additional exceptions to report them as CS1548.
12059         * compiler.csproj: Updated include CryptoConvert.cs.
12060         * compiler.csproj.user: Removed file - user specific configuration.
12061         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12062         Mono.Security assembly. The original class is maintained and tested in
12063         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12064         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12065         like CSC 8.0 (C# v2) supports.
12066         * Makefile: Added CryptoConvert.cs to mcs sources.
12067         * rootcontext.cs: Added new options for strongnames.
12068
12069 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12070
12071         * driver.cs: For --expect-error, report error code `2'
12072         if the program compiled with no errors, error code `1' if
12073         it compiled with an error other than the one expected.
12074
12075 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12076
12077         * compiler.csproj: Updated for Visual Studio .NET 2003.
12078         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12079         * compiler.sln: Updated for Visual Studio .NET 2003.
12080
12081 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12082
12083         * expression.cs: Fix bug #47234. We basically need to apply the
12084         rule that we prefer the conversion of null to a reference type
12085         when faced with a conversion to 'object' (csc behaviour).
12086
12087 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12088
12089         * statement.cs: Shorter form for foreach, eliminates
12090         a local variable. r=Martin.
12091
12092 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12093
12094         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12095         checks if we can use brtrue/brfalse to test for 0.
12096         * expression.cs: use the above in the test for using brtrue/brfalse.
12097         cleanup code a bit.
12098
12099 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12100
12101         * expression.cs: Rewrite string concat stuff. Benefits:
12102
12103         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12104         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12105         rather than a concat chain.
12106
12107         * typemanager.cs: Add lookups for more concat overloads.
12108
12109 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12110
12111         * expression.cs: Emit shorter il code for array init.
12112
12113         newarr
12114         dup
12115         // set 1
12116
12117         // set 2
12118
12119         newarr
12120         stloc.x
12121
12122         ldloc.x
12123         // set 1
12124
12125         ldloc.x
12126         // set 2
12127
12128 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12129
12130         * statement.cs: Before, two switch blocks would be merged if the
12131         total size of the blocks (end_item - begin_item + 1) was less than
12132         two times the combined sizes of the blocks.
12133
12134         Now, it will only merge if after the merge at least half of the
12135         slots are filled.
12136
12137         fixes 55885.
12138
12139 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12140
12141         * class.cs : csc build fix for GetMethods(). See bug #52503.
12142
12143 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12144
12145         * expression.cs: Make sure fp comparisons work with NaN.
12146         This fixes bug #54303. Mig approved this patch a long
12147         time ago, but we were not able to test b/c the runtime
12148         had a related bug.
12149
12150 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12153
12154 2004-03-19  Martin Baulig  <martin@ximian.com>
12155
12156         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12157         error here and not in our caller.
12158
12159 2004-03-19  Martin Baulig  <martin@ximian.com>
12160
12161         * interface.cs: Completely killed this file.
12162         (Interface): We're now a TypeContainer and live in class.cs.
12163
12164         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12165         argument; we're now also called for interfaces.
12166         (TypeContainer.DefineMembers): Allow this method being called
12167         multiple times.
12168         (TypeContainer.GetMethods): New public method; formerly known as
12169         Interface.GetMethod().  This is used by PendingImplementation.
12170         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12171         it's now private and non-static.
12172         (Interface): Moved this here; it's now implemented similar to
12173         Class and Struct.
12174         (Method, Property, Event, Indexer): Added `bool is_interface'
12175         argument to their .ctor's.
12176         (MemberBase.IsInterface): New public field.
12177
12178         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12179         instances instead of InterfaceMethod, InterfaceProperty, etc.
12180         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12181         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12182
12183 2004-03-19  Martin Baulig  <martin@ximian.com>
12184
12185         * class.cs (MethodCore.IsDuplicateImplementation): New private
12186         method which does the CS0111 checking.
12187         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12188         Use IsDuplicateImplementation().
12189
12190 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12191
12192         * decl.cs (FindMemberToOverride): New method to find the correct
12193         method or property to override in the base class.
12194         * class.cs
12195             - Make Method/Property use the above method to find the
12196               version in the base class.
12197             - Remove the InheritableMemberSignatureCompare as it is now
12198               dead code.
12199
12200         This patch makes large code bases much faster to compile, as it is
12201         O(n) rather than O(n^2) to do this validation.
12202
12203         Also, it fixes bug 52458 which is that nested classes are not
12204         taken into account when finding the base class member.
12205
12206         Reviewed/Approved by Martin.
12207
12208 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12209
12210         * interface.cs: In all interface classes removed redundant
12211         member initialization.
12212
12213 2004-03-16  Martin Baulig  <martin@ximian.com>
12214
12215         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12216
12217 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12218
12219         * decl.cs (DefineTypeAndParents): New helper method to define a
12220         type's containers before the type itself is defined;  This is a
12221         bug exposed by the recent changes to Windows.Forms when an
12222         implemented interface was defined inside a class that had not been
12223         built yet.   
12224
12225         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12226
12227         (Check): Loop correctly to report errors modifiers
12228         (UNSAFE was not in the loop, since it was the same as TOP).
12229
12230         * interface.cs: Every interface member now takes a ModFlags,
12231         instead of a "is_new" bool, which we set on the base MemberCore. 
12232
12233         Every place where we called "UnsafeOk" in the interface, now we
12234         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12235         the unsafe settings from the member declaration instead of the
12236         container interface. 
12237
12238         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12239
12240         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12241         `set_indexer_name' to the pending bits (one per type).
12242
12243         We fixed a bug today that was picking the wrong method to
12244         override, since for properties the existing InterfaceMethod code
12245         basically ignored the method name.  Now we make sure that the
12246         method name is one of the valid indexer names.
12247
12248 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12249  
12250         * support.cs (SeekableStreamReader): Keep track of stream byte
12251         positions and don't mix them with character offsets to the buffer.
12252
12253         Patch from Gustavo Giráldez
12254
12255 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12256
12257         * interface.cs (InterfaceSetGetBase): Removed double member
12258         initialization, base class does it as well.
12259
12260 2004-03-13  Martin Baulig  <martin@ximian.com>
12261
12262         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12263         when compiling corlib.
12264
12265 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12266
12267         * convert.cs (ExplicitConversion): We were reporting an error on
12268         certain conversions (object_type source to a value type, when the
12269         expression was `null') before we had a chance to pass it through
12270         the user defined conversions.
12271
12272         * driver.cs: Replace / and \ in resource specifications to dots.
12273         Fixes 50752
12274
12275         * class.cs: Add check for duplicate operators.  Fixes 52477
12276
12277 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12280         that are in the middle of the statements, not only at the end.
12281         Fixes #54987
12282
12283         * class.cs (TypeContainer.AddField): No longer set the
12284         `HaveStaticConstructor' flag, now we call it
12285         `UserDefineStaticConstructor' to diferentiate the slightly
12286         semantic difference.
12287
12288         The situation is that we were not adding BeforeFieldInit (from
12289         Modifiers.TypeAttr) to classes that could have it.
12290         BeforeFieldInit should be set to classes that have no static
12291         constructor. 
12292
12293         See:
12294
12295         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12296
12297         And most importantly Zoltan's comment:
12298
12299         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12300
12301         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12302          before its static fields are used', i.e. initialization does not need
12303          to be triggered by the first access to the type. Setting this flag
12304          helps the JIT to compile better code, since it can run the static
12305          constructor at JIT time, and does not need to generate code to call it
12306          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12307          this flag for lots of classes like String. 
12308          
12309          csc sets this flag if the type does not have an explicit static 
12310          constructor. The reasoning seems to be that if there are only static
12311          initalizers for a type, and no static constructor, then the programmer
12312          does not care when this initialization happens, so beforefieldinit
12313          can be used.
12314          
12315          This bug prevents the AOT compiler from being usable, since it 
12316          generates so many calls to mono_runtime_class_init that the AOT code
12317          is much slower than the JITted code. The JITted code is faster, 
12318          because it does not generate these calls if the vtable is type is
12319          already initialized, which is true in the majority of cases. But the
12320          AOT compiler can't do this."
12321
12322 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12323
12324         * class.cs (MethodData.Emit): Refactor the code so symbolic
12325         information is generated for destructors;  For some reasons we
12326         were taking a code path that did not generate symbolic information
12327         before. 
12328
12329 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12330
12331         * class.cs: Create a Constructor.CheckBase method that
12332         takes care of all validation type code. The method
12333         contains some code that was moved from Define.
12334
12335         It also includes new code that checks for duplicate ctors.
12336         This fixes bug #55148.
12337
12338 2004-03-09  Joshua Tauberer <tauberer@for.net>
12339
12340         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12341         a { ... }-style array creation invokes EmitStaticInitializers
12342         which is not good for reference-type arrays.  String, decimal
12343         and now null constants (NullCast) are not counted toward
12344         static initializers.
12345
12346 2004-03-05  Martin Baulig  <martin@ximian.com>
12347
12348         * location.cs (SourceFile.HasLineDirective): New public field;
12349         specifies whether the file contains or is referenced by a "#line"
12350         directive.
12351         (Location.DefineSymbolDocuments): Ignore source files which
12352         either contain or are referenced by a "#line" directive.        
12353
12354 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12355
12356         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12357         direct access to our parent, so check the method inline there.
12358
12359 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12360
12361         * expression.cs (Invocation.EmitCall): Miguel's last commit
12362         caused a regression. If you had:
12363
12364             T t = null;
12365             t.Foo ();
12366
12367         In Foo the implict this would be null.
12368
12369 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12370
12371         * expression.cs (Invocation.EmitCall): If the method is not
12372         virtual, do not emit a CallVirt to it, use Call.
12373
12374         * typemanager.cs (GetFullNameSignature): Improve the method to
12375         cope with ".ctor" and replace it with the type name.
12376
12377         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12378         as an argument the ConstructorBuilder where it is being defined,
12379         to catch the recursive constructor invocations.
12380
12381 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12382
12383         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12384         routines to check if a type is an enumerable/enumerator allow
12385         classes that implement the IEnumerable or IEnumerator interfaces.
12386
12387         * class.cs (Property, Operator): Implement IIteratorContainer, and
12388         implement SetYields.
12389
12390         (Property.Define): Do the block swapping for get_methods in the
12391         context of iterators.   We need to check if Properties also
12392         include indexers or not.
12393
12394         (Operator): Assign the Block before invoking the
12395         OperatorMethod.Define, so we can trigger the Iterator code
12396         replacement. 
12397
12398         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12399         Property and Operator classes are not created when we parse the
12400         declarator but until we have the block completed, so we use a
12401         singleton SimpleIteratorContainer.Simple to flag whether the
12402         SetYields has been invoked.
12403
12404         We propagate this setting then to the Property or the Operator to
12405         allow the `yield' to function.
12406
12407 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12408
12409         * codegen.cs: Implemented attribute support for modules.
12410         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12411         Assembly/Module functionality.
12412
12413         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12414         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12415         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12416
12417 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12418
12419         * interface.cs (FindMembers): The operation is performed on all base
12420         interfaces and not only on the first. It is required for future CLS Compliance patch.
12421
12422 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12423
12424         * statement.cs, codegen.cs:
12425         This patch deals with patterns such as:
12426
12427         public class List : IEnumerable {
12428
12429                 public MyEnumerator GetEnumerator () {
12430                         return new MyEnumerator(this);
12431                 }
12432
12433                 IEnumerator IEnumerable.GetEnumerator () {
12434                         ...
12435                 }
12436                 
12437                 public struct MyEnumerator : IEnumerator {
12438                         ...
12439                 }
12440         }
12441
12442         Before, there were a few things we did wrong:
12443         1) we would emit callvirt on a struct, which is illegal
12444         2) we emited ldarg when we needed to emit ldarga
12445         3) we would mistakenly call the interface methods on an enumerator
12446         type that derived from IEnumerator and was in another assembly. For example:
12447
12448         public class MyEnumerator : IEnumerator
12449
12450         Would have the interface methods called, even if there were public impls of the
12451         method. In a struct, this lead to invalid IL code.
12452
12453 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12454
12455         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12456           renamed to Emit.
12457
12458         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12459
12460 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12461
12462         * cs-parser.jay: Fix small regression: we were not testing V2
12463         compiler features correctly.
12464
12465         * interface.cs: If the emit context is null, then create one
12466
12467 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12468
12469         * decl.cs (GetSignatureForError): New virtual method to get full name
12470           for error messages.
12471
12472         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12473           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12474
12475         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12476           Duplicated members and code in these classes has been removed.
12477           Better encapsulation in these classes.
12478
12479 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * assign.cs (Assign.DoResolve): When dealing with compound
12482         assignments, there is a new rule in ECMA C# 2.4 (might have been
12483         there before, but it is documented here) that states that in:
12484
12485         a op= b;
12486
12487         If b is of type int, and the `op' is a shift-operator, then the
12488         above is evaluated as:
12489
12490         a = (int) a op b 
12491
12492         * expression.cs (Binary.ResolveOperator): Instead of testing for
12493         int/uint/long/ulong, try to implicitly convert to any of those
12494         types and use that in pointer arithmetic.
12495
12496         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12497         method to print information for from the type, not from the
12498         null-method we were given.
12499
12500 2004-02-01  Duncan Mak  <duncan@ximian.com>
12501
12502         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12503         parsing for cmd, fixes bug #53694.
12504
12505 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12506
12507         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12508         in the member name duplication tests. Property and operator name duplication
12509         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12510
12511 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12512
12513         * interface.cs (PopulateMethod): Fixed crash when interface method
12514         returns not existing type (error test cs0246-3.cs).
12515
12516 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12517
12518         * cs-parser.jay (interface_accessors): Re-write actions to also
12519         store attributes attached to get and set methods. Fix spelling
12520         while at it.
12521
12522         (inteface_property_declaration): Modify accordingly.
12523
12524         (InterfaceAccessorInfo): New helper class to store information to pass
12525         around between rules that use interface_accessors.
12526
12527         * interface.cs (Emit): Apply attributes on the get and set
12528         accessors of properties and indexers too.
12529
12530         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12531         right MethodBuilder when applying attributes to the get and set accessors.
12532
12533 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12536
12537 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12538
12539         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12540
12541 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12544         changes that treat `yield' specially when present before `break'
12545         or `return' tokens.
12546
12547         * cs-tokenizer.cs: yield is no longer a keyword.
12548
12549 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12550
12551         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12552         setting for default constructors.
12553         For default constructors are almost every time set wrong Modifier. The
12554         generated IL code has been alright. But inside mcs this values was
12555         wrong and this was reason why several of my CLS Compliance tests
12556         failed.
12557
12558 2004-01-22  Martin Baulig  <martin@ximian.com>
12559
12560         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12561         not a QualifiedIdentifier.  This is what `type_name_expression'
12562         was previously doing.
12563         (type_name_expression): Removed; the code is now in
12564         `namespace_or_type_name'.
12565         (qualified_identifier): Removed, use `namespace_or_type_name'
12566         instead.
12567         (QualifiedIdentifier): Removed this class.      
12568
12569 2004-01-22  Martin Baulig  <martin@ximian.com>
12570
12571         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12572         not a string as alias name.
12573
12574 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12575
12576         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12577         #52730 bug, and instead compute correctly the need to use a
12578         temporary variable when requesting an address based on the
12579         static/instace modified of the field and the constructor.
12580  
12581 2004-01-21  Martin Baulig  <martin@ximian.com>
12582
12583         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12584         class and namespace before looking up aliases.  Fixes #52517.
12585
12586 2004-01-21  Martin Baulig  <martin@ximian.com>
12587
12588         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12589         assinged in a 'try'; fixes exception4.cs.
12590
12591 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12592         * class.cs : Implemented parameter-less constructor for TypeContainer
12593
12594         * decl.cs: Attributes are now stored here. New property OptAttributes
12595
12596         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12597
12598         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12599
12600 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12601
12602         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12603           (CSharpSignature): New method for indexer and property signature.
12604
12605 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12606
12607         * pending.cs (IsVirtualFilter): Faster implementation.
12608
12609 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12610
12611         * typemanager.cs: Avoid inclusion of same assembly more than once.
12612
12613 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12614
12615         * cs-parser.jay: Fixed problem where the last assembly attribute
12616           has been applied also to following declaration (class, struct, etc.)
12617           
12618 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12619
12620         * class.cs: Added error CS0538, CS0539 reporting.
12621         Fixed crash on Microsoft runtime when field type is void.
12622
12623         * cs-parser.jay: Added error CS0537 reporting.
12624
12625         * pending.cs: Added error CS0535 reporting.
12626         Improved error report for errors CS0536, CS0534.
12627
12628 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12629
12630         Merge a few bits from the Anonymous Method MCS tree.
12631
12632         * statement.cs (ToplevelBlock): New class for toplevel methods,
12633         will hold anonymous methods, lifted variables.
12634
12635         * cs-parser.jay: Create toplevel blocks for delegates and for
12636         regular blocks of code. 
12637
12638 2004-01-20  Martin Baulig  <martin@ximian.com>
12639
12640         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12641         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12642         and `NeedExplicitReturn'; added `IsLastStatement'.
12643         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12644         have a `ReturnLabel' or we're not unreachable.
12645
12646         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12647         child's reachability; don't just override ours with it.  Fixes
12648         #58058 (lluis's example).
12649         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12650         InFinally(), InLoop(), InSwitch() and
12651         BreakCrossesTryCatchBoundary() methods.
12652
12653         * statement.cs (Return): Do all error checking in Resolve().
12654         Unless we are the last statement in a top-level block, always
12655         create a return label and jump to it.
12656         (Break, Continue): Do all error checking in Resolve(); also make
12657         sure we aren't leaving a `finally'.
12658         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12659         statement in a top-level block.
12660         (Block.Flags): Added `IsDestructor'.
12661         (Block.IsDestructor): New public property.
12662
12663 2004-01-20  Martin Baulig  <martin@ximian.com>
12664
12665         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12666
12667 2004-01-20  Martin Baulig  <martin@ximian.com>
12668
12669         * statement.cs (Statement.ResolveUnreachable): New public method.
12670         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12671         (Block.Resolve): Resolve unreachable statements.
12672
12673 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12674
12675         * expression.cs: We need to fix the case where we do
12676         not have a temp variable here.
12677
12678         * assign.cs: Only expression compound assignments need
12679         temporary variables.
12680
12681 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12682
12683         * flowanalysis.cs: Reduce memory allocation in a few ways:
12684           - A block with no variables should not allocate a bit
12685             vector for itself.
12686           - A method with no out parameters does not need any tracking
12687             for assignment of the parameters, so we need not allocate
12688             any data for it.
12689           - The arrays:
12690                 public readonly Type[] VariableTypes;
12691                 public readonly string[] VariableNames;
12692             Are redundant. The data is already stored in the variable
12693             map, so we need not allocate another array for it.
12694           - We need to add alot of checks for if (params | locals) == null
12695             due to the first two changes.
12696
12697 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12700         implement IMemoryLocation, we store a copy on a local variable and
12701         take the address of it.  Patch from Benjamin Jemlich
12702
12703         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12704         to use a special "type_name_expression" rule which reduces the
12705         number of "QualifiedIdentifier" classes created, and instead
12706         directly creates MemberAccess expressions.
12707
12708 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12711         that fixes #52853.  Null literal assignment to ValueType
12712
12713         * class.cs (MethodData.Emit): Instead of checking the name of the
12714         method to determine if its a destructor, create a new derived
12715         class from Method called Destructor, and test for that.  
12716
12717         * cs-parser.jay: Create a Destructor object instead of a Method.  
12718
12719         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12720
12721         Fixes: 52933
12722
12723 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12724
12725         * expression.cs (Binary.ResolveOperator): Perform an implicit
12726         conversion from MethodGroups to their delegate types on the
12727         Addition operation.
12728
12729         * delegate.cs: Introduce a new class DelegateCreation that is the
12730         base class for `NewDelegate' and `ImplicitDelegateCreation',
12731         factor some code in here.
12732
12733         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12734         conversion from MethodGroups to compatible delegate types. 
12735
12736         * ecore.cs (Expression.Resolve): Do not flag error 654
12737         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12738         we allow conversions from MethodGroups to delegate types now.
12739
12740         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12741         assignments in v2 either.
12742
12743 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12746         static read-only fields in ctors.
12747
12748         Applied patch from Benjamin Jemlich 
12749
12750         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12751
12752 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12753
12754         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12755         here to return true, as they can be used like this:
12756
12757                 (XXX) int.MEMBER ()
12758
12759         Fixed 49836 and all the other dups
12760
12761 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12762
12763         * driver.cs: Implement /win32res and /win32icon.
12764
12765 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12766
12767         * cs-parser.jay: Add a rule to improve error handling for the
12768         common mistake of placing modifiers after the type.
12769
12770 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12771
12772         * cs-parser.jay (interface_event_declaration): Catch
12773         initialization of events on interfaces, and report cs0068
12774
12775         * cs-parser.jay (interface_event_declaration): Catch
12776         initialization of events. 
12777
12778         * ecore.cs: Better report missing constructors.
12779
12780         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12781         the error reporting done in the wrong place.  Fix.
12782
12783         * expression.cs (Binary.ResolveOperator): Catch the 
12784         operator + (E x, E y) error earlier, and later allow for implicit
12785         conversions in operator +/- (E e, U x) from U to the underlying
12786         type of E.
12787
12788         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12789         52596, if the container class is abstract, the default constructor
12790         is protected otherwise its public (before, we were always public).
12791
12792         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12793         fixed statement.
12794
12795         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12796         Jemlich that fixes bug #52597, MCS was generating invalid code for
12797         idisposable structs.   Thanks to Ben for following up with this
12798         bug as well.
12799
12800 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * driver.cs: Allow assemblies without code to be generated, fixes
12803         52230.
12804
12805 2004-01-07  Nick Drochak <ndrochak@gol.com>
12806
12807         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12808
12809 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * cs-parser.jay: Add rules to improve error reporting if fields or
12812         methods are declared at the namespace level (error 116)
12813
12814         * Add rules to catch event add/remove
12815
12816 2004-01-04  David Sheldon <dave-mono@earth.li>
12817
12818   * expression.cs: Added matching ")" to error message for 
12819   CS0077
12820
12821 2004-01-03 Todd Berman <tberman@gentoo.org>
12822
12823         * ecore.cs, attribute.cs:
12824         Applying fix from #52429.
12825
12826 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12827
12828         * ecore.cs, expression.cs, statement.cs:
12829         Total rewrite of how we handle branching. We
12830         now handle complex boolean expressions with fewer
12831         jumps. As well if (x == 0) no longer emits a ceq.
12832
12833         if (x is Foo) is much faster now, because we generate
12834         better code.
12835
12836         Overall, we get a pretty big improvement on our benchmark
12837         tests. The code we generate is smaller and more readable.
12838
12839         I did a full two-stage bootstrap. The patch was reviewed
12840         by Martin and Miguel.
12841
12842 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12843
12844         * cs-parser.jay: Make primary_expression not take a QI.
12845         we dont need this because the member_access rule covers
12846         us here. So we replace the rule with just IDENTIFIER.
12847
12848         This has two good effects. First, we remove a s/r conflict.
12849         Second, we allocate many fewer QualifiedIdentifier objects.
12850
12851 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12852
12853         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12854         set the correct information via SRE. This prevents
12855         hanging on the MS runtime. Fixes #29374.
12856
12857 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12858
12859         * convert.cs: correctly handle conversions to value types
12860         from Enum and ValueType as unboxing conversions.
12861
12862         Fixes bug #52569. Patch by Benjamin Jemlich.
12863
12864 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12865
12866         * expression.cs (BetterConversion): Prefer int -> uint
12867         over int -> ulong (csc's behaviour). This fixed bug #52046.
12868
12869 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12870
12871         * decl.cs (MemberCache.FindMembers): now returns a
12872         MemberInfo [].
12873
12874         * typemanager.cs: In general, go with with ^^.
12875         (CopyNewMethods): take an IList.
12876         (RealMemberLookup): Only allocate an arraylist
12877         if we copy from two sets of methods.
12878
12879         This change basically does two things:
12880         1) Fewer array lists allocated due to CopyNewMethods.
12881         2) the explicit cast in MemberList costed ALOT.
12882
12883 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12884
12885         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12886         a hashtable to avoid needless string allocations when an identifier is
12887         used more than once (the common case).
12888
12889 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12890
12891         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12892         is broken, it will not return anything. So, we
12893         have to use the information we have in mcs to
12894         do the task.
12895
12896         * typemanager.cs: Add a cache for GetInterfaces,
12897         since this will now be used more often (due to ^^)
12898
12899         (GetExplicitInterfaces) New method that gets the
12900         declared, not effective, interfaces on a type
12901         builder (eg, if you have interface IFoo, interface
12902         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12903         { IBar }.
12904
12905         This patch makes MCS able to bootstrap itself on
12906         Windows again.
12907
12908 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12909
12910         * expression.cs: Remove the Nop's that Miguel put
12911         in by mistake.
12912
12913 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12914
12915         * report.cs, codegen.cs: Give the real stack trace to
12916         the error when an exception is thrown.
12917
12918 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12919
12920         * decl.cs: only allocate hashtables for ifaces if 
12921         it is an iface!
12922
12923 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12924
12925         * expression.cs: fix the error from cs0121-2.cs
12926         (a parent interface has two child interfaces that
12927         have a function with the same name and 0 params
12928         and the function is called through the parent).
12929
12930 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12931
12932         * class.cs, rootcontext.cs, typmanager.cs: do not
12933         leak pointers.
12934
12935 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12936
12937         * codegen.cs: remove stack for the ec flow branching.
12938         It is already a linked list, so no need.
12939
12940 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12941
12942         * Makefile: Allow custom profiler here.
12943
12944 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12945
12946         * typemanager.cs (LookupType):
12947           - Use a static char [], because split takes
12948             a param array for args, so it was allocating
12949             every time.
12950           - Do not store true in a hashtable, it boxes.
12951
12952 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12953
12954         * flowanalysis.cs: bytify common enums.
12955
12956 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12957
12958         * modifiers.cs: Add a new set of flags for the
12959         flags allowed on explicit interface impls.
12960         * cs-parser.jay: catch the use of modifiers in
12961         interfaces correctly.
12962         * class.cs: catch private void IFoo.Blah ().
12963
12964         All related to bug #50572.
12965
12966 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12967
12968         * decl.cs: Rewrite the consistant accessability checking.
12969         Accessability is not linear, it must be implemented in
12970         a tableish way. Fixes #49704.
12971
12972 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12973
12974         * expression.cs: Handle negation in a checked context.
12975         We must use subtraction from zero. Fixes #38674.
12976
12977 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12978
12979         * class.cs: Ignore static void main in DLLs.
12980         * rootcontext.cs: Handle the target type here,
12981         since we are have to access it from class.cs
12982         * driver.cs: account for the above.
12983
12984 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12985
12986         * report.cs: Give line numbers and files if available.
12987
12988 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12989
12990         * driver.cs: Implement /addmodule.
12991
12992         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12993         ModuleBuilders.
12994
12995 2003-12-20  Martin Baulig  <martin@ximian.com>
12996
12997         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12998         (FieldBase.IsAssigned): Removed this field.
12999         (FieldBase.SetAssigned): New public method.
13000         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13001
13002 2003-12-20  Martin Baulig  <martin@ximian.com>
13003
13004         * expression.cs (LocalVariableReference.DoResolve): Don't set
13005         `vi.Used' if we're called from DoResolveLValue().
13006
13007         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13008         returns the usage vector it just merged into the current one -
13009         pass this one to UsageWarning().
13010         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13011         of the `EmitContext', don't call this recursively on our children.
13012
13013 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13014
13015         * driver.cs: Implement /target:module.
13016
13017 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13018
13019         * support.cs (CharArrayHashtable): New helper class.
13020
13021         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13022         char arrays, not strings, so we can avoid creating a string in
13023         consume_identifier if the identifier is a keyword.
13024
13025 2003-12-16  Martin Baulig  <martin@ximian.com>
13026
13027         * statement.cs (LocalInfo.Assigned): Removed this property.
13028         (LocalInfo.Flags): Removed `Assigned'.
13029         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13030         and uses flow analysis.
13031         (Block.UsageWarning): Made this method private.
13032         (Block.Resolve): Call UsageWarning() if appropriate.
13033
13034         * expression.cs (LocalVariableReference.DoResolve): Always set
13035         LocalInfo.Used here.
13036
13037 2003-12-13  Martin Baulig  <martin@ximian.com>
13038
13039         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13040         any value here; we're now using flow analysis to figure out
13041         whether a statement/block returns a value.
13042
13043 2003-12-13  Martin Baulig  <martin@ximian.com>
13044
13045         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13046         working again.
13047         (FlowBranching.MergeFinally): Don't call
13048         `branching.CheckOutParameters()' here, this is called in
13049         MergeTopBlock().
13050         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13051         when adding the `finally' vector.       
13052
13053 2003-12-13  Martin Baulig  <martin@ximian.com>
13054
13055         * flowanalysis.cs
13056         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13057         actually work and also fix #48962.
13058
13059 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13060
13061         * decl.cs: Do not check System.Object for nested types,
13062         since we know it does not have any. Big bang for buck:
13063
13064         BEFORE:
13065            Run 1:   8.35 seconds
13066            Run 2:   8.32 seconds
13067            corlib:  17.99 seconds
13068         AFTER:
13069            Run 1:   8.17 seconds
13070            Run 2:   8.17 seconds
13071            corlib:  17.39 seconds
13072
13073 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13074
13075         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13076         time we are returning 0 members, so we save alot here.
13077
13078 2003-12-11  Martin Baulig  <martin@ximian.com>
13079
13080         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13081         `MergeChild()', also just take the `FlowBranching' as argument;
13082         call Merge() on it and return the result.
13083         (FlowBranching.Merge): We don't need to do anything if we just
13084         have one sibling.
13085
13086 2003-12-11  Martin Baulig  <martin@ximian.com>
13087
13088         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13089         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13090         Maurer for this idea.
13091
13092 2003-12-11  Martin Baulig  <martin@ximian.com>
13093
13094         * flowanalysis.cs (MergeResult): This class is now gone; we now
13095         use the `UsageVector' for this.  The reason for this is that if a
13096         branching just has one sibling, we don't need to "merge" them at
13097         all - that's the next step to do.
13098         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13099         `MergeResult'.
13100
13101 2003-12-11  Martin Baulig  <martin@ximian.com>
13102
13103         Reworked flow analyis and made it more precise and bug-free.  The
13104         most important change is that we're now using a special `Reachability'
13105         class instead of having "magic" meanings of `FlowReturns'.  I'll
13106         do some more cleanups and optimizations and also add some more
13107         documentation this week.
13108
13109         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13110         largely reworked this class.
13111         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13112         the new `Reachability' class instead of having "magic" values here.
13113         (FlowBranching): We're now using an instance of `Reachability'
13114         instead of having separate `Returns', `Breaks' etc. fields.
13115
13116         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13117         based on flow analysis; ignore the return value of block.Emit ().
13118
13119 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13120
13121         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13122         if they are private.
13123
13124 2003-12-09  Martin Baulig  <martin@ximian.com>
13125
13126         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13127         call them directly on the UsageVector.
13128
13129 2003-12-09  Martin Baulig  <martin@ximian.com>
13130
13131         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13132         Changed return type from `FlowReturns' to `Reachability'.
13133
13134 2003-12-09  Martin Baulig  <martin@ximian.com>
13135
13136         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13137         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13138         `Reachable' fields with a single `Reachability' one.
13139
13140 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13141
13142         * class.cs (FindMembers): Remove foreach's.
13143
13144         Bootstrap times:
13145
13146         BEFORE
13147                 Run 1:   8.74 seconds
13148                 Run 2:   8.71 seconds
13149
13150         AFTER
13151                 Run 1:   8.64 seconds
13152                 Run 2:   8.58 seconds
13153
13154
13155 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13156
13157         * cs-parser.jay:
13158         * gen-treedump.cs:
13159         * statement.cs:
13160         This patch does a few things:
13161                 1. EmptyStatement is now a singleton, so it is never reallocated.
13162                 2. All blah is EmptyStatement constructs have been changed to
13163                    blah == EmptyStatement.Value, which is much faster and valid
13164                    now that EmptyStatement is a singleton.
13165                 3. When resolving a block, rather than allocating a new array for
13166                    the non-empty statements, empty statements are replaced with
13167                    EmptyStatement.Value
13168                 4. Some recursive functions have been made non-recursive.
13169         Mainly the performance impact is from (3), however (1) and (2) are needed for
13170         this to work. (4) does not make a big difference in normal situations, however
13171         it makes the profile look saner.
13172
13173         Bootstrap times:
13174
13175         BEFORE
13176         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13177         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13178         Total memory allocated: 56397 KB
13179
13180         AFTER
13181         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13182         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13183         Total memory allocated: 55666 KB
13184
13185 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13186
13187         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13188         than the hashtable in a hashtable version
13189
13190         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13191         we always end up concating a string. This results in a huge perf
13192         loss, because many strings have to be tracked by the GC. In this
13193         patch, we first use a hashtable that works with two keys, so that
13194         the strings do not need to be concat'ed.
13195
13196         Bootstrap times:
13197         BEFORE
13198                 Run 1:   8.74 seconds
13199                 Run 2:   8.71 seconds
13200
13201         AFTER
13202                 Run 1:   8.65 seconds
13203                 Run 2:   8.56 seconds
13204
13205 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13206
13207         * Makefile: Add a new target `do-time' that does a quick and simple
13208         profile, leaving easy to parse output.
13209
13210 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13211
13212         * codegen.cs (Init): Create the dynamic assembly with 
13213         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13214
13215 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13216
13217         * support.cs: Make the PtrHashtable use only one
13218         instance of its comparer.
13219
13220 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13221
13222         * typemanager.cs: Fix lookup of GetNamespaces.
13223
13224 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13225
13226         * expression.cs: Removed redundant line.
13227
13228         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13229         ArrayLists, use for loops with bounds.  
13230
13231         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13232         arraylist.
13233
13234         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13235         arraylists, use for loop with bounds.
13236
13237         The above three changes give us a 0.071 second performance
13238         improvement out of 3.294 seconds down to 3.223.  On my machine
13239         the above changes reduced the memory usage by 1,387 KB during
13240         compiler bootstrap.
13241
13242         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13243         QualifiedIdentifiers.  Before we created a new string through
13244         concatenation, and mostly later on, the result would be
13245         manipulated by DecomposeQI through string manipulation.
13246
13247         This reduced the compiler memory usage for bootstrapping from
13248         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13249         compile times in 0.05 seconds.
13250
13251 2003-11-28  Dick Porter  <dick@ximian.com>
13252
13253         * support.cs: Do string compares with the Invariant culture.
13254
13255         * rootcontext.cs: 
13256         * gen-treedump.cs: 
13257         * expression.cs: 
13258         * driver.cs: 
13259         * decl.cs: 
13260         * codegen.cs: 
13261         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13262         the comparison is done with the Invariant culture.
13263
13264 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13265
13266         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13267         GetEnumerator method.
13268
13269         (ProbeCollectionType): Iterate starting at the most specific type
13270         upwards looking for a GetEnumerator
13271
13272         * expression.cs: Shift count can be up to 31 for int/uint and 63
13273         for long/ulong.
13274
13275 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13276
13277         * statement.cs (Block.LookupLabel): Also look for the label on the
13278         children blocks.  Use a hash table to keep track of visited
13279         nodes. 
13280
13281         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13282         we actually did transform the other operand, otherwise fall back
13283         to the common codepath that casts to long.
13284
13285         * cs-tokenizer.cs: Use the same code pattern as the int case.
13286         Maybe I should do the parsing myself, and avoid depending on the
13287         Parse routines to get this done.
13288
13289 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13290
13291         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13292         which fixes bug 51347.  This time test it.
13293
13294         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13295         attributes for example can not tell the difference between these.
13296         The difference was only a syntax feature of the language. 
13297
13298         * attribute.cs: Apply attributes to delegates.
13299
13300         * delegate.cs: Call the apply attributes method.
13301
13302 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13303
13304         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13305         comparing 0 vs Byte.MinValue, not the value
13306
13307         (ImplicitConversionRequired): When reporting a conversion error,
13308         use error 31 to print out the constant error instead of the
13309         simpler 29.
13310
13311         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13312         which fixes bug 51347.
13313
13314 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13317         which fixes the -warnaserror command line option.
13318
13319 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13320
13321         * cfold.cs (DoNumericPromotions): During constant folding of
13322         additions on UIntConstant, special case intconstants with
13323         IntConstants like we do on the expression binary operator. 
13324
13325 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * convert.cs (ImplicitReferenceConversion): We were missing a case
13328         (System.Enum are not value types or class types, so we need to
13329         classify them separatedly).
13330
13331         * driver.cs: We do not support error 2007.
13332
13333 2003-11-12 Jackson Harper <jackson@ximian.com>
13334
13335         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13336         system directory. Also use the full file name so users can
13337         libraries names mscorlib-o-tron.dll in a non system dir.
13338
13339 2003-11-10  Martin Baulig  <martin@ximian.com>
13340
13341         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13342         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13343         calling `ResolveType()' on them, directly assign their `Type'.
13344
13345 2003-11-08  Martin Baulig  <martin@ximian.com>
13346
13347         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13348         return value and the `out parent' parameter.
13349         (TypeContainer.DefineType): Moved the CS0644 check into
13350         GetClassBases().  Don't pass the interface types to the
13351         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13352         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13353
13354         * ecore.cs (TypeExpr.IsAttribute): New property.
13355         (TypeExpr.GetInterfaces): New method.
13356
13357         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13358         TypeExpr instead of a Type.
13359         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13360         (Interface.DefineType): Don't pass the interface types to the
13361         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13362         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13363
13364         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13365         instead of a `Type[]'.
13366         (TypeManager.RegisterBuilder): Likewise.
13367         (TypeManager.AddUserInterface): Likewise.
13368         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13369         `Type[]' and also return a `TypeExpr[]'.
13370         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13371
13372 2003-11-08  Martin Baulig  <martin@ximian.com>
13373
13374         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13375         Expression.     
13376
13377 2003-11-08  Martin Baulig  <martin@ximian.com>
13378
13379         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13380         TypeManager.ResolveExpressionTypes().
13381
13382         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13383         instead of an Expression.
13384         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13385         (TypeExpression): New public class; formerly known as `TypeExpr'.
13386
13387         * expression.cs (ComposedCast): Derive from TypeExpr.
13388
13389         * typemanager.cs (TypeManager.system_*_expr): These are now
13390         TypExpr's instead of Expression's.
13391         (TypeManager.ResolveExpressionTypes): New public static function;
13392         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13393         of them.        
13394
13395 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * expression.cs (New.DoResolve): Do not dereference value that
13398         might be a null return.
13399
13400         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13401         sure that the constant value has the right type.  Fixes an
13402         unreported bug, similar to 50425.
13403
13404         * const.cs (Const.LookupConstantValue): Call
13405         ImplicitStandardConversionExists before doing a conversion to
13406         avoid havng the TypeManager.ChangeType do conversions.
13407
13408         Reduced the number of casts used
13409
13410         (Const.ChangeType): New routine to enable reuse of the constant
13411         type changing code from statement.
13412
13413         * typemanager.cs (ChangeType): Move common initialization to
13414         static global variables.
13415
13416         Fixes #50425.
13417
13418         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13419         every value type to go through, even if it was void.  Fix that. 
13420
13421         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13422         character of the define, and the is_identifier_part_character for
13423         the rest of the string.
13424
13425 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13426
13427         * expression.cs (UnaryMutator.EmitCode): When I updated
13428         LocalVariableReference.DoResolve, I overdid it, and dropped an
13429         optimization done on local variable references.
13430
13431 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * ecore.cs: Convert the return from Ldlen into an int.
13434
13435 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13438         the accessibility, this is a special case for toplevel non-public
13439         classes (internal for instance).
13440
13441 2003-10-20  Nick Drochak <ndrochak@gol.com>
13442
13443         * ecore.cs: Fix typo and build.  Needed another right paren.
13444
13445 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13446
13447         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13448         `internal' case regular and protected, but not allowing protected
13449         to be evaluated later.  Bug 49840
13450
13451 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13452
13453         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13454         to kb.Nlast, and not the kb.nFirst to isolate the switch
13455         statement.
13456
13457         Extract the underlying type, so enumerations of long/ulong are
13458         treated like long/ulong.
13459
13460 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13461
13462         * expression.cs (New): Overload the meaning of RequestedType to
13463         track the possible creation of the NewDelegate type, since
13464         DoResolve is invoked more than once for new constructors on field
13465         initialization.
13466
13467         See bugs: #48800 and #37014
13468
13469         * cs-parser.jay (declare_local_constants): Take an arraylist
13470         instead of a single constant.
13471
13472         (local_constant_declaration): It should take a
13473         constant_declarators, not a constant_declarator.  Fixes 49487
13474
13475         * convert.cs: Fix error report.
13476
13477 2003-10-13 Jackson Harper <jackson@ximian.com>
13478
13479         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13480         bug #49611
13481
13482 2003-10-09  Martin Baulig  <martin@ximian.com>
13483
13484         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13485         to the .ctor.
13486         (MethodCore.DoDefineParameters): Removed the TypeContainer
13487         argument; use the DeclSpace which was passed to the .ctor instead.
13488         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13489         TypeContainer; we only need a DeclSpace here.
13490
13491 2003-10-09  Martin Baulig  <martin@ximian.com>
13492
13493         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13494         to the .ctor.
13495         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13496         EmitContext's .ctor.    
13497
13498 2003-10-09  Martin Baulig  <martin@ximian.com>
13499
13500         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13501         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13502         AsAccessible(), moved them as well.
13503
13504         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13505
13506 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13507
13508         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13509
13510 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13511
13512         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13513         generation for >=, as spotted by Paolo, bug 48679.  
13514         Patch from David Waite.
13515
13516         * cs-tokenizer.cs: Add handling for #pragma.
13517
13518         * cs-parser.jay: Allow for both yield and yield return in the
13519         syntax.  The anti-cobolization of C# fight will go on!
13520
13521         * class.cs (TypeBuilder.DefineType): Catch error condition here
13522         (Parent.DefineType erroring out and returning null).
13523
13524         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13525         coping with enumerations variables, we were mistakenly processing
13526         them as a regular value type instead of built-in types.  Fixes the
13527         bug #48063
13528
13529         * typemanager.cs (IsBuiltinOrEnum): New method.
13530
13531 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * cs-parser.jay: Upgrade: yield now needs the return clause.
13534
13535 2003-09-19  Martin Baulig  <martin@ximian.com>
13536
13537         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13538         `MemberCache parent' argument.  Normally, an interface doesn't
13539         have a parent type except System.Object, but we use this in gmcs
13540         for generic type parameters.
13541
13542 2003-09-18  Martin Baulig  <martin@ximian.com>
13543
13544         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13545         on `type.IsInterface'; don't check whether the type has a parent
13546         to determine whether it's an interface.
13547
13548 2003-09-15  Martin Baulig  <martin@ximian.com>
13549
13550         * class.cs (TypeContainer.DefineType): Added an error flag to
13551         avoid reporting duplicate CS0146's ("class definition is
13552         circular.").
13553
13554         * driver.cs (Driver.MainDriver): Abort if
13555         RootContext.ResolveTree() reported any errors.
13556
13557 2003-09-07  Martin Baulig  <martin@ximian.com>
13558
13559         * report.cs (Error, Warning): Added overloaded versions which take
13560         a `params object[] args' and call String.Format().
13561
13562 2003-09-07  Martin Baulig  <martin@ximian.com>
13563
13564         * decl.cs (DeclSpace..ctor): Don't call
13565         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13566         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13567         (DeclSpace.RecordDecl): New method.
13568
13569         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13570
13571 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13572
13573         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13574         value attributes to be applied to ParameterBuilders.
13575
13576         * class.cs (MethodCore.LabelParameters): Make static and more
13577         generic so that it can be used from other places - like interface
13578         methods, for instance.
13579
13580         * interface.cs (Interface.Emit): Call LabelParameters before
13581         emitting attributes on the InterfaceMethod.
13582
13583 2003-08-26  Martin Baulig  <martin@ximian.com>
13584
13585         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13586         resolving aliases; fixes #47927.
13587
13588 2003-08-26  Martin Baulig  <martin@ximian.com>
13589
13590         * statement.cs (Using.DoResolve): This is internally emitting a
13591         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13592         do not always return.  Fixes #47681.
13593
13594 2003-08-26  Martin Baulig  <martin@ximian.com>
13595
13596         * decl.cs (MemberCore): Moved WarningNotHiding(),
13597         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13598         into MemberBase.
13599         (AdditionResult): Make this nested in DeclSpace.
13600         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13601         argument; call NamespaceEntry.Define() unless we're nested in a
13602         class or struct.
13603
13604         * namespace.cs (Namespace.DefineName): New public function.  This
13605         is called from DeclSpace's .ctor to add 
13606         (Namespace.Lookup): Include DeclSpaces in the lookup.
13607
13608         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13609
13610         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13611
13612 2003-08-25  Martin Baulig  <martin@ximian.com>
13613
13614         * convert.cs (Convert.ExplicitReferenceConversion): When
13615         converting from an interface type to a class, unbox if the target
13616         type is a struct type.  Fixes #47822.
13617
13618 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13619
13620         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13621         #47854.
13622
13623 2003-08-22  Martin Baulig  <martin@ximian.com>
13624
13625         * class.cs (TypeManager.DefineType): When defining a nested type,
13626         call DefineType() on our parent; fixes #47801.
13627
13628 2003-08-22  Martin Baulig  <martin@ximian.com>
13629
13630         * class.cs (MethodData.Define): While checking if a method is an
13631         interface implementation, improve the test a bit more to fix #47654.
13632
13633 2003-08-22  Martin Baulig  <martin@ximian.com>
13634
13635         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13636         correctly; fixes #47722.
13637
13638 2003-08-22  Martin Baulig  <martin@ximian.com>
13639
13640         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13641         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13642
13643         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13644
13645 2003-08-22  Martin Baulig  <martin@ximian.com>
13646
13647         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13648         can only be assigned in static constructors.  Fixes #47161.
13649
13650 2003-08-22  Martin Baulig  <martin@ximian.com>
13651
13652         Rewrote and improved the flow analysis code.
13653
13654         * flowbranching.cs (FlowBranching): Make this class abstract.
13655         (FlowBranching.CreateBranching): New static function to create a
13656         new flow branching.
13657         (FlowBranchingBlock, FlowBranchingException): New classes.
13658         (FlowBranching.UsageVector.Type): New public readonly field.
13659         (FlowBranching.UsageVector.Breaks): Removed the setter.
13660         (FlowBranching.UsageVector.Returns): Removed the setter.
13661         (FlowBranching.UsageVector): Added Break(), Return(),
13662         NeverReachable() and Throw() methods to modify the reachability.
13663         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13664         done by FlowBranching.Merge().
13665         (FlowBranching.UsageVector.MergeChild): New method; merges the
13666         merge result into the current vector.
13667         (FlowBranching.Merge): New abstract method to merge a branching.
13668
13669 2003-08-12  Martin Baulig  <martin@ximian.com>
13670
13671         * expression.cs (Indirection.CacheTemporaries): Create the
13672         LocalTemporary with the pointer type, not its element type.
13673
13674 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13677         token was a keyword or not.
13678
13679         Add `error' options where an IDENTIFIER was expected;  Provide
13680         CheckToken and CheckIdentifierToken convenience error reporting
13681         functions. 
13682
13683         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13684
13685         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13686         NameSpaceEntry NameSpaceEntry.
13687
13688         (LookupInterfaceOrClass): Avoid creating a full qualified name
13689         from namespace and name: avoid doing lookups when we know the
13690         namespace is non-existant.   Use new Tree.LookupByNamespace which
13691         looks up DeclSpaces based on their namespace, name pair.
13692
13693         * driver.cs: Provide a new `parser verbose' to display the
13694         exception thrown during parsing.  This is turned off by default
13695         now, so the output of a failure from mcs is more graceful.
13696
13697         * namespace.cs: Track all the namespaces defined in a hashtable
13698         for quick lookup.
13699
13700         (IsNamespace): New method
13701
13702 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13703
13704         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13705         we know that we need to concatenate (full typename can never be
13706         null). 
13707
13708         * class.cs: ditto.
13709
13710         * statement.cs: Use a bitfield;  Do not initialize to null things
13711         which are done by the constructor by default.
13712
13713         * cs-parser.jay: bug fix, parameter was 4, not 3.
13714
13715         * expression.cs: Just use the property;
13716
13717         * statement.cs: No need for GetVariableInfo method.
13718
13719 2003-08-08  Martin Baulig  <martin@ximian.com>
13720
13721         * flowanalysis.cs (FlowReturns): This is now nested in the
13722         `FlowBranching' class.
13723         (MyBitVector): Moved this here from statement.cs.
13724         (FlowBranching.SiblingType): New enum type.
13725         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13726
13727 2003-08-07  Martin Baulig  <martin@ximian.com>
13728
13729         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13730         `FlowBranching' class and called `BranchingType'.
13731
13732 2003-08-07  Martin Baulig  <martin@ximian.com>
13733
13734         * flowanalysis.cs: Moved all the control flow analysis code into
13735         its own file.
13736
13737 2003-08-07  Martin Baulig  <martin@ximian.com>
13738
13739         * assign.cs (Assign.DoResolve): `target' must either be an
13740         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13741         #37319.
13742
13743 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13744
13745         * expression.cs (BinaryMethod): This kind of expression is created by the
13746         Binary class if it determines that the operator has to be handled
13747         by a method.
13748
13749         (BinaryDelegate): This kind of expression is created if we are
13750         dealing with a + or - operator on delegates.
13751
13752         (Binary): remove method, argumetns, and DelegateOperator: when
13753         dealing with methods, 
13754
13755         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13756
13757         * statement.cs (Block): use bitfields for the three extra booleans
13758         we had in use.   Remove unused topblock parameter.
13759
13760         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13761
13762         * assign.cs: Drop extra unneeded tests.
13763
13764 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13765
13766         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13767
13768         * statement.cs (Foreach): Use VariableStorage instead of
13769         LocalBuilders.   
13770
13771         * codegen.cs (VariableStorage): New class used by clients that
13772         require a variable stored: locals or fields for variables that
13773         need to live across yield.
13774
13775         Maybe provide a convenience api for EmitThis+EmitLoad?
13776
13777         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13778         these bad boys.
13779
13780 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13781
13782         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13783         RemapParameterLValue): New methods that are used to turn a
13784         precomputed FieldInfo into an expression like this:
13785
13786                 instance.FieldInfo
13787
13788         The idea is to use this instead of making LocalVariableReference
13789         have more than one meaning.
13790
13791         * cs-parser.jay: Add error production to BASE.
13792
13793         * ecore.cs: Deal with TypeManager.GetField returning null, which
13794         is now a valid return value.
13795
13796         (FieldExprNoAddress): New expression for Fields whose address can
13797         not be taken.
13798
13799         * expression.cs (LocalVariableReference): During the resolve
13800         phases, create new expressions if we are in a remapping context.
13801         Remove code that dealt with remapping here.
13802
13803         (ParameterReference): same.
13804
13805         (ProxyInstance): New expression, like the `This' expression, but
13806         it is born fully resolved.  We know what we are doing, so remove
13807         the errors that are targeted to user-provided uses of `this'.
13808
13809         * statement.cs (Foreach): our variable is now stored as an
13810         Expression;  During resolution, follow the protocol, dont just
13811         assume it will return this.
13812
13813 2003-08-06  Martin Baulig  <martin@ximian.com>
13814
13815         * support.cs (SeekableStreamReader.cs): New public class.
13816
13817         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13818         SeekableStreamReader instead of the normal StreamReader.
13819
13820 2003-08-04  Martin Baulig  <martin@ximian.com>
13821
13822         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13823         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13824         deambiguate casts and delegate invocations.
13825         (parenthesized_expression): Use the new tokens to ensure this is
13826         not a cast of method invocation.
13827
13828         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13829         when reading a `)' and Deambiguate_CloseParens () was previously
13830         called.
13831
13832         * expression.cs (ParenthesizedExpression): New class.  This is
13833         just used for the CS0075 test.
13834         (Binary.DoResolve): Check for CS0075.   
13835
13836 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13837
13838         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13839         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13840         reference comparison.
13841
13842         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13843         examine the ReturnType for equality - this is necessary in the
13844         cases of implicit and explicit operators whose signature also
13845         includes the return type.
13846
13847 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * namespace.cs: Cache the result of the namespace computation,
13850         instead of computing it every time.
13851
13852 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * decl.cs: Use a global arraylist that we reuse over invocations
13855         to avoid excesive memory consumption.  Reduces memory usage on an
13856         mcs compile by one meg (45 average).
13857
13858         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13859         private, work around that.
13860
13861 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * literal.cs (IntLiteral): Define Zero and One static literals. 
13864
13865         * cs-parser.jay (integer_literal): use static literals to reduce
13866         memory usage for the most used literals (0, 1 and -1).  211kb
13867         reduced in memory usage.
13868
13869         Replace all calls to `new ArrayList' with `new
13870         ArrayList(4)' which is a good average number for most allocations,
13871         and also requires only 16 bytes of memory for its buffer by
13872         default. 
13873
13874         This reduced MCS memory usage in seven megabytes for the RSS after
13875         bootstrapping.
13876
13877 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13878
13879         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13880         handle params methods the correct way by forming only one
13881         applicable set with params and normal methods in them. Earlier we
13882         were looking at params methods only if we found no normal methods
13883         which was not the correct thing to do.
13884
13885         (Invocation.BetterFunction): Take separate arguments indicating
13886         when candidate and the best method are params methods in their
13887         expanded form.
13888
13889         This fixes bugs #43367 and #46199.
13890
13891         * attribute.cs: Documentation updates.
13892
13893         (CheckAttribute): Rename to CheckAttributeTarget.
13894         (GetValidPlaces): Rename to GetValidTargets.
13895
13896         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13897         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13898
13899         Fixes bug #44468.
13900
13901 2003-07-28  Martin Baulig  <martin@ximian.com>
13902
13903         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13904         name when looking up the base class of a nested class.  Fixes #46977.
13905
13906 2003-07-26  Martin Baulig  <martin@ximian.com>
13907
13908         * expression.cs (Indexers.Indexer): New nested struct; contains
13909         getter, setter and the indexer's type.
13910         (Indexers.Properties): This is now an ArrayList of
13911         Indexers.Indexer's.
13912         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13913         indexer doesn't have any getters.
13914
13915         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13916         for embedded property and indexer assignments.
13917
13918 2003-07-26  Martin Baulig  <martin@ximian.com>
13919
13920         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13921         preprocessor directive is not the first non-whitespace character
13922         on a line.
13923
13924 2003-07-26  Martin Baulig  <martin@ximian.com>
13925
13926         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13927         namespace parsing, follow the spec more closely.
13928
13929         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13930         NamespaceEntry.Lookup().
13931
13932 2003-07-25  Martin Baulig  <martin@ximian.com>
13933
13934         * MethodCore.cs (OverridesSomething): New public field; it's set
13935         from TypeContainer.DefineMembers if this method overrides
13936         something (which doesn't need to be a method).  Fix #39462.
13937
13938 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13939
13940         * typemanager.cs (GetMembers): Ensure that the list of members is
13941         reversed. This keeps things in sync.
13942
13943         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13944         find an AttributeUsage attribute.
13945
13946         * expression.cs (Invocation.OverloadResolve): Perform the check
13947         which disallows Invoke to be directly called on a Delegate.
13948
13949         (Error_InvokeOnDelegate): Report error cs1533.
13950
13951 2003-07-25  Martin Baulig  <martin@ximian.com>
13952
13953         * expression.cs (Indexers.GetIndexersForType): Only look in the
13954         interface hierarchy if the requested type is already an
13955         interface.  Fixes #46788 while keeping #46502 fixed.
13956
13957 2003-07-25  Martin Baulig  <martin@ximian.com>
13958
13959         * class.cs (TypeContainer.DefineMembers): Check whether all
13960         readonly fields have been assigned and report warning CS0649 if
13961         not.
13962
13963         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13964         a valuetype.
13965
13966 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13967
13968         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13969         returned from GetMethods to make things consistent with the
13970         assumptions MCS makes about ordering of methods.
13971
13972         This should comprehensively fix bug #45127 and it does :-)
13973
13974         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13975         ordering is actually reverse.
13976
13977         * Clean up some debug messages I left lying around.
13978
13979         * interface.cs (Populate*): Get rid of code which emits attributes
13980         since the stage in which we emit attributes is the 'Emit' stage,
13981         not the define stage.
13982
13983         (Emit): Move attribute emission for interface members here.
13984
13985 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13986
13987         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13988         closely: we eliminate methods in base types when we have an
13989         applicable method in a top-level type.
13990
13991         Please see section 14.5.5.1 for an exact description of what goes
13992         on. 
13993
13994         This fixes bug #45127 and a host of other related to corlib compilation.
13995
13996         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13997         array is the method corresponding to the top-level type (this is
13998         because of the changes made to icall.c) so we change this
13999         accordingly.
14000
14001         (MethodGroupExpr.Name): This too.
14002
14003         * typemanager.cs (GetElementType): New method which does the right
14004         thing when compiling corlib. 
14005
14006         * everywhere: Make use of the above in the relevant places.
14007
14008 2003-07-22  Martin Baulig  <martin@ximian.com>
14009
14010         * cs-parser.jay (invocation_expression): Moved
14011         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14012         `cast_expression', but create a InvocationOrCast which later
14013         resolves to either an Invocation or a Cast.
14014
14015         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14016         method; call this before EmitStatement() to make sure that this
14017         expression can be used as a statement.
14018
14019         * expression.cs (InvocationOrCast): New class; resolves to either
14020         an Invocation or a Cast.
14021
14022         * statement.cs (StatementExpression): Call ResolveStatement() on
14023         the ExpressionStatement before emitting it.
14024
14025 2003-07-21  Martin Baulig  <martin@ximian.com>
14026
14027         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14028         `ref' and `out' attributes match; fixes #46220.
14029         (MemberAccess.ResolveMemberAccess): You can't reference a type
14030         through an expression; fixes #33180.
14031         (Indexers.GetIndexersForType): Don't return the indexers from
14032         interfaces the class implements; fixes #46502.
14033
14034 2003-07-21  Martin Baulig  <martin@ximian.com>
14035
14036         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14037         CS0661 checks; fixes bug #30442.
14038
14039 2003-07-21  Martin Baulig  <martin@ximian.com>
14040
14041         * decl.cs (AdditionResult): Added `Error'.
14042
14043         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14044
14045         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14046         makes cs0031.cs actually work.
14047
14048 2003-07-20  Martin Baulig  <martin@ximian.com>
14049
14050         * namespace.cs: Fixed that bug which caused a crash when compiling
14051         the debugger's GUI.
14052
14053 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14054
14055         * typemanager.cs (LookupTypeReflection): Never expose types which
14056         are NotPublic, NestedPrivate, NestedAssembly, or
14057         NestedFamANDAssem.  We used to return these, and later do a check
14058         that would report a meaningful error, but the problem is that we
14059         would not get the real match, if there was a name override.
14060
14061 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * namespace.cs (Namespace, Name): Do not compute the namespace
14064         name dynamically, compute it in the constructor.  This reduced
14065         memory usage by 1697 KB.
14066
14067         * driver.cs: Use --pause to pause at the end.
14068
14069 2003-07-17  Peter Williams  <peter@newton.cx>
14070
14071         * Makefile: Change the name of the test target so that it doesn't
14072         conflict with the recursive test target.
14073
14074 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14077         AddressOf): Do not use EmitThis, that was wrong, use the actual
14078         this pointer.
14079
14080 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * class.cs (MethodData.Define): While checking if a method is an
14083         interface implementation, improve the test: If we are not public
14084         (use new test here: use the computed MethodAttributes directly,
14085         instead of the parsed modifier flags) check if the `implementing'
14086         method comes from an interface or not.
14087
14088         * pending.cs (VerifyPendingMethods): Slightly better error
14089         message.
14090
14091         * makefile: add test target that does the mcs bootstrap.
14092
14093 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14094
14095         * interface.cs (Define): Do nothing here since there are no
14096         members to populate etc. Move the attribute emission out of here
14097         since this was just totally the wrong place to put it. Attribute
14098         application happens during the 'Emit' phase, not in the 'Define'
14099         phase.
14100
14101         (Emit): Add this method and move the attribute emission here
14102
14103         * rootcontext.cs (EmitCode): Call the Emit method on interface
14104         types too.
14105
14106 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14107
14108         * expression.cs (OverloadResolve): Report error only if Location
14109         is not 'Null' which means that there was a probe going on.
14110
14111 2003-07-14  Martin Baulig  <martin@ximian.com>
14112
14113         * expression.cs (ConditionalLogicalOperator): New public class to
14114         implement user defined conditional logical operators.
14115         This is section 14.11.2 in the spec and bug #40505.
14116
14117 2003-07-14  Martin Baulig  <martin@ximian.com>
14118
14119         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14120
14121 2003-07-14  Martin Baulig  <martin@ximian.com>
14122
14123         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14124
14125         * ecore.cs (IVariable.VerifyFixed): New interface method.
14126
14127         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14128         operator, check whether the variable is actually fixed.  Fixes bug
14129         #36055.  Set a variable definitely assigned when taking its
14130         address as required by the spec.
14131
14132         * statement.cs (LocalInfo.IsFixed): New field.
14133         (LocalInfo.MakePinned): Set `IsFixed' to true.
14134
14135 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14136
14137         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14138         for .ctors, ensure that we only ask for members declared in the
14139         attribute type (BindingFlags.DeclaredOnly).
14140
14141         Fixes bug #43632.
14142
14143         * expression.cs (Error_WrongNumArguments): Report error 1501
14144         correctly the way CSC does.
14145
14146 2003-07-13  Martin Baulig  <martin@ximian.com>
14147
14148         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14149         lookup on the fully qualified name, to make things like "X.X" work
14150         where "X.X" is a fully qualified type name, but we also have a
14151         namespace "X" in the using list.  Fixes #41975.
14152
14153 2003-07-13  Martin Baulig  <martin@ximian.com>
14154
14155         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14156         function. If we're a CompoundAssign, we need to create an embedded
14157         CompoundAssign, not an embedded Assign.
14158         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14159         Fixes #45854.
14160
14161 2003-07-13  Martin Baulig  <martin@ximian.com>
14162
14163         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14164         work to fix bug #46088.
14165
14166 2003-07-13  Ravi Pratap <ravi@ximian.com>
14167
14168         * class.cs (Operator.Emit): Do not emit attributes here - it is
14169         taken care of by the Method class that we delegate too. This takes
14170         care of bug #45876.
14171
14172 2003-07-10  Martin Baulig  <martin@ximian.com>
14173
14174         * expression.cs (TypeOfVoid): New class.
14175         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14176
14177 2003-07-10  Martin Baulig  <martin@ximian.com>
14178
14179         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14180         bug #35957.
14181
14182 2003-07-10  Martin Baulig  <martin@ximian.com>
14183
14184         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14185         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14186
14187         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14188
14189         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14190
14191 2003-07-10  Martin Baulig  <martin@ximian.com>
14192
14193         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14194         of decimal.  Fixes #42850.
14195
14196         NOTE: I also fixed the created byte blob, but this doesn't work on
14197         the MS runtime and csc never produces any byte blobs for decimal
14198         arrays.
14199
14200 2003-07-10  Martin Baulig  <martin@ximian.com>
14201
14202         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14203         structs; fixes #32068.
14204         (Block.AddChildVariableNames): Fixed #44302.
14205
14206 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14207
14208         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14209
14210 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * attribute.cs: And this test is onger needed.
14213
14214 2003-07-08  Martin Baulig  <martin@ximian.com>
14215
14216         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14217         inaccessible types.  Fixes #36313.
14218
14219         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14220
14221         * namespace.cs (NamespaceEntry): Create implicit entries for all
14222         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14223         implicit entries for N1.N2 and N1.
14224
14225 2003-07-08  Martin Baulig  <martin@ximian.com>
14226
14227         Rewrote the handling of namespaces to fix a lot of the issues
14228         wrt. `using' aliases etc.
14229
14230         * namespace.cs (Namespace): Splitted this class into a
14231         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14232
14233         * typemanager.cs (TypeManager.IsNamespace): Removed.
14234         (TypeManager.ComputeNamespaces): Only compute namespaces from
14235         loaded assemblies here, not the namespaces from the assembly we're
14236         currently compiling.
14237
14238 2003-07-08  Martin Baulig  <martin@ximian.com>
14239
14240         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14241
14242 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14243
14244         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14245         already fixed it.  
14246
14247         I thought about the memory savings here, but LookupTypeReflection
14248         is used under already very constrained scenarios.  Compiling
14249         corlib or mcs only exposes one hit, so it would not really reduce
14250         any memory consumption.
14251
14252 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14253
14254         * typemanager.cs: fixes bug #45889 by only adding public types from
14255         other assemblies to the list of known types.
14256
14257 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14260         on the type we resolved.
14261
14262 2003-07-05  Martin Baulig  <martin@ximian.com>
14263
14264         * pending.cs (PendingImplementation.ParentImplements): Don't
14265         create the proxy if the parent is abstract.
14266
14267         * class.cs (TypeContainer.DefineIndexers): Process explicit
14268         interface implementations first.  Fixes #37714.
14269
14270 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14271
14272         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14273         defined recursively;  but since we modify the input parameters
14274         (left is set to `this' temporarily), we reset this value if the
14275         left_is_explicit is false, which gives the original semantics to
14276         the code.  
14277
14278         * literal.cs (NullPointer): new class used to represent a null
14279         literal in a pointer context.
14280
14281         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14282         type is a pointer, use a NullPointer object instead of a
14283         NullLiteral.   Closes 43687
14284
14285         (ExplicitConversion): Convert pointer values using
14286         the conv opcode to the proper type.
14287
14288         * ecore.cs (New): change ValueTypeVariable property into a method,
14289         that returns whether the valuetype is suitable for being used.
14290
14291         * expression.cs (Binary.DoNumericPromotions): Only return if we
14292         the int constant was a valid uint, and we can return both left and
14293         right as uints.  If not, we continue processing, to trigger the
14294         type conversion.  This fixes 39018.
14295
14296         * statement.cs (Block.EmitMeta): During constant resolution, set
14297         the CurrentBlock property on the emitcontext, so that we resolve
14298         constants propertly.
14299
14300 2003-07-02  Martin Baulig  <martin@ximian.com>
14301
14302         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14303         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14304
14305         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14306         than emitting it here.
14307
14308         * statement.cs: Fixed some more flow analysis bugs.
14309
14310 2003-07-02  Martin Baulig  <martin@ximian.com>
14311
14312         * class.cs (MethodData.Define): When implementing interface
14313         methods, set Final unless we're Virtual.
14314
14315         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14316         check work for interface methods.
14317
14318 2003-07-01  Martin Baulig  <martin@ximian.com>
14319
14320         * ecore.cs (EmitContext.This): Replaced this property with a
14321         GetThis() method which takes a Location argument.  This ensures
14322         that we get the correct error location for a CS0188.
14323
14324 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14325
14326         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14327         ImplicitStandardConversion.
14328
14329         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14330
14331 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14332
14333         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14334         optimization.
14335
14336 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14337
14338         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14339         constructors.
14340
14341         (MethodData.Define): Turn off initlocals for unsafe methods.
14342
14343 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14344
14345         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14346         complete;  Fixes #37521.
14347
14348         * delegate.cs: Use Modifiers.TypeAttr to compute the
14349         TypeAttributes, instead of rolling our own.  This makes the flags
14350         correct for the delegates.
14351
14352 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * class.cs (Constructor.Define): Set the private flag for static
14355         constructors as well.
14356
14357         * cs-parser.jay (statement_expression): Set the return value to
14358         null, to avoid a crash when we catch an error.
14359
14360 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * cs-parser.jay: Applied patch from Jackson that adds support for
14363         extern and unsafe modifiers to destructor declarations.
14364
14365         * expression.cs: Report error 21 if the user is trying to index a
14366         System.Array.
14367
14368         * driver.cs: Add an error message, suggested by the bug report.
14369
14370         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14371         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14372
14373 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * namespace.cs: Add some information to reduce FAQs.
14376
14377 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14380         underlying enumeration types.  Fixes #43915.
14381
14382         * expression.cs: Treat ushort/short as legal values to be used in
14383         bitwise operations.
14384
14385 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14386
14387         * delegate.cs: transfer custom attributes for paramenters from
14388         the delegate declaration to Invoke and BeginInvoke.
14389
14390 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14391
14392         * attribute.cs: handle custom marshalers and emit marshal info
14393         for fields, too.
14394
14395 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14396
14397         * makefile.gnu: Added anonymous.cs to the compiler sources.
14398
14399 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14400
14401         * iterators.cs: Change the name of the proxy class to include two
14402         underscores.
14403
14404         * cs-parser.jay: Update grammar to include anonymous methods.
14405
14406         * anonymous.cs: new file.
14407
14408 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * class.cs (Field.Define): Add missing test for pointers and
14411         safety. 
14412
14413 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14414
14415         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14416         we use the stobj opcode.
14417
14418         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14419         since it wasn't the correct fix. 
14420
14421         It still is puzzling that we are required to use stobj for IntPtr
14422         which seems to be a ValueType.
14423
14424 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14425
14426         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14427         during regular simple name resolution.   Now, the trick is that
14428         instead of returning for processing the simplename, we do a
14429         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14430         contextual lookup type).   If a match is found, return that, if
14431         not, return for further composition.
14432
14433         This fixes long-standing 30485.
14434
14435         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14436         using the address to initialize an object, do an Stobj instead of
14437         using the regular Stelem.
14438
14439         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14440         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14441         Because if we are a BaseIndexerAccess that value will be true.
14442         Fixes 43643.
14443
14444         * statement.cs (GotoCase.Resolve): Return after reporting an
14445         error, do not attempt to continue. 
14446
14447         * expression.cs (PointerArithmetic.Emit): If our operand is a
14448         long, convert our constants to match the operand before
14449         multiplying.  Convert to I type before adding.   Fixes 43670.
14450
14451 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14452
14453         * enum.cs (ImplicitConversionExists) : Rename to
14454         ImplicitEnumConversionExists to remove ambiguity. 
14455
14456         * ecore.cs (NullCast): New type of cast expression class which
14457         basically is very similar to EmptyCast with the difference being
14458         it still is a constant since it is used only to cast a null to
14459         something else
14460         (eg. (string) null)
14461
14462         * convert.cs (ImplicitReferenceConversion): When casting a null
14463         literal, we return a NullCast.
14464
14465         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14466         should be around anymore.
14467
14468         The renaming (reported was slightly wrong). Corrections:
14469
14470         ConvertImplicitStandard -> ImplicitConversionStandard
14471         ConvertExplicitStandard -> ExplicitConversionStandard
14472
14473         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14474         before passing them in !
14475
14476         * convert.cs (ImplicitConversionStandard): When comparing for
14477         equal expr and target types, ensure that expr is not a
14478         NullLiteral.
14479
14480         In general, we must not be checking (expr_type ==
14481         target_type) in the top level conversion methods
14482         (ImplicitConversion, ExplicitConversion etc). This checking is
14483         done in the methods that they delegate to.
14484
14485 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * convert.cs: Move Error_CannotConvertType,
14488         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14489         ImplicitNumericConversion, ImplicitConversionExists,
14490         ImplicitUserConversionExists, StandardConversionExists,
14491         FindMostEncompassedType, FindMostSpecificSource,
14492         FindMostSpecificTarget, ImplicitUserConversion,
14493         ExplicitUserConversion, GetConversionOperators,
14494         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14495         TryImplicitIntConversion, Error_CannotConvertImplicit,
14496         ConvertImplicitRequired, ConvertNumericExplicit,
14497         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14498         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14499         its own file.
14500
14501         Perform the following renames:
14502
14503         StandardConversionExists -> ImplicitStandardConversionExists
14504         ConvertImplicit -> ImplicitConversion
14505         ConvertImplicitStandard -> ImplicitStandardConversion
14506         TryImplicitIntConversion -> ImplicitIntConversion
14507         ConvertImplicitRequired -> ImplicitConversionRequired
14508         ConvertNumericExplicit -> ExplicitNumericConversion
14509         ConvertReferenceExplicit -> ExplicitReferenceConversion
14510         ConvertExplicit -> ExplicitConversion
14511         ConvertExplicitStandard -> ExplicitStandardConversion
14512
14513 2003-05-19  Martin Baulig  <martin@ximian.com>
14514
14515         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14516         (TypeInfo): Added support for structs having structs as fields.
14517
14518         * ecore.cs (FieldExpr): Implement IVariable.
14519         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14520         VariableInfo for the field.
14521
14522 2003-05-18  Martin Baulig  <martin@ximian.com>
14523
14524         * expression.cs (This.DoResolve): Report a CS0027 if we're
14525         emitting a field initializer.
14526
14527 2003-05-18  Martin Baulig  <martin@ximian.com>
14528
14529         * expression.cs (This.ResolveBase): New public function.
14530         (This.DoResolve): Check for CS0188.
14531
14532         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14533         This.Resolve().
14534
14535         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14536         `instance_expression' to null if we don't have any non-static
14537         methods.
14538
14539 2003-05-18  Martin Baulig  <martin@ximian.com>
14540
14541         Reworked the way how local variables and parameters are handled by
14542         the flow analysis code.
14543
14544         * statement.cs (TypeInfo, VariableMap): New public classes.
14545         (VariableInfo): New public class.  This is now responsible for
14546         checking whether a variable has been assigned.  It is used for
14547         parameters and local variables.
14548         (Block.EmitMeta): Take the InternalParameters as argument; compute
14549         the layout of the flow vectors here.
14550         (Block.LocalMap, Block.ParameterMap): New public properties.
14551         (FlowBranching): The .ctor doesn't get the InternalParameters
14552         anymore since Block.EmitMeta() now computes the layout of the flow
14553         vector.
14554         (MyStructInfo): This class is now known as `StructInfo' and nested
14555         in `TypeInfo'; we don't access this directly anymore.
14556
14557         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14558         property and removed IsAssigned(), IsFieldAssigned(),
14559         SetAssigned() and SetFieldAssigned(); we now call them on the
14560         VariableInfo so we don't need to duplicate this code everywhere.
14561
14562         * expression.cs (ParameterReference): Added `Block block' argument
14563         to the .ctor.
14564         (LocalVariableReference, ParameterReference, This): The new
14565         VariableInfo class is now responsible for all the definite
14566         assignment stuff.
14567
14568         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14569         IsParameterAssigned, SetParameterAssigned): Removed.
14570
14571 2003-05-18  Martin Baulig  <martin@ximian.com>
14572
14573         * typemanager.cs (InitCoreTypes): Try calling
14574         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14575         the 3-args-version.  Corlib now also needs our `void_type'.
14576         (GetMethod): Added overloaded version which takes an optional
14577         `bool report_errors' to allow lookups of optional methods.
14578
14579 2003-05-12  Martin Baulig  <martin@ximian.com>
14580
14581         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14582         only used for locals and not for parameters.
14583
14584 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14585
14586         * support.cs (InternalParameters.ParameterType): Return the
14587         ExternalType of the parameter.
14588
14589         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14590         they were unused.
14591
14592 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14593
14594         * class.cs (MethodData.Define): Do not set the `newslot' on
14595         interface members, if they are also flagged as "override".
14596
14597         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14598         better code for ++i and i++.  This only works for static fields
14599         and local variables.
14600
14601         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14602         want to pull the DeclSpace out of the builder_to_declspace instead
14603         of the TypeBuilder (like in TypeContainer.FindMembers).
14604
14605         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14606         instead of LookupTypeContainer.  Fixes the crash on .NET for
14607         looking up interface members.
14608
14609         * const.cs: Create our own emit context during the Definition
14610         stage, so that constants are evaluated in the proper context, when
14611         a recursive definition happens.
14612
14613 2003-05-11  Martin Baulig  <martin@ximian.com>
14614
14615         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14616         new block for a switch section.
14617         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14618         the adding/lookup in the switch block.  Fixes #39828.
14619
14620 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14621
14622         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14623         functionality: I needed to convert the data after I had performed
14624         the add/sub operation into the operands type size.
14625
14626         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14627         pass the type for the box operation, otherwise the resulting
14628         object would have been of type object.
14629
14630         (BoxedCast): Add constructor to specify the type to box as.
14631
14632 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * iterators.cs: I was reusing the `count' variable inadvertently,
14635         take steps to not allow this to happen.
14636
14637 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14640         by creating an array at the point where the params starts and
14641         putting all those arguments there, then adjusting the size of the
14642         array.
14643
14644 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * expression.cs (New.AddressOf): Implement interface
14647         IMemoryLocation.  This is used when the `new' operator is used in
14648         the context of an invocation to a method on a value type.
14649
14650         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14651         example. 
14652
14653         * namespace.cs: Also check the using aliases here.
14654
14655         * driver.cs: Move the test for using validity after the types have
14656         been entered, so we do a single pass that also includes the using
14657         aliases. 
14658
14659         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14660         in the regular case.   CreateSiblingForFinally is doing extra
14661         error checking.
14662
14663         * attribute.cs (GetAttributeArgumentExpression): Store the result
14664         on an out value, and use the return value to indicate failure
14665         instead of using null (which is a valid return for Constant.GetValue).
14666
14667         * statement.cs: Perform the analysis flow for the increment
14668         portion after the statement, because this will be the real flow of
14669         execution.  Fixes #42385
14670
14671         * codegen.cs (EmitContext.EmitArgument,
14672         EmitContext.EmitStoreArgument): New helper functions when the
14673         RemapToProxy flag is set.
14674
14675         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14676         function.
14677
14678         Add support for remapping parameters. 
14679
14680         * iterators.cs: Propagate parameter values;  Store parameter
14681         values in the proxy classes.
14682
14683 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14684
14685         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14686         need a proxy reference;  I do not know what I was thinking
14687
14688         * cs-parser.jay (constructor_initializer): catch another error,
14689         and display nice message.
14690
14691         (field_declaration): catch void field declaration
14692         to flag a better error. 
14693
14694         * class.cs (MemberBase.CheckBase): Report an error instead of a
14695         warning if a new protected member is declared in a struct. 
14696         (Field.Define): catch the error of readonly/volatile.
14697
14698         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14699
14700         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14701         volatile variable is taken
14702
14703 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14704
14705         * statement.cs (Fixed.Resolve): Report an error if we are not in
14706         an unsafe context.
14707
14708 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14709
14710         * typemanager.cs: reuse the code that handles type clashes for
14711         delegates and enumerations.
14712
14713         * class.cs (Report28): Always report.
14714
14715         * expression.cs (EncodeAsAttribute): Allow nulls here.
14716
14717 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14718
14719         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14720         the functionality for testing whether an expression is valid for
14721         an attribute here.  Also handle the case of arrays of elements
14722         being stored. 
14723
14724         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14725         encoding a linear array into an array of objects that are suitable
14726         to be passed to an CustomAttributeBuilder.
14727
14728         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14729
14730         * ecore.cs: (FieldExpr): Handle field remapping here.
14731
14732         * iteratators.cs: Pass the instance variable (if the method is an
14733         instance method) to the constructors, so we can access the field
14734         variables on the class.
14735
14736         TODO: Test this with structs.  I think the THIS variable on
14737         structs might have to be a pointer, and not a refenrece
14738
14739 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14742         local variables to fields in a proxy class.
14743
14744         * iterators.cs (PopulateProxy): Rename our internal fields to
14745         <XXX>.  
14746         Create a <THIS> field if we are an instance method, so we can
14747         reference our parent container variables.
14748         (MapVariable): Called back from the EmitContext code to enter a
14749         new variable to field mapping into the proxy class (we just create
14750         a FieldBuilder).
14751
14752         * expression.cs
14753         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14754         for using the remapped locals to fields.
14755
14756         I placed the code here, because that gives the same semantics to
14757         local variables, and only changes the Emit code.
14758
14759         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14760         statements inside iterators.
14761         (VariableInfo): Add a FieldBuilder for the cases when we are
14762         remapping local variables to fields in a proxy class
14763
14764         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14765         current_block != null.
14766
14767         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14768         not cope with strings, as it has been moved to the
14769         TableSwitchEmit.  Fixed bug in switch generation.
14770
14771         * expression.cs (New.DoResolve): Provide more context for the user
14772         when reporting an error.
14773
14774         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14775         pointers. 
14776
14777         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14778         check the permissions for it.  Note than in a type-resolution
14779         context the check was already present in DeclSpace.ResolveType,
14780         but was missing from the MemberAccess.
14781
14782         (ArrayCreation.CheckIndices): warn if the user has
14783         more nested levels of expressions, but there are no more
14784         dimensions specified.  Avoids crash on bug 41906.
14785
14786 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14787
14788         * statement.cs (Block): replace Implicit bool, for a generic
14789         flags.   
14790         New flag: `Unchecked'.  This is used during the EmitMeta phase
14791         (which is out-of-line with the regular Resolve/Emit process for a
14792         statement, as this is done ahead of time, but still gets a chance
14793         to call constant resolve).
14794
14795         (Block.Flags): new enum for adding a new flag.
14796
14797         (Block.EmitMeta): track the state of unchecked.
14798
14799         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14800         to enable constant resolution to work there as well.
14801
14802 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14803
14804         * typemanager.cs (ienumerable_type): Also look up
14805         System.Collections.IEnumerable. 
14806
14807 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14808
14809         TODO: Test more than one conditional per method.
14810
14811         * class.cs (Indexer.Define): Report the location where the user is
14812         referencing the unsupported feature.
14813
14814         (MethodData): Overload the use of `conditionals' to
14815         minimize the creation of needless ArrayLists.   This saves roughly
14816         212kb on my machine.
14817
14818         (Method): Implement the new IIteratorContainer interface.
14819         (Method.SetYields): Implement the method by setting the ModFlags
14820         to contain METHOD_YIELDS.
14821
14822         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14823         which just got set to null.
14824
14825         * iterators.cs: New file.
14826
14827         (Yield, YieldBreak): New statements.
14828
14829         * statement.cs (Return.Resolve): Flag an error if we are used in
14830         an iterator method.
14831
14832         * codegen.cs (InIterator): New flag set if the code is being
14833         compiled in an iterator method.
14834
14835         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14836         internal modifier, and we just use it to avoid adding extra
14837         fields, as this is seldom used.  
14838
14839         * cs-parser.jay: Add yield_statement (yield and yield break).
14840
14841         * driver.cs: New flag -v2 to turn on version 2 features. 
14842
14843         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14844         hashtable when v2 is enabled.
14845
14846 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14847
14848         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14849         there is already a namespace defined with this name.
14850
14851         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14852         people upgraded their corlibs.
14853
14854         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14855         always use fully qualified types, no need to use the compiler
14856         front end.
14857
14858         (TypeManager.IsNamespace): Use binarysearch.
14859
14860         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14861         AddDelegate): I did not quite use the new IsValid API properly: I
14862         have to pass the short-name and the fullname.  I was passing only
14863         the basename instead of the fullname sometimes. 
14864
14865         (TypeContainer.DefineType): call NamespaceClash.
14866
14867         * interface.cs (Interface.DefineType): use NamespaceClash before
14868         defining the type.
14869
14870         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14871         defining the type.
14872
14873         * enum.cs: (Enum.DefineType): use NamespaceClash before
14874         defining the type.
14875
14876         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14877         speed increase.  First, use the negative_hits cache when we get a
14878         negative.  Second, add the type with its full original name
14879         instead of the new . and + encoded name (reflection uses + to
14880         separate type from a nested type).  Use LookupTypeReflection
14881         directly which bypasses the type->name hashtable (that we already
14882         know does not contain the type.
14883
14884         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14885         location/container type. 
14886
14887         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14888
14889 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14892
14893         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14894         method is being referenced in the method group from a static
14895         context, and report error 120 if so.
14896
14897         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14898         Error118. 
14899
14900         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14901         is created, we create the A namespace).
14902
14903         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14904         Fixes #41591
14905
14906 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14909         invocation to ModuleBuilder.GetType with the same values will
14910         return a new type instance, so we need to cache its return
14911         values. 
14912
14913         * expression.cs (Binary.ResolveOperator): Only allow the compare
14914         operators on enums if they are of the same type.
14915
14916         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14917         types of ValueType on their own case.  Before we were giving them
14918         the same treatment as objects.
14919
14920         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14921         fullname.  Short name is used to compare against container name.
14922         Fullname is used to check against defined namespace names.
14923
14924         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14925         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14926
14927         (Method.CheckBase): Call parent.
14928         (MemberBase.CheckBase): Check for protected members on sealed
14929         classes.
14930         (PropertyBase.CheckBase): Call parent.
14931         (Field.Define): Call parent.
14932
14933         * report.cs: Negative error codes are now mapped to 8000 - code,
14934         so that the display is render more nicely.
14935
14936         * typemanager.cs: Do not use try/catch, instead report a regular
14937         error. 
14938
14939         (GetPointerType, GetReferenceType): These methods provide
14940         mechanisms to obtain the T* and T& from a T.  We had the code
14941         previously scattered around the code base, and it also used
14942         TypeManager.LookupType that would go through plenty of caches.
14943         This one goes directly to the type source.
14944
14945         In some places we did the Type.GetType followed by
14946         ModuleBuilder.GetType, but not in others, so this unifies the
14947         processing as well.
14948
14949         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14950         statements now that we have namespace information.
14951
14952         * typemanager.cs (IsNamespace): New method, returns whether the
14953         string presented is a namespace or not.
14954
14955         (ComputeNamespaces): New public entry point, computes the list of
14956         available namespaces, using the GetNamespaces API call in Mono, or
14957         the slower version in MS.NET.   
14958
14959         Now before we start the semantic analysis phase, we have a
14960         complete list of namespaces including everything that the user has
14961         provided.
14962
14963         Deleted old code to cache namespaces in .nsc files.
14964
14965 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14968         class/struct location definition Location for the implicit
14969         constructor location.
14970
14971         (Operator.Define): Use the location of the operator for the
14972         implicit Method definition.
14973
14974         (Constructor.Emit): use the constructor location for the implicit
14975         base initializer constructor.
14976
14977         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14978         and the Expression class now contains two new methods:
14979
14980         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14981         isolate type lookup from the rest of the resolution process.
14982
14983         Since we use Expressions to hold type definitions due to the way
14984         we parse the input we have historically overloaded Resolve to
14985         perform the Type lookups if a special flag is passed.  Now this is
14986         eliminated and two methods take their place. 
14987
14988         The differences in the two methods between xStep and xTerminal is
14989         that xStep is involved in our current lookup system that uses
14990         SimpleNames to compose a name, while xTerminal is used just to
14991         catch the case where the simplename lookup failed.
14992
14993 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * expression.cs (ResolveMemberAccess): Remove redundant code.
14996         TypeExpr expressions are always born fully resolved.
14997
14998         * interface.cs (PopulateMethod): Do not lookup the types twice.
14999         We were doing it once during SemanticAnalysis and once during
15000         PopulateMethod.
15001
15002         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15003         in local variable type definitions, were being returned as a
15004         SimpleName (we decomposed everything into a string), that is
15005         because primary_expression was being used instead of a type in the
15006         grammar (reduce/reduce conflicts).
15007
15008         The part that was wrong is that we converted the expression into a
15009         string (an oversimplification in one hand, compounded with primary
15010         expressions doing string concatenation).
15011
15012         So things like:
15013
15014         A.B.C [] x;
15015
15016         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15017         using clauses from working on this particular context.  And a type
15018         was being matched directly against "A.B.C[]".
15019
15020         We now use the correct approach, and allow for ComposedCast to be
15021         part of the unary expression.  So the "A.B.C []" become a composed
15022         cast of "A.B.C" (as a nested group of MemberAccess with a
15023         SimpleName at the end) plus the rank composition "[]". 
15024
15025         Also fixes 35567
15026
15027 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15028
15029         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15030         for the access level checking.
15031
15032         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15033         `TypeContainer container', because I kept getting confused when I
15034         was debugging this code.
15035
15036         * expression.cs (Indexers): Instead of tracking getters/setters,
15037         we now track them in parallel.  We create one arraylist less, but
15038         most importantly it is possible now for the LValue code to find a
15039         matching get for a set.
15040
15041         (IndexerAccess.DoResolveLValue): Update the code.
15042         GetIndexersForType has been modified already to extract all the
15043         indexers from a type.  The code assumed it did not.
15044
15045         Also make the code set the correct return type for the indexer.
15046         This was fixed a long time ago for properties, but was missing for
15047         indexers.  It used to be void_type.
15048
15049         (Binary.Emit): Test first for doubles instead of
15050         floats, as they are more common.
15051
15052         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15053         when dealing with floats and the <=, >= operators.  This fixes bug
15054         #39314 
15055
15056         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15057         to load the array value by emitting a load on the foreach variable
15058         type.  This was incorrect.  
15059
15060         We now emit the code to load an element using the the array
15061         variable type, and then we emit the conversion operator.
15062
15063         Fixed #40176
15064
15065 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15066
15067         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15068
15069 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15070
15071         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15072         test for protection before we test for signatures. 
15073
15074         (MethodSignature.ToString): implement.
15075
15076         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15077         to the case where we reduced into a LongConstant.
15078
15079         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15080         depend on whether the information is acurrate, because the
15081         Microsoft runtime will always claim that the array type is public,
15082         regardless of the real state.
15083
15084         If the type is a pointer, another problem happens: the type is
15085         reported as non-public in Microsoft.  
15086
15087         In both cases we have to call CheckAccessLevel recursively with
15088         the underlying type as the argument to be tested.
15089
15090 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * assign.cs (Assign.Emit): If we are dealing with a compound
15093         assignment expression, we should use the code path that stores the
15094         intermediate result in a temporary value.  This fixes #40903.
15095
15096         *expression.cs (Indirection.ToString): Provide ToString method for
15097         debugging. 
15098
15099 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15100
15101         * class.cs: Null out fields holding references to Block objects so
15102         they can be garbage collected.
15103
15104         * expression.cs (OverloadResolve): Remove unused local.
15105
15106 2003-04-07  Martin Baulig  <martin@ximian.com>
15107
15108         * codegen.cs (EmitContext.CurrentFile): New public field.
15109         (EmitContext.Mark): Use the CurrentFile to check whether the
15110         location is in the correct file.
15111         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15112
15113 2003-04-07  Martin Baulig  <martin@ximian.com>
15114
15115         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15116
15117         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15118         location.  [FIXME: The location argument which gets passed to this
15119         method is sometimes wrong!]
15120
15121 2003-04-07  Nick Drochak <ndrochak@gol.com>
15122
15123         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15124
15125 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15126
15127         * expression.cs (Indirection.EmitAssign): We were using the
15128         temporary, but returning immediately instead of continuing the
15129         EmitAssing flow.
15130
15131 2003-04-06  Martin Baulig  <martin@ximian.com>
15132
15133         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15134         if it's a nested child, but also deriving from the outer class.
15135         See test 190.cs.
15136
15137         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15138         nested child, but also deriving from the outer class.  See
15139         test-190.cs.
15140         (FilterWithClosure): We may access private members of the outer
15141         class if we're a nested child and deriving from the outer class.
15142         (RealMemberLookup): Only set `closure_private_ok' if the
15143         `original_bf' contained BindingFlags.NonPublic.
15144
15145 2003-04-05  Martin Baulig  <martin@ximian.com>
15146
15147         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15148
15149 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15150
15151         * class.cs (Event.Define): Do not allow abstract events to have
15152         initializers. 
15153
15154 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15157         block in event declarations.
15158
15159         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15160         value type, get its address.
15161
15162         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15163         leaving a class on the stack instead of a boolean value (int
15164         0/1).  Change the code so we compare against null, and then the
15165         result against zero.
15166
15167         * class.cs (TypeContainer.GetClassBases): We were checking for the
15168         parent class being sealed too late.
15169
15170         * expression.cs (Binary.Emit): For <= and >= when dealing with
15171         floating point values, use cgt.un and clt.un instead of cgt and
15172         clt alone.
15173
15174 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15175
15176         * statement.cs: Apply the same optimization as MS: skip the 
15177         GetEnumerator returning an IEnumerator, and use the one returning a 
15178         CharEnumerator instead. This allows us to avoid the try-finally block 
15179         and the boxing.
15180
15181 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15182
15183         * cs-parser.jay: Attributes cannot be applied to
15184                          namespaces. Fixes #40473
15185
15186 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15187
15188         * class.cs:
15189         (Add*): check if the name is valid using the full name for constants,
15190         fields, properties and events.
15191
15192 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15195         char constants to be part of the enumeration.
15196
15197         * expression.cs (Conditional.DoResolve): Add support for operator
15198         true. Implements the missing functionality from 14.12
15199
15200         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15201         operator true/false as required by the spec.
15202
15203         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15204         implicit conversion to boolean.
15205
15206         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15207         also one where the type implements `operator true'. 
15208
15209         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15210         get an expression that will invoke operator true based on an
15211         expression.  
15212
15213         (GetConversionOperators): Removed the hack that called op_True
15214         here.  
15215
15216         (Expression.ResolveBoolean): Move this from Statement.
15217
15218 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15219
15220         * ecore.cs (FieldExpr): do not allow initialization of initonly
15221         fields on derived classes
15222
15223 2003-03-13  Martin Baulig  <martin@ximian.com>
15224
15225         * statement.cs (Block.Emit): Call ig.BeginScope() and
15226         ig.EndScope() when compiling with debugging info; call
15227         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15228
15229 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15230
15231         * expression.cs (Indexers): Do not construct immediately, allow
15232         for new members to be appended as we go.  Fixes 38143
15233
15234 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15235
15236         * expression.cs: save/restore context when resolving an unchecked
15237         expression.
15238
15239 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * cfold.cs: Catch division by zero in modulus operator during
15242         constant folding.
15243
15244 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15245
15246         * interface.cs (Interface.DefineMembers): Avoid defining members
15247         twice. 
15248
15249 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15250
15251         * driver.cs: handle the +/- options for -noconfig
15252
15253         * statement.cs (Unckeched.Resolve): Also track the state of
15254         unchecked in the Resolve phase.
15255
15256 2003-02-27  Martin Baulig  <martin@ximian.com>
15257
15258         * ecore.cs (Expression.MemberLookup): Don't create a
15259         MethodGroupExpr for something which is not a method.  Fixes #38291.
15260
15261 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * class.cs (MemberBase.CheckParameters): Also check that the type
15264         is unmanaged if it is a pointer.
15265
15266         * expression.cs (SizeOf.Resolve): Add location information.
15267
15268         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15269         a managed type is declared.
15270
15271         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15272         parameter modifiers as well.  Fixes bug 38606
15273
15274         * class.cs: Very sad.  Am backing out the speed up changes
15275         introduced by the ArrayList -> Array in the TypeContainer, as they
15276         were not actually that much faster, and introduced a bug (no error
15277         reports on duplicated methods).
15278
15279         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15280         source first, this will guarantee that we have a valid expression
15281         before calling in lower levels functions that will require a
15282         resolved object.  Then use this original_source in the
15283         target.ResolveLValue instead of the original source that was
15284         passed to us.
15285
15286         Another change.  Use target.Resolve instead of LValueResolve.
15287         Although we are resolving for LValues, we will let the Assign code
15288         take care of that (it will be called again from Resolve).  This
15289         basically allows code like this:
15290
15291         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15292         class Y { void A (X x) { x [0] += o; }
15293
15294         The problem was that the indexer was trying to resolve for
15295         set_Item (idx, object o) and never finding one.  The real set_Item
15296         was set_Item (idx, X).  By delaying the process we get the right
15297         semantics. 
15298
15299         Fixes bug 36505
15300
15301 2003-02-23  Martin Baulig  <martin@ximian.com>
15302
15303         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15304         while calling DoEmit ().
15305
15306         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15307         source files; if you use the #line directive inside a method, the
15308         compiler stops emitting line numbers for the debugger until it
15309         reaches the end of the method or another #line directive which
15310         restores the original file.
15311
15312 2003-02-23  Martin Baulig  <martin@ximian.com>
15313
15314         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15315
15316 2003-02-23  Martin Baulig  <martin@ximian.com>
15317
15318         * statement.cs (Block.AddChildVariableNames): We need to call this
15319         recursively, not just for our immediate children.
15320
15321 2003-02-23  Martin Baulig  <martin@ximian.com>
15322
15323         * class.cs (Event.Define): Always make the field private, like csc does.
15324
15325         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15326         actually work, fixes bug #37521.
15327
15328 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * delegate.cs: When creating the various temporary "Parameters"
15331         classes, make sure that we call the ComputeAndDefineParameterTypes
15332         on those new parameters (just like we do with the formal ones), to
15333         allow them to be resolved in the context of the DeclSpace.
15334
15335         This fixes the bug that Dick observed in Bugzilla #38530.
15336
15337 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * expression.cs (ResolveMemberAccess): When resolving a constant,
15340         do not attempt to pull a constant if the value was not able to
15341         generate a valid constant.
15342
15343         * const.cs (LookupConstantValue): Do not report more errors than required.
15344
15345 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15346
15347         * expression.cs: fixes bug #38328.
15348
15349 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15350
15351         * class.cs: Changed all the various members that can be part of a
15352         class from being an ArrayList to be an Array of the right type.
15353         During the DefineType type_list, interface_list, delegate_list and
15354         enum_list are turned into types, interfaces, delegates and enums
15355         arrays.  
15356
15357         And during the member population, indexer_list, event_list,
15358         constant_list, field_list, instance_constructor_list, method_list,
15359         operator_list and property_list are turned into their real arrays.
15360
15361         Although we could probably perform this operation earlier, for
15362         good error reporting we need to keep the lists and remove the
15363         lists for longer than required.
15364
15365         This optimization was triggered by Paolo profiling the compiler
15366         speed on the output of `gen-sample-program.pl' perl script. 
15367
15368         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15369         not crash in methods like MemberLookupFailed that use this field.  
15370
15371         This problem arises when the compiler fails to resolve a type
15372         during interface type definition for example.
15373
15374 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15377         inherit from System.Object, so we have to stop at null, not only
15378         when reaching System.Object.
15379
15380 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15381
15382         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15383         DeclaredOnly because the parent indexer might have had a different
15384         name, but did not loop until the top of the hierarchy was reached.
15385
15386         The problem this one fixes is 35492: when a class implemented an
15387         indexer from an interface, we were getting the interface method
15388         (which was abstract) and we were flagging an error (can not invoke
15389         abstract method).
15390
15391         This also keeps bug 33089 functioning, and test-148 functioning.
15392
15393         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15394         out if a method is special is to see if it is declared in a
15395         property or event, or whether it is one of the predefined operator
15396         names.   This should fix correctly #36804.
15397
15398 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15399
15400         The goal here is to remove the dependency on EmptyCast.Peel ().
15401         Killing it completely.
15402
15403         The problem is that currently in a number of places where
15404         constants are expected, we have to "probe" for an EmptyCast, and
15405         Peel, which is not the correct thing to do, as this will be
15406         repetitive and will likely lead to errors. 
15407
15408         The idea is to remove any EmptyCasts that are used in casts that
15409         can be reduced to constants, so we only have to cope with
15410         constants. 
15411
15412         This bug hunt was triggered by Bug 37363 and the desire to remove
15413         the duplicate pattern where we were "peeling" emptycasts to check
15414         whether they were constants.  Now constants will always be
15415         constants.
15416
15417         * ecore.cs: Use an enumconstant here instead of wrapping with
15418         EmptyCast.  
15419
15420         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15421         throwing me off.  By handling this we can get rid of a few hacks.
15422
15423         * statement.cs (Switch): Removed Peel() code.
15424
15425 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15426
15427         * class.cs: Location information for error 508
15428
15429         * expression.cs (New.DoResolve): Add a guard against double
15430         resolution of an expression.  
15431
15432         The New DoResolve might be called twice when initializing field
15433         expressions (see EmitFieldInitializers, the call to
15434         GetInitializerExpression will perform a resolve on the expression,
15435         and later the assign will trigger another resolution
15436
15437         This leads to bugs (#37014)
15438
15439         * delegate.cs: The signature for EndInvoke should contain any ref
15440         or out parameters as well.  We were not doing this in the past. 
15441
15442         * class.cs (Field.Define): Do not overwrite the type definition
15443         inside the `volatile' group.  Turns out that volatile enumerations
15444         were changing the type here to perform a validity test, which
15445         broke conversions. 
15446
15447 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15450         and structs, we do not want to load the instance variable
15451
15452         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15453         enum_type has to be handled like an object reference (implicit
15454         conversions exists from this to object), but the regular IsClass
15455         and IsValueType tests will never return true for this one.
15456
15457         Also we use TypeManager.IsValueType instead of type.IsValueType,
15458         just for consistency with the rest of the code (this is only
15459         needed if we ever use the construct exposed by test-180.cs inside
15460         corlib, which we dont today).
15461
15462 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15463
15464         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15465         just InternalCall.
15466
15467 2003-02-09  Martin Baulig  <martin@ximian.com>
15468
15469         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15470         (Namespace.DefineNamespaces): New static public method; this is
15471         called when we're compiling with debugging to add all namespaces
15472         to the symbol file.
15473
15474         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15475         pass it to the Namespace's .ctor.
15476
15477         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15478         and MethodBase arguments; pass the namespace ID to the symwriter;
15479         pass the MethodBase instead of the token to the symwriter.
15480         (SymbolWriter.DefineNamespace): New method to add a namespace to
15481         the symbol file.
15482
15483 2003-02-09  Martin Baulig  <martin@ximian.com>
15484
15485         * symbolwriter.cs: New file.  This is a wrapper around
15486         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15487         methods here in near future.
15488
15489 2003-02-09  Martin Baulig  <martin@ximian.com>
15490
15491         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15492         ILGenerator.MarkSequencePoint() which are actually used by the
15493         symbol writer.
15494
15495 2003-02-09  Martin Baulig  <martin@ximian.com>
15496
15497         * location.cs (SourceFile): New public sealed class.  This
15498         contains the name and an index which is used in the location's token.
15499         (Location): Reserve an appropriate number of bits in the token for
15500         the source file instead of walking over that list, this gives us a
15501         really huge performance improvement when compiling with debugging.
15502
15503         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15504         `SourceFile' argument instead of a string.
15505         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15506         but don't parse/tokenize here, we need to generate the list of all
15507         source files before we do that.
15508         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15509         the files.
15510
15511         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15512         instead of a string.
15513
15514         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15515         of a string.
15516
15517 2003-02-09  Martin Baulig  <martin@ximian.com>
15518
15519         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15520         filename on `#line default'.
15521
15522 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15523
15524         * statement.cs: don't clear the pinned var when the fixed statement
15525         returns from the method (fixes bug#37752).
15526
15527 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15528
15529         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15530         to IsValueType.
15531
15532 2003-02-07  Martin Baulig  <martin@ximian.com>
15533
15534         * driver.cs: Removed the `--debug-args' command line argument.
15535
15536         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15537         automatically by the AsssemblyBuilder.
15538         (CodeGen.InitializeSymbolWriter): We don't need to call any
15539         initialization function on the symbol writer anymore.  This method
15540         doesn't take any arguments.
15541
15542 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15543
15544         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15545         from referenced assemblies as well.
15546
15547 2003-02-02  Martin Baulig  <martin@ximian.com>
15548
15549         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15550
15551 2003-02-02  Martin Baulig  <martin@ximian.com>
15552
15553         * class.cs (Constructor.Emit): Open the symbol writer before
15554         emitting the constructor initializer.
15555         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15556         single-stepping through constructor initializers.
15557
15558 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15559
15560         * class.cs: Handle error 549: do not allow virtual methods in
15561         sealed classes. 
15562
15563 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15564
15565         * decl.cs: Check access levels when resolving types
15566
15567 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15568
15569         * statement.cs: Add parameters and locals set in catch blocks that might 
15570         return to set vector
15571
15572 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * class.cs (Operator): Set the SpecialName flags for operators.
15575
15576         * expression.cs (Invocation.DoResolve): Only block calls to
15577         accessors and operators on SpecialName methods.
15578
15579         (Cast.TryReduce): Handle conversions from char constants.
15580
15581
15582 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15583
15584         * statement.cs: small memory and time optimization in FlowBranching.
15585
15586 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15587
15588         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15589         problem that the last fix but in the other sid (Set).
15590
15591         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15592         access when there is no indexer in the hierarchy.
15593
15594 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15595
15596         * class.cs: Combine some if statements.
15597
15598 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15599
15600         * driver.cs: fixed bug #37187.
15601
15602 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15603
15604         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15605         any indexer, it's needed to build a list with all the indexers in the
15606         hierarchy (AllGetters), else we have problems. Fixes #35653.
15607
15608 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * class.cs (MethodData.Define): It is wrong for an interface
15611         implementation to be static in both cases: explicit and implicit.
15612         We were only handling this in one case.
15613
15614         Improve the if situation there to not have negations.
15615
15616         * class.cs (Field.Define): Turns out that we do not need to check
15617         the unsafe bit on field definition, only on usage.  Remove the test.
15618
15619 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15620
15621         * driver.cs: use assembly.Location instead of Codebase (the latest
15622         patch made mcs fail when using MS assemblies).
15623
15624 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15625
15626         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15627         get the path to *corlib.dll.
15628
15629 2003-01-21  Nick Drochak <ndrochak@gol.com>
15630
15631         * cs-tokenizer.cs:
15632         * pending.cs:
15633         * typemanager.cs: Remove compiler warnings
15634
15635 2003-01-20  Duncan Mak  <duncan@ximian.com>
15636
15637         * AssemblyInfo.cs: Bump the version number to 0.19.
15638
15639 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15640
15641         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15642
15643 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15644
15645         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15646
15647 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15648
15649         * cs-parser.jay: Small fix: we were not comparing the constructor
15650         name correctly.   Thanks to Zoltan for the initial pointer.
15651
15652 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15653
15654         * cs-tokenizer.cs: Set file name when specified with #line
15655
15656 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * cs-parser.jay: Only perform the constructor checks here if we
15659         are named like the class;  This will help provider a better
15660         error.  The constructor path is taken when a type definition is
15661         not found, but most likely the user forgot to add the type, so
15662         report that rather than the constructor error.
15663
15664 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15665
15666         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15667         allocations.
15668
15669 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15670
15671         * cs-parser.jay: Add cleanup call.
15672
15673 2003-01-13  Duncan Mak  <duncan@ximian.com>
15674
15675         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15676         consistent with other methods.
15677
15678 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15679
15680         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15681
15682 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15683
15684         * attribute.cs: only set GuidAttr to true when we have a
15685         GuidAttribute.
15686
15687 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15688
15689         * ecore.cs:
15690         * expression.cs:
15691         * typemanager.cs: fixes to allow mcs compile corlib with the new
15692         Type.IsSubclassOf fix.
15693
15694 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * expression.cs (LocalVariableReference.DoResolve): Classify a
15697         constant as a value, not as a variable.   Also, set the type for
15698         the variable.
15699
15700         * cs-parser.jay (fixed_statement): take a type instead of a
15701         pointer_type, so we can produce a better error message later.
15702
15703         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15704         as an error.  
15705
15706         (For.DoEmit): Make inifinite loops have a
15707         non-conditional branch back.
15708
15709         (Fixed.DoEmit): First populate the pinned variables, then emit the
15710         statement, then clear the variables.  Before I was emitting the
15711         code once for each fixed piece.
15712
15713
15714 2003-01-08  Martin Baulig  <martin@ximian.com>
15715
15716         * statement.cs (FlowBranching.MergeChild): A break in a
15717         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15718
15719 2003-01-08  Martin Baulig  <martin@ximian.com>
15720
15721         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15722         lives in the same number space than `param_map'.  Fixes #36154.
15723
15724 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15725
15726         * cs-parser.jay (constructor_declaration): Set the
15727         Constructor.ModFlags before probing for it.  This makes the
15728         compiler report 514, 515 and 132 (the code was there, but got
15729         broken). 
15730
15731         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15732         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15733         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15734
15735 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15736
15737         * enum.cs: create the enum static fields using the enum type.
15738
15739 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15740
15741         * class.cs: don't try to create the ParamBuilder for the return
15742         type if it's not needed (and handle it breaking for the ms runtime
15743         anyway).
15744
15745 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15746
15747         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15748
15749 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15750
15751         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15752         the command.   This showed up while compiling the JANET source
15753         code, which used \r as its only newline separator.
15754
15755 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * class.cs (Method.Define): If we are an operator (because it
15758         reuses our code), then set the SpecialName and HideBySig.  #36128
15759
15760 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15763         exception, report error 120 `object reference required'.
15764
15765         * driver.cs: Add --pause option, used during to measure the size
15766         of the process as it goes with --timestamp.
15767
15768         * expression.cs (Invocation.DoResolve): Do not allow methods with
15769         SpecialName to be invoked.
15770
15771 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15774         number before adding it.
15775
15776 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15777
15778         * ecore.cs (StandardImplicitConversion): When in an unsafe
15779         context, we allow conversion between void * to any other pointer
15780         type. This fixes bug #35973.
15781
15782 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15783
15784         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15785         is not thrown when extensionless outputs are used 
15786
15787 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15788
15789         * rootcontext.cs: fixed compilation of corlib.
15790
15791 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15792
15793         * attribute.cs (Attributes.Contains): Add new method.
15794
15795         * class.cs (MethodCore.LabelParameters): if the parameter is an
15796         `out' parameter, check that no attribute `[In]' has been passed.
15797
15798         * enum.cs: Handle the `value__' name in an enumeration.
15799
15800 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15801
15802         * decl.cs: Added special case to allow overrides on "protected
15803         internal" methods
15804
15805 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15806
15807         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15808         since it makes much more sense.
15809
15810         (Attributes.ctor): Don't require a Location parameter.
15811
15812         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15813
15814         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15815         since we already have that information per attribute.
15816
15817         * everywhere : make appropriate changes.
15818
15819         * class.cs (LabelParameters): Write the code which actually
15820         applies attributes to the return type. We can't do this on the MS
15821         .NET runtime so we flag a warning in the case an exception is
15822         thrown.
15823
15824 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15825
15826         * const.cs: Handle implicit null conversions here too.
15827
15828 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15829
15830         * class.cs (MethodCore.LabelParameters): Remove the extra
15831         Type [] parameter since it is completely unnecessary. Instead
15832         pass in the method's attributes so that we can extract
15833         the "return" attribute.
15834
15835 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15836
15837         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15838         of ignoring it and letting the compile continue.
15839
15840         * typemanager.cs (ChangeType): use an extra argument to return an
15841         error condition instead of throwing an exception.
15842
15843 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15844
15845         * expression.cs (Unary.TryReduce): mimic the code for the regular
15846         code path.  Perform an implicit cast in the cases where we can
15847         implicitly convert to one of the integral types, and then reduce
15848         based on that constant.   This fixes bug #35483.
15849
15850 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15851
15852         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15853
15854 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15855
15856         * namespace.cs: fixed bug #35489.
15857
15858 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15859
15860         * class.cs: Remove some dead code.
15861
15862         * cs-parser.jay: Estimate the number of methods needed
15863         (RootContext.MethodCount);
15864
15865         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15866         numbers instead of StringBuilders.
15867
15868         * support.cs (PtrHashtable): Add constructor with initial size;
15869         We can now reduce reallocations of the method table.
15870
15871 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15872
15873         * attribute.cs (ApplyAttributes): Keep track of the emitted
15874         attributes on a per-target basis. This fixes bug #35413.
15875
15876 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15877
15878         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15879         default to the Windows 1252 encoding.
15880
15881         (UnixParseOption): Support version, thanks to Alp for the missing
15882         pointer. 
15883
15884         * AssemblyInfo.cs: Add nice assembly information.
15885
15886         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15887         (bug 35169).
15888
15889         * cs-parser.jay: Allow a trailing comma before the close bracked
15890         in the attribute_section production.
15891
15892         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15893         address of the instance was being taken, I will take this out,
15894         because we take the address of the object immediately here.
15895
15896 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15897
15898         * typemanager.cs (AreMultipleAllowed): Take care of the most
15899         obvious case where attribute type is not in the current assembly -
15900         stupid me ;-)
15901
15902 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15903
15904         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15905         definitions, instead of doing that afterwards.  
15906
15907         Also we use a nice little hack, depending on the constructor, we
15908         know if we are a "composed" name or a simple name.  Hence, we
15909         avoid the IndexOf test, and we avoid 
15910
15911         * codegen.cs: Add code to assist in a bug reporter to track down
15912         the source of a compiler crash. 
15913
15914 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15915
15916         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15917         types have been emitted for a given element and flag an error
15918         if something which does not have AllowMultiple set is used more
15919         than once.
15920
15921         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15922         attribute types and their corresponding AllowMultiple properties
15923
15924         (AreMultipleAllowed): Check the property for a given type.
15925
15926         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15927         property in the case we have a TypeContainer.
15928
15929         (Attributes.AddAttribute): Detect duplicates and just skip on
15930         adding them. This trivial fix catches a pretty gross error in our
15931         attribute emission - global attributes were being emitted twice!
15932
15933         Bugzilla bug #33187 is now fixed.
15934
15935 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15936
15937         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15938         instead of pp_and).
15939
15940         * expression.cs (Binary.ResolveOperator): I can only use the
15941         Concat (string, string, string) and Concat (string, string,
15942         string, string) if the child is actually a concatenation of
15943         strings. 
15944
15945 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15946
15947         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15948         context where we need a 2-character lookahead.
15949
15950         * pending.cs (PendingImplementation): Rework so we can keep track
15951         of interface types all the time, and flag those which were
15952         implemented by parents as optional.
15953
15954 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15955
15956         * expression.cs (Binary.ResolveOperator): Use
15957         String.Concat(string,string,string) or
15958         String.Concat(string,string,string,string) when possible. 
15959
15960         * typemanager: More helper methods.
15961
15962
15963 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15964
15965         * pending.cs: remove the bogus return from GetMissingInterfaces()
15966         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15967
15968 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15969
15970         * namespace.cs: avoid duplicated 'using xxx' being added to
15971         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15972         when we get more than one 'using' statement for the same namespace.
15973         Report a CS0105 warning for it.
15974
15975 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15978         of calling getChar/putback, uses internal knowledge of it.    
15979
15980         (xtoken): Reorder tokenizer so most common patterns are checked
15981         first.  This reduces the compilation time in another 5% (from 8.11s
15982         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15983
15984         The parsing time is 22% of the compilation in mcs, and from that
15985         64% is spent on the tokenization process.  
15986
15987         I tried using a binary search for keywords, but this is slower
15988         than the hashtable.  Another option would be to do a couple of
15989         things:
15990
15991                 * Not use a StringBuilder, instead use an array of chars,
15992                   with a set value.  Notice that this way we could catch
15993                   the 645 error without having to do it *afterwards*.
15994
15995                 * We could write a hand-parser to avoid the hashtable
15996                   compares altogether.
15997
15998         The identifier consumption process takes 37% of the tokenization
15999         time.  Another 15% is spent on is_number.  56% of the time spent
16000         on is_number is spent on Int64.Parse:
16001
16002                 * We could probably choose based on the string length to
16003                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16004                   computations. 
16005
16006         Another 3% is spend on wrapping `xtoken' in the `token' function.
16007
16008         Handle 0xa0 as whitespace (#34752)
16009
16010 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16011
16012         * typemanager.cs (IsCLRType): New routine to tell whether a type
16013         is one of the builtin types.  
16014
16015         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16016         typecode in more places instead of doing pointer comparissions.
16017         We could leverage some knowledge about the way the typecodes are
16018         laid out.
16019
16020         New code to cache namespaces in assemblies, it is currently not
16021         invoked, to be used soon.
16022
16023         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16024
16025         * expression.cs (Binary.ResolveOperator): specially handle
16026         strings, and do not perform user-defined operator overloading for
16027         built-in types.
16028
16029 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16030
16031         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16032         internalcall as it is a pretty simple operation;  Avoid whenever
16033         possible to call Char.IsLetter.
16034
16035         (consume_identifier): Cut by half the number of
16036         hashtable calls by merging the is_keyword and GetKeyword behavior.
16037
16038         Do not short-circuit, because if we do, we
16039         report errors (ie, #if false && true would produce an invalid
16040         directive error);
16041
16042
16043 2002-11-24  Martin Baulig  <martin@ximian.com>
16044
16045         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16046         check constant ranges and report a CS0221.  Fixes #33186.
16047
16048 2002-11-24  Martin Baulig  <martin@ximian.com>
16049
16050         * cs-parser.jay: Make this work for uninitialized variable
16051         declarations in the `for' initializer.  Fixes #32416.
16052
16053 2002-11-24  Martin Baulig  <martin@ximian.com>
16054
16055         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16056         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16057
16058 2002-11-24  Martin Baulig  <martin@ximian.com>
16059
16060         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16061         argument; if true, we also check for user-defined conversions.
16062         This is only needed if both arguments are of a user-defined type.
16063         Fixes #30443, added test-175.cs.
16064         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16065
16066         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16067
16068 2002-11-24  Martin Baulig  <martin@ximian.com>
16069
16070         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16071         function to get the store opcode.
16072         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16073         only emit the Ldelema if the store opcode is Stobj.  You must run
16074         both test-34 and test-167 to test this.  Fixes #34529.
16075
16076 2002-11-23  Martin Baulig  <martin@ximian.com>
16077
16078         * ecore.cs (Expression.MemberLookup): Added additional
16079         `qualifier_type' argument which is used when we're being called
16080         from MemberAccess.DoResolve() and null if we're called from a
16081         SimpleName lookup.
16082         (Expression.MemberLookupFailed): New method to report errors; this
16083         does the CS1540 check and reports the correct error message.
16084
16085         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16086         argument for the CS1540 check and redone the way how we're dealing
16087         with private members.  See the comment in the source code for details.
16088         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16089         `closure_start_type' to `closure_qualifier_type' and check whether
16090         it's not null.  It was not this filter being broken, it was just
16091         being called with the wrong arguments.
16092
16093         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16094         and pass it the correct `qualifier_type'; this also does the error
16095         handling for us.
16096
16097 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16098
16099         * expression.cs (Invocation.EmitParams): If the we are dealing
16100         with a non-built-in value type, load its address as well.
16101
16102         (ArrayCreation): Use a a pretty constant instead
16103         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16104         static initializers.  
16105
16106         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16107         because they are not really value types, just glorified integers. 
16108
16109         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16110
16111         * ecore.cs: Remove redundant code for enumerations, make them use
16112         the same code path as everything else, fixes the casting issue
16113         with enumerations in Windows.Forms.
16114
16115         * attribute.cs: Do only cast to string if it is a string, the
16116         validation happens later.
16117
16118         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16119         people upgrade their corlibs.
16120
16121         * ecore.cs: Oops, enumerations were not following the entire code path
16122
16123 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * typemanager.cs (FilterWithClosure): Commented out the test for
16126         1540 in typemanager.cs, as it has problems when accessing
16127         protected methods from a parent class (see test-174.cs). 
16128
16129         * attribute.cs (Attribute.ValidateGuid): new method.
16130         (Attribute.Resolve): Use above.
16131
16132 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16135
16136         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16137         handling for enumerations, as we only needed the TypeContainer
16138         functionality to begin with (this is required for the fix below to
16139         work for enums that reference constants in a container class for
16140         example). 
16141
16142         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16143
16144         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16145         a valid TypeBuilder to perform lookups on.o
16146
16147         * class.cs (InheritableMemberSignatureCompare): Use true in the
16148         call to GetGetMethod and GetSetMethod, because we are comparing
16149         the signature, and we need to get the methods *even* if they are
16150         private. 
16151
16152         (PropertyBase.CheckBase): ditto.
16153
16154         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16155         GotoCase.Resolve): Use Peel on EmpytCasts.
16156
16157         * ecore.cs (EmptyCast): drop child, add Peel method.
16158
16159 2002-11-17  Martin Baulig  <martin@ximian.com>
16160
16161         * ecore.cs (EmptyCast.Child): New public property.
16162
16163         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16164         label resolved to an EmptyCast.  Fixes #34162.
16165         (GotoCase.Resolve): Likewise.
16166         (Block.EmitMeta): Likewise.
16167
16168 2002-11-17  Martin Baulig  <martin@ximian.com>
16169
16170         * expression.cs (Invocation.BetterConversion): Prefer int over
16171         uint; short over ushort; long over ulong for integer literals.
16172         Use ImplicitConversionExists instead of StandardConversionExists
16173         since we also need to check for user-defined implicit conversions.
16174         Fixes #34165.  Added test-173.cs.
16175
16176 2002-11-16  Martin Baulig  <martin@ximian.com>
16177
16178         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16179         with the `true' and `false' literals.  Fixes #33151.
16180
16181 2002-11-16  Martin Baulig  <martin@ximian.com>
16182
16183         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16184         October 22nd; don't do the cs1540 check for static members.
16185
16186         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16187         now using our own filter here and doing the cs1540 check again.
16188
16189 2002-11-16  Martin Baulig  <martin@ximian.com>
16190
16191         * support.cs (InternalParameters): Don't crash if we don't have
16192         any fixed parameters.  Fixes #33532.
16193
16194 2002-11-16  Martin Baulig  <martin@ximian.com>
16195
16196         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16197         when looking up static methods to make this work on Windows.
16198         Fixes #33773.
16199
16200 2002-11-16  Martin Baulig  <martin@ximian.com>
16201
16202         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16203         a setter rather than using PropertyInfo.CanWrite.
16204
16205 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16206
16207         * class.cs: Allow acces to block member by subclasses. Fixes build
16208         breaker.
16209
16210 2002-11-14  Martin Baulig  <martin@ximian.com>
16211
16212         * class.cs (Constructor.Emit): Added the extern/block check.
16213         Fixes bug #33678.
16214
16215 2002-11-14  Martin Baulig  <martin@ximian.com>
16216
16217         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16218         iteration while looking for indexers, this is needed because the
16219         indexer may have a different name in our base classes.  Fixed the
16220         error reporting (no indexers at all, not get accessor, no
16221         overloaded match).  Fixes bug #33089.
16222         (IndexerAccess.DoResolveLValue): Likewise.
16223
16224 2002-11-14  Martin Baulig  <martin@ximian.com>
16225
16226         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16227         indexers.  Fixes the first part of bug #33089.
16228         (MethodSignature.InheritableMemberSignatureCompare): Added support
16229         for properties.
16230
16231 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16232
16233         * attribute.cs (Attribute.Resolve): Catch the
16234         NullReferenceException and report it since it isn't supposed to
16235         happen. 
16236
16237 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16238
16239         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16240         LogicalOr and LogicalAnd that can benefit from recursively
16241         handling EmitBranchable.  The code now should be nice for Paolo.
16242
16243 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16244
16245         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16246         the Type lookups, as we perform quite a number of lookups on
16247         non-Types.  This can be removed once we can deterministically tell
16248         whether we have a type or a namespace in advance.
16249
16250         But this might require special hacks from our corlib.
16251
16252         * TODO: updated.
16253
16254         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16255         and double which avoids a conversion from an integer to a double.
16256
16257         * expression.cs: tiny optimization, avoid calling IsConstant,
16258         because it effectively performs the lookup twice.
16259
16260 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16261
16262         But a bogus return here to keep the semantics of the old code
16263         until the Mono runtime is fixed.
16264
16265         * pending.cs (GetMissingInterfaces): New method used to remove all
16266         the interfaces that are already implemented by our parent
16267         classes from the list of pending methods. 
16268
16269         * interface.cs: Add checks for calls after ResolveTypeExpr.
16270
16271 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16272
16273         * class.cs (Class.Emit): Report warning 67: event not used if the
16274         warning level is beyond 3.
16275
16276         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16277         being a NullLiteral.
16278
16279         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16280         specifiers. 
16281
16282         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16283         path that might fail if a type can not be resolved.
16284
16285         * expression.cs (Binary.Emit): Emit unsigned versions of the
16286         operators. 
16287
16288         * driver.cs: use error 5.
16289
16290 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16291
16292         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16293
16294 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16295
16296         * cs-parser.jay (switch_section): A beautiful patch from Martin
16297         Baulig that fixed 33094.
16298
16299 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16300
16301         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16302         Check whether the base is abstract and report an error if so.
16303
16304         * expression.cs (IndexerAccess.DoResolveLValue,
16305         IndexerAccess.DoResolve): ditto. 
16306
16307         (Invocation.DoResolve): ditto.
16308
16309         (Invocation.FullMethodDesc): Improve the report string.
16310
16311         * statement.cs (Block): Eliminate IsVariableDefined as it is
16312         basically just a wrapper for GetVariableInfo.
16313
16314         * ecore.cs (SimpleName): Use new 
16315
16316         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16317         type, as we return the actual parameter ref/unref state on a
16318         different call.
16319
16320 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16321
16322         * support.cs: Return proper flags REF/OUT fixing the previous
16323         commit.  
16324
16325         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16326         not used to mean `ref' but `ref or out' in ParameterReference
16327
16328         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16329         full type signature instead of calling TypeManger.CSharpName
16330         ourselves. 
16331
16332         * support.cs (InternalParameters.ParameterDesc): Do not compare
16333         directly to the modflags, because REF/OUT will actually be bitsets
16334         if set. 
16335
16336         * delegate.cs (VerifyMethod): Check also the modifiers.
16337
16338         * cs-tokenizer.cs: Fix bug where floating point values with an
16339         exponent where a sign was missing was ignored.
16340
16341         * driver.cs: Allow multiple assemblies to be specified in a single
16342         /r: argument
16343
16344 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16345
16346         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16347         because identifiers after a parenthesis would end up in this kind
16348         of production, and we needed to desamiguate it for having casts
16349         like:
16350
16351                 (UserDefinedType *) xxx
16352
16353 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16354
16355         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16356         we should set on the Bindingflags.NonPublic, but not turn on
16357         private_ok.  private_ok controls whether a Private member is
16358         returned (this is chekced on the filter routine), while the
16359         BindingFlags.NonPublic just controls whether private/protected
16360         will be allowed.   This fixes the problem part of the problem of
16361         private properties being allowed to be used in derived classes.
16362
16363         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16364         so we can call the children DoResolveLValue method (this will
16365         properly signal errors on lvalue assignments to base properties)
16366
16367         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16368         getter are null, and we have a property info, we know that this
16369         happened because the lookup failed, so we report an error 122 for
16370         protection level violation.
16371
16372         We also silently return if setter and getter are null in the
16373         resolve functions, this condition only happens if we have flagged
16374         the error before.  This is the other half of the problem. 
16375
16376         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16377         not have accessibility information, that is why we were returning
16378         true in the filter function in typemanager.cs.
16379
16380         To properly report 122 (property is inaccessible because of its
16381         protection level) correctly, we report this error in ResolveAccess
16382         by failing if both the setter and the getter are lacking (ie, the
16383         lookup failed). 
16384
16385         DoResolve and DoLResolve have been modified to check for both
16386         setter/getter being null and returning silently, the reason being
16387         that I did not want to put the knowledge about this error in upper
16388         layers, like:
16389
16390         int old = Report.Errors;
16391         x = new PropertyExpr (...);
16392         if (old != Report.Errors)
16393                 return null;
16394         else
16395                 return x;
16396
16397         So the property expr is returned, but it is invalid, so the error
16398         will be flagged during the resolve process. 
16399
16400         * class.cs: Remove InheritablePropertySignatureCompare from the
16401         class, as we no longer depend on the property signature to compute
16402         whether it is possible to implement a method or not.
16403
16404         The reason is that calling PropertyInfo.GetGetMethod will return
16405         null (in .NET, in Mono it works, and we should change this), in
16406         cases where the Get Method does not exist in that particular
16407         class.
16408
16409         So this code:
16410
16411         class X { public virtual int A { get { return 1; } } }
16412         class Y : X { }
16413         class Z : Y { public override int A { get { return 2; } } }
16414
16415         Would fail in Z because the parent (Y) would not have the property
16416         defined.  So we avoid this completely now (because the alternative
16417         fix was ugly and slow), and we now depend exclusively on the
16418         method names.
16419
16420         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16421         reference method, instead of using the property.
16422
16423         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16424         routines are gone now.
16425
16426         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16427         names, they were incorrectly named.
16428
16429         * cs-tokenizer.cs: Return are more gentle token on failure. 
16430
16431         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16432         had an out-of-sync index variable, which caused it to remove from
16433         the list of pending methods the wrong method sometimes.
16434
16435 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16436
16437         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16438         CanWrite, because those refer to this particular instance of the
16439         property, and do not take into account the fact that we can
16440         override single members of a property.
16441
16442         Constructor requires an EmitContext.  The resolution process does
16443         not happen here, but we need to compute the accessors before,
16444         because the resolution does not always happen for properties.
16445
16446         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16447         subclass, before we did not update this flag, but we did update
16448         bindingflags. 
16449
16450         (GetAccessors): Drop this routine, as it did not work in the
16451         presence of partially overwritten set/get methods. 
16452
16453         Notice that this broke the cs1540 detection, but that will require
16454         more thinking. 
16455
16456 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16457
16458         * class.cs:
16459         * codegen.cs:
16460         * driver.cs: issue a warning instead of an error if we don't support
16461         debugging for the platform. Also ignore a couple of errors that may
16462         arise when trying to write the symbols. Undo my previous patch.
16463
16464 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16465
16466         * driver.cs: ignore /debug switch except for Unix platforms.
16467
16468 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16469
16470         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16471
16472 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16473
16474         * driver.cs: Do not make mcs-debug conditional, so we do not break
16475         builds that use it.
16476
16477         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16478         review this patch.  But basically after all the children variables
16479         have been merged, the value of "Breaks" was not being set to
16480         new_breaks for Switch blocks.  I think that it should be set after
16481         it has executed.  Currently I set this to the value of new_breaks,
16482         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16483         conservative, but I do not understand this code very well.
16484
16485         I did not break anything in the build, so that is good ;-)
16486
16487         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16488
16489 2002-10-20  Mark Crichton  <crichton@gimp.org>
16490
16491         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16492
16493 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16494
16495         * cfold.cs: Fixed compile blocker.
16496
16497 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * driver.cs: I was chekcing the key, not the file.
16500
16501 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16502
16503         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16504         message that we were generating - we just need to silently return
16505         a null.
16506
16507 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16508
16509         * class.cs (Event.Define): Change my previous commit, as this
16510         breaks the debugger.  This is a temporary hack, as it seems like
16511         the compiler is generating events incorrectly to begin with.
16512
16513         * expression.cs (Binary.ResolveOperator): Added support for 
16514         "U operator - (E x, E y)"
16515
16516         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16517         y)".
16518
16519         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16520         init-only variables, but this path did not take into account that
16521         there might be also instance readonly variables.  Correct this
16522         problem. 
16523
16524         This fixes bug 32253
16525
16526         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16527         delegates as well.
16528
16529         * driver.cs: Change the extension for modules to `netmodule'
16530
16531         * cs-parser.jay: Improved slightly the location tracking for
16532         the debugger symbols.
16533
16534         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16535         modifiers that were specified instead of the hardcoded value
16536         (FamAndAssem).  This was basically ignoring the static modifier,
16537         and others.  Fixes 32429.
16538
16539         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16540         fixed a bug in the process (32476)
16541
16542         * expression.cs (ArrayAccess.EmitAssign): Patch from
16543         hwang_rob@yahoo.ca that fixes bug 31834.3
16544
16545 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16546
16547         * driver.cs: Make the module extension .netmodule.
16548
16549 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16550
16551         * driver.cs: Report an error if the resource file is not found
16552         instead of crashing.
16553
16554         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16555         false, like Emit does.
16556
16557 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16558
16559         * typemanager.cs: Remove unused private member.  Also reported mcs
16560         bug to report this as a warning like csc.
16561
16562 2002-10-15  Martin Baulig  <martin@gnome.org>
16563
16564         * statement.cs (Statement.Emit): Made this a virtual method; emits
16565         the line number info and calls DoEmit().
16566         (Statement.DoEmit): New protected abstract method, formerly knows
16567         as Statement.Emit().
16568
16569         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16570
16571 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16572
16573         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16574         have fixed a remaining problem: not every AddXXXX was adding a
16575         fully qualified name.  
16576
16577         Now everyone registers a fully qualified name in the DeclSpace as
16578         being defined instead of the partial name.  
16579
16580         Downsides: we are slower than we need to be due to the excess
16581         copies and the names being registered this way.  
16582
16583         The reason for this is that we currently depend (on the corlib
16584         bootstrap for instance) that types are fully qualified, because
16585         we dump all the types in the namespace, and we should really have
16586         types inserted into the proper namespace, so we can only store the
16587         basenames in the defined_names array.
16588
16589 2002-10-10  Martin Baulig  <martin@gnome.org>
16590
16591         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16592         from bug #31834, see the bug report for a testcase which is
16593         miscompiled.
16594
16595 2002-10-10  Martin Baulig  <martin@gnome.org>
16596
16597         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16598         flow analysis code for this.
16599
16600         * statement.cs (Do, While, For): Tell the flow analysis code about
16601         infinite loops.
16602         (FlowBranching.UsageVector): Added support for infinite loops.
16603         (Block.Resolve): Moved the dead code elimination here and use flow
16604         analysis to do it.
16605
16606 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * class.cs (Field.Define): Catch cycles on struct type
16609         definitions. 
16610
16611         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16612         fields if the fields are static.  We only need to check instance
16613         fields. 
16614
16615         * expression.cs (As.DoResolve): Test for reference type.
16616
16617         * statement.cs (Using.ResolveExpression): Use
16618         ConvertImplicitRequired, not ConvertImplicit which reports an
16619         error on failture
16620         (Using.ResolveLocalVariableDecls): ditto.
16621
16622         * expression.cs (Binary.ResolveOperator): Report errors in a few
16623         places where we had to.
16624
16625         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16626
16627 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16628
16629         * expression.cs: Use StoreFromPtr instead of extracting the type
16630         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16631
16632         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16633         an enumeration value to a System.Enum, but System.Enum is not a
16634         value type, but an class type, so we need to box.
16635
16636         (Expression.ConvertExplicit): One codepath could return
16637         errors but not flag them.  Fix this.  Fixes #31853
16638
16639         * parameter.cs (Resolve): Do not allow void as a parameter type.
16640
16641 2002-10-06  Martin Baulig  <martin@gnome.org>
16642
16643         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16644         if it's a class type and not a struct.  Fixes #31815.
16645
16646 2002-10-06  Martin Baulig  <martin@gnome.org>
16647
16648         * statement.cs: Reworked the flow analysis code a bit to make it
16649         usable for dead code elimination.
16650
16651 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16652
16653         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16654
16655 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16656
16657         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16658         to fix the test 165, will investigate deeper.
16659
16660 2002-10-04  Martin Baulig  <martin@gnome.org>
16661
16662         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16663         finally blocks actually work.
16664         (Try.Resolve): We don't need to create a sibling for `finally' if
16665         there is no finally block.
16666
16667 2002-10-04  Martin Baulig  <martin@gnome.org>
16668
16669         * class.cs (Constructor.Define): The default accessibility for a
16670         non-default constructor is private, not public.
16671
16672 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16673
16674         * class.cs (Constructor): Make AllowedModifiers public, add
16675         EXTERN.
16676
16677         * cs-parser.jay: Perform the modifiers test here, as the
16678         constructor for the Constructor class usually receives a zero
16679         because of the way we create it (first we create, later we
16680         customize, and we were never checking the modifiers).
16681
16682         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16683         is a version of LookupTypeReflection that includes the type-name
16684         cache.  This can be used as a fast path for functions that know
16685         the fully qualified name and are only calling into *.GetType() to
16686         obtain a composed type.
16687
16688         This is also used by TypeManager.LookupType during its type
16689         composition.
16690
16691         (LookupType): We now also track the real type name, as sometimes
16692         we can get a quey for the real type name from things like
16693         ComposedCast.  This fixes bug 31422.
16694
16695         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16696         complete type fullname, it does not have to go through the type
16697         resolution system to obtain the composed version of the type (for
16698         obtaining arrays or pointers).
16699
16700         (Conditional.Emit): Use the EmitBoolExpression to
16701         generate nicer code, as requested by Paolo.
16702
16703         (ArrayCreation.CheckIndices): Use the patch from
16704         hwang_rob@yahoo.ca to validate the array initializers. 
16705
16706 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16707
16708         * class.cs (ConstructorInitializer.Emit): simplify code by using
16709         Invocation.EmitCall, and at the same time, fix the bugs in calling
16710         parent constructors that took variable arguments. 
16711
16712         * ecore.cs (Expression.ConvertNumericExplicit,
16713         Expression.ImplicitNumericConversion): Remove the code that
16714         manually wrapped decimal (InternalTypeConstructor call is now gone
16715         as well).
16716
16717         * expression.cs (Cast.TryReduce): Also handle decimal types when
16718         trying to perform a constant fold on the type.
16719
16720         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16721
16722         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16723         that only turned off an error report, and did nothing else. 
16724
16725 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16726
16727         * driver.cs: Handle and ignore /fullpaths
16728
16729 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16730
16731         * expression.cs (Binary.ResolveOperator): Catch the case where
16732         DoNumericPromotions returns true, 
16733
16734         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16735
16736 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16737
16738         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16739         report error 70.
16740
16741 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16744         conversion exists, but it is also required that the conversion be
16745         performed.  This manifested in "(Type64Enum) 2".  
16746
16747         * class.cs (TypeManager.AddMethod): The fix is not to change
16748         AddEnum, because that one was using a fully qualified name (every
16749         DeclSpace derivative does), but to change the AddMethod routine
16750         that was using an un-namespaced name.  This now correctly reports
16751         the duplicated name.
16752
16753         Revert patch until I can properly fix it.  The issue
16754         is that we have a shared Type space across all namespaces
16755         currently, which is wrong.
16756
16757         Options include making the Namespace a DeclSpace, and merge
16758         current_namespace/current_container in the parser.
16759
16760 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * cs-parser.jay: Improve error reporting when we get a different
16763         kind of expression in local_variable_type and
16764         local_variable_pointer_type. 
16765
16766         Propagate this to avoid missleading errors being reported.
16767
16768         * ecore.cs (ImplicitReferenceConversion): treat
16769         TypeManager.value_type as a target just like object_type.   As
16770         code like this:
16771
16772         ValueType v = 1;
16773
16774         Is valid, and needs to result in the int 1 being boxed before it
16775         is assigned to the value type v.
16776
16777         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16778         to validate the enumeration name.
16779
16780         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16781         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16782         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16783
16784         * ecore.cs (TryImplicitIntConversion): When doing an
16785         implicit-enumeration-conversion, check if the type is 64-bits and
16786         perform a conversion before passing to EnumConstant.
16787
16788 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16789
16790         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16791         report ambiguous type references.  Unlike the MS version, we
16792         report what the ambiguity is.   Innovation at work ;-)
16793
16794         (DeclSpace.FindType): Require a location argument to
16795         display when we display an ambiguous error.
16796
16797         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16798
16799         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16800
16801         * expression.cs (EmitDynamicInitializers): Apply patch from
16802         hwang_rob@yahoo.ca that fixes the order in which we emit our
16803         initializers. 
16804
16805 2002-09-21  Martin Baulig  <martin@gnome.org>
16806
16807         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16808         delegate takes no arguments.
16809
16810 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16811
16812         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16813         from integers.
16814
16815         * expression.cs: Extract the underlying type.
16816
16817         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16818
16819         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16820
16821 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16822
16823         * class.cs (TypeContainer.DefineType): We can not use the nice
16824         PackingSize with the size set to 1 DefineType method, because it
16825         will not allow us to define the interfaces that the struct
16826         implements.
16827
16828         This completes the fixing of bug 27287
16829
16830         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16831         means also structs.  This fixes part of the problem. 
16832         (Expresion.ImplicitReferenceConversionExists): ditto.
16833
16834         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16835         error if there were no errors reported during the type lookup
16836         process, to avoid duplicates or redundant errors.  Without this
16837         you would get an ambiguous errors plus a type not found.  We have
16838         beaten the user enough with the first error.  
16839
16840         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16841         reference. 
16842
16843         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16844         during the resolution process, stop the lookup, this avoids
16845         repeated error reports (same error twice).
16846
16847         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16848
16849         * typemanager.cs (LookupType): Redo the type lookup code to match
16850         the needs of System.Reflection.  
16851
16852         The issue is that System.Reflection requires references to nested
16853         types to begin with a "+" sign instead of a dot.  So toplevel
16854         types look like: "NameSpace.TopLevelClass", and nested ones look
16855         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16856         levels. 
16857
16858 2002-09-19  Martin Baulig  <martin@gnome.org>
16859
16860         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16861         says that a method always returns or always throws an exception,
16862         don't report the CS0161.
16863
16864         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16865         set `Returns = new_returns'.
16866
16867 2002-09-19  Martin Baulig  <martin@gnome.org>
16868
16869         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16870         to an enum constant, check for a CS0176.
16871
16872 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16875         for operators that must be in pairs and report errors.
16876
16877         * ecore.cs (SimpleName.DoResolveType): During the initial type
16878         resolution process, when we define types recursively, we must
16879         check first for types in our current scope before we perform
16880         lookups in the enclosing scopes.
16881
16882         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16883
16884         (Invocation.VerifyArgumentsCompat): Call
16885         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16886         I thought we were supposed to always call this, but there are a
16887         few places in the code where we dont do it.
16888
16889 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16890
16891         * driver.cs: Add support in -linkres and -resource to specify the
16892         name of the identifier.
16893
16894 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * ecore.cs (StandardConversionExists): Sync with the conversion
16897         code: allow anything-* to void* conversions.
16898
16899         (FindMostSpecificSource): Use an Expression argument
16900         instead of a Type, because we might be handed over a Literal which
16901         gets a few more implicit conversions that plain types do not.  So
16902         this information was being lost.
16903
16904         Also, we drop the temporary type-holder expression when not
16905         required.
16906
16907 2002-09-17  Martin Baulig  <martin@gnome.org>
16908
16909         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16910         this is an explicit interface implementation.
16911
16912 2002-09-17  Martin Baulig  <martin@gnome.org>
16913
16914         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16915         different `IndexerName' attributes.
16916
16917         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16918         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16919         virtual CommonResolve().
16920
16921 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16922
16923         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16924         and convert that to the UnderlyingType.
16925
16926         * statement.cs (Foreach.Resolve): Indexers are just like variables
16927         or PropertyAccesses.
16928
16929         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16930         inside quoted strings, we were not doing this before.
16931
16932 2002-09-16  Martin Baulig  <martin@gnome.org>
16933
16934         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16935         resolve it.  This is needed for the definite assignment check of the
16936         instance expression, fixes bug #29846.
16937         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16938
16939 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16940
16941         * parameter.cs: Fix compile error.  Cannot reference static member
16942         from an instance object.  Is this an mcs bug?
16943
16944 2002-09-14  Martin Baulig  <martin@gnome.org>
16945
16946         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16947         multiple times.  Fixes bug #30295, added test-166.cs.
16948
16949 2002-09-14  Martin Baulig  <martin@gnome.org>
16950
16951         * statement.cs (Block.Emit): Don't emit unreachable code.
16952         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16953         `break' statements.
16954         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16955
16956 2002-09-14  Martin Baulig  <martin@gnome.org>
16957
16958         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16959         is set.
16960
16961 2002-09-14  Martin Baulig  <martin@gnome.org>
16962
16963         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16964         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16965         be false on the ms runtime.
16966
16967 2002-09-13  Martin Baulig  <martin@gnome.org>
16968
16969         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16970         the CS0038 error message.
16971
16972 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16973
16974         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16975         constant inside, return it.
16976
16977 2002-09-12  Martin Baulig  <martin@gnome.org>
16978
16979         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16980         implicit conversion can be done between enum types.
16981
16982         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16983         check whether an implicit conversion to the current enum's UnderlyingType
16984         exists and report an error if not.
16985
16986         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16987         without debugging support.
16988
16989         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16990         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16991
16992 2002-09-12  Martin Baulig  <martin@gnome.org>
16993
16994         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16995
16996         * ecore.cs (IMemberExpr.DeclaringType): New property.
16997         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16998         nonstatic member of an outer type (CS0038).
16999
17000 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17001
17002         * driver.cs: Activate the using-error detector at warning level
17003         4 (at least for MS-compatible APIs).
17004
17005         * namespace.cs (VerifyUsing): Small buglett fix.
17006
17007         * pending.cs (PendingImplementation): pass the container pointer. 
17008
17009         * interface.cs (GetMethods): Allow for recursive definition.  Long
17010         term, I would like to move every type to support recursive
17011         definitions, not the current ordering mechanism that we have right
17012         now.
17013
17014         The situation is this: Attributes are handled before interfaces,
17015         so we can apply attributes to interfaces.  But some attributes
17016         implement interfaces, we will now handle the simple cases
17017         (recursive definitions will just get an error).  
17018
17019         * parameter.cs: Only invalidate types at the end if we fail to
17020         lookup all types.  
17021
17022 2002-09-09  Martin Baulig  <martin@gnome.org>
17023
17024         * ecore.cs (PropertyExpr.Emit): Also check for
17025         TypeManager.system_int_array_get_length so this'll also work when
17026         compiling corlib.  Fixes #30003.
17027
17028 2002-09-09  Martin Baulig  <martin@gnome.org>
17029
17030         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17031         and throw an exception if we can't get the type's size.  Fixed #30040,
17032         added test-165.cs.
17033
17034 2002-09-09  Martin Baulig  <martin@gnome.org>
17035
17036         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17037
17038         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17039         context.  Fixes bug #30027.
17040
17041         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17042         virtual functions.  Fixes bug #30043, added test-164.cs.
17043
17044 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17045
17046         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17047
17048 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17049
17050         * driver.cs: Use an object to get the windows codepage since it's not a
17051         static property.
17052
17053 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17054
17055         * statement.cs (For.Emit): for infinite loops (test == null)
17056         return whether there is a break inside, not always "true".
17057
17058         * namespace.cs (UsingEntry): New struct to hold the name of the
17059         using definition, the location where it is defined, and whether it
17060         has been used in a successful type lookup.
17061
17062         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17063         strings.
17064
17065         * decl.cs: ditto.
17066
17067 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17068
17069         * attribute.cs : Fix incorrect code which relied on catching
17070         a NullReferenceException to detect a null being passed in
17071         where an object was expected.
17072
17073 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17074
17075         * statement.cs (Try): flag the catch variable as assigned
17076
17077         * expression.cs (Cast): Simplified by using ResolveType instead of
17078         manually resolving.
17079
17080         * statement.cs (Catch): Fix bug by using ResolveType.
17081
17082 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17083
17084         * expression.cs (BetterConversion): Special case for when we have
17085         a NullLiteral as the argument and we have to choose between string
17086         and object types - we choose string the way csc does.
17087
17088         * attribute.cs (Attribute.Resolve): Catch the
17089         NullReferenceException and report error #182 since the Mono
17090         runtime no more has the bug and having this exception raised means
17091         we tried to select a constructor which takes an object and is
17092         passed a null.
17093
17094 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17095
17096         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17097         message (1502, 1503) when we can't locate a method after overload
17098         resolution. This is much more informative and closes the bug
17099         Miguel reported.
17100
17101         * interface.cs (PopulateMethod): Return if there are no argument
17102         types. Fixes a NullReferenceException bug.
17103
17104         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17105         expressions too. Previously we were checking only in one place for
17106         positional arguments leaving out named arguments.
17107
17108         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17109         type to the enum type is not allowed. Remove code corresponding to
17110         that.
17111
17112         (ConvertNumericExplicit): Allow explicit conversions from
17113         the underlying type to enum type. This precisely follows the spec
17114         and closes a bug filed by Gonzalo.
17115
17116 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17117
17118         * compiler.csproj:
17119         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17120
17121 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17122
17123         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17124         it was important that we stored the right value after the
17125         reduction in `converted'.
17126
17127 2002-09-04  Martin Baulig  <martin@gnome.org>
17128
17129         * location.cs (Location.SymbolDocument): Use full pathnames for the
17130         source files.
17131
17132 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17135         of the expression resolve mechanism, because that will catch the
17136         SimpleName error failures.
17137
17138         (Conditional): If we can not resolve the
17139         expression, return, do not crash.
17140
17141 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17142
17143         * cs-tokenizer.cs:
17144         (location): display token name instead of its number.
17145
17146 2002-08-28  Martin Baulig  <martin@gnome.org>
17147
17148         * expression.cs (Binary.ResolveOperator): Don't silently return
17149         but return an error if an operator cannot be applied between two
17150         enum types.
17151
17152 2002-08-28  Martin Baulig  <martin@gnome.org>
17153
17154         * class.cs (Constructor.Define): Set the permission attributes
17155         correctly instead of making all constructors public.
17156
17157 2002-08-28  Martin Baulig  <martin@gnome.org>
17158
17159         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17160         for private members before reporting a CS0103; if we find anything,
17161         it's a CS0122.
17162
17163 2002-08-28  Martin Baulig  <martin@gnome.org>
17164
17165         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17166         to check whether `closure_start_type == closure_invocation_type',
17167         we also need to check whether `m.DeclaringType == closure_invocation_type'
17168         before bypassing the permission checks.  We might be accessing
17169         protected/private members from the base class.
17170         (TypeManager.RealMemberLookup): Only set private_ok if private
17171         members were requested via BindingFlags.NonPublic.
17172
17173         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17174
17175         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17176         MethodGroupExpr.IsExplicitImpl if appropriate.
17177         (Invocation.DoResolve): Don't report the CS0120 for explicit
17178         interface implementations.
17179
17180 2002-08-27  Martin Baulig  <martin@gnome.org>
17181
17182         * expression.cs (Invocation.DoResolve): If this is a static
17183         method and we don't have an InstanceExpression, we must report
17184         a CS0120.
17185
17186 2002-08-25  Martin Baulig  <martin@gnome.org>
17187
17188         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17189         `==' between a valuetype and an object.
17190
17191 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17192
17193         * ecore.cs (TypeExpr): Provide a ToString method.
17194
17195 2002-08-24  Martin Baulig  <martin@gnome.org>
17196
17197         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17198         now called proggie.dbg and it's a binary file.
17199
17200 2002-08-23  Martin Baulig  <martin@gnome.org>
17201
17202         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17203
17204 2002-08-23  Martin Baulig  <martin@gnome.org>
17205
17206         * struct.cs (MyStructInfo.ctor): Make this work with empty
17207         structs; it's not allowed to use foreach() on null.
17208
17209 2002-08-23  Martin Baulig  <martin@gnome.org>
17210
17211         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17212         writer the full pathname of the generated assembly.
17213
17214 2002-08-23  Martin Baulig  <martin@gnome.org>
17215
17216         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17217         A `finally' block never returns or breaks; improved handling of
17218         unreachable code.
17219
17220 2002-08-23  Martin Baulig  <martin@gnome.org>
17221
17222         * statement.cs (Throw.Resolve): Allow `throw null'.
17223
17224 2002-08-23  Martin Baulig  <martin@gnome.org>
17225
17226         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17227         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17228         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17229         MemberLookup would return a wrong event if this is an explicit
17230         interface implementation and the class has an event with the same
17231         name.
17232
17233 2002-08-23  Martin Baulig  <martin@gnome.org>
17234
17235         * statement.cs (Block.AddChildVariableNames): New public method.
17236         (Block.AddChildVariableName): Likewise.
17237         (Block.IsVariableNameUsedInChildBlock): Likewise.
17238         (Block.AddVariable): Check whether a variable name has already
17239         been used in a child block.
17240
17241         * cs-parser.jay (declare_local_variables): Mark all variable names
17242         from the current block as being used in a child block in the
17243         implicit block.
17244
17245 2002-08-23  Martin Baulig  <martin@gnome.org>
17246
17247         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17248         find the symbol writer.
17249
17250         * driver.cs: csc also allows the arguments to /define being
17251         separated by commas, not only by semicolons.
17252
17253 2002-08-23  Martin Baulig  <martin@gnome.org>
17254
17255         * interface.cs (Interface.GetMembers): Added static check for events.
17256
17257 2002-08-15  Martin Baulig  <martin@gnome.org>
17258
17259         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17260         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17261
17262         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17263         why the MethodData.EmitDestructor() change was necessary.
17264
17265 2002-08-20  Martin Baulig  <martin@gnome.org>
17266
17267         * class.cs (TypeContainer.FindMembers): Added static check for events.
17268
17269         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17270
17271         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17272         use Type.GetEvents(), not Type.FindMembers().
17273
17274 2002-08-20  Martin Baulig  <martin@gnome.org>
17275
17276         * decl.cs (MemberCache): Added a special method cache which will
17277         be used for method-only searched.  This ensures that a method
17278         search will return a MethodInfo with the correct ReflectedType for
17279         inherited methods.      
17280
17281 2002-08-20  Martin Baulig  <martin@gnome.org>
17282
17283         * decl.cs (DeclSpace.FindMembers): Made this public.
17284
17285 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17286
17287         * delegate.cs: fixed build on windows.
17288         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17289
17290 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17291
17292         * ecore.cs (StandardConversionExists): Return a false
17293         if we are trying to convert the void type to anything else
17294         since that is not allowed.
17295
17296         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17297         we flag error 70 in the event an event is trying to be accessed
17298         directly from outside the declaring type.
17299
17300 2002-08-20  Martin Baulig  <martin@gnome.org>
17301
17302         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17303         MemberCache from typemanager.cs to decl.cs.
17304
17305 2002-08-19  Martin Baulig  <martin@gnome.org>
17306
17307         * class.cs (TypeContainer): Implement IMemberContainer.
17308         (TypeContainer.DefineMembers): Create the MemberCache.
17309         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17310         return public members if BindingFlags.Public was given, check
17311         whether members are static.
17312
17313 2002-08-16  Martin Baulig  <martin@gnome.org>
17314
17315         * decl.cs (DeclSpace.Define): Splitted this in Define and
17316         DefineMembers.  DefineMembers is called first and initializes the
17317         MemberCache.
17318
17319         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17320         DefineMembers() on all our DeclSpaces.
17321
17322         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17323         but call DefineMembers() on all nested interfaces.  We call their
17324         Define() in our new Define() function.
17325
17326         * interface.cs (Interface): Implement IMemberContainer.
17327         (Interface.Define): Moved all code except the attribute stuf to
17328         DefineMembers().
17329         (Interface.DefineMembers): Initialize the member cache.
17330
17331         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17332         need this anymore since we can use MemberCache.FindMembers directly.
17333
17334 2002-08-19  Martin Baulig  <martin@gnome.org>
17335
17336         * typemanager.cs (MemberCache): When creating the cache for an
17337         interface type, add all inherited members.
17338         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17339         to `out bool used_cache' and documented it.
17340         (TypeManager.MemberLookup): If we already used the cache in the first
17341         iteration, we don't need to do the interfaces check.
17342
17343 2002-08-19  Martin Baulig  <martin@gnome.org>
17344
17345         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17346         here from IMemberFinder and don't implement this interface anymore.
17347         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17348
17349         * typemanager.cs (IMemberFinder): This interface is now only used by
17350         classes which actually support the member cache.
17351         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17352         since we only put DeclSpaces into this Hashtable.
17353         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17354         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17355
17356 2002-08-16  Martin Baulig  <martin@gnome.org>
17357
17358         * typemanager.cs (ICachingMemberFinder): Removed.
17359         (IMemberFinder.MemberCache): New property.
17360         (TypeManager.FindMembers): Merged this with RealFindMembers().
17361         This function will never be called from TypeManager.MemberLookup()
17362         so we can't use the cache here, just the IMemberFinder.
17363         (TypeManager.MemberLookup_FindMembers): Check whether the
17364         IMemberFinder has a MemberCache and call the cache's FindMembers
17365         function.
17366         (MemberCache): Rewrote larger parts of this yet another time and
17367         cleaned it up a bit.
17368
17369 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * driver.cs (LoadArgs): Support quoting.
17372
17373         (Usage): Show the CSC-like command line arguments.
17374
17375         Improved a few error messages.
17376
17377 2002-08-15  Martin Baulig  <martin@gnome.org>
17378
17379         * typemanager.cs (IMemberContainer.Type): New property.
17380         (IMemberContainer.IsInterface): New property.
17381
17382         The following changes are conditional to BROKEN_RUNTIME, which is
17383         defined at the top of the file.
17384
17385         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17386         class'es members, but add all members from TypeHandle.ObjectType
17387         if we're an interface.
17388         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17389         is the current type.
17390         (MemberCache.CacheEntry.Container): Removed this field.
17391         (TypeHandle.GetMembers): Include inherited members.
17392
17393 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17394
17395         * typemanager.cs: fixed compilation and added a comment on a field that
17396         is never used.
17397
17398 2002-08-15  Martin Baulig  <martin@gnome.org>
17399
17400         * class.cs (ConstructorInitializer.Resolve): In the
17401         Expression.MemberLookup call, use the queried_type as
17402         invocation_type.
17403
17404         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17405         declared' attribute, it's always true.
17406         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17407         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17408         temporary wrapper for FindMembers which tells MemberLookup whether
17409         members from the base classes are included in the return value.
17410         This will go away soon.
17411         (TypeManager.MemberLookup): Use this temporary hack here; once the
17412         new MemberCache is completed, we don't need to do the DeclaredOnly
17413         looping here anymore since the MemberCache will take care of this.
17414         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17415         (MemberCache): When creating the MemberCache for a class, get
17416         members from the current class and all its base classes.
17417         (MemberCache.CacheEntry.Container): New field.  This is a
17418         temporary hack until the Mono runtime is fixed to distinguish
17419         between ReflectedType and DeclaringType.  It allows us to use MCS
17420         with both the MS runtime and the unfixed Mono runtime without
17421         problems and without accecting performance.
17422         (MemberCache.SearchMembers): The DeclaredOnly looping from
17423         TypeManager.MemberLookup is now done here.      
17424
17425 2002-08-14  Martin Baulig  <martin@gnome.org>
17426
17427         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17428         Type.GetFields on dynamic types but get the fields from the
17429         corresponding TypeContainer.
17430         (MyStructInfo.GetStructInfo): Added check for enum types.
17431
17432         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17433         (MemberList.SyncRoot): Implemented.
17434         (TypeManager.FilterWithClosure): No need to check permissions if
17435         closure_start_type == closure_invocation_type, don't crash if
17436         closure_invocation_type is null.
17437
17438 2002-08-13  Martin Baulig  <martin@gnome.org>
17439
17440         Rewrote TypeContainer.FindMembers to use a member cache.  This
17441         gives us a speed increase of about 35% for the self-hosting MCS
17442         build and of about 15-20% for the class libs (both on GNU/Linux).
17443
17444         * report.cs (Timer): New class to get enhanced profiling.  This
17445         whole class is "TIMER" conditional since it remarkably slows down
17446         compilation speed.
17447
17448         * class.cs (MemberList): New class.  This is an IList wrapper
17449         which we're now using instead of passing MemberInfo[]'s around to
17450         avoid copying this array unnecessarily.
17451         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17452         (ICachingMemberFinder, IMemberContainer): New interface.
17453         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17454         has already been checked, otherwise use it for the name comparision.
17455         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17456         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17457         if possible.  Returns a MemberList, not a MemberInfo [].
17458         (TypeHandle): New class, implements IMemberContainer.  We create
17459         one instance of this class per type, it contains a MemberCache
17460         which is used to do the member lookups.
17461         (MemberCache): New class.  Each instance of this class contains
17462         all members of a type and a name-based hash table.
17463         (MemberCache.FindMembers): This is our new member lookup
17464         function.  First, it looks up all members of the requested name in
17465         the hash table.  Then, it walks this list and sorts out all
17466         applicable members and returns them.
17467
17468 2002-08-13  Martin Baulig  <martin@gnome.org>
17469
17470         In addition to a nice code cleanup, this gives us a performance
17471         increase of about 1.4% on GNU/Linux - not much, but it's already
17472         half a second for the self-hosting MCS compilation.
17473
17474         * typemanager.cs (IMemberFinder): New interface.  It is used by
17475         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17476         Enum, Delegate or Interface.
17477         (TypeManager.finder_to_member_finder): New PtrHashtable.
17478         (TypeManager.finder_to_container): Removed.
17479         (TypeManager.finder_to_delegate): Removed.
17480         (TypeManager.finder_to_interface): Removed.
17481         (TypeManager.finder_to_enum): Removed.
17482
17483         * interface.cs (Interface): Implement IMemberFinder.
17484
17485         * delegate.cs (Delegate): Implement IMemberFinder.
17486
17487         * enum.cs (Enum): Implement IMemberFinder.
17488
17489         * class.cs (TypeContainer): Implement IMemberFinder.
17490
17491 2002-08-12  Martin Baulig  <martin@gnome.org>
17492
17493         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17494
17495 2002-08-12  Martin Baulig  <martin@gnome.org>
17496
17497         * ecore.cs (ITypeExpression): New interface for expressions which
17498         resolve to a type.
17499         (TypeExpression): Renamed to TypeLookupExpression.
17500         (Expression.DoResolve): If we're doing a types-only lookup, the
17501         expression must implement the ITypeExpression interface and we
17502         call DoResolveType() on it.
17503         (SimpleName): Implement the new ITypeExpression interface.
17504         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17505         hack, the situation that we're only looking up types can't happen
17506         anymore when this method is called.  Moved the type lookup code to
17507         DoResolveType() and call it.
17508         (SimpleName.DoResolveType): This ITypeExpression interface method
17509         is now doing the types-only lookup.
17510         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17511         (ResolveFlags): Added MaskExprClass.
17512
17513         * expression.cs (MemberAccess): Implement the ITypeExpression
17514         interface.
17515         (MemberAccess.DoResolve): Added support for a types-only lookup
17516         when we're called via ITypeExpression.DoResolveType().
17517         (ComposedCast): Implement the ITypeExpression interface.
17518
17519         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17520         Expression.Resolve() with ResolveFlags.Type instead.
17521
17522 2002-08-12  Martin Baulig  <martin@gnome.org>
17523
17524         * interface.cs (Interface.Define): Apply attributes.
17525
17526         * attribute.cs (Attribute.ApplyAttributes): Added support for
17527         interface attributes.
17528
17529 2002-08-11  Martin Baulig  <martin@gnome.org>
17530
17531         * statement.cs (Block.Emit): Only check the "this" variable if we
17532         do not always throw an exception.
17533
17534         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17535         whether the property has a set accessor.
17536
17537 2002-08-11  Martin Baulig  <martin@gnome.org>
17538
17539         Added control flow analysis support for structs.
17540
17541         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17542         with control flow analysis turned off.
17543         (IVariable): New interface.
17544         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17545         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17546         (FieldExpr.DoResolve): Resolve the instance expression with flow
17547         analysis turned off and do the definite assignment check after the
17548         resolving when we know what the expression will resolve to.
17549
17550         * expression.cs (LocalVariableReference, ParameterReference):
17551         Implement the new IVariable interface, only call the flow analysis
17552         code if ec.DoFlowAnalysis is true.
17553         (This): Added constructor which takes a Block argument.  Implement
17554         the new IVariable interface.
17555         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17556         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17557         This does the definite assignment checks for struct members.
17558
17559         * class.cs (Constructor.Emit): If this is a non-static `struct'
17560         constructor which doesn't have any initializer, call
17561         Block.AddThisVariable() to tell the flow analysis code that all
17562         struct elements must be initialized before control returns from
17563         the constructor.
17564
17565         * statement.cs (MyStructInfo): New public class.
17566         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17567         argument to this indexer.  If non-zero, check an individual struct
17568         member, not the whole struct.
17569         (FlowBranching.CheckOutParameters): Check struct members.
17570         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17571         overloaded versions of these methods which take an additional
17572         `int field_idx' argument to check struct members.
17573         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17574         overloaded versions of these methods which take an additional
17575         `string field_name' argument to check struct member.s
17576         (VariableInfo): Implement the IVariable interface.
17577         (VariableInfo.StructInfo): New public property.  Returns the
17578         MyStructInfo instance of the variable if it's a struct or null.
17579         (Block.AddThisVariable): New public method.  This is called from
17580         Constructor.Emit() for non-static `struct' constructor which do
17581         not have any initializer.  It creates a special variable for the
17582         "this" instance variable which will be checked by the flow
17583         analysis code to ensure that all of the struct's fields are
17584         initialized before control returns from the constructor.
17585         (UsageVector): Added support for struct members.  If a
17586         variable/parameter is a struct with N members, we reserve a slot
17587         in the usage vector for each member.  A struct is considered fully
17588         initialized if either the struct itself (slot 0) or all its
17589         members are initialized.
17590
17591 2002-08-08  Martin Baulig  <martin@gnome.org>
17592
17593         * driver.cs (Driver.MainDriver): Only report an error CS5001
17594         if there were no compilation errors.
17595
17596         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17597         `UnsafeContext' property to determine whether the parent is in
17598         unsafe context rather than checking the parent's ModFlags:
17599         classes nested in an unsafe class are unsafe as well.
17600
17601 2002-08-08  Martin Baulig  <martin@gnome.org>
17602
17603         * statement.cs (UsageVector.MergeChildren): Distinguish between
17604         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17605         we return.  Added test17() and test18() to test-154.cs.
17606
17607 2002-08-08  Martin Baulig  <martin@gnome.org>
17608
17609         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17610         Family access, make sure the invoking type isn't a subclass of the
17611         queried type (that'd be a CS1540).
17612
17613         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17614         this method which takes an additional `Type invocation_type'.
17615
17616         * expression.cs (BaseAccess.DoResolve): Use the base type as
17617         invocation and query type.
17618         (MemberAccess.DoResolve): If the lookup failed and we're about to
17619         report a CS0122, try a lookup with the ec.ContainerType - if this
17620         succeeds, we must report a CS1540.
17621
17622 2002-08-08  Martin Baulig  <martin@gnome.org>
17623
17624         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17625         (MethodGroupExpr): Implement the IMemberExpr interface.
17626
17627         * expression (MemberAccess.ResolveMemberAccess): No need to have
17628         any special code for MethodGroupExprs anymore, they're now
17629         IMemberExprs.   
17630
17631 2002-08-08  Martin Baulig  <martin@gnome.org>
17632
17633         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17634         Family, FamANDAssem and FamORAssem permissions.
17635         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17636
17637 2002-08-08  Martin Baulig  <martin@gnome.org>
17638
17639         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17640         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17641         or loop block.
17642
17643 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17644
17645         * driver.cs: implemented /resource option to embed managed resources.
17646
17647 2002-08-07  Martin Baulig  <martin@gnome.org>
17648
17649         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17650         (FieldBase.HasFieldInitializer): New public property.
17651         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17652         returns the field initializer and makes sure it is only resolved once.
17653         (TypeContainer.EmitFieldInitializers): Call
17654         FieldBase.GetInitializerExpression to get the initializer, this ensures
17655         that it isn't resolved multiple times.
17656
17657         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17658         the resolving process (SimpleName/MemberLookup) that we're currently
17659         emitting a field initializer (which must not access any instance members,
17660         this is an error CS0236).
17661
17662         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17663         argument, if the `IsFieldInitializer' flag is set, we must report and
17664         error CS0236 and not an error CS0120.   
17665
17666 2002-08-07  Martin Baulig  <martin@gnome.org>
17667
17668         * ecore.cs (IMemberExpr): New public interface.
17669         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17670         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17671         if the expression is an IMemberExpr.
17672
17673         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17674         to be null, implicitly default to `this' if we're non-static in
17675         this case.  Simplified the code a lot by using the new IMemberExpr
17676         interface.  Also fixed bug #28176 here.
17677
17678 2002-08-06  Martin Baulig  <martin@gnome.org>
17679
17680         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17681         ParameterReferences during semantic analysis so that we can do a
17682         type-only search when resolving Cast, TypeOf and SizeOf.
17683         (block): Pass the `current_local_parameters' to the Block's
17684         constructor.
17685
17686         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17687         argument to the constructor.
17688         (ConstructorInitializer.Resolve): Create a temporary implicit
17689         block with the parameters.
17690
17691         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17692         references here if we aren't doing a type-only search.
17693
17694         * statement.cs (Block): Added constructor which takes a
17695         `Parameters parameters' argument.
17696         (Block.Parameters): New public property.
17697
17698         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17699         to `Parameters' and made it public readonly.
17700
17701 2002-08-06  Martin Baulig  <martin@gnome.org>
17702
17703         * ecore.cs (Expression.Warning): Made this public as well.
17704
17705         * report.cs (Report.Debug): Print the contents of collections.
17706
17707 2002-08-06  Martin Baulig  <martin@gnome.org>
17708
17709         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17710         used to tell Resolve() which kinds of expressions it may return.
17711         (Expression.Resolve): Added overloaded version of this method which
17712         takes a `ResolveFlags flags' argument.  This can be used to tell
17713         Resolve() which kinds of expressions it may return.  Reports a
17714         CS0118 on error.
17715         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17716         ResolveFlags.SimpleName.
17717         (Expression.Error118): Added overloaded version of this method which
17718         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17719         which kinds of expressions are allowed.
17720
17721         * expression.cs (Argument.ResolveMethodGroup): New public method.
17722         Resolves an argument, but allows a MethodGroup to be returned.
17723         This is used when invoking a delegate.
17724
17725         * TODO: Updated a bit.
17726
17727 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17728
17729         Fixed compilation with csc.
17730
17731         * ecore.cs: Expression.Error made public. Is this correct? Should
17732         Warning be made public too?
17733
17734         * expression.cs: use ea.Location instead of ea.loc.
17735         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17736
17737 2002-08-06  Martin Baulig  <martin@gnome.org>
17738
17739         * ecore.cs (Expression.loc): Moved the location here instead of
17740         duplicating it in all derived classes.
17741         (Expression.Location): New public property.
17742         (Expression.Error, Expression.Warning): Made them non-static and
17743         removed the location argument.
17744         (Expression.Warning): Added overloaded version which takes an
17745         `int level' argument.
17746         (Expression.Error118): Make this non-static and removed the
17747         expression and location arguments.
17748         (TypeExpr): Added location argument to the constructor.
17749
17750         * expression.cs (StaticCallExpr): Added location argument to
17751         the constructor.
17752         (Indirection, PointerArithmetic): Likewise.
17753         (CheckedExpr, UnCheckedExpr): Likewise.
17754         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17755         (StringPtr): Likewise.
17756
17757
17758 2002-08-05  Martin Baulig  <martin@gnome.org>
17759
17760         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17761
17762         * assign.cs (Assign.DoResolve): Check whether the source
17763         expression is a value or variable.
17764
17765         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17766         while resolving the corresponding blocks.
17767
17768         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17769         an error, don't silently return null.
17770
17771         * statement.cs (Block.AddVariable): Do the error reporting here
17772         and distinguish between CS0128 and CS0136.
17773         (Block.DoResolve): Report all unused labels (warning CS0164).
17774         (LabeledStatement): Pass the location to the constructor.
17775         (LabeledStatement.HasBeenReferenced): New property.
17776         (LabeledStatement.Resolve): Set it to true here.
17777
17778         * statement.cs (Return.Emit): Return success even after reporting
17779         a type mismatch error (CS0126 or CS0127), this is what csc does and
17780         it avoids confusing the users with any consecutive errors.
17781
17782 2002-08-05  Martin Baulig  <martin@gnome.org>
17783
17784         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17785
17786         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17787
17788         * expression.cs (MemberAccess.DoResolve): Silently return if an
17789         error has already been reported.
17790
17791         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17792         error has already been reported.
17793
17794 2002-08-05  Martin Baulig  <martin@gnome.org>
17795
17796         * statement.cs (UsageVector): Only initialize the `parameters'
17797         vector if we actually have any "out" parameters.
17798
17799 2002-08-05  Martin Baulig  <martin@gnome.org>
17800
17801         * expression.cs (Binary.ResolveOperator): When combining delegates,
17802         they must have the same type.
17803
17804 2002-08-05  Martin Baulig  <martin@gnome.org>
17805
17806         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17807         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17808         work with the ms runtime and we also don't need it: if we're a
17809         PropertyBuilder and not in the `indexer_arguments' hash, then we
17810         are a property and not an indexer.
17811
17812         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17813         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17814         since the latter one doesn't work with the ms runtime.
17815
17816 2002-08-03  Martin Baulig  <martin@gnome.org>
17817
17818         Fixed bugs #27998 and #22735.
17819
17820         * class.cs (Method.IsOperator): New public field.
17821         (Method.CheckBase): Report CS0111 if there's already a method
17822         with the same parameters in the current class.  Report CS0508 when
17823         attempting to change the return type of an inherited method.
17824         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17825         and it's not marked abstract or extern.
17826         (PropertyBase): New abstract base class for Property and Indexer.
17827         (PropertyBase.CheckBase): Moved here from Property and made it work
17828         for indexers.
17829         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17830         the same so we can reuse it there.
17831         (Property, Indexer): Derive from PropertyBase.
17832         (MethodSignature.inheritable_property_signature_filter): New delegate
17833         to find properties and indexers.
17834
17835         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17836         argument and improved error reporting.
17837
17838         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17839         EmptyReadOnlyParameters and made it a property.
17840
17841         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17842         version of this method which takes a `PropertyInfo indexer'.
17843         (TypeManager.RegisterIndexer): New method.
17844
17845         * class.cs: Added myself as author of this file :-)
17846
17847 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17848
17849         * class.cs: fixed compilation on windoze.
17850
17851 2002-08-03  Martin Baulig  <martin@gnome.org>
17852
17853         * interface.cs (Interface.GetInterfaceBases): Check whether all
17854         base interfaces are at least as accessible than the current one.
17855
17856         * class.cs (TypeContainer.GetClassBases): Check whether base types
17857         are at least as accessible than the current type.
17858         (TypeContainer.AsAccessible): Implemented and made non-static.
17859         (MemberBase.CheckParameters): Report errors if the accessibility
17860         checks fail.
17861
17862         * delegate.cs (Delegate.Delegate): The default visibility is
17863         internal for top-level types and private for nested types.
17864         (Delegate.Define): Report errors if the accessibility checks fail.
17865
17866         * enum.cs (Enum.Enum): The default visibility is internal for
17867         top-level types and private for nested types.
17868         (Enum.DefineType): Compute the correct visibility.
17869
17870         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17871         function which takes a `bool is_toplevel' instead of a TypeContainer.
17872
17873         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17874         builtin type.
17875
17876 2002-08-02  Martin Baulig  <martin@gnome.org>
17877
17878         * expression.cs (LocalVariableReferenc): Added constructor which
17879         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17880         (LocalVariableReference.IsReadOnly): New property.
17881         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17882         variable is readonly, use our own readonly flag to do this; you can
17883         use the new constructor to get a writable reference to a read-only
17884         variable.
17885
17886         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17887         reference to the local variable.
17888
17889 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17890
17891         * rootcontext.cs (ResolveCore): Also include System.Exception
17892
17893         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17894         we reach an EmptyStatement.
17895
17896         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17897         is also fine.
17898
17899         * expression.cs (Binary.ResolveOperator): Check error result in
17900         two places.
17901
17902         use brtrue/brfalse directly and avoid compares to null.
17903
17904 2002-08-02  Martin Baulig  <martin@gnome.org>
17905
17906         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17907         Fixes bug #28407, added test-155.cs.
17908
17909 2002-08-01  Martin Baulig  <martin@gnome.org>
17910
17911         * class.cs (Event.EmitDefaultMethod): Make this work with static
17912         events.  Fixes #28311, added verify-3.cs.
17913
17914 2002-08-01  Martin Baulig  <martin@gnome.org>
17915
17916         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17917         `is_disposable' fields.
17918         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17919         `hm.is_disposable' if we're using the collection pattern.
17920         (Foreach.EmitCollectionForeach): Use the correct type for the
17921         enumerator's local variable, only emit the try/finally block if
17922         necessary (fixes #27713).
17923
17924 2002-08-01  Martin Baulig  <martin@gnome.org>
17925
17926         * ecore.cs (Expression.report118): Renamed to Error118 and made
17927         it public static.
17928
17929         * statement.cs (Throw.Resolve): Check whether the expression is of
17930         the correct type (CS0118) and whether the type derives from
17931         System.Exception (CS0155).
17932         (Catch.Resolve): New method.  Do the type lookup here and check
17933         whether it derives from System.Exception (CS0155).
17934         (Catch.CatchType, Catch.IsGeneral): New public properties.
17935
17936         * typemanager.cs (TypeManager.exception_type): Added.
17937
17938 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17939
17940         * driver.cs: Updated About function.
17941
17942 2002-07-31  Martin Baulig  <martin@gnome.org>
17943
17944         Implemented Control Flow Analysis.
17945
17946         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17947         (EmitContext.CurrentBranching): Added.
17948         (EmitContext.StartFlowBranching): Added.
17949         (EmitContext.EndFlowBranching): Added.
17950         (EmitContext.KillFlowBranching): Added.
17951         (EmitContext.IsVariableAssigned): Added.
17952         (EmitContext.SetVariableAssigned): Added.
17953         (EmitContext.IsParameterAssigned): Added.
17954         (EmitContext.SetParameterAssigned): Added.
17955         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17956         Added control flow analysis stuff here.
17957
17958         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17959         resolve the expression as lvalue.
17960         (LocalVariableReference.DoResolve): Check whether the variable has
17961         already been assigned.
17962         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17963         the parameter as assigned here.
17964         (ParameterReference.DoResolve): Check whether the parameter has already
17965         been assigned.
17966         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17967         expression as lvalue.
17968
17969         * statement.cs (FlowBranching): New class for the flow analysis code.
17970         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17971         (LabeledStatement.IsDefined): New public property.
17972         (LabeledStatement.AddUsageVector): New public method to tell flow
17973         analyis that the label may be reached via a forward jump.
17974         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17975         flow analysis.
17976         (VariableInfo.Number): New public field.  This is used by flow analysis
17977         to number all locals of a block.
17978         (Block.CountVariables): New public property.  This is the number of
17979         local variables in this block (including the locals from all parent
17980         blocks).
17981         (Block.EmitMeta): Number all the variables.
17982
17983         * statement.cs: Added flow analysis support to all classes.
17984
17985 2002-07-31  Martin Baulig  <martin@gnome.org>
17986
17987         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17988         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17989         then use this argument.
17990
17991         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17992
17993         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17994         use this to specify /define options.
17995
17996 2002-07-29  Martin Baulig  <martin@gnome.org>
17997
17998         * statement.cs (Fixed): Moved all code that does variable lookups
17999         and resolvings from Emit to Resolve.
18000
18001         * statement.cs (For): Moved all code that does variable lookups
18002         and resolvings from Emit to Resolve.
18003
18004         * statement.cs (Using): Moved all code that does variable lookups
18005         and resolvings from Emit to Resolve.
18006
18007 2002-07-29  Martin Baulig  <martin@gnome.org>
18008
18009         * attribute.cs (Attribute.Resolve): Explicitly catch a
18010         System.NullReferenceException when creating the
18011         CustromAttributeBuilder and report a different warning message.
18012
18013 2002-07-29  Martin Baulig  <martin@gnome.org>
18014
18015         * support.cs (ParameterData.ParameterName): Added method to
18016         get the name of a parameter.
18017
18018         * typemanager.cs (TypeManager.IsValueType): New public method.
18019
18020 2002-07-29  Martin Baulig  <martin@gnome.org>
18021
18022         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18023         is a flag which specifies that it's either ref or out.
18024         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18025         the out parameter to `out Parameter.Modifier mod', also set the
18026         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18027
18028         * support.cs (InternalParameters.ParameterModifier): Distinguish
18029         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18030         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18031
18032         * expression.cs (Argument.GetParameterModifier): Distinguish
18033         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18034         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18035
18036 2002-07-29  Martin Baulig  <martin@gnome.org>
18037
18038         * expression.cs (ParameterReference.ParameterReference): Added
18039         `Location loc' argument to the constructor.
18040
18041         * cs-parser.jay: Pass location to ParameterReference.
18042
18043 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * statement.cs (Try): Initialize the location.
18046
18047         * cs-parser.jay: pass location to Try.
18048
18049         * expression.cs (Unary.Reduce): Change the prototype to return
18050         whether a constant fold could be performed or not.  The result is
18051         returned in an out parameters.  In the case of Indirection and
18052         AddressOf, we want to perform the full tests.
18053
18054 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * statement.cs (Statement.Emit): Flag dead code.
18057
18058 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18059
18060         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18061
18062 2002-07-27  Martin Baulig  <martin@gnome.org>
18063
18064         * class.cs (MethodData.Define): Put back call to
18065         TypeManager.AddMethod(), accidentally commented this out.
18066
18067         * report.cs (Debug): New public method to print debugging information,
18068         this is `[Conditional ("DEBUG")]'.
18069
18070 2002-07-26  Martin Baulig  <martin@gnome.org>
18071
18072         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18073         (switch_statement): Push the current_block to the switch_stack and
18074         pop it again when we're done with the switch.
18075         (switch_section): The new block is a child of the current_block.
18076         Fixes bug #24007, added test-152.cs.
18077
18078 2002-07-27  Martin Baulig  <martin@gnome.org>
18079
18080         * expression.cs (Invocation.EmitArguments): When calling a varargs
18081         function with only its fixed arguments, we need to pass an empty
18082         array.
18083
18084 2002-07-27  Martin Baulig  <martin@gnome.org>
18085
18086         Mono 0.13 has been released.
18087
18088 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * driver.cs: Rename --resource to --linkres, because that is what
18091         we do currently, we dont support --resource yet.
18092
18093         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18094
18095 2002-07-25  Martin Baulig  <martin@gnome.org>
18096
18097         * class.cs (MethodData): New public class.  This is a `method builder'
18098         class for a method or one accessor of a Property/Indexer/Event.
18099         (MethodData.GetMethodFlags): Moved here from MemberBase.
18100         (MethodData.ApplyAttributes): Likewise.
18101         (MethodData.ApplyObsoleteAttribute): Likewise.
18102         (MethodData.ApplyConditionalAttribute): Likewise.
18103         (MethodData.ApplyDllImportAttribute): Likewise.
18104         (MethodData.CheckAbstractAndExternal): Likewise.
18105         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18106         (MethodData.Emit): Formerly known as Method.Emit().
18107         (MemberBase): Moved everything which was specific to a single
18108         accessor/method to MethodData.
18109         (Method): Create a new MethodData and call Define() and Emit() on it.
18110         (Property, Indexer, Event): Create a new MethodData objects for each
18111         accessor and call Define() and Emit() on them.
18112
18113 2002-07-25  Martin Baulig  <martin@gnome.org>
18114
18115         Made MethodCore derive from MemberBase to reuse the code from there.
18116         MemberBase now also checks for attributes.
18117
18118         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18119         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18120         as virtual.
18121         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18122         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18123         (MemberBase.ApplyAttributes): New virtual method; applies the
18124         attributes to a method or accessor.
18125         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18126         (MemberBase.ApplyConditionalAttribute): Likewise.
18127         (MemberBase.ApplyDllImportAttribute): Likewise.
18128         (MemberBase.CheckAbstractAndExternal): Likewise.
18129         (MethodCore.ParameterTypes): This is now a property instead of a
18130         method, it's initialized from DoDefineParameters().
18131         (MethodCore.ParameterInfo): Removed the set accessor.
18132         (MethodCore.DoDefineParameters): New protected virtual method to
18133         initialize ParameterTypes and ParameterInfo.
18134         (Method.GetReturnType): We can now simply return the MemberType.
18135         (Method.GetMethodFlags): Override the MemberBase version and add
18136         the conditional flags.
18137         (Method.CheckBase): Moved some code from Define() here, call
18138         DoDefineParameters() here.
18139         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18140         here to avoid some larger code duplication.
18141         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18142         ensure that abstract and external accessors don't declare a body.
18143
18144         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18145         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18146         lookup in the attribute's parent classes, so we need to abort as soon
18147         as we found the first match.
18148         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18149         the attribute has no arguments.
18150
18151         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18152         of a Method.
18153
18154 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18155
18156         * cs-parser.jay: reverted previous patch.
18157
18158 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18159
18160         * cs-parser.jay: fixed bug #22119.
18161
18162 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18163
18164         * attribute.cs: fixed compilation. The error was:
18165         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18166         be assigned to before control leaves the current method."
18167         [FIXME:  Filed as bug #28186: MCS must report this error.]
18168
18169 2002-07-25  Martin Baulig  <martin@gnome.org>
18170
18171         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18172         method to pull the condition name ouf of a Conditional attribute.
18173         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18174         the obsolete message and error flag out of an Obsolete attribute.
18175
18176         * class.cs (Method.GetMethodFlags): New public method to get the
18177         TypeManager.MethodFlags for this method.
18178         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18179         private methods.
18180         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18181         if we're overriding a virtual function, set the new private variable
18182         `parent_method'; call the new TypeManager.AddMethod().
18183
18184         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18185         the MethodBuilder and the Method in a PtrHashtable.
18186         (TypeManager.builder_to_method): Added for this purpose.
18187         (TypeManager.MethodFlags): Added IsObsoleteError.
18188         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18189         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18190         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18191         the message from the attribute.
18192
18193 2002-07-24  Martin Baulig  <martin@gnome.org>
18194
18195         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18196         preprocessor directives, ensure that the argument to #define/#undef is
18197         exactly one identifier and that it's actually an identifier.
18198
18199         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18200         did not work ....
18201
18202 2002-07-24  Martin Baulig  <martin@gnome.org>
18203
18204         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18205         initialize it to TypeManager.object_type in the constructor.
18206         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18207         of the `hm.get_current' method if we're using the collection pattern.
18208         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18209         for the explicit conversion to make it work when we're using the collection
18210         pattern and the `Current' property has a different return type than `object'.
18211         Fixes #27713.
18212
18213 2002-07-24  Martin Baulig  <martin@gnome.org>
18214
18215         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18216         does not match, but don't report any errors.  This method is called in
18217         order for all methods in a MethodGroupExpr until a matching method is
18218         found, so we don't want to bail out if the first method doesn't match.
18219         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18220         matches, report the 123.  Fixes #28070.
18221
18222 2002-07-24  Martin Baulig  <martin@gnome.org>
18223
18224         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18225         TypeManager.TypeToCoreType() to the top of the method so the
18226         following equality checks will work.  Fixes #28107.
18227
18228 2002-07-24  Martin Baulig  <martin@gnome.org>
18229
18230         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18231         operand is of type uint, and the other operand is of type sbyte,
18232         short or int, the operands are converted to type long." -
18233         Actually do what this comment already told us.  Fixes bug #28106,
18234         added test-150.cs.
18235
18236 2002-07-24  Martin Baulig  <martin@gnome.org>
18237
18238         * class.cs (MethodBase): New abstract class.  This is now a base
18239         class for Property, Indexer and Event to avoid some code duplication
18240         in their Define() and DefineMethods() methods.
18241         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18242         generic methods for Define() and DefineMethods().
18243         (FieldBase): Derive from MemberBase, not MemberCore.
18244         (Property): Derive from MemberBase, not MemberCore.
18245         (Property.DefineMethod): Moved all the code from this method to the
18246         new MethodBase.DefineAccessor(), just call it with appropriate
18247         argumetnts.
18248         (Property.Define): Call the new Property.DoDefine(), this does some
18249         sanity checks and we don't need to duplicate the code everywhere.
18250         (Event): Derive from MemberBase, not MemberCore.
18251         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18252         accessors, this will also make them work with interface events.
18253         (Indexer): Derive from MemberBase, not MemberCore.
18254         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18255         (Indexer.Define): Use the new MethodBase functions.
18256
18257         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18258         argument to the constructor.
18259         (Interface.FindMembers): Added support for interface events.
18260         (Interface.PopluateEvent): Implemented.
18261
18262         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18263
18264 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18267         but this is required to check for a method name being the same as
18268         the containing class.  
18269
18270         Handle this now.
18271
18272 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18273
18274         * interface.cs: initialize variable.
18275
18276 2002-07-23  Martin Baulig  <martin@gnome.org>
18277
18278         Implemented the IndexerName attribute in interfaces.
18279
18280         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18281         name if this is an explicit interface implementation.
18282         (Indexer.InterfaceIndexerName): New public variable.  If we're
18283         implementing an interface indexer, this is the IndexerName in that
18284         interface.  Otherwise, it's the IndexerName.
18285         (Indexer.DefineMethod): If we're implementing interface indexer,
18286         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18287         and Pending.ImplementIndexer methods.
18288         (Indexer.Define): Also define the PropertyBuilder if we're
18289         implementing an interface indexer and this is neither an explicit
18290         interface implementation nor do the IndexerName match the one in
18291         the interface.
18292
18293         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18294         If a method is defined here, then we always need to create a proxy
18295         for it.  This is used when implementing interface indexers.
18296         (Pending.IsInterfaceIndexer): New public method.
18297         (Pending.ImplementIndexer): New public method.
18298         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18299         This is used when implementing interface indexers to define a proxy
18300         if necessary.
18301         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18302         define a proxy if necessary.
18303
18304         * interface.cs (Interface.IndexerName): New public variable.
18305         (Interface.PopulateIndexer): Set the IndexerName.
18306         (Interface.DefineIndexers): New private method.  Populate all the
18307         indexers and make sure their IndexerNames match.
18308
18309         * typemanager.cs (IndexerPropertyName): Added support for interface
18310         indexers.
18311
18312 2002-07-22  Martin Baulig  <martin@gnome.org>
18313
18314         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18315         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18316         ret if HasReturnLabel.
18317         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18318         variables.
18319
18320         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18321         and set the ec.LoopBeginTryCatchLevel.
18322         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18323         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18324         the current ec.TryCatchLevel, the branch goes out of an exception
18325         block.  In this case, we need to use Leave and not Br.
18326
18327 2002-07-22  Martin Baulig  <martin@gnome.org>
18328
18329         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18330         block unless the block does not always return or it is contained in
18331         another try { ... } catch { ... } block.  Fixes bug #26506.
18332         Added verify-1.cs to the test suite.
18333
18334 2002-07-22  Martin Baulig  <martin@gnome.org>
18335
18336         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18337         then we do not always return.  Fixes bug #24985.
18338
18339 2002-07-22  Martin Baulig  <martin@gnome.org>
18340
18341         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18342         lookup on a per-class level; ie. walk up the class hierarchy until we
18343         found at least one applicable method, then choose the best among them.
18344         Fixes bug #24463 and test-29.cs.
18345
18346 2002-07-22  Martin Baulig  <martin@gnome.org>
18347
18348         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18349         return types of the methods.  The return type is not part of the
18350         signature and we must not check it to make the `new' modifier work.
18351         Fixes bug #27999, also added test-147.cs.
18352         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18353
18354         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18355         on the method's return type.
18356
18357 2002-07-21  Martin Baulig  <martin@gnome.org>
18358
18359         * assign.cs: Make this work if the rightmost source is a constant and
18360         we need to do an implicit type conversion.  Also adding a few more tests
18361         to test-38.cs which should have caught this.
18362
18363         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18364         target in the makefile for this.  The makefile.gnu is primarily intended
18365         for end-users who don't want to debug the compiler.
18366
18367 2002-07-21  Martin Baulig  <martin@gnome.org>
18368
18369         * assign.cs: Improved the Assign class so it can now handle embedded
18370         assignments (X = Y = Z = something).  As a side-effect this'll now also
18371         consume less local variables.  test-38.cs now passes with MCS, added
18372         a few new test cases to that test.
18373
18374 2002-07-20  Martin Baulig  <martin@gnome.org>
18375
18376         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18377         instructions.  Fixes bug #27977, also added test-146.cs.
18378
18379 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18380
18381         * cs-tokenizer.cs: fixed getHex ().
18382
18383 2002-07-19  Martin Baulig  <martin@gnome.org>
18384
18385         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18386         not Type.GetType() to lookup the array type.  This is needed when
18387         we're constructing an array of a user-defined type.
18388         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18389         single-dimensional arrays, but also for single-dimensial arrays of
18390         type decimal.
18391
18392 2002-07-19  Martin Baulig  <martin@gnome.org>
18393
18394         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18395         this function is called, it's not allowed to share LocalBuilders
18396         among ILGenerators.
18397
18398 2002-07-19  Martin Baulig  <martin@gnome.org>
18399
18400         * expression.cs (Argument.Resolve): Report an error 118 when trying
18401         to pass a type as argument.
18402
18403 2002-07-18  Martin Baulig  <martin@gnome.org>
18404
18405         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18406         Conv_R_Un for the signed `long' type.
18407
18408 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18411         `expr' for the temporary result, as that will fail if we do
18412         multiple resolves on the same expression.
18413
18414 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18415
18416         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18417         ec.TypeContainer for looking up aliases. 
18418
18419         * class.cs (TypeContainer): Remove LookupAlias from here.
18420
18421         * decl.cs (DeclSpace); Move here.
18422
18423 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * class.cs (FindMembers): Only call filter if the constructor
18426         bulider is not null.
18427
18428         Also handle delegates in `NestedTypes' now.  Now we will perform
18429         type lookups using the standard resolution process.  This also
18430         fixes a bug.
18431
18432         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18433         This uses Expressions (the limited kind that can be parsed by the
18434         tree) instead of strings.
18435
18436         * expression.cs (ComposedCast.ToString): Implement, used to flag
18437         errors since now we have to render expressions.
18438
18439         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18440         FormArrayType. 
18441
18442         * ecore.cs (SimpleName.ToString): ditto.
18443
18444         * cs-parser.jay: Instead of using strings to assemble types, use
18445         Expressions to assemble the type (using SimpleName, ComposedCast,
18446         MemberAccess).  This should fix the type lookups in declarations,
18447         because we were using a different code path for this.
18448
18449         * statement.cs (Block.Resolve): Continue processing statements
18450         even when there is an error.
18451
18452 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18453
18454         * class.cs (Event.Define): Also remove the `remove' method from
18455         the list of pending items.
18456
18457         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18458         generate more compact code. 
18459
18460 2002-07-17  Martin Baulig  <martin@gnome.org>
18461
18462         * const.cs (Const.LookupConstantValue): Add support for constant
18463         `unchecked' and `checked' expressions.
18464         Also adding test case test-140.cs for this.
18465
18466 2002-07-17  Martin Baulig  <martin@gnome.org>
18467
18468         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18469         check whether mi.ReturnType implements the IEnumerator interface; the
18470         `==' and the IsAssignableFrom() will fail in this situation.
18471
18472 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18473
18474         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18475         here too.
18476
18477 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18478
18479         * expression.cs: fixed bug #27811.
18480
18481 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18482
18483         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18484         Molaro: when we are a ref, the value already contains a pointer
18485         value, do not take the address of it.
18486
18487 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18488         * removed mb-parser.jay and mb-tokenizer.cs
18489
18490 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18491
18492         * expression.cs: check against the building corlib void type.
18493
18494 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18495
18496         * ecore.cs: fix for valuetype static readonly fields: when 
18497         initializing them, we need their address, not the address of a copy.
18498
18499 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18500
18501         * typemanager.cs: register also enum_type in corlib.
18502
18503 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18504
18505         * class.cs: allow calling this (but not base) initializers in structs.
18506
18507 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18508
18509         * ecore.cs: make sure we compare against the building base types
18510         in GetTypeSize ().
18511
18512 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18513
18514         * typemanager.cs: fix TypeToCoreType() to handle void and object
18515         (corlib gets no more typerefs after this change).
18516
18517 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * expression.cs (ArrayCreation.EmitArrayArguments): use
18520         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18521
18522         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18523         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18524         array indexes, the runtime actually forbids them.
18525
18526         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18527         for array arguments here.
18528
18529         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18530         instead of the default for ValueTypes.
18531
18532         (New.DoEmit): Use IsValueType instead of
18533         IsSubclassOf (value_type)
18534         (New.DoResolve): ditto.
18535         (Invocation.EmitCall): ditto.
18536
18537         * assign.cs (Assign): ditto.
18538
18539         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18540         Statements *are* currently doing part of their resolution during
18541         Emit.  
18542
18543         Expressions do always resolve during resolve, but statements are
18544         only required to propagate resolution to their children.
18545
18546 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18549
18550         (LoadAssembly): Do not add the dll if it is already specified
18551
18552         (MainDriver): Add the System directory to the link path at the end,
18553         after all the other -L arguments. 
18554
18555         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18556         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18557         ldelem.u1) and using the opposite for sbytes.
18558
18559         This fixes Digger, and we can finally run it.
18560
18561         * driver.cs (UnixParseOption): Move the option parsing here.  
18562         (CSCParseOption): Implement CSC-like parsing of options.
18563
18564         We now support both modes of operation, the old Unix way, and the
18565         new CSC-like way.  This should help those who wanted to make cross
18566         platform makefiles.
18567
18568         The only thing broken is that /r:, /reference: and /lib: are not
18569         implemented, because I want to make those have the same semantics
18570         as the CSC compiler has, and kill once and for all the confussion
18571         around this.   Will be doing this tomorrow.
18572
18573         * statement.cs (Unsafe.Resolve): The state is checked during
18574         resolve, not emit, so we have to set the flags for IsUnsfe here.
18575
18576 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18579         not catch the Error_ObjectRefRequired in SimpleName (as it is
18580         possible to have a class/instance variable name that later gets
18581         deambiguated), we have to check this here.      
18582
18583 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18584
18585         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18586         make static and put into Expression.
18587
18588         (Event.Define): Register the private field of the event with the 
18589         TypeManager so that GetFieldFromEvent can get at it.
18590
18591         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18592         keep track of the private field associated with an event which
18593         has no accessors.
18594
18595         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18596         private field.
18597
18598         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18599
18600 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18601
18602         * expression.cs (Binary.EmitBranchable): this routine emits the
18603         Binary expression in a branchable context.  This basically means:
18604         we need to branch somewhere, not just get the value on the stack.
18605
18606         This works together with Statement.EmitBoolExpression.
18607
18608         * statement.cs (Statement.EmitBoolExpression): Use
18609         EmitBranchable. 
18610
18611 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18612
18613         * statement.cs (For): Reduce the number of jumps in loops.
18614
18615         (For): Implement loop inversion for the For statement.
18616
18617         (Break): We can be breaking out of a Try/Catch controlled section
18618         (foreach might have an implicit try/catch clause), so we need to
18619         use Leave instead of Br.
18620
18621         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18622         now).  If the instace expression supports IMemoryLocation, we use
18623         the AddressOf method from the IMemoryLocation to extract the
18624         address instead of emitting the instance.
18625
18626         This showed up with `This', as we were emitting the instance
18627         always (Emit) instead of the Address of This.  Particularly
18628         interesting when This is a value type, as we dont want the Emit
18629         effect (which was to load the object).
18630
18631 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18634
18635         * statement.cs (Checked): Set the CheckedState during the resolve
18636         process too, as the ConvCast operations track the checked state on
18637         the resolve process, and not emit.
18638
18639         * cs-parser.jay (namespace_member_declaration): Flag that we have
18640         found a declaration when we do.  This is used to flag error 1529
18641
18642         * driver.cs: Report ok when we display the help only.
18643
18644 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18645
18646         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18647
18648 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * cs-tokenizer.cs (define): We also have to track locally the
18651         defines.  AllDefines is just used for the Conditional Attribute,
18652         but we also need the local defines for the current source code. 
18653
18654 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * statement.cs (While, For, Do): These loops can exit through a
18657         Break statement, use this information to tell whether the
18658         statement is the last piece of code.
18659
18660         (Break): Flag that we break.
18661
18662         * codegen.cs (EmitContexts): New `Breaks' state variable.
18663
18664 2002-07-03  Martin Baulig  <martin@gnome.org>
18665
18666         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18667         modifiers in method declarations in structs.  Otherwise, you won't
18668         be able to override things like Object.Equals().
18669
18670 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18671
18672         * class.cs (Method, Property, Indexer): Do not allow the public
18673         modifier to be used in explicit interface implementations.
18674
18675         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18676         override modifiers in method declarations in structs
18677
18678 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18679
18680         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18681         integer or real overflow, report an error
18682
18683 2002-07-02  Martin Baulig  <martin@gnome.org>
18684
18685         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18686         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18687         to tell the runtime about our newly created System.Object and
18688         System.ValueType types.
18689
18690 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18691
18692         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18693         struct instead of Ldarg/Starg.
18694
18695 2002-07-02  Martin Baulig  <martin@gnome.org>
18696
18697         * expression.cs (Indirection.Indirection): Call
18698         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18699
18700 2002-07-02  Martin Baulig  <martin@gnome.org>
18701
18702         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18703         ValueType, call TypeManager.TypeToCoreType() on it.
18704         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18705         the OpCodes.Newarr argument.
18706
18707 2002-07-02  Martin Baulig  <martin@gnome.org>
18708
18709         * expression.cs (Invocation.EmitCall): When compiling corlib,
18710         replace all calls to the system's System.Array type to calls to
18711         the newly created one.
18712
18713         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18714         System.Array methods.
18715         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18716         from the system's System.Array type which must be replaced.
18717
18718 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18719
18720         * typemanager.cs: load unverifiable_code_ctor so we can build
18721         corlib using the correct type. Avoid using GetTypeCode() with
18722         TypeBuilders.
18723         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18724         TypeManager.object_type to allow building corlib.
18725
18726 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18727
18728         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18729
18730 2002-07-01  Martin Baulig  <martin@gnome.org>
18731
18732         * class.cs: Make the last change actually work, we need to check
18733         whether `ifaces != null' to avoid a crash.
18734
18735 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18736
18737         * class.cs: when we build structs without fields that implement
18738         interfaces, we need to add the interfaces separately, since there is
18739         no API to both set the size and add the interfaces at type creation
18740         time.
18741
18742 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18743
18744         * expression.cs: the dimension arguments to the array constructors
18745         need to be converted if they are a long.
18746
18747 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18748
18749         * class.cs: don't emit ldarg.0 if there is no parent constructor
18750         (fixes showstopper for corlib).
18751
18752 2002-06-29  Martin Baulig  <martin@gnome.org>
18753
18754         MCS now compiles corlib on GNU/Linux :-)
18755
18756         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18757         ie. check for MethodImplOptions.InternalCall.
18758
18759         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18760         and TypeManager.attribute_type are null, so we must explicitly check
18761         whether parent is not null to find out whether it's an attribute type.
18762         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18763         and SetBuilder, not only if the property is neither abstract nor external.
18764         This is necessary to set the MethodImplOptions on the accessor methods.
18765         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18766         SetBuilder, see Property.Emit().
18767
18768         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18769         populate "System.Object", "System.ValueType" and "System.Attribute" since
18770         they've already been populated from BootCorlib_PopulateCoreTypes().
18771
18772 2002-06-29  Martin Baulig  <martin@gnome.org>
18773
18774         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18775         is the NullLiteral, we also need to make sure that target_type is not
18776         an enum type.   
18777
18778 2002-06-29  Martin Baulig  <martin@gnome.org>
18779
18780         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18781         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18782         before calling BootstrapCorlib_ResolveDelegate ().
18783
18784 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18785
18786         * statement.cs: fixed build-breaker. All tests passed ok.
18787
18788 2002-06-27  Martin Baulig  <martin@gnome.org>
18789
18790         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18791         for System.Decimal when compiling corlib.
18792
18793 2002-06-27  Martin Baulig  <martin@gnome.org>
18794
18795         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18796         switch blocks which contain nothing but a default clause.
18797
18798 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18799
18800        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18801
18802 2002-06-27  Martin Baulig  <martin@gnome.org>
18803
18804         * ecore.cs (PropertyExpr.PropertyExpr): Call
18805         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18806
18807         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18808         is already a TypeBuilder.
18809
18810 2002-06-27  Martin Baulig  <martin@gnome.org>
18811
18812         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18813         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18814         the "from an array-type to System.Array" case.  This makes it work
18815         when compiling corlib.
18816
18817 2002-06-27  Martin Baulig  <martin@gnome.org>
18818
18819         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18820         non-static PropertyExpr, set its InstanceExpression.  This makes
18821         the `ICollection.Count' property work in System/Array.cs.
18822
18823 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18824
18825         * driver.cs: Made error handling more consistent.  Errors now
18826         tracked by Report class, so many methods which used to return int
18827         now return void.  Main() now prints success/failure and 
18828         errors/warnings message.
18829
18830         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18831         the magic number return values (123 and 124).  Now, if the
18832         expected error occurs, the compiler exits with success (exit value
18833         0).  If the compilation completes without seeing that particular
18834         error, the compiler exits with failure (exit value 1).  The
18835         makefile in mcs/errors has been changed to handle the new behaviour.
18836
18837         * report.cs: Made 'expected error' number a property and renamed
18838         it from 'Probe' to 'ExpectedError'.
18839
18840         * genericparser.cs: Removed error handling support, since it is
18841         now all done by Report class.
18842
18843         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18844         class, so parse() no longer returns an int.
18845
18846         * namespace.cs: Use Report.Error instead of GenericParser.error
18847
18848 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18849
18850         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18851         TypeContainer.AddOperator): At the front of the list put the
18852         explicit implementations, so they get resolved/defined first. 
18853
18854 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18857         interface type is implemented by this TypeContainer.  Used during
18858         explicit interface implementation.
18859
18860         (Property.Define, Indexer.Define, Method.Define): Validate that
18861         the given interface in the explicit implementation is one of the
18862         base classes for the containing type.
18863
18864         Also if we are explicitly implementing an interface, but there is
18865         no match in the pending implementation table, report an error.
18866
18867         (Property.Define): Only define the property if we are
18868         not explicitly implementing a property from an interface.  Use the
18869         correct name also for those properties (the same CSC uses,
18870         although that is really not needed).
18871
18872         (Property.Emit): Do not emit attributes for explicitly implemented
18873         properties, as there is no TypeBuilder.
18874
18875         (Indexer.Emit): ditto.
18876
18877         Hiding then means that we do not really *implement* a pending
18878         implementation, which makes code fail.
18879
18880 2002-06-22  Martin Baulig  <martin@gnome.org>
18881
18882         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18883         the return value of Object.GetType().  [FIXME: we need to do this whenever
18884         we get a type back from the reflection library].
18885
18886 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18887
18888         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18889
18890 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18891
18892         * attribute.cs: Return null if we can not look up the type.
18893
18894         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18895         the interface types found.
18896
18897         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18898         interface types found.
18899
18900         * typemanager.cs (GetInterfaces): Make this routine returns alll
18901         the interfaces and work around the lame differences between
18902         System.Type and System.Reflection.Emit.TypeBuilder in the results
18903         result for GetInterfaces.
18904
18905         (ExpandInterfaces): Given an array of interface types, expand and
18906         eliminate repeated ocurrences of an interface.  This expands in
18907         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18908         be IA, IB, IC.
18909
18910 2002-06-21  Martin Baulig  <martin@gnome.org>
18911
18912         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18913         on System.Enum.
18914
18915 2002-06-21  Martin Baulig  <martin@gnome.org>
18916
18917         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18918         and called with one of the core types, return the corresponding typebuilder for
18919         that type.
18920
18921         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18922         element type.
18923
18924 2002-06-21  Martin Baulig  <martin@gnome.org>
18925
18926         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18927         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18928         (Expression.ConvertReferenceExplicit): Likewise.
18929
18930         * expression.cs (ElementAccess.DoResolve): Likewise.
18931         (ElementAccess.DoResolveLValue): Likewise.
18932
18933 2002-06-10  Martin Baulig  <martin@gnome.org>
18934
18935         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18936         add the "value" parameter to the parameter list.
18937
18938         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18939         to our caller.
18940
18941 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18942
18943         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18944         the argument to an int, uint, long or ulong, per the spec.  Also
18945         catch negative constants in array creation.
18946
18947 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18948
18949         * class.cs: do not allow the same interface to appear twice in
18950         the definition list.
18951
18952 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18953
18954         * ecore.cs: don't use ldlen with System.Array.
18955
18956 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18957
18958         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18959
18960 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18961
18962         * modifiers.cs: produce correct field attributes for protected
18963         internal. Easy fix so miguel can work on ther harder stuff:-)
18964
18965 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18966
18967         * pending.cs: New file.  Move the code from class.cs here.
18968         Support clearning the pending flag for all methods (when not doing
18969         explicit interface implementation).
18970
18971 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18972
18973         * rootcontext.cs: added a couple more types needed to bootstrap.
18974
18975 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18978         constructor in the type, instead of any constructor in the type
18979         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18980         a bug in the Mono runtime when applying the params attribute). 
18981
18982 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18983         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18984
18985 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18986
18987         * expression.cs (Unary.ResolveOperator): Use TypeManager
18988         to resolve the type.
18989
18990 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18991
18992         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18993         attached.
18994
18995         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18996         with each member too.
18997
18998         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18999         field builders too - this takes care of the enum member case.
19000
19001 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19002
19003         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19004         address-of operator on both value types and pointers.
19005
19006 2002-06-10  Martin Baulig  <martin@gnome.org>
19007
19008         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19009         PropertyBuilder to the `property_builders' list.
19010
19011         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19012         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19013         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19014         find any indexers which are inherited from an interface.
19015
19016 2002-06-09  Martin Baulig  <martin@gnome.org>
19017
19018         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19019         the same type as the constant if necessary.  There's also a test-130.cs
19020         for this.
19021
19022         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19023
19024         * typemanager.cs (TypeManager.ChangeType): Previously known as
19025         Enum.ChangeEnumType().
19026
19027 2002-06-09  Martin Baulig  <martin@gnome.org>
19028
19029         * expression.cs (Cast.TryReduce): Added support for consts.
19030
19031 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19032
19033         * class.cs (Accessor): Hold attributes information so we can pass
19034         it along.
19035
19036         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19037         Modify to pass in attributes attached to the methods.
19038
19039         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19040
19041         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19042         to handle the Accessor kind :-)
19043
19044         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19045
19046 2002-06-08  Martin Baulig  <martin@gnome.org>
19047
19048         * expression.cs (Unary.TryReduceNegative): Added support for
19049         ULongConstants.
19050
19051 2002-06-08  Martin Baulig  <martin@gnome.org>
19052
19053         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19054         name can't be found in the `defined_names' - the caller will do a
19055         MemberLookup in this case and thus find methods in System.Enum
19056         such as Enum.IsDefined().
19057
19058 2002-06-08  Martin Baulig  <martin@gnome.org>
19059
19060         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19061         Convert.ChangeType() which works with TypeBuilder created types.
19062         (Enum.LookupEnumValue, Enum.Define): Use it here.
19063
19064         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19065         `TypeBuilder.BaseType != null' check.
19066         (TypeContainer.FindMembers): Only lookup parent members if we
19067         actually have a parent.
19068         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19069         (ConstructorInitializer.Resolve): Likewise.
19070
19071         * interface.cs (Interface.FindMembers): Added
19072         `TypeBuilder.BaseType != null' check.
19073
19074         * rootcontext.cs (RootContext.ResolveCore): Added
19075         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19076         classes_second_stage.
19077
19078         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19079         debug_type and trace_type when compiling with --nostdlib.       
19080
19081 2002-06-07  Martin Baulig  <martin@gnome.org>
19082
19083         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19084         (AddField): Set it to true when adding a non-static field.
19085         (DefineType): Use `have_nonstatic_fields' to find out whether we
19086         have non-static fields, not `Fields != null'.
19087
19088 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19091         dereferencing a null on the static-field code path)
19092
19093 2002-05-30  Martin Baulig  <martin@gnome.org>
19094
19095         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19096         to take command line arguments.  Use reflection to call the new
19097         custom `Initialize' function on the symbol writer and pass it the
19098         command line arguments.
19099
19100         * driver.cs (--debug-args): New command line argument to pass command
19101         line arguments to the symbol writer.
19102
19103 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19104
19105         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19106         the target type for indexers and properties.  Thanks to Joe for
19107         catching this.
19108
19109 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19110
19111         * typemanager.cs (MethodFlags): returns the method flags
19112         (Obsolete/ShouldIgnore) that control warning emission and whether
19113         the invocation should be made, or ignored. 
19114
19115         * expression.cs (Invocation.Emit): Remove previous hack, we should
19116         not do this on matching a base type, we should do this based on an attribute
19117
19118         Only emit calls to System.Diagnostics.Debug and
19119         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19120         on the command line.
19121
19122         * rootcontext.cs: Global settings for tracing and debugging.
19123
19124         * cs-tokenizer.cs (define): New utility function to track
19125         defines.   Set the global settings for TRACE and DEBUG if found.
19126
19127 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19128
19129         * interface.cs (Populate*): Pass in the TypeContainer as well as
19130         the DeclSpace as parameters so that we can create EmitContexts and
19131         then use that to apply attributes etc.
19132
19133         (PopulateMethod, PopulateEvent, PopulateProperty)
19134         (PopulateIndexer): Apply attributes everywhere.
19135
19136         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19137         etc.
19138
19139         (ApplyAttributes): Update accordingly.
19140
19141         We now apply interface attributes for all members too.
19142
19143 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * class.cs (Indexer.Define); Correctly check if we are explicit
19146         implementation (instead of checking the Name for a ".", we
19147         directly look up if the InterfaceType was specified).
19148
19149         Delay the creation of the PropertyBuilder.
19150
19151         Only create the PropertyBuilder if we are not an explicit
19152         interface implementation.   This means that explicit interface
19153         implementation members do not participate in regular function
19154         lookups, and hence fixes another major ambiguity problem in
19155         overload resolution (that was the visible effect).
19156
19157         (DefineMethod): Return whether we are doing an interface
19158         implementation. 
19159
19160         * typemanager.cs: Temporary hack until we get attributes in
19161         interfaces (Ravi is working on that) and we get IndexerName
19162         support in interfaces.
19163
19164         * interface.cs: Register the indexers as properties.
19165
19166         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19167         warning, I have verified that this is a bug in the .NET runtime
19168         (JavaScript suffers of the same problem).
19169
19170         * typemanager.cs (MemberLookup): When looking up members for
19171         interfaces, the parent of an interface is the implicit
19172         System.Object (so we succeed in searches of Object methods in an
19173         interface method invocation.  Example:  IEnumerable x;  x.ToString
19174         ()) 
19175
19176 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19177
19178         * class.cs (Event): Events should also register if they do
19179         implement the methods that an interface requires.
19180
19181         * typemanager.cs (MemberLookup); use the new GetInterfaces
19182         method. 
19183
19184         (GetInterfaces): The code used to lookup interfaces for a type is
19185         used in more than one place, factor it here. 
19186
19187         * driver.cs: Track the errors at the bottom of the file, we kept
19188         on going.
19189
19190         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19191         instance if the method we are calling is static!
19192
19193 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19194
19195         * attribute.cs (ApplyAttributes): Make this function filter out
19196         the IndexerName attribute (as that attribute in reality is never
19197         applied) and return the string constant for the IndexerName
19198         attribute. 
19199
19200         * class.cs (TypeContainer.Emit): Validate that all the indexers
19201         have the same IndexerName attribute, and if so, set the
19202         DefaultName attribute on the class. 
19203
19204         * typemanager.cs: The return value might contain other stuff (not
19205         only methods).  For instance, consider a method with an "Item"
19206         property and an Item method.
19207
19208         * class.cs: If there is a problem with the parameter types,
19209         return. 
19210
19211 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19212
19213         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19214         looks at user defined conversion after making a call to 
19215         StandardConversionExists - we need this for overload resolution.
19216
19217         * expression.cs : Update accordingly the various method calls.
19218
19219         This fixes 2 bugs filed against implicit user defined conversions 
19220
19221 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19222
19223         * statement.cs: Track the result of the assignment.
19224
19225 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * expression.cs (MemberAccess): Improved error reporting for
19228         inaccessible members.
19229
19230 2002-05-22  Martin Baulig  <martin@gnome.org>
19231
19232         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19233         itself with debugging support.
19234
19235 2002-05-22  Martin Baulig  <martin@gnome.org>
19236
19237         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19238         Removed, this isn't needed anymore.
19239
19240 2002-05-20  Martin Baulig  <martin@gnome.org>
19241
19242         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19243         be underlying type for an enum.
19244
19245 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19246
19247         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19248         that splits out the loading of just the core types.
19249
19250         * rootcontext.cs (ResolveCore): Split the struct resolution in
19251         two, so we can load the enumeration underlying types before any
19252         enums are used.
19253
19254         * expression.cs (Is): Bandaid until we fix properly Switch (see
19255         bug #24985 for details).
19256
19257         * typemanager.cs (ImplementsInterface): The hashtable will contain
19258         a null if there are no interfaces implemented.
19259
19260 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19261
19262         * cs-parser.jay (indexer_declarator): It is fine to have array
19263         parameters
19264
19265 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19266
19267         * typemanager.cs: (RegisterBuilder): New function used to register
19268         TypeBuilders that implement interfaces.  Since
19269         TypeBuilder.GetInterfaces (as usual) does not work with lame
19270         Reflection.Emit. 
19271         (AddUserType): register interfaces.
19272
19273         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19274         dealing with TypeBuilder.  Also, arrays are showing up as
19275         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19276         methods can not be invoked on them!
19277
19278         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19279         (ImplicitReferenceConversionExists): Split out from
19280         StandardConversionExists. 
19281
19282         * expression.cs (As): We were only implementing one of the three
19283         cases for the as operator.  We now implement them all.
19284         (Is): Implement the various other cases for Is as well.
19285
19286         * typemanager.cs (CACHE): New define used to control if we want or
19287         not the FindMembers cache.  Seems to have a negative impact on
19288         performance currently
19289
19290         (MemberLookup): Nested types have full acess to
19291         enclosing type members
19292
19293         Remove code that coped with instance/static returns for events, we
19294         now catch this in RealFindMembers.
19295
19296         (RealFindMembers): only perform static lookup if the instance
19297         lookup did not return a type or an event.  
19298
19299 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * assign.cs (CompoundAssign): We pass more semantic information
19302         now to Compound Assignments than we did before: now we have all
19303         the information at hand, and now we resolve the target *before* we
19304         do the expression expansion, which allows the "CacheValue" method
19305         to have the effect we intended (before, a [x] += 1 would generate
19306         two differen ArrayAccess expressions from the ElementAccess,
19307         during the resolution process).
19308
19309         (CompoundAssign.DoResolve): Resolve target and original_source here.
19310
19311 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19312
19313         * expression.cs (ArrayAccess): dropped debugging information. 
19314
19315         * typemanager.cs: Small bug fix: I was always returning i_members,
19316         instead of one of i_members or s_members (depending on which had
19317         the content).
19318
19319         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19320         method is invoked before any code generation takes place, and it
19321         is a mechanism to inform that the expression will be invoked more
19322         than once, and that the method should use temporary values to
19323         avoid having side effects
19324
19325         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19326
19327         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19328         implementation.
19329
19330         * expression.cs (Indirection, ArrayAccess): Add support for
19331         CacheTemporaries in these two bad boys. 
19332
19333         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19334         ldobj or ldind_ref.  
19335         (StoreFromPtr): Handle stobj as well.
19336
19337         * expression.cs (UnaryMutator): Share more code.
19338
19339         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19340         down: I was not tracking the Filter function as well, which
19341         was affecting the results of the cache.
19342
19343 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * attribute.cs: Remove the hack to handle the CharSet property on
19346         StructLayouts. 
19347
19348 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * attribute.cs (DoResolve): More uglyness, we now only try to
19351         resolve the attribute partially, to extract the CharSet
19352         information (only if we are a StructLayout attribute).  Otherwise 
19353
19354         (GetExtraTypeInfo): Add some code to conditionally kill in the
19355         future this.   I am more and more convinced that the .NET
19356         framework has special code to handle the attribute setting on
19357         certain elements.
19358
19359         * expression.cs (IsParamsMethodApplicable): Revert my previous
19360         foreach change here, it was wrong.
19361
19362 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19365         (pp_expr): do not abort on unknown input, just return.
19366         (eval): abort if there are pending chars.
19367
19368         * attribute.cs (Attribute.Resolve): Positional parameters are
19369         optional.  Deal with that case.
19370
19371         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19372         the Ansi/Unicode/Auto information for the type.
19373
19374         (TypeContainer.DefineType): instantiate the EmitContext here, as
19375         we will be using it during the type definition (to resolve
19376         attributes) and during the emit phase.
19377
19378         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19379         to pull type information out of the attributes
19380
19381         (Attribute.Resolve): track the constructor builder, and allow for
19382         multiple invocations (structs and classes will use this).
19383
19384         * ecore.cs (MemberLookupFinal): new version with all the
19385         parameters customizable.
19386
19387         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19388         constructors.  Return if the result value is null (as the error
19389         would have been flagged already by MemberLookupFinal)
19390
19391         Do not allow instances of abstract classes or interfaces to be
19392         created.
19393
19394         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19395         We have to compare the assembly property here when dealing with
19396         FamANDAssem and Assembly access modifiers, because we might be
19397         creating an assembly from *modules* (that means that we are not
19398         getting TypeBuilders for types defined in other modules that are
19399         part of this assembly).
19400
19401         (Method.Emit): If the method is marked abstract and has a body,
19402         emit an error. 
19403
19404         (TypeContainer.DefineMembers): If both the defined member and the
19405         parent name match are methods, then do not emit any warnings: let
19406         the Method.Define routine take care of flagging warnings.  But if
19407         there is a mismatch (method overrides something else, or method is
19408         overriwritten by something, then emit warning).
19409
19410         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19411         set to null, this means `do not check for the return type on the
19412         signature'. 
19413
19414         (Method.Define): set the return type for the method signature to
19415         null, so that we get methods with the same name and parameters and
19416         different return types.  This is used to flag warning 114 (you are
19417         hiding a method, and you probably want to use the new/override
19418         keywords instead).
19419
19420         * typemanager.cs (MemberLookup): Implemented proper access
19421         control, closing a long standing set of bug reports.  The problem
19422         was that the Framework only has two bits: Public and NonPublic,
19423         and NonPublic includes private and protected methods, but we need
19424         to enforce the FamANDAssem, FamOrAssem and Family. 
19425
19426 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * statement.cs (GotoCase): Return true: Ammounts to giving up
19429         knowledge on whether we return or not, and letting the other case
19430         be responsible for it.
19431
19432 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19433
19434         * driver.cs: Do not load directories for each file processed, only
19435         do it if there is a pattern.
19436
19437         * ecore.cs: Report readonly assigns here as well, as we might have
19438         been resolved only by MemberAccess.
19439
19440         (SimpleName.SimpleNameResolve): Also be useful for LValue
19441         resolution.   We need this to propagate assign to local readonly variables
19442
19443         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19444         do not want to reuse potential criteria memory.
19445
19446         * class.cs (MyEventBuilder): Set reflected_type;
19447
19448         * ecore.cs (Constantify): Added support for constifying bools.
19449
19450         (RootContext.LookupType): Added a cache for values looked up in
19451         the declaration space.
19452
19453         * typemanager.cs (FindMembers): Now is a front-end to
19454         RealFindMembers, and provides a two-level hashtable-based cache to
19455         the request.  
19456
19457         15% performance improvement: from 22.5 to 19.2 seconds.
19458
19459         * expression.cs (IsParamsMethodApplicable): use foreach.
19460         (Invocation.DoResolve): ditto.
19461         (New.DoResolve): ditto.
19462         (ArrayCreation.DoResolve): ditto.
19463
19464         * ecore.cs (FindMostEncompassingType): use foreach.
19465
19466         * delegate.cs (NewDelegate.DoResolve): Use foreach
19467
19468         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19469         (RemoveMethods): use foreach.
19470
19471         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19472         nested foreach statements instead of for, and also break out of
19473         the inner loop once a match is found.
19474
19475         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19476
19477 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19478
19479         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19480         we actually unwrap the expression to allow for extra information
19481         to be extracted. 
19482
19483         * expression.cs: Use Shr_Un on unsigned operations. 
19484
19485 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19486
19487         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19488         applicable operators was not being considered correctly. This closes
19489         the bug Miguel reported.
19490
19491 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19492
19493         * attribute.cs: check that the type derives from System.Attribute
19494         and report the correct error in that case (moved the duplicate code to
19495         its own method, too).
19496
19497 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19498
19499         * attribute.cs: lookup attribute type name as the spec says: first the
19500         bare attribute name and then name + "Attribute" (nant compiles with
19501         mcs after this fix).
19502
19503 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19504
19505         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19506         Because of the way we parse things, we should try to see if a
19507         UIntConstant can fit in an integer.
19508
19509 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19510
19511         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19512         when we are in an explicit context.
19513
19514         (ConvertReferenceExplicit): When converting from Iface type S to Class
19515         T make sure the rules are implemented as an OR.
19516
19517         * parameter.cs (ParameterType): Make it a property for now although the
19518         purpose really isn't anything immediate.
19519
19520         * expression.cs (Is*Applicable): Do better checking on the parameter type
19521         of a ref/out parameter. The ones from the system assemblies are already 
19522         marked with the correct type so we don't need to do any correction.
19523
19524         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19525         the object type is standard too so include that.
19526
19527 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19528
19529         * ecore.cs (StandardConversionExists): Augment with missing code:
19530         deal with IntConstant, LongConstants and Enumerations.
19531
19532         * assign.cs: Report the error, instead of failing silently
19533
19534         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19535         typecontainer that they are declared, because the
19536         typecontainer/namespace will have the list of using clauses that
19537         need to be applied.
19538
19539         Assembly Attributes were escaping the normal registration
19540         mechanism. 
19541
19542         (EmitCode): Apply attributes within an EmitContext that represents
19543         the container they were declared on.
19544
19545         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19546
19547 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19548
19549         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19550         Revamp completely - make much cleaner as we now operate only
19551         on a set of Types.
19552
19553         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19554         to implement the logic detailed in the spec more correctly.
19555
19556         (UserDefinedConversion): Update accordingly.
19557
19558 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * statement.cs: Return flow analysis information up.
19561
19562         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19563         and the default.
19564
19565         (token): Do not consume an extra character before calling
19566         decimal_digits.
19567
19568 2002-05-06  Piers Haken <piersh@friskit.com>
19569
19570         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19571
19572 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19575         EmitContext during the instance constructor initializer
19576         resolution, to stop access to instance variables.
19577
19578         This is mandated by the spec, last paragraph of the `constructor
19579         initializers' section. 
19580
19581 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19582
19583         * cs-parser.jay, class.cs (Accessor): new class used to represent
19584         an accessor (get or set).  In the past we used `null' to represent
19585         a missing accessor.  But this is ambiguous because there was no
19586         way to tell in abstract indexers/properties if one of them was
19587         specified.
19588
19589         Now there is a way of addressing that.
19590
19591         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19592         instead of FindMembers.
19593
19594         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19595         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19596
19597         * attribute.cs: Treat indexers and properties as the same in terms
19598         of applying attributes
19599
19600         * ecore.cs (FindMostEncompassedType): Use statically initialized
19601         EmptyExpressions()s like we do elsewhere to avoid creating useless
19602         objects (and we take this out of the tight loop).
19603
19604         (GetConversionOperators): Move the code to extract the actual
19605         operators to a separate routine to clean things up.
19606
19607 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19608
19609         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19610         events are always registered FieldBuilders.
19611
19612         * class.cs (FieldBase): New class shared by Fields 
19613
19614         * delegate.cs: If we are a toplevel delegate, use our full name.
19615         If we are a nested delegate, then only use our tail name.
19616
19617 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19618
19619         * expression.cs (IsApplicable): Ensure that we add the "&" to
19620         ref/out types before comparing it with the type of the argument.
19621
19622         (IsParamsMethodApplicable): Ditto.
19623
19624         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19625         silly me ;-)
19626
19627         * delegate.cs : Handle the case when we have more than one applicable
19628         method. Flag an error only when we finish checking all.
19629
19630 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19631
19632         * expression.cs: Add support for boolean static initializers.
19633
19634 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19637
19638         * parameter.cs (ComputeParameterTypes,
19639         ComputeAndDefineParameterTypes): Better error handling: now we
19640         clear the `types' cache if we fail during any of the type lookups.
19641         We also return the status code correctly to our caller
19642
19643         * delegate.cs: If we fail to define a delegate, abort the extra
19644         steps. 
19645
19646         * expression.cs (Binary.ResolveOperator): for
19647         operator==(object,object) and operator !=(object, object) we also
19648         have to verify that there is an implicit conversion from one to
19649         the other.
19650
19651         (ArrayAccess.DoResolve): Array Access can operate on
19652         non-variables. 
19653
19654 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19655
19656         * assign.cs (CompoundAssign): A new class used as a "flag" that
19657         the assignment actually is happening as part of a compound
19658         assignment operator.
19659
19660         During compound assignment, a few new rules exist to enable things
19661         like:
19662
19663         byte b |= 1 + 2
19664
19665         From the spec:
19666
19667         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19668         to the type of x) if y is implicitly convertible to the type of x,
19669         and the operator is a builtin operator and the return type of the
19670         operator is explicitly convertible to the type of x. 
19671
19672         * rootcontext.cs: Reset warning level to 2.  4 catches various
19673         "interesting" features in mcs, we must clean this up at some
19674         point, but currently am trying to kill other bugs ;-)
19675
19676         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19677         in container classes as well.  
19678
19679         * expression.cs (Binary.ResolveOperator): Handle string case
19680         before anything else (as operator overloading does emit an error
19681         before doing anything else).
19682
19683         This code could go away when we move to a table driven model, but
19684         i could not come up with a good plan last night.
19685
19686 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19687
19688         * typemanager.cs (CSharpName): reimplementation using regex.
19689         * class.cs: added null check for fields in Emit
19690         * rootcontext.cs: set warninglevel to 4
19691
19692 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * typemanager.cs (CSharpName): reimplemented with Lupus
19695         suggestion.
19696
19697 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19698
19699         * statement.cs (If): correclty implement Resolve, because we were
19700         not catching sem errors in there.  The same process is needed
19701         everywhere else. 
19702         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19703
19704
19705         (Statement.Warning_DeadCodeFound): Factorize code.
19706         (While): Report dead code here too.
19707
19708         (Statement): Added Resolve virtual method to allow
19709         for resolution split from the emit code.
19710
19711 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19712
19713         * statement.cs (EmitBoolExpression): No longer try to resolve the
19714         expression here.    
19715         (MakeBoolean): New utility function that resolve, implicitly
19716         converts to boolean and tags the expression. 
19717
19718
19719         (If, Do): Implement dead code elimination.
19720         (While): Implement loop inversion
19721
19722         (Do, While, For, If): Resolve the expression prior to calling our
19723         code generation.
19724
19725 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19726
19727         * class.cs:
19728           - added method Report28 (warning: program has more than one entry point)
19729           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19730           - modified method Method.Define, the part at the end of the method
19731
19732         * rootcontext.cs: added static public Location EntryPointLocation;
19733           
19734         * ../errors/cs0028.cs : Add test case for the above warning.              
19735
19736         * typemanager.cs:
19737           - modified method CSharpName to allow arrays of primitive type to
19738             be printed nicely (e.g. instead of System.Int32[][] it now prints
19739             int[][])
19740           - added method CSharpSignature: returns the signature of a method
19741             in string format to be used in reporting errors, warnings, etc.
19742
19743         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19744         with String.Empty.
19745
19746 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19747
19748         * delegate.cs (Define): Fix extremely silly bug where I was
19749         setting the type of the 'object' parameter of the BeginInvoke
19750         method to System.IAsyncResult instead of System.Object ;-)
19751
19752 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19755         here. 
19756
19757         (Constructor.Emit): return if we fail to initialize the
19758         constructor.  Another door closed!  
19759
19760         * expression.cs (New.DoResolve): Improve error message (from -6 to
19761         1501).  Use DeclaredOnly lookup to find the exact constructor.
19762
19763         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19764         loop.  This is useful.
19765
19766         * cs-parser.jay: Adjust the default parameters so that destructors
19767         have the proper signature.
19768
19769 2002-04-26  Martin Baulig  <martin@gnome.org>
19770
19771         * driver.cs (LoadAssembly): If `assembly' contains any characters
19772         which are only valid in path names and not in assembly names
19773         (currently slash, backslash and point), use Assembly.LoadFrom ()
19774         instead of Assembly.Load () on the `assembly' (before iteration
19775         over the link_paths).
19776
19777 2002-04-26  Martin Baulig  <martin@gnome.org>
19778
19779         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19780
19781 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19782
19783         * class.cs (Property): use the new typemanager.MemberLookup
19784
19785         (TypeContainer.MemberLookup): Implement using the
19786         TypeManager.MemberLookup now. 
19787
19788         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19789         and return MemberInfos, so that these can be used without an
19790         EmitContext (what we had before).
19791
19792 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19793
19794         * expression.cs: Fix the case where the argument to params if the
19795         type of the params.  I omitted handling this before.   Fixed
19796
19797 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * driver.cs: Call BootCorlib_PopulateCoreType
19800
19801         * class.cs (Property.CheckBase): Check for properties only, not
19802         for all members. 
19803
19804         * interface.cs: Temporary hack: try/catch around the
19805         CustomAttributeBuilder, because I am getting an exception that I
19806         do not understand.
19807
19808         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19809         types whose definitions are required to be there (attributes are
19810         defined before standard types).
19811
19812         Compute definitions as we boot the various types, as they are used
19813         immediately (value_type class will need object_type, but if we do
19814         not initialize object_type, we will pass a null, which will let
19815         the runtime pick the System.Object from the existing corlib, which
19816         is not what we want).
19817
19818 2002-04-22  Patrik Torstensson <totte@labs2.com>
19819
19820         * cs-tokenizer.cs: fixed a number of trim() issues.
19821
19822 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19823
19824         * expression.cs (Argument.Type): Ensure that we return the correct
19825         type when we have out or ref parameters [in which case we 
19826         append a "&"].
19827
19828 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * class.cs (Property, Indexer): Allow extern modifier in there. 
19831
19832         * typemanager.cs (InitBaseTypes): Initializes object_type and
19833         value_type, since those will be used early on during the bootstrap
19834         process to compile corlib.
19835
19836         (InitCoreTypes): Move code from here to InitBaseTypes.
19837
19838 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19839
19840         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19841         single-dimension arrays as using the ldlen opcode.  
19842
19843         Daniel Lewis discovered this optimization.  
19844
19845         * typemanager.cs: Add signature for System.Array::get_Length
19846
19847 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19848
19849         * statement.cs: report the error when the foreach does not apply to an
19850         array nor a collection.
19851
19852 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19853
19854         * expression.cs: Add implicit conversions to the operator ~.
19855
19856         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19857
19858         * typemanager.cs: Locate the decimal constructor.
19859
19860 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19861
19862         * attribute.cs: use the new property of TypeOf.
19863         * expression.cs: added 'get' property around typearg.
19864
19865         These changes fix a build breaker reported by NickD. Is this the
19866         correct way to fix?  If not, please, revert my changes and make it
19867         work :-).
19868
19869 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19870
19871         * attribute.cs: Add support for typeof in attribute invocations.
19872         I am not sure that this is right though.
19873
19874 2002-04-14  Duncan Mak  <duncan@ximian.com>
19875
19876         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19877         Binary.Operator.Division case.
19878
19879 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19880
19881         * class.cs (DefineType): Ensure that we do a proper check on
19882         attribute types and also register it with the TypeManager.
19883
19884         (TypeContainer.Targets): The default for attribute types is
19885         AttributeTargets.All.
19886
19887         * attribute.cs (ApplyAttributes): Registering the attribute type
19888         is done elsewhere, not when we discover we have a Usage attribute.
19889
19890 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19891
19892         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19893         and get rid of is_delegate parameter.
19894
19895         * everywhere : update.
19896
19897 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19898
19899         * cs-parser.jay (compilation_unit): Revamp completely to use
19900         some new ideas that I got from Rhys' grammar to solve the problems
19901         with assembly level attributes.
19902
19903         (outer_declaration): New grammar production.
19904
19905         (attribute_sections): Add.
19906
19907         (opt_attributes): Base on attribute_sections
19908
19909         (namespace_declaration): Allow opt_attributes to tackle the case
19910         when we have assembly level attributes - we are clever in this
19911         regard now ;-)
19912
19913         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19914         attributes in the non-global context.
19915
19916         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19917         instead of SetGlobalAttributes.
19918
19919         * class.cs, rootcontext.cs : Ensure we define and generate 
19920         attribute types before anything else.
19921
19922         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19923         and flag the new error -20 for the case when the attribute type
19924         does not have valid targets specified. csc does not catch this.
19925
19926         * ../errors/errors.txt : update for error # -20
19927
19928 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19929
19930         * support.cs (InternalParameters.ParameterModifier): Do some null
19931         checking and return sane values.
19932
19933         * class.cs (Method.Define): If we are a PInvoke method, ensure
19934         that we are static and extern. Report error # 601
19935
19936         * ../errors/cs0601.cs : Add test case for the above error.
19937
19938 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19939
19940         * rootcontext.cs (attribute_types): We need to keep type of
19941         all attribute types separately and emit code for them first.
19942
19943         (RegisterAttribute) : Implement.
19944
19945         * class.cs (DefineType): Check if the current Type is a custom
19946         attribute type and register it accordingly.
19947
19948         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19949         adding the first attribute twice and rename to
19950
19951         (SetGlobalAttributes): this.
19952
19953         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19954         lookups.
19955
19956         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19957         if we are processing global arguments. Hmm, I am unsure of this.
19958
19959 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19960
19961         * expression.cs: added static array of strings to avoid calling
19962         Enum.ToString () for Operator in Binary. Significant recover of
19963         performance.
19964
19965 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19966
19967         * class.cs (FindMembers): Allow the Builders of the various
19968         members to be null.  If they are skip them.  This only happens
19969         during the PInvoke declaration.
19970
19971 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19972
19973         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19974         failure, so we do not keep going afterwards.
19975
19976         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19977         wanted to pass `false' as the `is_delegate' argument.  If this is
19978         the case, why not use delegate_type == null to mean `is_delegate =
19979         false' and anything else as is_delegate = true.
19980
19981 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19982
19983         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19984         code for the section, not the beginning of the tests.
19985
19986 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19987
19988         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19989
19990         * expression.cs (Binary): same.  Warn about errors where we have
19991         Enum/Enum in operator + as well.
19992
19993 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19994
19995         * statement.cs:
19996                 - added support for switch(bool)
19997                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19998                 - add TableSwitchEmit() to handle table-based switch statements
19999
20000 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20001
20002         * expression.cs (Invocation.OverloadResolve): Factor out code which
20003         does parameter compatibility checking with arguments so that we can 
20004         re-use the code even from Delegate.VerifyApplicability
20005
20006         (VerifyArgumentsCompat): Move above code here.
20007
20008         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20009         and instead make a call to the above method.
20010
20011 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20012
20013         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20014         We use it to keep track of classes which are attribute types.
20015
20016 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20017
20018         * delegate.cs (Delegate.Define): Correctly define the types in the
20019         presence of fixed and array parameters.
20020
20021         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20022         doing FindMembers.
20023
20024         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20025         include NonPublic after the first iteration.
20026
20027         * class.cs (Indexer.CheckBase): Only check if both parents are
20028         non-null. 
20029
20030         * cs-parser.jay (accessor_body): If empty, set to null.
20031
20032         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20033         same code path here to resolve constants names that we did have in
20034         MemberAccess.DoResolve.  There is too much code duplicated here.
20035
20036 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20037
20038         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20039
20040         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20041         to MakeUnionSet.
20042
20043         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20044         tokens, numbers and strings.
20045
20046         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20047         parenthesis.
20048
20049         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20050         asyncronous parameters and the regular parameters.  
20051
20052         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20053         specify the target directory.
20054
20055         * expression.cs: (This.DoResolve): Simplify
20056         (As.Emit): Optimize, do not generate IsInst if the expression is
20057         always of the given type.
20058
20059         (Is.DoResolve): Bug fix, we were reporting both always/never for
20060         the is expression.
20061
20062         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20063         creating too many unnecessary arrays.
20064
20065 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20066
20067         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20068         fields instead of rolling our own initializer.   Takes care of all
20069         implicit conversions, and drops unnecessary static checks/argument.
20070
20071 2002-03-31  Dick Porter  <dick@ximian.com>
20072
20073         * driver.cs: use the GetDirectories() return values properly, and
20074         use "/" as path separator.
20075
20076 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20077
20078         * expression.cs (Unary): Optimize - - expr into expr.
20079         (Binary): Optimize a + (-b) into a -b.
20080
20081         * codegen.cs (CodeGen): Made all methods static.
20082
20083 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20084
20085         * rootcontext.cs: 
20086
20087         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20088         TypeBuilder property.
20089
20090         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20091         instead. 
20092
20093         * tree.cs: Removed the various RecordXXXX, and replaced with a
20094         single RecordDecl.  Removed all the accessor methods, and just
20095         left a single access point Type 
20096
20097         * enum.cs: Rename DefineEnum to DefineType.
20098
20099         * decl.cs: New abstract method `DefineType' used to unify the
20100         Defines for Enumerations, Interfaces, TypeContainers and
20101         Delegates.
20102
20103         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20104         LookupBaseClasses method that used to live in class.cs and
20105         interface.cs here, and renamed to FindType.
20106
20107         * delegate.cs: Implement DefineType.  Take advantage of the
20108         refactored pattern for locating the parent builder without taking
20109         the parent_builder argument (which we know does not work if we are
20110         nested, and triggering a toplevel definition).
20111
20112 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20115         accessibility of a member has changed during override and report
20116         an error if so.
20117
20118         * class.cs (Method.Define, Property.Define): Only complain on
20119         overrides if the method is private, any other accessibility is
20120         fine (and since we just checked the permission is the same, we are
20121         good to go).
20122
20123         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20124         and elif are processed always.  The other pre-processing
20125         directives are only processed if we are "taking" the path
20126
20127 2002-03-29  Martin Baulig  <martin@gnome.org>
20128
20129         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20130         current location is not Null.
20131
20132         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20133         a separate method so we can profile it.
20134
20135         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20136         `span.Seconds' are just seconds, but no minutes or hours.
20137         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20138
20139 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20142         Remove the gratuitous set of Final:
20143
20144                                 // If an interface implementation, then we can set Final.
20145                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20146                                     implementing.DeclaringType.IsInterface)
20147                                         flags |= MethodAttributes.Final;
20148
20149         I do not know what I was smoking when I used that.
20150
20151
20152         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20153         step into fixing the name resolution issues for delegates and
20154         unifying the toplevel name resolution.
20155
20156 2002-03-28  Martin Baulig  <martin@gnome.org>
20157
20158         * class.cs (Method.Emit): If we have a symbol writer, call its
20159         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20160         tell it about the current method.
20161
20162         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20163         writer that we're going to emit the first byte of IL code for a new
20164         statement (a new source line).
20165         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20166         EmitContext.Mark() before emitting any code.
20167
20168         * location.cs (SymbolDocument): Return null when we're Null.
20169
20170         * statement.cs (Statement): Moved the `Location loc' variable here.
20171         (Statement.EmitBoolExpression): If we have a symbol writer, call
20172         ec.Mark() before emitting any code to tell it that we're at the
20173         beginning of a new statement.
20174         (StatementExpression): Added `Location' argument to the constructor.
20175         (Block): Added public readonly variable `StartLocation' and public
20176         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20177         (Block): Added constructor which takes a start and end location.
20178         (Block.SetEndLocation): New method. This sets the end location.
20179         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20180         local variables we create.
20181         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20182         each statement and do also mark the begin and end of the block.
20183
20184         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20185         tell it the current lexer.Location, use Location.Null for the end of the
20186         block.
20187         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20188         current block, set its end location using SetEndLocation().
20189         (statement_expression): StatementExpression constructor now takes the
20190         lexer.Location as additional argument.
20191         (for_statement, declare_local_variables): Likewise.
20192         (declare_local_variables): When creating a new implicit block, use the
20193         new Block constructor and pass it the lexer.Location.
20194
20195 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20196
20197         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20198         members also on the parent interfaces recursively.
20199
20200 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20201
20202         * report.cs: Use new formats, since Gonzalo finished the missing
20203         bits. 
20204
20205         * expression.cs (Binary.ResolveOperator): added missing operator|
20206         operator& and operator^ for bool/bool.
20207
20208         * cs-parser.jay: CheckDef now takes a Location argument that is
20209         used to report errors more precisly (instead of reporting the end
20210         of a definition, we try to track something which is a lot closer
20211         to the source of the problem).
20212
20213         * cs-tokenizer.cs: Track global token use, so we can properly flag
20214         the use of #define/#undef after the first token has been seen.
20215
20216         Also, rename the reportXXXX to Error_DescriptiveName
20217
20218         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20219         TypeContainer, so that Enum and Interface can use this too.
20220
20221         * class.cs (TypeContainer.LookupInterfaceOrClass,
20222         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20223         `builder' argument.  Typically this was used to pass the parent
20224         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20225         the definition).  
20226
20227         The problem is that a nested class could trigger the definition of
20228         a toplevel class, and the builder would be obviously wrong in that
20229         case. 
20230
20231         So we drop this argument, and we compute dynamically the
20232         TypeBuilder/ModuleBuilder (the correct information was available
20233         to us anyways from DeclSpace.Parent)
20234
20235         * interface.cs (Interface.DefineInterface): Drop builder
20236         parameter cleanup like class.cs
20237
20238         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20239         like class.cs
20240
20241         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20242         values. 
20243
20244         (Try.Emit): Propagate the returns value from the statement.
20245
20246         (Return.Emit): Even if we are leavning 
20247
20248         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20249
20250         * modifiers.cs: Fix the computation of MethodAttributes flags.
20251
20252 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20253
20254         * driver.cs: allow compilation of files that start with '/'.
20255         Add a default case when checking the argument of --target.
20256
20257 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * interface.cs: Implement the same search algorithm for types in
20260         the interface code.
20261
20262         * delegate.cs: Do not allow multiple definition.
20263
20264         * Recovered ChangeLog that got accidentally amputated
20265
20266         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20267
20268         * rootcontext.cs: Load manually enum to allow core classes to
20269         contain enumerations.
20270
20271         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20272         Update to new static methods in TypeManager.
20273
20274         * typemanager.cs (GetMethod, GetConstructor): Use our
20275         implementation of FindMembers to find the members, since during
20276         corlib compilation, the types are TypeBuilders and GetMethod and
20277         GetConstructor do not work.
20278
20279         Make all methods in TypeManager static.
20280
20281         (InitCodeHelpers): Split the functionality from
20282         the InitCodeTypes function.
20283
20284         * driver.cs: Call InitCodeHelpers after we have populated the
20285         types. 
20286
20287         * cs-parser.jay (delegate_declaration): we did not used to compute
20288         the delegate name correctly for void delegates.
20289
20290 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20291
20292         * rootcontext.cs (RootContext): Init the interface_resolve_order
20293         and type_container_resolve_order always.
20294
20295         (ResolveCore, BootstrapCorlib_ResolveClass,
20296         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20297         compiler when compiling with --nostdlib
20298
20299         * class.cs (TypeContainer.DefineType): Check that our parent is
20300         not null.  This test is most important when we are bootstraping
20301         the core types.
20302
20303         * codegen.cs: Split out the symbol writing code.
20304
20305 2002-03-25  Martin Baulig  <martin@gnome.org>
20306
20307         * driver.cs (-g): Made -g an alias for --debug.
20308
20309 2002-03-24  Martin Baulig  <martin@gnome.org>
20310
20311         * codegen.cs (SymbolWriter): New public variable. Returns the
20312         current symbol writer.
20313         (CodeGen): Added `bool want_debugging_support' argument to the
20314          constructor. If true, tell the ModuleBuild that we want debugging
20315         support and ask it for the ISymbolWriter.
20316         (Save): If we have a symbol writer, call it's Close() method after
20317         saving the assembly.
20318
20319         * driver.c (--debug): New command line argument to create a
20320         debugger information file.
20321
20322         * location.cs (SymbolDocument): New public property. Returns an
20323         ISymbolDocumentWriter object for the current source file or null
20324         if we don't have a symbol writer.
20325
20326 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * driver.cs (LoadAssembly): Correctly return when all the paths
20329         have been tried and not before.
20330
20331         * statement.cs (Switch.Emit): return the actual coverage for this
20332         statement (returns/not-returns)
20333
20334         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20335         switch of the statement if we are the last switch section.  That
20336         kills two problems: try/catch problems (we used to emit an empty
20337         nop at the end) and switch statements where all branches would
20338         return. 
20339
20340 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20341
20342         * driver.cs: Add default assemblies (the equivalent to the
20343         Microsoft CSC.RSP file)
20344
20345         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20346         also update tokens_seen and set it to false.
20347
20348         * driver.cs: Implement --recurse for Mike.
20349
20350         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20351         correctly splitting out the paths.
20352
20353 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20354
20355         * interface.cs (Interface.PopulateProperty): Instead of using
20356         `parent' as the declaration space for the set parameters, use
20357         `this' 
20358
20359         * support.cs (InternalParameters): InternalParameters constructor
20360         takes a DeclSpace instead of a TypeContainer.
20361
20362         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20363         types are being initialized, load the address of it before calling
20364         the function.  
20365
20366         (New): Provide a mechanism to disable the generation of local
20367         value type temporaries when the caller will be providing us with
20368         an address to store it.
20369
20370         (ArrayCreation.EmitDynamicInitializers): Use it.
20371
20372 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20373
20374         * expression.cs (Invocation.EmitArguments): Only probe for array
20375         property if there is more than one argument.  Sorry about that.
20376
20377         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20378         empty param arrays.
20379
20380         * class.cs (Method.LabelParameters): Fix incorrect code path that
20381         prevented the `ParamArrayAttribute' from being applied to the
20382         params attribute.
20383
20384 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20385
20386         * support.cs (ReflectionParameters): Correctly compute whether the
20387         last argument is a params array.  Fixes the problem with
20388         string.Split ('a')
20389
20390         * typemanager.cs: Make the assemblies array always be non-null
20391         (empty, but non-null)
20392
20393         * tree.cs (RecordDecl): New function that abstracts the recording
20394         of names.  This reports error 101, and provides a pointer to the
20395         previous declaration.  Fixes a crash in the compiler.
20396
20397         * cs-parser.jay (constructor_declaration): Update to new grammar,
20398         and provide a constructor_body that can be empty.
20399
20400 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * driver.cs: Add support for --resources.
20403
20404         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20405         Make all types for the various array helper methods be integer.
20406
20407         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20408         CheckState to ConvCast.
20409
20410         (ConvCast): Now it takes a `checked' state argument, to avoid
20411         depending on the emit context for the conversion, and just using
20412         the resolve time setting.
20413
20414         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20415         instead of Invocation.EmitArguments.  We do not emit the original
20416         arguments, instead we emit those which have been converted to
20417         unsigned int expressions.
20418
20419         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20420
20421         * codegen.cs: ditto.
20422
20423         * expression.cs (LocalVariableReference): Drop the use of the
20424         Store function that depended on the variable index.
20425
20426         * statement.cs (VariableInfo): Drop the `Idx' property from this
20427         class, as this is not taking into account the indexes for
20428         temporaries tat we generate during the execution, getting the
20429         indexes wrong.
20430
20431         * class.cs: First emit class initializers, then call the parent
20432         constructor. 
20433
20434         * expression.cs (Binary): Fix opcode emision.
20435         (UnaryMutator.EmitCode): Support checked code generation
20436
20437         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20438         matches for events for both the Static and Instance scans,
20439         pointing to the same element.   Fix that.
20440
20441 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20442
20443         * rootcontext.cs (ResolveTree): Always set the
20444         interface_resolve_order, because nested interfaces will be calling
20445         into us.
20446
20447         * class.cs (GetInterfaceOrClass): Track the same resolution
20448         process used by TypeManager.LookupType.  This fixes the nested
20449         type lookups in class declarations (separate path from
20450         LookupType). 
20451
20452         (TypeContainer.DefineType): Also define nested interfaces.
20453         (TypeContainer.RegisterOrder): New public function used to
20454         register the order in which child interfaces need to be closed.
20455
20456         Nested interfaces need to be closed after their parents have been
20457         created. 
20458
20459         * interface.cs (InterfaceAttr): Put all the logic for computing
20460         the interface attribute here. 
20461
20462         (DefineInterface): Register our interface order with the
20463         RootContext or with the TypeContainer depending on the case.
20464
20465 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20466
20467         * cs-parser.jay: rework foreach statement to work with the new
20468         changes to the policy on SimpleNames.
20469
20470         * report.cs: support Stacktrace on warnings as well.
20471
20472         * makefile: drop --unsafe and /unsafe from the compile.
20473
20474 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20475
20476         * ecore.cs (StandardConversionExists): Modify to take an Expression
20477         as the first parameter. Ensure we do null -> reference type conversion
20478         checking.
20479
20480         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20481         temporary Expression objects.
20482
20483 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20484
20485         * interface.cs: workaround bug in method overloading resolution
20486         (there is already a bugzilla bug for it).
20487
20488 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20489
20490         We could also solve this problem by having a separate path for
20491         performing type lookups, instead of DoResolve, we could have a
20492         ResolveType entry point, and only participating pieces of the
20493         production (simplename, deref, array) would implement this. 
20494
20495         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20496         signal SimpleName to only resolve type names and not attempt to
20497         resolve anything else.
20498
20499         * expression.cs (Cast): Set the flag.
20500
20501         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20502
20503         * class.cs: Only report 108 if there is no `new' modifier.
20504
20505         * cs-parser.jay: rework foreach statement to work with the new
20506         changes to the policy on SimpleNames.
20507
20508         * report.cs: support Stacktrace on warnings as well.
20509
20510         * makefile: drop --unsafe and /unsafe from the compile.
20511
20512 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20513
20514         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20515         lookups here, instead of doing that at parse time.  This means
20516         that our grammar will not introduce `LocalVariableReferences' as
20517         expressions at this point.  That solves the problem of code like
20518         this:
20519
20520         class X {
20521            static void Main ()
20522            { int X = 1;
20523             { X x = null }}}
20524
20525         This is only half the fix.  The full fix requires parameters to
20526         also be handled in this way.
20527
20528         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20529         makes the use more obvious of the DeclSpace.  The
20530         ec.TypeContainer.TypeBuilder is now only used to pull the
20531         TypeBuilder for it.
20532
20533         My theory is that I can get rid of the TypeBuilder completely from
20534         the EmitContext, and have typecasts where it is used (from
20535         DeclSpace to where it matters).  
20536
20537         The only pending problem is that the code that implements Aliases
20538         is on TypeContainer, and probably should go in DeclSpace.
20539
20540         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20541         lookups here, instead of doing that at parse time.  This means
20542         that our grammar will not introduce `LocalVariableReferences' as
20543         expressions at this point.  That solves the problem of code like
20544         this:
20545
20546         class X {
20547            static void Main ()
20548            { int X = 1;
20549             { X x = null }}}
20550
20551         This is only half the fix.  The full fix requires parameters to
20552         also be handled in this way.
20553
20554         * class.cs (Property.DefineMethod): When implementing an interface
20555         method, set newslot, when implementing an abstract method, do not
20556         set the flag (before we tried never setting it, or always setting
20557         it, which is the difference).
20558         (Indexer.DefineMethod): same.
20559         (Method.DefineMethod): same.
20560
20561         * ecore.cs: Only set the status used flag if we get back a Field.
20562
20563         * attribute.cs: Temporary hack, so Paolo can keep working.
20564
20565 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20566
20567         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20568         the unmanaged type in the case we have a MarshalAs attribute.
20569
20570         (Resolve): Handle the case when we are parsing the special MarshalAs
20571         attribute [we need to store the unmanaged type to use later]
20572
20573         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20574         MarshalAs Attribute.
20575
20576         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20577         on parameters and accordingly set the marshalling info.
20578
20579 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20580
20581         * class.cs: Optimizing slightly by removing redundant code after
20582         we switched to the `NoTypes' return value.
20583         (Property.DefineMethod): use NoTypes here too.
20584
20585         This fixes the bug I introduced in my last batch of changes.
20586
20587 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20588
20589         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20590
20591         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20592         Enums since those are types too. 
20593
20594         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20595
20596         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20597         thanks to a call during the lookup process.
20598
20599 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20600
20601         * statement.cs (Foreach): Lots of work to accomodate a particular
20602         kind of foreach statement that I had not kept in mind.  It is
20603         possible to have foreachs on classes that provide a GetEnumerator
20604         method that return objects that implement the "pattern" for using
20605         a foreach, there is no need to support GetEnumerator
20606         specifically. 
20607
20608         This is needed to compile nant.
20609
20610         * decl.cs: Only report 114 if the member is not `Finalize' and if
20611         the warning level is at least 2.
20612
20613         * class.cs: Moved the compare function from Method to
20614         MethodSignature. 
20615
20616         (MethodSignature.InheritableMemberSignatureCompare): Add new
20617         filter function that is used to extract inheritable methods from a
20618         class. 
20619
20620         (Method.Define): Use the new `inheritable_method_signature_filter'
20621         delegate
20622
20623         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20624         command. 
20625
20626 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20629
20630         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20631
20632         * expression.cs: Pass location information to
20633         ConvertImplicitStandard. 
20634
20635         * class.cs: Added debugging code to track return values from
20636         interfaces. 
20637
20638 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20639
20640         * expression.cs (Is.DoResolve): If either side of the `is' is an
20641         interface, do not flag the warning.
20642
20643         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20644         for interfaces
20645
20646         * report.cs: Allow for --fatal to be used with --probe.
20647
20648         * typemanager.cs (NoTypes): Move the definition for the empty Type
20649         array here. 
20650
20651         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20652         properties. 
20653         (TypeContainer.DefineProxy): New function used to proxy to parent
20654         implementations when implementing interfaces.
20655         (TypeContainer.ParentImplements): used to lookup if our parent
20656         implements a public function that is required by an interface.
20657         (TypeContainer.VerifyPendingMethods): Hook this up.
20658
20659         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20660         `modules' and `assemblies' arraylists into arrays.  We only grow
20661         these are the very early start up of the program, so this improves
20662         the speedof LookupType (nicely measured).
20663
20664         * expression.cs (MakeByteBlob): Replaced unsafe code with
20665         BitConverter, as suggested by Paolo.
20666
20667         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20668         folding of string concatenation, but if either side is a string,
20669         and the other is not, then return null, and let the runtime use
20670         the concatenation on the string plus the object (using
20671         `Object.ToString'). 
20672
20673 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20674
20675         Constant Folding has been implemented now.
20676
20677         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20678         the error instead on types that are not supported in one's
20679         complement. 
20680
20681         * constant.cs (Constant and all children): New set of functions to
20682         perform implict and explicit conversions.
20683
20684         * ecore.cs (EnumConstant): Implement the new functions to perform
20685         conversion by proxying to the child expression.
20686
20687         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20688         own separate setting that can not be turned off from the command
20689         line using --unchecked or --checked and is only controlled using
20690         the checked/unchecked statements and expressions.  This setting is
20691         used by the constant folder to flag errors.
20692
20693         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20694         ConstantCheckState as well.   
20695
20696         During Resolve, they also have to flag the state, because the
20697         constant folder runs completely in the Resolve phase.
20698
20699         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20700         well.
20701
20702 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * cfold.cs: New file, this file contains the constant folder.
20705
20706         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20707         argument to track whether we are using the resulting address to
20708         load or store a value and provide better error messages. 
20709
20710         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20711         new AddressOf arguments.
20712
20713         * statement.cs (Foreach.EmitCollectionForeach): Update
20714
20715         * expression.cs (Argument.Emit): Call AddressOf with proper
20716         arguments to track usage.
20717
20718         (New.DoEmit): Call AddressOf with new arguments.
20719
20720         (Unary.Emit): Adjust AddressOf call.
20721
20722 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20723
20724         * cs-parser.jay (member_access): Change the case for pre-defined types
20725         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20726         this suggestion.
20727
20728         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20729         a method body.
20730
20731         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20732         essentially like methods and apply attributes like MethodImplOptions to them too.
20733
20734         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20735         not being null.
20736
20737         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20738         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20739         is the DeclSpace.
20740
20741         * Update code everywhere accordingly.
20742
20743         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20744
20745         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20746
20747 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20748
20749         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20750         try performing lookups against those instead of jumping straight into using
20751         the 'using' clauses.
20752
20753         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20754
20755         (LookupType): Perform lookups in implicit parents too.
20756
20757         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20758         sequence as RootContext.LookupType. 
20759
20760         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20761         the various cases of namespace lookups into this method.
20762
20763 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20764
20765         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20766         in positional arguments)
20767
20768         * class.cs (Operator): Update the AllowedModifiers to contain
20769         extern. 
20770
20771         * cs-parser.jay: Update operator declaration to allow for the
20772         operator body to be empty.
20773
20774         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20775         values. 
20776
20777 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * class.cs (Method.Emit): Label parameters.
20780
20781         * driver.cs: Return 1 or 0 as the program exit code.
20782
20783 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20784
20785         * expression.cs: Special case the `null' object when trying to
20786         auto-compute the type, as anything can be explicitly converted to
20787         that. 
20788
20789         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20790         spotting this Paolo.
20791
20792         (Expression.ImplicitNumericConversion): Perform comparissions of
20793         the type using the underlying type in the case of an enumeration
20794         rather than using the enumeration type for the compare.
20795
20796         Cope with the underlying == type case, which is not possible to
20797         catch before. 
20798
20799         (Expression.ConvertNumericExplicit): Perform comparissions of
20800         the type using the underlying type in the case of an enumeration
20801         rather than using the enumeration type for the compare.
20802
20803         * driver.cs: If the user does not supply an extension, assume .exe
20804
20805         * cs-parser.jay (if_statement): Rewrote so that we can track the
20806         location for the if statement.
20807
20808         * expression.cs (Binary.ConstantFold): Only concat strings when
20809         the operation is "+", not everything ;-)
20810
20811         * statement.cs (Statement.EmitBoolExpression): Take a location
20812         argument. 
20813         (If, While, Do): Track location.
20814
20815         * expression.cs (Binary.ResolveOperator): In the object + string
20816         case, I was missing a call to ConvertImplicit
20817
20818 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20819
20820         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20821         Location arguments. Ensure we use RootContext.LookupType to do our work
20822         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20823
20824         * interface.cs (PopulateMethod): Handle the type of the parameter being
20825         null gracefully.
20826
20827         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20828         have a params method with no fixed arguments and a call is made with no
20829         arguments.
20830
20831 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20832
20833         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20834         the verbatim-string-literal
20835
20836         * support.cs (InternalParameters.ParameterModifier): handle null
20837         fixed parameters.
20838         (InternalParameters.ParameterType): ditto.
20839
20840         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20841         duplicating the name of the variable parameter.
20842         (GetParameterByName): Fix bug where we were not looking up array
20843         paramters if they were the only present (thanks Paolo!).
20844         (GetParameterInfo): We only have an empty set of types if both
20845         fixed and array are set to null.
20846         (GetParameterInfo-idx): Handle FixedParameter == null
20847
20848         * cs-parser.jay: Handle the case where there is no catch
20849         statements (missing null test).
20850
20851 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * driver.cs (MainDriver): Be conservative on our command line
20854         handling.
20855
20856         Catch DirectoryNotFoundException when calling GetFiles.
20857
20858         (SplitPathAndPattern): Used to split the input specification into
20859         a path and a pattern that we can feed to Directory.GetFiles.
20860
20861 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20862
20863         * statement.cs (Fixed): Implement the last case of the Fixed
20864         statement (string handling).
20865
20866         * expression.cs (StringPtr): New class used to return a char * to
20867         a string;  Used by the Fixed statement.
20868
20869         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20870
20871         * expression.cs (Binary.ResolveOperator): Remove redundant
20872         MemberLookup pn parent type.
20873         Optimize union call, we do not need a union if the types are the same.
20874         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20875         type.
20876
20877         Specialize the use of MemberLookup everywhere, instead of using
20878         the default settings. 
20879
20880         (StackAlloc): Implement stackalloc keyword.
20881
20882         * cs-parser.jay: Add rule to parse stackalloc.
20883
20884         * driver.cs: Handle /h, /help, /?
20885
20886         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20887         before we supported unsafe code.
20888
20889         * makefile: add --unsafe to the self compilation of mcs.
20890
20891 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20892
20893         * expression.cs (PointerArithmetic): New class that is used to
20894         perform pointer arithmetic.
20895         (Binary.Resolve): Handle pointer arithmetic
20896         Handle pointer comparission.
20897         (ArrayPtr): Utility expression class that is used to take the
20898         address of an array.
20899
20900         (ElementAccess): Implement array access for pointers
20901
20902         * statement.cs (Fixed): Implement fixed statement for arrays, we
20903         are missing one more case before we are done.
20904
20905         * expression.cs (Indirection): Implement EmitAssign and set the
20906         ExprClass to Variable.  This allows pointer dereferences to be
20907         treated as variables, and to have values assigned to them.
20908
20909         * ecore.cs (Expression.StoreFromPtr): New utility function to
20910         store values dereferencing.
20911
20912 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20913
20914         * expression.cs (Binary.ResolveOperator): Ensure that we are
20915         not trying to operate on a void type - this fixes the reported
20916         bug.
20917
20918         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20919         the parent implementation is sealed.
20920
20921         * ../errors/cs0239.cs : Add.
20922
20923         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20924
20925         * typemanager.cs (unverifiable_code_type): Corresponds to 
20926         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20927         which have unsafe code in them.
20928
20929         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20930         unsafe context.
20931
20932 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * cs-tokenizer.cs: Add support for @"litreal strings"
20935
20936         Make tokenizer accept pre-processor directives
20937         on any column (remove the old C-like limitation). 
20938
20939         * rootcontext.cs (EmitCode): Emit any global attributes.
20940         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20941
20942         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20943
20944         * cs-parser.jay: Add support for global attributes.  
20945
20946 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20947
20948         * expression.cs (Indirection): New helper class.  Unary will
20949         create Indirection classes to be able to implement the
20950         IMemoryLocation interface on it.
20951
20952 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20953
20954         * cs-parser.jay (fixed_statement): reference the right statement.
20955
20956         * statement.cs (Fixed.Emit): Finish implementing the fixed
20957         statement for the &x case.
20958
20959 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20960
20961         * class.cs (Property.Define, Method.Define): Remove newslot when
20962         `implementing'.  
20963
20964         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20965         wrong.  NewSlot should only be used if the `new' keyword is present.
20966
20967         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20968         locating our system dir.  Sorry about this.
20969
20970 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * driver.cs (GetSystemDir): Compute correctly the location of our
20973         system assemblies.  I was using the compiler directory instead of
20974         the library directory.
20975
20976 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20977
20978         * expression.cs (BetterFunction): Put back in what Miguel commented out
20979         since it is the correct fix. The problem is elsewhere ;-)
20980
20981         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20982         parameters of the parms method are themselves compatible or not !
20983
20984         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20985         to check that a class implements an interface before saying that an implicit
20986         conversion was allowed. Use ImplementsInterface to do the checking.
20987
20988 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20989
20990         * class.cs (Method.Define): Track whether we are an explicit
20991         implementation or not.  And only call DefineMethodOverride if we
20992         are an explicit implementation.
20993
20994         (Property.DefineMethod): Ditto.
20995
20996 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20997
20998         * expression.cs (BetterFunction): Catch hideous bug which was
20999          preventing us from detecting ambiguous calls due to implicit casts i.e
21000         cs0121.
21001
21002 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * support.cs (Pair): Remove un-needed method.  I figured why I was
21005         getting the error in cs-parser.jay, the variable in a foreach loop
21006         is readonly, and the compiler does not really treat this as a variable.
21007
21008         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21009         instead of EQUALS in grammar.  
21010
21011         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21012
21013         * expression.cs (Unary.DoResolve): Check whether the argument is
21014         managed or not.
21015
21016 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21017
21018         * support.cs: Api for Pair to set a value.  Despite the fact that
21019         the variables are public the MS C# compiler refuses to compile
21020         code that accesses the field if the variable is part of a foreach
21021         statement. 
21022
21023         * statement.cs (Fixed): Begin implementation of the fixed
21024         statement.
21025
21026         (Block.AddVariable): Return the VariableInfo on success and null
21027         on failure instead of true/false. 
21028
21029         * cs-parser.jay (foreach): Catch errors on variables already
21030         defined (we were ignoring this value before) and properly unwind
21031         the block hierarchy
21032
21033         (fixed_statement): grammar for the fixed statement.
21034
21035 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21038         pointer types to be incretemented.
21039
21040         (SizeOf): Implement.
21041
21042         * cs-parser.jay (pointer_member_access): Implement
21043         expr->IDENTIFIER production.
21044
21045         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21046         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21047         on safe contexts.
21048
21049         (Unary): Implement indirection.
21050
21051         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21052         use in non-unsafe context).
21053
21054         (SimpleName.DoResolve): Check for pointers in field access on safe
21055         contexts. 
21056
21057         (Expression.LoadFromPtr): Factor the load-indirect code in this
21058         function.  This was duplicated in UnboxCast and ParameterReference
21059
21060 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21061
21062         * expression.cs (ComposedCast): report an error if a pointer cast
21063         is used in a safe region.
21064
21065         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21066         pointer type casts in unsafe context.
21067
21068         * codegen.cs (EmitContext): Set up IsUnsafe.
21069
21070         * cs-parser.jay (non_expression_type): Add productions for pointer
21071         casts. 
21072
21073         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21074         code.  We should not use force into static mode if the method is
21075         not virtual.  Fixes bug in MIS
21076
21077         * statement.cs (Do.Emit, While.Emit, For.Emit,
21078         Statement.EmitBoolExpression): Add support to Do and While to
21079         propagate infinite loop as `I do return' semantics.
21080
21081         Improve the For case to also test for boolean constants.
21082
21083         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21084         to the list of attributes we can add.
21085
21086         Remove `EmitContext' argument.
21087
21088         * class.cs (Method.Define): Apply parameter attributes.
21089         (Constructor.Define): Apply parameter attributes.
21090         (MethodCore.LabelParameters): Move here the core of labeling
21091         parameters. 
21092
21093         * support.cs (ReflectionParameters.ParameterModifier,
21094         InternalParameters.ParameterModifier): Use IsByRef on the type and
21095         only return the OUT bit for these parameters instead of in/out/ref
21096         flags.
21097
21098         This is because I miss-understood things.  The ParameterInfo.IsIn
21099         and IsOut represent whether the parameter has the [In] and [Out]
21100         attributes set.  
21101
21102 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21103
21104         * ecore.cs (FieldExpr.Emit): Release temporaries.
21105
21106         * assign.cs (LocalTemporary.Release): new function.
21107
21108         * codegen.cs (EmitContext.GetTemporaryStorage,
21109         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21110         temporary storage.  Now we can "put back" localbuilders when we
21111         are done with them
21112
21113 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21114
21115         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21116         need to make a copy of the variable to generate verifiable code.
21117
21118 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21119
21120         * driver.cs: Compute dynamically the system directory.
21121
21122         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21123         Slower, but more generally useful.  Used by the abstract
21124         registering implementation. 
21125
21126         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21127         the rules for the special rule on Type/instances.  First check if
21128         we have the same name, and if so, try that special static path
21129         rather than the instance path.
21130
21131 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21134         for, while and if.
21135
21136         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21137         Enum, ValueType, Delegate or Array for non-corlib compiles.
21138
21139         * cs-tokenizer.cs: Catch long identifiers (645)
21140
21141         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21142         piece of code.
21143
21144         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21145         fix, we were returning too early, so we were not registering
21146         pending methods from abstract classes.
21147
21148         Do not register pending methods if the class is abstract.
21149
21150         * expression.cs (Conditional.DoResolve): Report circular implicit
21151         conversions when we neecd to compute it for conditional
21152         expressions. 
21153
21154         (Is.DoResolve): If the expression is always of the provided type,
21155         flag warning 183.  If the expression can not ever be of the
21156         provided type flag warning 184.
21157
21158         * class.cs: Catch 169 as well.
21159
21160         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21161         read. 
21162
21163 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21164
21165         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21166
21167 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * interface.cs: (PopulateMethod): Check for pointers being defined
21170         only if the unsafe context is active.
21171         (PopulateProperty): ditto.
21172         (PopulateIndexer): ditto.
21173
21174         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21175         specified.  If pointers are present, make sure that they are
21176         present in an unsafe context.
21177         (Constructor, Constructor.Define): ditto.
21178         (Field, Field.Define): ditto.
21179         (Property, Property.Define): ditto.
21180         (Event, Event.Define): ditto.
21181
21182         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21183         hashtable if there are classes or structs defined.
21184
21185         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21186         code, as the constant resolution moved.
21187
21188         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21189         the metadata, so we can flag error 133. 
21190
21191         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21192         pointer is being declared in an unsafe context.
21193
21194 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * modifiers.cs (Modifiers.Check): Require a Location argument.
21197         Report error 227 for Unsafe use.
21198
21199         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21200
21201         * statement.cs (For.Emit): If the test is null, then report that
21202         we do `return', as we wont reach anything afterwards.
21203
21204         (Switch.SwitchGoverningType): Track the expression that matched
21205         the conversion.
21206
21207         * driver.cs: Allow negative numbers as an error code to flag.
21208
21209         * cs-parser.jay: Handle 1551.
21210
21211         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21212
21213 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21214
21215         * cs-parser.jay: Report 1518 (type declaration can only contain
21216         class, struct, interface, enum or delegate)
21217
21218         (switch_label): Report 1523 (keywords `case' or `default' must
21219         preced code)
21220
21221         (opt_switch_sections): Report 1522 (empty switch)
21222
21223         * driver.cs: Report 1515 (response file specified multiple times)
21224         Report 1516 (Source file specified multiple times).
21225
21226         * expression.cs (Argument.Resolve): Signal 1510
21227
21228         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21229         access not allowed in static code)
21230
21231 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21232
21233         * typemanager.cs (IsPointerType): Utility method which we are going
21234         to need a lot.
21235
21236         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21237         the object type, so we take care of that.
21238
21239         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21240
21241         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21242         added to non-params parameters :-)
21243
21244         * typemanager.cs (CSharpName): Include 'void' type too. 
21245
21246         (void_ptr_type): Include in the set of core types.
21247
21248         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21249         duplicating code.
21250
21251         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21252         an unsafe context.
21253
21254         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21255         completely forgotten about it.
21256
21257 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21258
21259         * cs-parser.jay (pointer_type): Add. This begins our implementation
21260         of parsing rules for unsafe code.
21261
21262         (unsafe_statement): Implement.
21263
21264         (embedded_statement): Modify to include the above.
21265
21266         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21267
21268         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21269         if the current context is an unsafe one.
21270
21271         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21272         are handled differently, we need separate rules for them.
21273
21274         (local_variable_declaration): Update to use local_variable_pointer_type
21275         to allow variable declarations of unmanaged pointer types.
21276
21277         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21278         in unsafe contexts.
21279
21280         * ../errors/cs0214.cs : Add.
21281
21282 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21283
21284         * makefile: remove 'response' file when cleaning.
21285
21286 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21287
21288         * cs-parser.jay: Report 1524.
21289
21290 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21291
21292         * typemanager.cs (RegisterMethod): drop checking if we have
21293         registered this from here
21294
21295 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * class.cs (Method.EmitDestructor): Implement calling our base
21298         destructor. 
21299
21300         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21301         value of InFinally.
21302
21303         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21304         this routine and will wrap the call in a try/catch block.  Deal
21305         with the case.
21306
21307 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * ecore.cs (Expression.MemberLookup): instead of taking a
21310         parameter `same_type' that was used to tell whether we could
21311         access private members we compute our containing type from the
21312         EmitContext.
21313
21314         (FieldExpr): Added partial support for volatile fields.  This does
21315         not work for volatile fields exposed from assemblies, as I can not
21316         figure out how to extract the modreq from it.
21317
21318         Updated all the source files to use this.
21319
21320         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21321         because it is referenced by MemberLookup very often. 
21322
21323 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21324
21325         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21326         TypeBuilder.GetCustomAttributes to retrieve what we need.
21327
21328         Get rid of redundant default_member_attr_type as this is the same as
21329         default_member_type which already exists.
21330
21331         * interface.cs, attribute.cs : Update accordingly.
21332
21333 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21334
21335         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21336         work for TYpeBuilders though.  Ravi, can you please fix this?
21337
21338         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21339
21340         * expression.cs (Argument.Emit): Handle the case of ref objects
21341         being passed to ref functions;  
21342
21343         (ParameterReference.EmitLoad): Loads the content of the pointer
21344         without dereferencing.
21345
21346 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21347
21348         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21349
21350 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21351
21352         * class.cs (Indexer.DefineMethod): Incorporate the interface
21353         type in the name of the method if we are doing explicit interface
21354         implementation.
21355
21356         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21357
21358         (BetterConversion): Fix extremely trivial bug where we were referring to
21359         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21360         again !
21361
21362         * ../errors/bug16.cs : Add although we have fixed it.
21363
21364 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21365
21366         * expression.cs (BaseIndexer): Begin implementation.
21367
21368         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21369
21370         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21371         production directly to remove a shift/reduce, and implement
21372         explicit interface implementation.
21373
21374         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21375         after a floating point suffix.
21376
21377         * expression.cs (DoNumericPromotions): Improved the conversion for
21378         uint/uint.  If we have a constant, we avoid doing a typecast to a
21379         larger type.
21380
21381         * class.cs (Indexer): Implement explicit interface implementation
21382         for indexers.
21383
21384 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21385
21386         * class.cs: make the default instance constructor public and hidebysig.
21387
21388 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21389
21390         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21391         so we can call it from elsewhere.
21392
21393         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21394         we emit it internally if the class has a defined indexer; otherwise the user
21395         emits it by decorating the class definition with the DefaultMemberAttribute.
21396
21397         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21398         attribute is not used on a type which defines an indexer.
21399
21400         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21401         character when we skip whitespace.
21402
21403         * ../errors/cs0646.cs : Add.
21404
21405 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21406
21407         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21408         again. 
21409
21410         * makefile: Add practical target `mcs3.exe' which builds the third
21411         generation compiler. 
21412
21413         * expression.cs (New): Fix structures constructor calling.
21414
21415         * class.cs (Property, Method, Indexer): Emit Final flag on the
21416         method if we are an interface implementation and we are not
21417         abstract. 
21418
21419         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21420         whether this property is referencing a `base' method.
21421
21422         * expression.cs (Invocation.EmitCall): take an extra argument:
21423         is_base, this is used to determine whether the `call' or
21424         `callvirt' opcode should be used.
21425
21426
21427         * delegate.cs: update EmitCall.
21428
21429         * class.cs (Method.Define): Set NewSlot for the cases where we are
21430         not implementing an interface method.
21431
21432         (Property.Define): ditto.
21433
21434 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21435
21436         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21437         'r'.  Allows mcs to parse itself fully.
21438
21439 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21440
21441         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21442         of the number of initializers that require the InitializeArray method.
21443
21444         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21445         update the above field where necessary.
21446
21447         (MakeByteBlob): Update accordingly.
21448
21449         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21450         greater than 2.
21451
21452         (EmitDynamicInitializers): Update in accordance with the new optimization.
21453
21454         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21455         same OpCode applies.
21456
21457         * cs-parser.jay : Fix some glaring errors I introduced.
21458
21459 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21460
21461         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21462         so that we can check for name clashes there too.
21463
21464         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21465         for interface indexers.
21466
21467         * interfaces.cs (Define): Emit the default member attribute.
21468
21469         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21470         variable was being referred to while setting the value ;-)
21471
21472 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21475         byte-by-byte information when we know the data is zero.
21476
21477         Make the block always a multiple of 4, because
21478         DefineInitializedData has a bug.
21479
21480         * assign.cs: Fix, we should assign from the temporary, not from
21481         the source. 
21482
21483         * expression.cs (MakeByteBlob): Fix my incorrect code.
21484
21485 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21486
21487         * typemanager.cs (EnumToUnderlying): This function is used to get
21488         the underlying type from an enumeration, because it does not
21489         always work. 
21490
21491         * constant.cs: Use the I4_S form for values between -128 and 127.
21492
21493         * statement.cs (Block.LookupLabel): Looks up a label.
21494         (Block): Drop support for labeled blocks.
21495
21496         (LabeledStatement): New kind of statement that represents a label
21497         only.
21498
21499         (Goto): Finally implement this bad boy.
21500
21501         * cs-parser.jay: Update to reflect new mechanism to implement
21502         labels.
21503
21504 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21505
21506         * codegen.cs (EmitContext.This): a codegen property that keeps the
21507         a single instance of this instead of creating many different this
21508         instances. 
21509
21510         * delegate.cs (Delegate.DoResolve): Update to use the property;
21511
21512         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21513
21514         * expression.cs (BaseAccess.DoResolve): Ditto.
21515
21516 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21517
21518         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21519         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21520
21521         (InitCoreTypes): Update accordingly.
21522
21523         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21524         so we can quickly store the state.
21525
21526         (ApplyAttributes): Set the correct implementation flags
21527         for InternalCall methods.
21528
21529 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21530
21531         * expression.cs (EmitCall): if a method is not virtual, then do
21532         not use callvirt on it.
21533
21534         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21535         user defined stuff) requires the use of stobj, which takes an
21536         address on the stack instead of an array and an index.  So emit
21537         the Ldelema operation for it.
21538
21539         (EmitStoreOpcode): Use stobj for valuetypes.
21540
21541         (UnaryMutator.EmitCode): Use the right 1 value depending on
21542         whether we are dealing with int64/uint64, float or doubles.
21543
21544         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21545         constructors that I implemented last night.
21546
21547         (Constructor.IsDefault): Fix to work properly for static
21548         constructors.
21549
21550         * cs-parser.jay (CheckDef): report method signature errors.
21551         Update error number 103 to be 132.
21552
21553         * decl.cs: New AdditionResult enumeration value: MethodExists.
21554         Although we do this check for methods later on in the semantic
21555         analysis, catching repeated default constructors is so easy that
21556         we catch these here. 
21557
21558         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21559         promotions code.
21560
21561         (ParameterReference.EmitAssign, Emit): handle
21562         bools as bytes.
21563
21564         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21565         (ArrayAccess.EmitStoreOpcode): ditto.
21566
21567         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21568
21569         * expression.cs (MakeByteBlob): Complete all the missing types
21570         (uint, short, ushort, byte, sbyte)
21571
21572         * class.cs: Only init instance field initializers on instance
21573         constructors. 
21574
21575         Rename `constructors' to instance_constructors. 
21576
21577         (TypeContainer.AddConstructor): Only add constructors to the list
21578         if it is not static.
21579
21580         Make sure that we handle default_static_constructor independently
21581         everywhere where we handle instance_constructors
21582
21583 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21584
21585         * class.cs: Do not lookup or create a base initializer for a
21586         static constructor.
21587
21588         (ConstructorInitializer.Resolve): use the proper type to lookup
21589         for constructors.
21590
21591         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21592
21593         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21594         in DeclSpace. 
21595
21596         * decl.cs: CloseType is now an virtual method, the default
21597         implementation just closes this type.
21598
21599 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21600
21601         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21602         to PreserveSig by default. Also emit HideBySig on such methods.
21603
21604         Basically, set the defaults to standard values.
21605
21606         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21607         argument, if candidate is better, it can't be worse than the best !
21608
21609         (Invocation): Re-write bits to differentiate between methods being
21610         applicable in their expanded form and their normal form - for params
21611         methods of course.
21612
21613         Get rid of use_standard everywhere as only standard conversions are allowed
21614         in overload resolution. 
21615
21616         More spec conformance.
21617
21618 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * driver.cs: Add --timestamp, to see where the compiler spends
21621         most of its time.
21622
21623         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21624         `this' in static code.
21625
21626         (SimpleName.DoResolve): Implement in terms of a helper function
21627         that allows static-references to be passed upstream to
21628         MemberAccess.
21629
21630         (Expression.ResolveWithSimpleName): Resolve specially simple
21631         names when called by MemberAccess to implement the special
21632         semantics. 
21633
21634         (Expression.ImplicitReferenceConversion): Handle conversions from
21635         Null to reference types before others, as Null's type is
21636         System.Object. 
21637
21638         * expression.cs (Invocation.EmitCall): Handle the special case of
21639         calling methods declared on a reference type from a ValueType
21640         (Base classes System.Object and System.Enum)
21641
21642         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21643         the left hand side is a TypeExpr, not on every enumeration. 
21644
21645         (Binary.Resolve): If types are reference types, then do a cast to
21646         object on operators != and == of both arguments.
21647
21648         * typemanager.cs (FindMembers): Extract instance and static
21649         members if requested.
21650
21651         * interface.cs (PopulateProperty): Use void_type instead of null
21652         as the return type for the setter method.
21653
21654         (PopulateIndexer): ditto.
21655
21656 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21657
21658         * support.cs (ReflectionParameters): Fix minor bug where we
21659         were examining the wrong parameter for the ParamArray attribute.
21660
21661         Cope with requests for the type of the parameter at position
21662         greater than the params parameter's. We now return the element
21663         type of the params array as that makes more sense.
21664
21665         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21666         accordingly as we no longer have to extract the element type
21667         ourselves.
21668
21669         (Invocation.OverloadResolve): Update.
21670
21671 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21674         against IEnumerator, test whether the return value is a descendant
21675         of the IEnumerator interface.
21676
21677         * class.cs (Indexer.Define): Use an auxiliary method to implement
21678         the other bits of the method definition.  Begin support for
21679         explicit interface implementation.
21680
21681         (Property.DefineMethod): Use TypeManager.void_type instead of null
21682         for an empty return value.
21683
21684 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21685
21686         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21687         dealing with a FieldExpr which is composed of a FieldBuilder, in
21688         the code path we did extract the constant, but we should have
21689         obtained the underlying value to be able to cast it (otherwise we
21690         end up in an infinite loop, this is what Ravi was running into).
21691
21692         (ArrayCreation.UpdateIndices): Arrays might be empty.
21693
21694         (MemberAccess.ResolveMemberAccess): Add support for section
21695         14.5.4.1 that deals with the special case of E.I when E is a type
21696         and something else, that I can be a reference to a static member.
21697
21698         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21699         handle a particular array type to create byte blobs, it is just
21700         something we dont generate byteblobs for.
21701
21702         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21703         arguments. 
21704
21705         * location.cs (Push): remove the key from the hashtable that we
21706         are about to add.   This happens for empty files.
21707
21708         * driver.cs: Dispose files after we have parsed them.
21709
21710         (tokenize): new function that only runs the tokenizer on its
21711         input, for speed testing.
21712
21713 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21714
21715         * class.cs (Event.Define): Define the private field only if there
21716         are no accessors defined.
21717
21718         * expression.cs (ResolveMemberAccess): If there is no associated
21719         field with the event, that means we have an event defined with its
21720         own accessors and we should flag error cs0070 since transforming
21721         ourselves into a field is not valid in that case.
21722
21723         * ecore.cs (SimpleName.DoResolve): Same as above.
21724
21725         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21726         and charset to sane values.
21727
21728 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21729
21730         * assign.cs (DoResolve): Perform check on events only if they 
21731         are being accessed outside the declaring type.
21732
21733         * cs-parser.jay (event_declarations): Update rules to correctly
21734         set the type of the implicit parameter etc.
21735
21736         (add_accessor, remove_accessor): Set current local parameters.
21737
21738         * expression.cs (Binary): For delegate addition and subtraction,
21739         cast the return value from the method into the appropriate delegate
21740         type.
21741
21742 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21743
21744         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21745         of these as the workaround is unnecessary.
21746
21747         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21748         delegate data - none of that is needed at all.
21749
21750         Re-write bits to extract the instance expression and the delegate method
21751         correctly.
21752
21753         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21754         on delegates too.
21755
21756         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21757         of attaching attributes instead of duplicating code everywhere.
21758
21759         * everywhere : Update code to do attribute emission using the above method.
21760
21761 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21762
21763         * expression.cs (IsParamsMethodApplicable): if there are not
21764         parameters, return immediately.
21765
21766         * ecore.cs: The 0 literal can be implicity converted to an enum
21767         type. 
21768
21769         (SimpleName.DoResolve): First lookup the type, then lookup the
21770         members. 
21771
21772         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21773         want to get its address.  If the InstanceExpression is not
21774         addressable, store the result in a temporary variable, then get
21775         the address of it.
21776
21777         * codegen.cs: Only display 219 errors on warning level or above. 
21778
21779         * expression.cs (ArrayAccess): Make it implement the
21780         IMemoryLocation interface.
21781
21782         (Binary.DoResolve): handle the operator == (object a, object b)
21783         and operator != (object a, object b) without incurring into a
21784         BoxedCast (because 5 != o should never be performed).
21785
21786         Handle binary enumerator operators.
21787
21788         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21789         value type, otherwise use Ldelem_ref.
21790
21791         Use precomputed names;
21792
21793         (AddressOf): Implement address of
21794
21795         * cs-parser.jay (labeled_statement): Fix recursive block
21796         addition by reworking the production.
21797
21798         * expression.cs (New.DoEmit): New has a special case:
21799                 
21800                  If we are dealing with a ValueType, we have a few
21801                  situations to deal with:
21802                 
21803                     * The target of New is a ValueType variable, that is
21804                       easy, we just pass this as the variable reference
21805                 
21806                     * The target of New is being passed as an argument,
21807                       to a boxing operation or a function that takes a
21808                       ValueType.
21809                 
21810                       In this case, we need to create a temporary variable
21811                       that is the argument of New.
21812
21813
21814 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21815
21816         * rootcontext.cs (LookupType): Check that current_type is not null before
21817         going about looking at nested types.
21818
21819         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21820         not implement the IAssignMethod interface any more.
21821
21822         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21823         where we tranform them into FieldExprs if they are being resolved from within
21824         the declaring type.
21825
21826         * ecore.cs (SimpleName.DoResolve): Do the same here.
21827
21828         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21829
21830         * ../errors/bug10.cs : Add.
21831
21832         * ../errors/cs0070.cs : Add.
21833
21834         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21835
21836         * assign.cs : Get rid of EventIsLocal everywhere.
21837
21838 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21839
21840         * ecore.cs (ConvertIntLiteral): finished the implementation.
21841
21842         * statement.cs (SwitchLabel): Convert the value we are using as a
21843         key before looking up the table.
21844
21845 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * codegen.cs (EmitTopBlock): Require a Location argument now.
21848
21849         * cs-parser.jay (constructor_declarator): We need to setup
21850         current_local_parameters before we parse the
21851         opt_constructor_initializer, to allow the variables to be bound
21852         to the constructor arguments.
21853
21854         * rootcontext.cs (LookupType): First lookup nested classes in our
21855         class and our parents before we go looking outside our class.
21856
21857         * expression.cs (ConstantFold): Extract/debox the values at the
21858         beginnning. 
21859
21860         * rootcontext.cs (EmitCode): Resolve the constants first before we
21861         resolve the types.  This is not really needed, but it helps debugging.
21862
21863         * statement.cs: report location.
21864
21865         * cs-parser.jay: pass location to throw statement.
21866
21867         * driver.cs: Small bug fix.
21868
21869         * report.cs: Updated format to be 4-zero filled digits.
21870
21871 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21872
21873         * expression.cs (CheckIndices): Fix minor bug where the wrong
21874         variable was being referred to ;-)
21875
21876         (DoEmit): Do not call EmitStaticInitializers when the 
21877         underlying type is System.Object.
21878
21879 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21880
21881         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21882         and do the usual workaround for SRE.
21883
21884         * class.cs (MyEventBuilder.EventType): New member to get at the type
21885         of the event, quickly.
21886
21887         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21888
21889         * assign.cs (Assign.DoResolve): Handle the case when the target
21890         is an EventExpr and perform the necessary checks.
21891
21892         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21893         interface.
21894
21895         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21896
21897         (EventExpr): Set the type in the constructor itself since we 
21898         are meant to be born fully resolved.
21899
21900         (EventExpr.Define): Revert code I wrote earlier.
21901                 
21902         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21903         instance expression is null. The instance expression is a This in that case
21904         or a null, depending on whether it is a static method or not.
21905
21906         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21907         refers to more than one method.
21908
21909         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21910         and accordingly flag errors.
21911
21912 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21913
21914         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21915
21916 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21917
21918         * location.cs (ToString): Provide useful rutine.
21919
21920 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21921
21922         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21923         objects, return the actual integral boxed.
21924
21925         * statement.cs (SwitchLabel): define an ILLabel for each
21926         SwitchLabel. 
21927
21928         (Switch.CheckSwitch): If the value is a Literal, extract
21929         the underlying literal.
21930
21931         Also in the unused hashtable we had, add the SwitchLabel so we can
21932         quickly look this value up.
21933
21934         * constant.cs: Implement a bunch of new constants.  Rewrite
21935         Literal based on this.  Made changes everywhere to adapt to this.
21936
21937         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21938         dereferencing array only once, and also copes with enumrations.
21939
21940         bytes are two bytes wide, not one.
21941
21942         (Cast): Perform constant conversions.
21943
21944         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21945         wrappers to the literals here.
21946
21947         * expression.cs (DoNumericPromotions): long literals can converted
21948         to ulong implicity (this is taken care of elsewhere, but I was
21949         missing this spot).
21950
21951         * ecore.cs (Expression.Literalize): Make the return type Literal,
21952         to improve type checking.
21953
21954         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21955
21956 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21957
21958         * literal.cs: Revert code from ravi that checked the bounds.  The
21959         bounds are sane by the definition of the type itself. 
21960
21961         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21962         need to actually look up in our parent hierarchy for interfaces
21963         implemented. 
21964
21965         * const.cs: Use the underlying type for enumerations
21966
21967         * delegate.cs: Compute the basename for the delegate creation,
21968         that should fix the delegate test case, and restore the correct
21969         Type Lookup semantics in rootcontext
21970
21971         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21972         referencing a nested type with the Reflection API is using the "+"
21973         sign. 
21974
21975         * cs-parser.jay: Do not require EOF token at the end.
21976
21977 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21978
21979         * rootcontext.cs (LookupType): Concatenate type names with
21980         a '.' instead of a '+' The test suite passes again.
21981
21982         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21983         field of the enumeration.
21984
21985         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21986         the case when the member is an EventExpr.
21987
21988         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21989         static has an associated instance expression.
21990
21991         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21992
21993         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21994
21995         * class.cs (Event.Define): Register event and perform appropriate checks
21996         for error #111.
21997
21998         We define the Add and Remove methods even if the use provides none because
21999         in that case, we provide default implementations ourselves.
22000
22001         Define a private field of the type of the event. This is done by the CSC compiler
22002         and we should be doing it too ;-)
22003
22004         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22005         More methods we use in code we generate.
22006
22007         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22008         is important.
22009
22010         (InitCoreTypes): Update accordingly for the above.
22011
22012         * class.cs (Event.Emit): Generate code for default accessors that we provide
22013
22014         (EmitDefaultMethod): Do the job in the above.
22015
22016         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22017         appropriate place.
22018
22019 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22020
22021         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22022         builders even if we were missing one.
22023
22024         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22025         pass the Basename as our class name instead of the Name.  The
22026         basename will be correctly composed for us.
22027
22028         * parameter.cs (Paramters): Now takes a Location argument.
22029
22030         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22031         make all the code call directly LookupType in RootContext and take
22032         this chance to pass the Location information everywhere.
22033
22034         * Everywhere: pass Location information.
22035
22036 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22037
22038         * class.cs (Constructor.Define): Updated way of detecting the
22039         length of the parameters.
22040
22041         (TypeContainer.DefineType): Use basename as the type name for
22042         nested types.
22043
22044         (TypeContainer.Define): Do not recursively define types here, as
22045         definition is taken care in order by the RootContext.
22046
22047         * tree.cs: Keep track of namespaces in a per-file basis.
22048
22049         * parameter.cs (Parameter.ComputeSignature): Update to use
22050         DeclSpace. 
22051
22052         (Parameters.GetSignature): ditto.
22053
22054         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22055         instead of a TypeContainer.
22056
22057         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22058         resolve names.  Because we need to be resolve in our context, not
22059         our parents.
22060
22061         * driver.cs: Implement response files.
22062
22063         * class.cs (TypeContainer.DefineType): If we are defined, do not
22064         redefine ourselves.
22065
22066         (Event.Emit): Emit the code for add/remove handlers.
22067         (Event.Define): Save the MethodBuilders for add/remove.
22068
22069         * typemanager.cs: Use pair here too.
22070
22071         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22072         DictionaryEntry requires the first argument to be non-null.  
22073
22074         (enum_declaration): Compute full name for registering the
22075         enumeration.
22076
22077         (delegate_declaration): Instead of using
22078         formal_parameter_list, use opt_formal_parameter_list as the list
22079         can be empty.
22080
22081         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22082         (EventParsing): New property that controls whether `add' and
22083         `remove' are returned as tokens or identifiers (for events);
22084
22085 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22086
22087         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22088         use MyEventBuilder only and let it wrap the real builder for us.
22089
22090         (MyEventBuilder): Revamp constructor etc.
22091
22092         Implement all operations that we perform on EventBuilder in precisely the same
22093         way here too.
22094
22095         (FindMembers): Update to use the EventBuilder member.
22096
22097         (Event.Emit): Update accordingly.
22098
22099 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22100
22101         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22102         by calling the appropriate methods.
22103
22104         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22105         useful.
22106
22107         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22108
22109 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22110
22111         * delegate.cs (Delegate.Populate): Check that the return type
22112         and various parameters types are indeed accessible.
22113
22114         * class.cs (Constructor.Define): Same here.
22115
22116         (Field.Define): Ditto.
22117
22118         (Event.Define): Ditto.
22119
22120         (Operator.Define): Check that the underlying Method defined itself
22121         correctly - so it's MethodBuilder should not be null.
22122
22123         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22124         expression happens to be null.
22125
22126         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22127         members but as of now we don't seem to be able to do anything really useful with it.
22128
22129         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22130         not the EventBuilder.
22131
22132 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22133
22134         * cs-tokenizer.cs: Add support for defines.
22135         Add support for #if, #elif, #else, #endif
22136
22137         (eval_var): evaluates a variable.
22138         (eval): stubbed for evaluating functions.
22139
22140         * cs-parser.jay: Pass the defines information
22141
22142         * driver.cs: Add --define command line option.
22143
22144         * decl.cs: Move MemberCore here.
22145
22146         Make it the base class for DeclSpace.  This allows us to catch and
22147         report 108 and 109 for everything now.
22148
22149         * class.cs (TypeContainer.Define): Extract all the members
22150         before populating and emit the warning 108 (new keyword required
22151         to override) instead of having each member implement this.
22152
22153         (MemberCore.Define): New abstract method, we will be using this in
22154         the warning reporting engine in Populate.
22155
22156         (Operator.Define): Adjust to new MemberCore protocol. 
22157
22158         * const.cs (Const): This does not derive from Expression, it is a
22159         temporary object we use to create fields, it is a MemberCore. 
22160
22161         * class.cs (Method.Define): Allow the entry point to be in a
22162         specific class.
22163
22164         * driver.cs: Rewrite the argument handler to clean it up a bit.
22165
22166         * rootcontext.cs: Made it just an auxiliary namespace feature by
22167         making everything static.
22168
22169         * driver.cs: Adapt code to use RootContext type name instead of
22170         instance variable.
22171
22172         * delegate.cs: Remove RootContext argument.
22173
22174         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22175         argument. 
22176
22177         * class.cs (Event.Define): The lookup can fail.
22178
22179         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22180
22181         * expression.cs: Resolve the this instance before invoking the code.
22182
22183 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22184
22185         * cs-parser.jay: Add a production in element_access that allows
22186         the thing to become a "type" reference.  This way we can parse
22187         things like "(string [])" as a type.
22188
22189         Note that this still does not handle the more complex rules of
22190         casts. 
22191
22192
22193         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22194
22195         * ecore.cs: (CopyNewMethods): new utility function used to
22196         assemble the list of methods from running FindMembers.
22197
22198         (MemberLookup): Rework FindMembers so that 
22199
22200 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22201
22202         * class.cs (TypeContainer): Remove Delegates who fail to be
22203         defined.
22204
22205         * delegate.cs (Populate): Verify that we dont get null return
22206         values.   TODO: Check for AsAccessible.
22207
22208         * cs-parser.jay: Use basename to emit error 574 (destructor should
22209         have the same name as container class), not the full name.
22210
22211         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22212         possible representation.  
22213
22214         Also implements integer type suffixes U and L.
22215
22216 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22217
22218         * expression.cs (ArrayCreation.DoResolve): We need to do the
22219         argument resolution *always*.
22220
22221         * decl.cs: Make this hold the namespace.  Hold the root context as
22222         well.
22223         (LookupType): Move here.
22224
22225         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22226
22227         * location.cs (Row, Name): Fixed the code, it was always returning
22228         references to the first file.
22229
22230         * interface.cs: Register properties defined through interfaces.
22231
22232         * driver.cs: Add support for globbing on the command line
22233
22234         * class.cs (Field): Make it derive from MemberCore as well.
22235         (Event): ditto.
22236
22237 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22238
22239         * class.cs (Event::Define): Check that the type of the event is a delegate
22240         type else flag error #66.
22241
22242         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22243         same.
22244
22245         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22246         values of EntryPoint, CharSet etc etc.
22247
22248         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22249
22250         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22251         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22252         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22253         which needs this to do its work.
22254
22255         * ../errors/cs0066.cs : Add.
22256
22257 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22258
22259         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22260         helper functions.
22261
22262         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22263         clears out the parameters field.
22264         (MemberSignatureCompare): Cleanup
22265
22266         (MemberCore): New base class used to share code between MethodCore
22267         and Property.
22268
22269         (RegisterRequiredImplementations) BindingFlags.Public requires
22270         either BindingFlags.Instace or Static.  Use instance here.
22271
22272         (Property): Refactored code to cope better with the full spec.
22273
22274         * parameter.cs (GetParameterInfo): Return an empty array instead
22275         of null on error.
22276
22277         * class.cs (Property): Abstract or extern properties have no bodies.
22278
22279         * parameter.cs (GetParameterInfo): return a zero-sized array.
22280
22281         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22282         method modifier validation to the typecontainer so we can reuse
22283         this on properties.
22284
22285         (MethodCore.ParameterTypes): return an empty sized array of types.
22286
22287         (Property.Define): Test property modifier validity.
22288
22289         Add tests for sealed/override too.
22290
22291         (Method.Emit): abstract or extern methods have no bodies.
22292
22293 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22294
22295         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22296         thing.
22297
22298         (Method::Define, ::Emit): Modify accordingly.
22299
22300         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22301
22302         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22303
22304         * makefile: Pass in /unsafe.
22305
22306 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22307
22308         * class.cs (MakeKey): Kill routine.
22309
22310         * class.cs (TypeContainer.Define): Correctly define explicit
22311         method implementations (they require the full interface name plus
22312         the method name).
22313
22314         * typemanager.cs: Deply the PtrHashtable here and stop using the
22315         lame keys.  Things work so much better.
22316
22317         This of course broke everyone who depended on `RegisterMethod' to
22318         do the `test for existance' test.  This has to be done elsewhere.
22319
22320         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22321         the object stupid Equals method (because, that like fails all over
22322         the place).  We still do not use it.
22323
22324         * class.cs (TypeContainer.SetRequiredInterface,
22325         TypeContainer.RequireMethods): Killed these two routines and moved
22326         all the functionality to RegisterRequiredImplementations.
22327
22328         (TypeContainer.RegisterRequiredImplementations): This routine now
22329         registers all the implementations required in an array for the
22330         interfaces and abstract methods.  We use an array of structures
22331         which can be computed ahead of time to reduce memory usage and we
22332         also assume that lookups are cheap as most classes will not
22333         implement too many interfaces.
22334
22335         We also avoid creating too many MethodSignatures.
22336
22337         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22338         clear the "pending" bit if we find that there are problems with
22339         the declaration.
22340
22341         (TypeContainer.VerifyPendingMethods): Update to report errors of
22342         methods that look like implementations but are not.
22343
22344         (TypeContainer.Define): Add support for explicit interface method
22345         implementation. 
22346
22347 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22348
22349         * typemanager.cs: Keep track of the parameters here instead of
22350         being a feature of the TypeContainer.
22351
22352         * class.cs: Drop the registration of parameters here, as
22353         InterfaceMethods are also interface declarations.
22354
22355         * delegate.cs: Register methods with the TypeManager not only with
22356         the TypeContainer.  This code was buggy.
22357
22358         * interface.cs: Full registation here.
22359
22360 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22361
22362         * expression.cs: Remove reducer for binary expressions, it can not
22363         be done this way.
22364
22365         * const.cs: Put here the code that used to go into constant.cs
22366
22367         * constant.cs: Put here the code for constants, this is a new base
22368         class for Literals.
22369
22370         * literal.cs: Make Literal derive from Constant.
22371
22372 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22373
22374         * statement.cs (Return.Emit): Report error 157 if the user
22375         attempts to return from a finally block.
22376
22377         (Return.Emit): Instead of emitting a return, jump to the end of
22378         the function.
22379
22380         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22381         LocalBuilder to store the result of the function.  ReturnLabel is
22382         the target where we jump.
22383
22384
22385 2001-12-09  Radek Doulik  <rodo@ximian.com>
22386
22387         * cs-parser.jay: remember alias in current namespace
22388
22389         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22390         namespaces
22391
22392         * class.cs (LookupAlias): lookup alias in my_namespace
22393
22394         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22395         aliases hashtable
22396         (LookupAlias): lookup alias in this and if needed in parent
22397         namespaces
22398
22399 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * support.cs: 
22402
22403         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22404         making things static.  I need this to avoid passing the
22405         TypeContainer when calling ParameterType.
22406
22407         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22408         that did string manipulation to compute the type and then call
22409         GetType.  Use Parameter.ParameterType instead.
22410
22411         * cs-tokenizer.cs: Consume the suffix for floating values.
22412
22413         * expression.cs (ParameterReference): figure out whether this is a
22414         reference parameter or not.  Kill an extra variable by computing
22415         the arg_idx during emission.
22416
22417         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22418         function that returns whether a parameter is an out/ref value or not.
22419
22420         (Parameter.ParameterType): The type of the parameter (base,
22421         without ref/out applied).
22422
22423         (Parameter.Resolve): Perform resolution here.
22424         (Parameter.ExternalType): The full type (with ref/out applied).
22425
22426         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22427         support for expressions on the using statement.
22428
22429 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22430
22431         * statement.cs (Using.EmitLocalVariableDecls): Split the
22432         localvariable handling of the using statement.
22433
22434         (Block.EmitMeta): Keep track of variable count across blocks.  We
22435         were reusing slots on separate branches of blocks.
22436
22437         (Try.Emit): Emit the general code block, we were not emitting it. 
22438
22439         Check the type of the declaration to be an IDisposable or
22440         something that can be implicity converted to it. 
22441
22442         Emit conversions if required.
22443
22444         * ecore.cs (EmptyExpression): New utility class.
22445         (Expression.ImplicitConversionExists): New utility function.
22446
22447 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22448
22449         * statement.cs (Using): Implement.
22450
22451         * expression.cs (LocalVariableReference): Support read only variables.
22452
22453         * statement.cs: Remove the explicit emit for the Leave opcode.
22454         (VariableInfo): Add a readonly field.
22455
22456 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22457
22458         * ecore.cs (ConvCast): new class used to encapsulate the various
22459         explicit integer conversions that works in both checked and
22460         unchecked contexts.
22461
22462         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22463         properly generate the overflow opcodes.
22464
22465 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * statement.cs: The correct type for the EmptyExpression is the
22468         element_type, not the variable type.  Ravi pointed this out.
22469
22470 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22471
22472         * class.cs (Method::Define): Handle PInvoke methods specially
22473         by using DefinePInvokeMethod instead of the usual one.
22474
22475         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22476         above to do the task of extracting information and defining the method.
22477
22478 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22479
22480         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22481         of the condition for string type.
22482
22483         (Emit): Move that here. 
22484
22485         (ArrayCreation::CheckIndices): Keep string literals in their expression
22486         form.
22487
22488         (EmitDynamicInitializers): Handle strings appropriately.
22489
22490 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22491
22492         * codegen.cs (EmitContext): Replace multiple variables with a
22493         single pointer to the current Switch statement.
22494
22495         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22496         EmitContext.
22497
22498 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22499
22500         * statement.cs 
22501
22502         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22503         default'.
22504
22505         (Foreach.Emit): Foreach on arrays was not setting
22506         up the loop variables (for break/continue).
22507
22508         (GotoCase): Semi-implented.
22509
22510 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22511
22512         * attribute.cs (CheckAttribute): Handle system attributes by using
22513         Attribute.GetAttributes to examine information we need.
22514
22515         (GetValidPlaces): Same here.
22516
22517         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22518
22519         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22520
22521         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22522
22523         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22524
22525         (Method::Emit): Handle the case when we are a PInvoke method.
22526
22527 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * expression.cs: Use ResolveWithSimpleName on compound names.
22530
22531 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22532
22533         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22534         before trying to reduce it.
22535
22536         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22537
22538         * constant.cs (LookupConstantValue): Implement.
22539
22540         (EmitConstant): Use the above in emitting the constant.
22541
22542         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22543         that are user-defined by doing a LookupConstantValue on them.
22544
22545         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22546         too, like above.
22547
22548 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22549
22550         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22551
22552         (BaseAccess.DoResolve): Implement.
22553
22554         (MemberAccess.DoResolve): Split this routine into a
22555         ResolveMemberAccess routine that can be used independently
22556
22557 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22558
22559         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22560         As that share bits of the implementation.  Is returns a boolean,
22561         while As returns the Type that is being probed.
22562
22563 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22564
22565         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22566         instead of a Literal - much easier.
22567
22568         (EnumInTransit): Remove - utterly useless :-)
22569
22570         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22571
22572         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22573
22574         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22575         chain when we have no associated expression.
22576
22577 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22578
22579         * constant.cs (Define): Use Location while reporting the errror.
22580
22581         Also emit a warning when 'new' is used and there is no inherited
22582         member to hide.
22583
22584         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22585         populated.
22586
22587         (LookupEnumValue): Implement to lookup an enum member's value and define it
22588         if necessary.
22589
22590         (Populate): Re-write accordingly to use the above routine.
22591
22592 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22593
22594         * expression.cs (This): Fix prototype for DoResolveLValue to
22595         override the base class DoResolveLValue.
22596
22597         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22598         declarations) 
22599
22600         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22601         (we need to load the address of the field here).  This fixes
22602         test-22. 
22603
22604         (FieldExpr.DoResolveLValue): Call the DoResolve
22605         function to initialize the Instance expression.
22606
22607         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22608         correctly the GetEnumerator operation on a value type.
22609
22610         * cs-parser.jay: Add more simple parsing error catches.
22611
22612         * statement.cs (Switch): Add support for string switches.
22613         Handle null specially.
22614
22615         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22616
22617 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22618
22619         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22620
22621         (declare_local_constant): New helper function.
22622
22623         * statement.cs (AddConstant): Keep a separate record of constants
22624
22625         (IsConstant): Implement to determine if a variable is a constant.
22626
22627         (GetConstantExpression): Implement.
22628
22629         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22630
22631         * statement.cs (IsVariableDefined): Re-write.
22632
22633 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22634
22635         * class.cs (TypeContainer::FindMembers): Look for constants
22636         in the case when we are looking for MemberTypes.Field
22637
22638         * expression.cs (MemberAccess::DoResolve): Check that in the
22639         case we are a FieldExpr and a Literal, we are not being accessed
22640         by an instance reference.
22641
22642         * cs-parser.jay (local_constant_declaration): Implement.
22643
22644         (declaration_statement): Implement for constant declarations.
22645
22646 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22647
22648         * statement.cs (Switch): Catch double defaults.
22649
22650         (Switch): More work on the switch() statement
22651         implementation.  It works for integral values now, need to finish
22652         string support.
22653
22654
22655 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22658         integer literals into other integer literals.  To be used by
22659         switch. 
22660
22661 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22662
22663         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22664         some memory.
22665
22666         (EmitDynamicInitializers): Cope with the above since we extract data
22667         directly from ArrayData now.
22668
22669         (ExpectInitializers): Keep track of whether initializers are mandatory
22670         or not.
22671
22672         (Bounds): Make it a hashtable to prevent the same dimension being 
22673         recorded for every element in that dimension.
22674
22675         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22676         from being found.
22677
22678         Also fix bug which was causing the indices to be emitted in the reverse
22679         order.
22680
22681 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22682
22683         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22684         unfinished.  They do not work, because the underlying code is
22685         sloppy.
22686
22687 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22688
22689         * cs-parser.jay: Remove bogus fixme.
22690
22691         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22692         on Switch statement.
22693
22694 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22695
22696         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22697         the same. 
22698
22699         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22700         parameter. Apparently, any expression is allowed. 
22701
22702         (ValidateInitializers): Update accordingly.
22703
22704         (CheckIndices): Fix some tricky bugs thanks to recursion.
22705
22706         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22707         I was being completely brain-dead.
22708
22709         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22710         and re-write acordingly.
22711
22712         (DelegateInvocation): Re-write accordingly.
22713
22714         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22715
22716         (MakeByteBlob): Handle types more correctly.
22717
22718         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22719         initialization from expressions but it is incomplete because I am a complete
22720         Dodo :-|
22721
22722 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22723
22724         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22725         on If.  Basically, we have to return `true' (ie, we do return to
22726         our caller) only if both branches of the if return.
22727
22728         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22729         short-circuit operators, handle them as short circuit operators. 
22730
22731         (Cast.DoResolve): Resolve type.
22732         (Cast.Cast): Take an expression as the target type.
22733
22734         * cs-parser.jay (cast_expression): Remove old hack that only
22735         allowed a limited set of types to be handled.  Now we take a
22736         unary_expression and we resolve to a type during semantic
22737         analysis.
22738
22739         Use the grammar productions from Rhys to handle casts (this is
22740         not complete like Rhys syntax yet, we fail to handle that corner
22741         case that C# has regarding (-x), but we will get there.
22742
22743 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22744
22745         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22746         field which is an array type.
22747
22748         * cs-parser.jay (declare_local_variables): Support array initialization too.
22749
22750         * typemanager.cs (MakeKey): Implement.
22751
22752         (everywhere): Use the above appropriately.
22753
22754         * cs-parser.jay (for_statement): Update for array initialization while
22755         declaring variables.
22756
22757         * ecore.cs : The error message was correct, it's the variable's names that
22758         were misleading ;-) Make the code more readable.
22759
22760         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22761         the correct type etc.
22762
22763         (ConvertExplicit): Handle Enum types by examining the underlying type.
22764
22765 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22766
22767         * parameter.cs (GetCallingConvention): Always return
22768         CallingConventions.Standard for now.
22769
22770 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22771
22772         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22773         and `r' after calling DoNumericPromotions.
22774
22775         * ecore.cs: Fix error message (the types were in the wrong order).
22776
22777         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22778         BindingFlags.Instance as well 
22779
22780         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22781         implicit int literal conversion in an empty cast so that we
22782         propagate the right type upstream.
22783
22784         (UnboxCast): new class used to unbox value types.
22785         (Expression.ConvertExplicit): Add explicit type conversions done
22786         by unboxing.
22787
22788         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22789         the target type before applying the implicit LongLiterals to ULong
22790         literal cast.
22791
22792 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22793
22794         * cs-parser.jay (for_statement): Reworked the way For works: now
22795         we declare manually any variables that are introduced in
22796         for_initializer to solve the problem of having out-of-band code
22797         emition (that is what got for broken).
22798
22799         (declaration_statement): Perform the actual variable declaration
22800         that used to be done in local_variable_declaration here.
22801
22802         (local_variable_declaration): Do not declare anything, just pass
22803         the information on a DictionaryEntry
22804
22805 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22806
22807         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22808         re-write of the logic to now make it recursive.
22809
22810         (UpdateIndices): Re-write accordingly.
22811
22812         Store element data in a separate ArrayData list in the above methods.
22813
22814         (MakeByteBlob): Implement to dump the array data into a byte array.
22815
22816 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22817
22818         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22819         into CheckIndices.
22820
22821         * constant.cs (Define): Implement.
22822
22823         (EmitConstant): Re-write fully.
22824
22825         Pass in location info.
22826
22827         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22828         respectively.
22829
22830         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22831         DictionaryEntry since we need location info too.
22832
22833         (constant_declaration): Update accordingly.
22834
22835         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22836         code into another method : UpdateIndices.
22837
22838 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22839
22840         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22841         some type checking etc.
22842
22843 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22844
22845         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22846         bits to provide dimension info if the user skips doing that.
22847
22848         Update second constructor to store the rank correctly.
22849
22850 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22851
22852         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22853         and try to implement.
22854
22855         * ../errors/cs0150.cs : Add.
22856
22857         * ../errors/cs0178.cs : Add.
22858
22859 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22860
22861         * statement.cs: Implement foreach on multi-dimensional arrays. 
22862
22863         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22864         name of the params argument.
22865
22866         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22867         initializing the array.
22868
22869         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22870         we can use this elsewhere.
22871
22872         * statement.cs: Finish implementation of foreach for single
22873         dimension arrays.
22874
22875         * cs-parser.jay: Use an out-of-band stack to pass information
22876         around, I wonder why I need this.
22877
22878         foreach_block: Make the new foreach_block the current_block.
22879
22880         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22881         function used to return a static Parameters structure.  Used for
22882         empty parameters, as those are created very frequently.
22883
22884         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22885
22886 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22887
22888         * interface.cs : Default modifier is private, not public. The
22889         make verify test passes again.
22890
22891 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22892
22893         * support.cs (ReflectionParameters): Fix logic to determine
22894         whether the last parameter is a params one. Test 9 passes again.
22895
22896         * delegate.cs (Populate): Register the builders we define with
22897         RegisterParameterForBuilder. Test 19 passes again.
22898
22899         * cs-parser.jay (property_declaration): Reference $6 instead
22900         of $$ to get at the location.
22901
22902         (indexer_declaration): Similar stuff.
22903
22904         (attribute): Ditto.
22905
22906         * class.cs (Property): Register parameters for the Get and Set methods
22907         if they exist. Test 23 passes again.
22908
22909         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22910         call to EmitArguments as we are sure there aren't any params arguments. 
22911         Test 32 passes again.
22912
22913         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22914         IndexOutOfRangeException. 
22915
22916         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22917         Test 33 now passes again.
22918
22919 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22920
22921         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22922         broke a bunch of things.  Will have to come up with a better way
22923         of tracking locations.
22924
22925         * statement.cs: Implemented foreach for single dimension arrays.
22926
22927 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22928
22929         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22930         an error.  This removes the lookup from the critical path.
22931
22932         * cs-parser.jay: Removed use of temporary_loc, which is completely
22933         broken. 
22934
22935 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22936
22937         * support.cs (ReflectionParameters.ParameterModifier): Report
22938         whether the argument is a PARAMS argument or not.
22939
22940         * class.cs: Set the attribute `ParamArrayAttribute' on the
22941         parameter argument.
22942
22943         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22944         and cons_param_array_attribute (ConstructorInfo for
22945         ParamArrayAttribute)., 
22946
22947         * codegen.cs: Emit the return using the `Return' statement, that
22948         way we can report the error correctly for missing return values. 
22949
22950         * class.cs (Method.Emit): Clean up.
22951
22952         * expression.cs (Argument.Resolve): Take another argument: the
22953         location where this argument is used.  Notice that this is not
22954         part of the "Argument" class as to reduce the size of the
22955         structure (we know the approximate location anyways).
22956
22957         Test if the argument is a variable-reference, if not, then
22958         complain with a 206.
22959
22960         (Argument.Emit): Emit addresses of variables.
22961
22962         (Argument.FullDesc): Simplify.
22963
22964         (Invocation.DoResolve): Update for Argument.Resolve.
22965
22966         (ElementAccess.DoResolve): ditto.
22967
22968         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22969         method should be virtual, as this method is always virtual.
22970
22971         (NewDelegate.DoResolve): Update for Argument.Resolve.
22972
22973         * class.cs (ConstructorInitializer.DoResolve): ditto.
22974
22975         * attribute.cs (Attribute.Resolve): ditto.
22976
22977 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22978
22979         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22980
22981         * expression.cs (ParameterReference): Drop IStackStorage and implement
22982         IAssignMethod instead. 
22983
22984         (LocalVariableReference): ditto.
22985
22986         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22987         IAssignMethod instead. 
22988
22989 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22990
22991         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22992         enumerations that are used in heavily used structures derive from
22993         byte in a laughable and pathetic attempt to reduce memory usage.
22994         This is the kind of pre-optimzations that you should not do at
22995         home without adult supervision.
22996
22997         * expression.cs (UnaryMutator): New class, used to handle ++ and
22998         -- separatedly from the other unary operators.  Cleans up the
22999         code, and kills the ExpressionStatement dependency in Unary.
23000
23001         (Unary): Removed `method' and `Arguments' from this class, making
23002         it smaller, and moving it all to SimpleCall, so I can reuse this
23003         code in other locations and avoid creating a lot of transient data
23004         strucutres when not required.
23005
23006         * cs-parser.jay: Adjust for new changes.
23007
23008 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23009
23010         * enum.cs (Enum.Populate): If there is a failure during
23011         definition, return
23012
23013         * cs-parser.jay (opt_enum_base): we used to catch type errors
23014         here, but this is really incorrect.  The type error should be
23015         catched during semantic analysis.
23016
23017 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23018
23019         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23020         current_local_parameters as expected since I, in my stupidity, had forgotten
23021         to do this :-)
23022
23023         * attribute.cs (GetValidPlaces): Fix stupid bug.
23024
23025         * class.cs (Method::Emit): Perform check on applicability of attributes.
23026
23027         (Constructor::Emit): Ditto.
23028
23029         (Field::Emit): Ditto.
23030
23031         (Field.Location): Store location information.
23032
23033         (Property, Event, Indexer, Operator): Ditto.
23034
23035         * cs-parser.jay (field_declaration): Pass in location for each field.
23036
23037         * ../errors/cs0592.cs : Add.
23038
23039 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23040
23041         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23042
23043         (InitCoreTypes): Update accordingly.
23044
23045         (RegisterAttrType, LookupAttr): Implement.
23046
23047         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23048         info about the same.
23049
23050         (Resolve): Update to populate the above as necessary.
23051
23052         (Error592): Helper.
23053
23054         (GetValidPlaces): Helper to the above.
23055
23056         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23057
23058         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23059
23060 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23061
23062         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23063
23064         * ../errors/cs0617.cs : Add.
23065
23066 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23067
23068         * enum.cs (Emit): Rename to Populate to be more consistent with what
23069         we expect it to do and when exactly it is called.
23070
23071         * class.cs, rootcontext.cs : Update accordingly.
23072
23073         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23074         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23075
23076         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23077
23078         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23079         of a fieldinfo using the above, when dealing with a FieldBuilder.
23080
23081 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23082
23083         * ../errors/cs0031.cs : Add.
23084
23085         * ../errors/cs1008.cs : Add.
23086
23087         * ../errrors/cs0543.cs : Add.
23088
23089         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23090         enum type.
23091
23092         (FindMembers): Implement.
23093
23094         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23095         enums and delegates too.
23096
23097         (enum_types): Rename to builder_to_enum.
23098
23099         (delegate_types): Rename to builder_to_delegate.
23100
23101         * delegate.cs (FindMembers): Implement.
23102
23103 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23104
23105         * typemanager.cs (IsEnumType): Implement.
23106
23107         * enum.cs (Emit): Re-write parts to account for the underlying type
23108         better and perform checking etc.
23109
23110         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23111         of the underlying type.
23112
23113         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23114         value
23115
23116         * enum.cs (error31): Helper to report error #31.
23117
23118         * cs-parser.jay (enum_declaration): Store location of each member too.
23119
23120         * enum.cs (member_to_location): New hashtable. 
23121
23122         (AddEnumMember): Update location hashtable.
23123
23124         (Emit): Use the location of each member while reporting errors.
23125
23126 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23127
23128         * cs-parser.jay: A for_initializer if is a
23129         local_variable_declaration really ammount to have an implicit
23130         block with the variable declaration and no initializer for for.
23131
23132         * statement.cs (For.Emit): Cope with null initializers.
23133
23134         This fixes the infinite loop on for initializers.
23135
23136 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * enum.cs: More cleanup.
23139
23140         * ecore.cs: Remove dead code.
23141
23142         * class.cs (Property.Emit): More simplification.
23143         (Event.Emit): ditto.
23144
23145         Reworked to have less levels of indentation.
23146
23147 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23148
23149         * class.cs (Property): Emit attributes.
23150
23151         (Field): Ditto.
23152
23153         (Event): Ditto.
23154
23155         (Indexer): Ditto.
23156
23157         (Operator): Ditto.
23158
23159         * enum.cs (Emit): Ditto.
23160
23161         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23162         Enums too.
23163
23164         * class.cs (Field, Event, etc.): Move attribute generation into the
23165         Emit method everywhere.
23166
23167         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23168         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23169         as we had no way of defining nested enums !
23170
23171         * rootcontext.cs : Adjust code accordingly.
23172
23173         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23174
23175 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23176
23177         * expression.cs (EvalConstantExpression): Move into ecore.cs
23178
23179         * enum.cs (Enum): Rename some members and make them public and readonly
23180         according to our convention.
23181
23182         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23183         nothing else.
23184
23185         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23186
23187         (Enum::Emit): Write a simple version for now which doesn't try to compute
23188         expressions. I shall modify this to be more robust in just a while.
23189
23190         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23191
23192         (TypeContainer::CloseType): Create the Enum types too.
23193
23194         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23195
23196         * expression.cs (EvalConstantExpression): Get rid of completely.
23197
23198         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23199         user-defined values and other cases.
23200
23201         (IsValidEnumLiteral): Helper function.
23202
23203         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23204         out there in the case we had a literal FieldExpr.
23205
23206         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23207
23208         (Literalize): Revamp a bit to take two arguments.
23209
23210         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23211
23212 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23213
23214         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23215
23216         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23217
23218         (Resolve): Use the above to ensure we have proper initializers.
23219
23220 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23221
23222         * expression.cs (Expression::EvalConstantExpression): New method to 
23223         evaluate constant expressions.
23224
23225         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23226
23227 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23228
23229         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23230         in an array.
23231
23232         (Binary.ResolveOperator): Handle operator != (object a, object b)
23233         and operator == (object a, object b);
23234
23235         (Binary.DoNumericPromotions): Indicate whether the numeric
23236         promotion was possible.
23237
23238         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23239         Implement.  
23240
23241         Made the ArrayAccess implement interface IAssignMethod instead of
23242         IStackStore as the order in which arguments are passed reflects
23243         this.
23244
23245         * assign.cs: Instead of using expr.ExprClass to select the way of
23246         assinging, probe for the IStackStore/IAssignMethod interfaces.
23247
23248         * typemanager.cs: Load InitializeArray definition.
23249
23250         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23251         static data that can be used to initialize arrays. 
23252
23253 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23254
23255         * expression.cs: Handle operator== and operator!= for booleans.
23256
23257         (Conditioal.Reduce): Implement reducer for the ?: operator.
23258
23259         (Conditional.Resolve): Implement dead code elimination.
23260
23261         (Binary.Resolve): Catch string literals and return a new
23262         concatenated string.
23263
23264         (Unary.Reduce): Implement reduction of unary expressions.
23265
23266         * ecore.cs: Split out the expression core handling here.
23267
23268         (Expression.Reduce): New method used to perform constant folding
23269         and CSE.  This is needed to support constant-expressions. 
23270
23271         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23272         targets, and optimize for !x.
23273
23274 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23275
23276         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23277         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23278         set custom atttributes.
23279
23280         * literal.cs (Literal::GetValue): New abstract method to return the actual
23281         value of the literal, cast as an object.
23282
23283         (*Literal): Implement GetValue method.
23284
23285         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23286         expressions to the arraylist but objects of type Argument.
23287
23288         * class.cs (TypeContainer::Emit): Emit our attributes too.
23289
23290         (Method::Emit, Constructor::Emit): Ditto.
23291
23292         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23293         to be ignoring earlier.
23294
23295 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23296
23297         * attribute.cs (AttributeSection::Define): Implement to do the business
23298         of constructing a CustomAttributeBuilder.
23299
23300         (Attribute): New trivial class. Increases readability of code.  
23301
23302         * cs-parser.jay : Update accordingly.
23303
23304         (positional_argument_list, named_argument_list, named_argument): New rules
23305
23306         (attribute_arguments): Use the above so that we are more correct.
23307
23308 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23309
23310         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23311         to perform all checks for a method with a params parameter.
23312
23313         (Invocation::OverloadResolve): Update to use the above method and therefore
23314         cope correctly with params method invocations.
23315
23316         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23317         params too.
23318
23319         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23320         constructors in our parent too because we can't afford to miss out on 
23321         protected ones ;-)
23322
23323         * attribute.cs (AttributeSection): New name for the class Attribute
23324
23325         Other trivial changes to improve readability.
23326
23327         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23328         use the new class names.
23329
23330 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23331
23332         * class.cs (Method::Define): Complete definition for params types too
23333
23334         (Indexer::Define): Ditto.
23335
23336         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23337         Cope everywhere with a request for info about the array parameter.
23338
23339 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23340
23341         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23342
23343         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23344         local_variable_type to extract the string corresponding to the type.
23345
23346         (local_variable_type): Fixup the action to use the new helper method.
23347
23348         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23349         go.
23350
23351         * expression.cs : Clean out code which uses the above.
23352
23353 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23354
23355         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23356         and bale out if necessary by returning a false.
23357
23358         (RegisterProperty): Ditto.
23359
23360         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23361         and print out appropriate error messages.
23362
23363         * interface.cs (everywhere): Ditto.
23364
23365         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23366         location to constructor.
23367
23368         * class.cs (Property, Event, Indexer): Update accordingly.
23369
23370         * ../errors/cs111.cs : Added.
23371
23372         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23373         of a method, as laid down by the spec.
23374
23375         (Invocation::OverloadResolve): Use the above method.
23376
23377 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23378
23379         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23380         now take a TypeContainer and a Parameters object.
23381
23382         (ParameterData): Modify return type of ParameterModifier method to be 
23383         Parameter.Modifier and not a string.
23384
23385         (ReflectionParameters, InternalParameters): Update accordingly.
23386
23387         * expression.cs (Argument::GetParameterModifier): Same here.
23388
23389         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23390         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23391         symbol in it at all so maybe this is only for now.
23392
23393 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23394
23395         * support.cs (InternalParameters): Constructor now takes an extra argument 
23396         which is the actual Parameters class.
23397
23398         (ParameterDesc): Update to provide info on ref/out modifiers.
23399
23400         * class.cs (everywhere): Update call to InternalParameters to pass in
23401         the second argument too.
23402
23403         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23404         to return the modifier info [ref/out etc]
23405
23406         (InternalParameters, ReflectionParameters): Implement the above.
23407
23408         * expression.cs (Argument::ParameterModifier): Similar function to return
23409         info about the argument's modifiers.
23410
23411         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23412         too.
23413
23414         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23415         a new SetFormalParameters object which we pass to InternalParameters.
23416
23417 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23418
23419         * expression.cs (NewArray): Merge into the ArrayCreation class.
23420
23421 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23422
23423         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23424         NewUserdefinedArray into one as there wasn't much of a use in having
23425         two separate ones.
23426
23427         * expression.cs (Argument): Change field's name to ArgType from Type.
23428
23429         (Type): New readonly property which returns the proper type, taking into 
23430         account ref/out modifiers.
23431
23432         (everywhere): Adjust code accordingly for the above.
23433
23434         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23435         whether we are emitting for a ref or out parameter.
23436
23437         * expression.cs (Argument::Emit): Use the above field to set the state.
23438
23439         (LocalVariableReference::Emit): Update to honour the flag and emit the
23440         right stuff.
23441
23442         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23443
23444         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23445
23446         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23447
23448         (ReflectionParameters, InternalParameters): Implement the above method.
23449
23450         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23451         reporting errors.
23452
23453         (Invocation::FullMethodDesc): Ditto. 
23454
23455 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23456
23457         * cs-parser.jay: Add extra production for the second form of array
23458         creation. 
23459
23460         * expression.cs (ArrayCreation): Update to reflect the above
23461         change. 
23462
23463         * Small changes to prepare for Array initialization.
23464
23465 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * typemanager.cs (ImplementsInterface): interface might be null;
23468         Deal with this problem;
23469
23470         Also, we do store negative hits on the cache (null values), so use
23471         this instead of calling t.GetInterfaces on the type everytime.
23472
23473 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23474
23475         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23476
23477         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23478         split functionality out into different classes.
23479
23480         (New::FormArrayType): Move into NewBuiltinArray.
23481
23482         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23483         quite useless.
23484
23485         (NewBuiltinArray): New class to handle creation of built-in arrays.
23486
23487         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23488         account creation of one-dimensional arrays.
23489
23490         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23491
23492         (NewUserdefinedArray::DoResolve): Implement.
23493
23494         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23495
23496         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23497         we maintain inside the TypeManager. This is necessary to perform lookups on the
23498         module builder.
23499
23500         (LookupType): Update to perform GetType on the module builders too.     
23501
23502         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23503
23504         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23505
23506 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23507
23508         * expression.cs (New::DoResolve): Implement guts of array creation.
23509
23510         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23511
23512 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23513
23514         * expression.cs: Fix bug I introduced lsat night that broke
23515         Delegates. 
23516
23517         (Expression.Resolve): Report a 246 error (can not resolve name)
23518         if we find a SimpleName in the stream.
23519
23520         (Expression.ResolveLValue): Ditto.
23521
23522         (Expression.ResolveWithSimpleName): This function is a variant of
23523         ResolveName, this one allows SimpleNames to be returned without a
23524         warning.  The only consumer of SimpleNames is MemberAccess
23525
23526 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23527
23528         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23529         might arrive here.  I have my doubts that this is correct.
23530
23531         * statement.cs (Lock): Implement lock statement.
23532
23533         * cs-parser.jay: Small fixes to support `lock' and `using'
23534
23535         * cs-tokenizer.cs: Remove extra space
23536
23537         * driver.cs: New flag --checked, allows to turn on integer math
23538         checking. 
23539
23540         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23541         Threading.Monitor.Exit 
23542
23543 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23544
23545         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23546         Expression Class to be IndexerAccess.
23547
23548         Notice that Indexer::DoResolve sets the eclass to Value.
23549
23550 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23551
23552         * class.cs (TypeContainer::Emit): Emit code for indexers.
23553
23554         * assign.cs (IAssignMethod): New interface implemented by Indexers
23555         and Properties for handling assignment.
23556
23557         (Assign::Emit): Simplify and reuse code. 
23558
23559         * expression.cs (IndexerAccess, PropertyExpr): Implement
23560         IAssignMethod, clean up old code. 
23561
23562 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23563
23564         * typemanager.cs (ImplementsInterface): New method to determine if a type
23565         implements a given interface. Provides a nice cache too.
23566
23567         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23568         method.
23569
23570         (ConvertReferenceExplicit): Ditto.
23571
23572         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23573         various methods, with correct names etc.
23574
23575         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23576         Operator.UnaryNegation.
23577
23578         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23579         we have a unary plus or minus operator.
23580
23581         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23582         UnaryMinus.
23583
23584         * everywhere : update accordingly.
23585
23586         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23587         respectively.
23588
23589         * class.cs (Method::Define): For the case where we are implementing a method
23590         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23591         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23592
23593 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23594
23595         * interface.cs (FindMembers): Implement to work around S.R.E
23596         lameness.
23597
23598         * typemanager.cs (IsInterfaceType): Implement.
23599
23600         (FindMembers): Update to handle interface types too.
23601
23602         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23603         use IsAssignableFrom as that is not correct - it doesn't work.
23604
23605         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23606         and accordingly override EmitStatement.
23607
23608         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23609         using the correct logic :-)
23610
23611 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23612
23613         * ../errors/cs-11.cs : Add to demonstrate error -11 
23614
23615 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23616
23617         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23618         then pass this as a hint to ResolveLValue.
23619
23620         * expression.cs (FieldExpr): Add Location information
23621
23622         (FieldExpr::LValueResolve): Report assignment to readonly
23623         variable. 
23624
23625         (Expression::ExprClassFromMemberInfo): Pass location information.
23626
23627         (Expression::ResolveLValue): Add new method that resolves an
23628         LValue. 
23629
23630         (Expression::DoResolveLValue): Default invocation calls
23631         DoResolve. 
23632
23633         (Indexers): New class used to keep track of indexers in a given
23634         Type. 
23635
23636         (IStackStore): Renamed from LValue, as it did not really describe
23637         what this did.  Also ResolveLValue is gone from this interface and
23638         now is part of Expression.
23639
23640         (ElementAccess): Depending on the element access type
23641
23642         * typemanager.cs: Add `indexer_name_type' as a Core type
23643         (System.Runtime.CompilerServices.IndexerNameAttribute)
23644
23645         * statement.cs (Goto): Take a location.
23646
23647 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23648
23649         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23650         if two delegates are compatible.
23651
23652         (NewDelegate::DoResolve): Update to take care of the case when
23653         we instantiate a delegate from another delegate.
23654
23655         * typemanager.cs (FindMembers): Don't even try to look up members
23656         of Delegate types for now.
23657
23658 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23659
23660         * delegate.cs (NewDelegate): New class to take care of delegate
23661         instantiation.
23662
23663         * expression.cs (New): Split the delegate related code out into 
23664         the NewDelegate class.
23665
23666         * delegate.cs (DelegateInvocation): New class to handle delegate 
23667         invocation.
23668
23669         * expression.cs (Invocation): Split out delegate related code into
23670         the DelegateInvocation class.
23671
23672 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23673
23674         * expression.cs (New::DoResolve): Implement delegate creation fully
23675         and according to the spec.
23676
23677         (New::DoEmit): Update to handle delegates differently.
23678
23679         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23680         because of which we were printing out arguments in reverse order !
23681
23682         * delegate.cs (VerifyMethod): Implement to check if the given method
23683         matches the delegate.
23684
23685         (FullDelegateDesc): Implement.
23686
23687         (VerifyApplicability): Implement.
23688
23689         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23690         delegate invocations too.
23691
23692         (Invocation::Emit): Ditto.
23693
23694         * ../errors/cs1593.cs : Added.
23695
23696         * ../errors/cs1594.cs : Added.
23697
23698         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23699
23700 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23701
23702         * typemanager.cs (intptr_type): Core type for System.IntPtr
23703
23704         (InitCoreTypes): Update for the same.
23705
23706         (iasyncresult_type, asynccallback_type): Ditto.
23707
23708         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23709         correct.
23710
23711         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23712         too.
23713
23714         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23715         the builders for the 4 members of a delegate type :-)
23716
23717         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23718         type.
23719
23720         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23721
23722         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23723
23724 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23725
23726         * statement.cs (Break::Emit): Implement.   
23727         (Continue::Emit): Implement.
23728
23729         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23730         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23731         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23732         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23733         end loop
23734
23735         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23736         properties that track the label for the current loop (begin of the
23737         loop and end of the loop).
23738
23739 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23740
23741         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23742         use of emitting anything at all.
23743
23744         * class.cs, rootcontext.cs : Get rid of calls to the same.
23745
23746         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23747
23748         (Populate): Define the constructor correctly and set the implementation
23749         attributes.
23750
23751         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23752         have been defined.
23753
23754         (AddDelegateType): Implement.
23755
23756         (IsDelegateType): Implement helper method.
23757
23758         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23759
23760         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23761         and accordingly handle it.
23762
23763         * delegate.cs (Populate): Take TypeContainer argument.
23764         Implement bits to define the Invoke method. However, I still haven't figured out
23765         how to take care of the native int bit :-(
23766
23767         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23768         Qualify the name of the delegate, not its return type !
23769
23770         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23771         conversion.
23772
23773         (StandardConversionExists): Checking for array types turns out to be recursive.
23774
23775         (ConvertReferenceExplicit): Implement array conversion.
23776
23777         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23778
23779 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23780
23781         * cs-parser.jay (delegate_declaration): Store the fully qualified
23782         name as it is a type declaration.
23783
23784         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23785         readonly.
23786
23787         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23788         as TypeContainer::DefineType.
23789
23790         (Populate): Method in which all the definition of the various methods (Invoke)
23791         etc is done.
23792
23793         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23794         see.
23795
23796         (CloseDelegate): Finally creates the delegate.
23797
23798         * class.cs (TypeContainer::DefineType): Update to define delegates.
23799         (Populate, Emit and CloseType): Do the same thing here too.
23800
23801         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23802         delegates in all these operations.
23803
23804 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23805
23806         * expression.cs: LocalTemporary: a new expression used to
23807         reference a temporary that has been created.
23808
23809         * assign.cs: Handle PropertyAccess back here, so that we can
23810         provide the proper semantic access to properties.
23811
23812         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23813         a few more explicit conversions. 
23814
23815         * modifiers.cs: `NEW' modifier maps to HideBySig.
23816
23817         * expression.cs (PropertyExpr): Make this into an
23818         ExpressionStatement, and support the EmitStatement code path. 
23819
23820         Perform get/set error checking, clean up the interface.
23821
23822         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23823         them into toplevel access objects.
23824
23825 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23826
23827         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23828         SRE.
23829
23830         * typemanager.cs: Keep track here of our PropertyBuilders again to
23831         work around lameness in SRE.
23832
23833 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23834
23835         * expression.cs (LValue::LValueResolve): New method in the
23836         interface, used to perform a second resolution pass for LValues. 
23837
23838         (This::DoResolve): Catch the use of this in static methods.
23839
23840         (This::LValueResolve): Implement.
23841
23842         (This::Store): Remove warning, assigning to `this' in structures
23843         is 
23844
23845         (Invocation::Emit): Deal with invocation of
23846         methods on value types.  We need to pass the address to structure
23847         methods rather than the object itself.  (The equivalent code to
23848         emit "this" for structures leaves the entire structure on the
23849         stack instead of a pointer to it). 
23850
23851         (ParameterReference::DoResolve): Compute the real index for the
23852         argument based on whether the method takes or not a `this' pointer
23853         (ie, the method is static).
23854
23855         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23856         value types returned from functions when we need to invoke a
23857         method on the sturcture.
23858
23859
23860 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23861
23862         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23863         defining the type in the Modulebuilder or Typebuilder. This is to take
23864         care of nested types which need to be defined on the TypeBuilder using
23865         DefineNestedMethod.
23866
23867         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23868         methods in RootContext, only ported to be part of TypeContainer.
23869
23870         (TypeContainer::GetInterfaceOrClass): Ditto.
23871
23872         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23873
23874         * interface.cs (Interface::DefineInterface): New method. Does exactly
23875         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23876         too.
23877
23878         (Interface::GetInterfaces): Move from RootContext here and port.
23879
23880         (Interface::GetInterfaceByName): Same here.
23881
23882         * rootcontext.cs (ResolveTree): Re-write.
23883
23884         (PopulateTypes): Re-write.
23885
23886         * class.cs (TypeContainer::Populate): Populate nested types too.
23887         (TypeContainer::Emit): Emit nested members too.
23888
23889         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23890         instead just use the name argument passed in as it is already fully
23891         qualified.
23892
23893         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23894         to TypeContainer mapping to see if a type is user-defined.
23895
23896         * class.cs (TypeContainer::CloseType): Implement. 
23897
23898         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23899         the default constructor.
23900
23901         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23902         twice.
23903
23904         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23905
23906         * interface.cs (CloseType): Create the type here.
23907
23908         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23909         the hierarchy.
23910
23911         Remove all the methods which are now in TypeContainer.
23912
23913 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23914
23915         * delegate.cs (Define): Re-write bits to define the delegate
23916         correctly.
23917
23918 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23919
23920         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23921
23922         * expression.cs (ImplicitReferenceConversion): handle null as well
23923         as a source to convert to any reference type.
23924
23925         * statement.cs (Return): Perform any implicit conversions to
23926         expected return type.  
23927
23928         Validate use of return statement.  
23929
23930         * codegen.cs (EmitContext): Pass the expected return type here.
23931
23932         * class.cs (Method, Constructor, Property): Pass expected return
23933         type to EmitContext.
23934
23935 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23936
23937         * expression.cs: Make DoResolve take an EmitContext instead of a
23938         TypeContainer.
23939
23940         Replaced `l' and `location' for `loc', for consistency.
23941
23942         (Error, Warning): Remove unneeded Tc argument.
23943
23944         * assign.cs, literal.cs, constant.cs: Update to new calling
23945         convention. 
23946
23947         * codegen.cs: EmitContext now contains a flag indicating whether
23948         code is being generated in a static method or not.
23949
23950         * cs-parser.jay: DecomposeQI, new function that replaces the old
23951         QualifiedIdentifier.  Now we always decompose the assembled
23952         strings from qualified_identifier productions into a group of
23953         memberaccesses.
23954
23955 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23956
23957         * rootcontext.cs: Deal with field-less struct types correctly now
23958         by passing the size option to Define Type.
23959
23960         * class.cs: Removed hack that created one static field. 
23961
23962 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23963
23964         * statement.cs: Moved most of the code generation here. 
23965
23966 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23967
23968         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23969         seem very right.
23970
23971         (ElementAccess): Remove useless bits for now - keep checks as the spec
23972         says.
23973
23974 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23975
23976         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23977         and start performing checks according to the spec.
23978
23979 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23980
23981         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23982         rank_specifiers instead.
23983
23984         (rank_specifiers): Change the order in which the rank specifiers are stored
23985
23986         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23987
23988         * expression.cs (ElementAccess): Implement the LValue interface too.
23989
23990 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23991
23992         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23993         except that user defined conversions are not included.
23994
23995         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23996         perform the conversion of the return type, if necessary.
23997
23998         (New::DoResolve): Check whether we are creating an array or an object
23999         and accordingly do the needful.
24000
24001         (New::Emit): Same here.
24002
24003         (New::DoResolve): Implement guts of array creation.
24004
24005         (New::FormLookupType): Helper function.
24006
24007 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24008
24009         * codegen.cs: Removed most of the code generation here, and move the
24010         corresponding code generation bits to the statement classes. 
24011
24012         Added support for try/catch/finalize and throw.
24013
24014         * cs-parser.jay: Added support for try/catch/finalize.
24015
24016         * class.cs: Catch static methods having the flags override,
24017         virtual or abstract.
24018
24019         * expression.cs (UserCast): This user cast was not really doing
24020         what it was supposed to do.  Which is to be born in fully resolved
24021         state.  Parts of the resolution were being performed at Emit time! 
24022
24023         Fixed this code.
24024
24025 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24026
24027         * expression.cs: Implicity convert the result from UserCast.
24028
24029 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24030
24031         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24032         prevented it from working correctly. 
24033
24034         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24035         merely ConvertImplicit.
24036
24037 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24038
24039         * typemanager.cs: Make the LookupTypeContainer function static,
24040         and not per-instance.  
24041
24042         * class.cs: Make static FindMembers (the one that takes a Type
24043         argument). 
24044
24045         * codegen.cs: Add EmitForeach here.
24046
24047         * cs-parser.jay: Make foreach a toplevel object instead of the
24048         inline expansion, as we need to perform semantic analysis on it. 
24049
24050 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24051
24052         * expression.cs (Expression::ImplicitUserConversion): Rename to
24053         UserDefinedConversion.
24054
24055         (Expression::UserDefinedConversion): Take an extra argument specifying 
24056         whether we look for explicit user conversions too.
24057
24058         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24059
24060         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24061
24062         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24063         with the appropriate arguments.
24064
24065         * cs-parser.jay (cast_expression): Record location too.
24066
24067         * expression.cs (Cast): Record location info.
24068
24069         (Expression::ConvertExplicit): Take location argument.
24070
24071         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24072         to determine if we are doing explicit conversions.
24073
24074         (UserCast::Emit): Update accordingly.
24075
24076         (Expression::ConvertExplicit): Report an error if everything fails.
24077
24078         * ../errors/cs0030.cs : Add.
24079
24080 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24081
24082         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24083         virtual and newslot bits. 
24084
24085         * class.cs (TypeContainer::RegisterRequiredImplementations):
24086         Record methods we need.
24087
24088         (TypeContainer::MakeKey): Helper function to make keys for
24089         MethodBases, since the Methodbase key is useless.
24090
24091         (TypeContainer::Populate): Call RegisterRequiredImplementations
24092         before defining the methods.   
24093
24094         Create a mapping for method_builders_to_methods ahead of time
24095         instead of inside a tight loop.
24096
24097         (::RequireMethods):  Accept an object as the data to set into the
24098         hashtable so we can report interface vs abstract method mismatch.
24099
24100 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24101
24102         * report.cs: Make all of it static.
24103
24104         * rootcontext.cs: Drop object_type and value_type computations, as
24105         we have those in the TypeManager anyways.
24106
24107         Drop report instance variable too, now it is a global.
24108
24109         * driver.cs: Use try/catch on command line handling.
24110
24111         Add --probe option to debug the error reporting system with a test
24112         suite. 
24113
24114         * report.cs: Add support for exiting program when a probe
24115         condition is reached.
24116
24117 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24118
24119         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24120         we do a forcible conversion regardless of type, to check if 
24121         ForceConversion returns a null.
24122
24123         (Binary::error19): Use location to report error.
24124
24125         (Unary::error23): Use location here too.
24126
24127         * ../errors/cs0019.cs : Check in.
24128
24129         * ../errors/cs0023.cs : Check in.
24130
24131         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24132         case of a non-null MethodInfo object with a length of 0 !
24133
24134         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24135         an applicable member - according to the spec :-)
24136         Also fix logic to find members in base types.
24137
24138         (Unary::ResolveOperator): Same here.
24139
24140         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24141         as I was getting thoroughly confused between this and error19 :-)
24142
24143         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24144         (::FindMostEncompassedType): Implement.
24145         (::FindMostEncompassingType): Implement.
24146         (::StandardConversionExists): Implement.
24147
24148         (UserImplicitCast): Re-vamp. We now need info about most specific
24149         source and target types so that we can do the necessary conversions.
24150
24151         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24152         mathematical union with no duplicates.
24153
24154 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24155
24156         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24157         in order from base classes to child classes, so that we can in
24158         child classes look up in our parent for method names and
24159         attributes (required for handling abstract, virtual, new, override
24160         constructs: we need to instrospect our base class, and if we dont
24161         populate the classes in order, the introspection might be
24162         incorrect.  For example, a method could query its parent before
24163         the parent has any methods and would determine that the parent has
24164         no abstract methods (while it could have had them)).
24165
24166         (RootContext::CreateType): Record the order in which we define the
24167         classes.
24168
24169 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24170
24171         * class.cs (TypeContainer::Populate): Also method definitions can
24172         fail now, keep track of this.
24173
24174         (TypeContainer::FindMembers): Implement support for
24175         DeclaredOnly/noDeclaredOnly flag.
24176
24177         (Constructor::Emit) Return the ConstructorBuilder.
24178
24179         (Method::Emit) Return the MethodBuilder. 
24180         Check for abstract or virtual methods to be public.
24181
24182         * rootcontext.cs (RootContext::CreateType): Register all the
24183         abstract methods required for the class to be complete and the
24184         interface methods that must be implemented. 
24185
24186         * cs-parser.jay: Report error 501 (method requires body if it is
24187         not marked abstract or extern).
24188
24189         * expression.cs (TypeOf::Emit): Implement.
24190
24191         * typemanager.cs: runtime_handle_type, new global type.
24192
24193         * class.cs (Property::Emit): Generate code for properties.
24194
24195 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24196
24197         * expression.cs (Unary::ResolveOperator): Find operators on base type
24198         too - we now conform exactly to the spec.
24199
24200         (Binary::ResolveOperator): Same here.
24201
24202         * class.cs (Operator::Define): Fix minor quirk in the tests.
24203
24204         * ../errors/cs0215.cs : Added.
24205
24206         * ../errors/cs0556.cs : Added.
24207
24208         * ../errors/cs0555.cs : Added.
24209
24210 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24211
24212         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24213         single integer which is really efficient
24214
24215 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24216
24217         *  expression.cs (Expression::ImplicitUserConversion): Use location
24218         even in the case when we are examining True operators.
24219  
24220         * class.cs (Operator::Define): Perform extensive checks to conform
24221         with the rules for operator overloading in the spec.
24222
24223         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24224         some of the other conversions mentioned in the spec.
24225
24226         * typemanager.cs (array_type): New static member for the System.Array built-in
24227         type.
24228
24229         (cloneable_interface): For System.ICloneable interface.
24230
24231         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24232         we start resolving the tree and populating types.
24233
24234         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24235  
24236 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24237
24238         * expression.cs (Expression::ExprClassFromMemberInfo,
24239         Expression::Literalize): Create literal expressions from
24240         FieldInfos which are literals.
24241
24242         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24243         type casts, because they were wrong.  The test suite in tests
24244         caught these ones.
24245
24246         (ImplicitNumericConversion): ushort to ulong requires a widening
24247         cast. 
24248
24249         Int32 constant to long requires widening cast as well.
24250
24251         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24252         for integers because the type on the stack is not i4.
24253
24254 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24255
24256         * expression.cs (report118): require location argument. 
24257
24258         * parameter.cs: Do not dereference potential null value.
24259
24260         * class.cs: Catch methods that lack the `new' keyword when
24261         overriding a name.  Report warnings when `new' is used without
24262         anything being there to override.
24263
24264         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24265
24266         * class.cs: Only add constructor to hashtable if it is non-null
24267         (as now constructors can fail on define).
24268
24269         (TypeManager, Class, Struct): Take location arguments.
24270
24271         Catch field instance initialization in structs as errors.
24272
24273         accepting_filter: a new filter for FindMembers that is static so
24274         that we dont create an instance per invocation.
24275
24276         (Constructor::Define): Catch errors where a struct constructor is
24277         parameterless 
24278
24279         * cs-parser.jay: Pass location information for various new
24280         constructs. 
24281
24282         * delegate.cs (Delegate): take a location argument.
24283
24284         * driver.cs: Do not call EmitCode if there were problesm in the
24285         Definition of the types, as many Builders wont be there. 
24286
24287         * decl.cs (Decl::Decl): Require a location argument.
24288
24289         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24290         into integers, and find the most appropiate integer for it.
24291
24292         * literal.cs: Implement ULongLiteral.
24293
24294         * rootcontext.cs: Provide better information about the location of
24295         failure when CreateType fails.
24296
24297 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24298
24299         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24300         as well.
24301
24302         * expression.cs (Binary::CheckShiftArguments): Add missing type
24303         computation.
24304         (Binary::ResolveOperator): Add type to the logical and and logical
24305         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24306         before.
24307
24308         (Binary::DoNumericPromotions): In the case where either argument
24309         is ulong (and most signed types combined with ulong cause an
24310         error) perform implicit integer constant conversions as well.
24311
24312 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24313
24314         * expression.cs (UserImplicitCast): Method should always be
24315         non-null. 
24316         (Invocation::BetterConversion): Simplified test for IntLiteral.
24317
24318         (Expression::ImplicitNumericConversion): Split this routine out.
24319         Put the code that performs implicit constant integer conversions
24320         here. 
24321
24322         (Expression::Resolve): Become a wrapper around DoResolve so we can
24323         check eclass and type being set after resolve.
24324
24325         (Invocation::Badness): Remove this dead function
24326
24327         (Binary::ResolveOperator): Do not compute the expensive argumnets
24328         unless we have a union for it.
24329
24330         (Probe::Emit): Is needs to do an isinst and then
24331         compare against null.
24332
24333         (::CanConvert): Added Location argument.  If the Location argument
24334         is null (Location.Null), then we do not report errors.  This is
24335         used by the `probe' mechanism of the Explicit conversion.  We do
24336         not want to generate an error for something that the user
24337         explicitly requested to be casted.  But the pipeline for an
24338         explicit cast first tests for potential implicit casts.
24339
24340         So for now, if the Location is null, it means `Probe only' to
24341         avoid adding another argument.   Might have to revise this
24342         strategy later.
24343
24344         (ClassCast): New class used to type cast objects into arbitrary
24345         classes (used in Explicit Reference Conversions).
24346
24347         Implement `as' as well.
24348
24349         Reverted all the patches from Ravi below: they were broken:
24350
24351                 * The use of `level' as a mechanism to stop recursive
24352                   invocations is wrong.  That was there just to catch the
24353                   bug with a strack trace but not as a way of addressing
24354                   the problem.
24355
24356                   To fix the problem we have to *understand* what is going
24357                   on and the interactions and come up with a plan, not
24358                   just get things going.
24359
24360                 * The use of the type conversion cache that I proposed
24361                   last night had an open topic: How does this work across
24362                   protection domains.  A user defined conversion might not
24363                   be public in the location where we are applying the
24364                   conversion, a different conversion might be selected
24365                   (ie, private A->B (better) but public B->A (worse),
24366                   inside A, A->B applies, but outside it, B->A will
24367                   apply).
24368
24369                 * On top of that (ie, even if the above is solved),
24370                   conversions in a cache need to be abstract.  Ie, `To
24371                   convert from an Int to a Short use an OpcodeCast', not
24372                   `To convert from an Int to a Short use the OpcodeCast on
24373                   the variable 5' (which is what this patch was doing).
24374
24375 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24376
24377         * expression.cs (Invocation::ConversionExists): Re-write to use
24378         the conversion cache
24379
24380         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24381         cache all conversions done, not just user-defined ones.
24382
24383         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24384         to determine if a conversion exists instead of acutually trying to 
24385         perform the conversion. It's faster too.
24386
24387         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24388         and only then attempt the implicit conversion.
24389
24390 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24391
24392         * expression.cs (ConvertImplicit): Use a cache for conversions
24393         already found. Check level of recursion and bail out if necessary.
24394
24395 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24396
24397         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24398         Export standard methods that we expect for string operations.
24399
24400         * statement.cs (Block::UsageWarning): Track usage of variables and
24401         report the errors for not used variables.
24402
24403         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24404         operator. 
24405
24406 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24407
24408         * codegen.cs: remove unnneded code 
24409
24410         * expression.cs: Removed BuiltinTypeAccess class
24411
24412         Fix the order in which implicit conversions are
24413         done.  
24414
24415         The previous fixed dropped support for boxed conversions (adding a
24416         test to the test suite now)
24417
24418         (UserImplicitCast::CanConvert): Remove test for source being null,
24419         that code is broken.  We should not feed a null to begin with, if
24420         we do, then we should track the bug where the problem originates
24421         and not try to cover it up here.
24422
24423         Return a resolved expression of type UserImplicitCast on success
24424         rather than true/false.  Ravi: this is what I was talking about,
24425         the pattern is to use a static method as a "constructor" for
24426         objects. 
24427
24428         Also, do not create arguments until the very last minute,
24429         otherwise we always create the arguments even for lookups that
24430         will never be performed. 
24431
24432         (UserImplicitCast::Resolve): Eliminate, objects of type
24433         UserImplicitCast are born in a fully resolved state. 
24434
24435         * typemanager.cs (InitCoreTypes): Init also value_type
24436         (System.ValueType). 
24437
24438         * expression.cs (Cast::Resolve): First resolve the child expression.
24439
24440         (LValue): Add new method AddressOf to be used by
24441         the `&' operator.  
24442
24443         Change the argument of Store to take an EmitContext instead of an
24444         ILGenerator, because things like FieldExpr need to be able to call
24445         their children expression to generate the instance code. 
24446
24447         (Expression::Error, Expression::Warning): Sugar functions for
24448         reporting errors.
24449
24450         (Expression::MemberLookup): Accept a TypeContainer instead of a
24451         Report as the first argument.
24452
24453         (Expression::ResolvePrimary): Killed.  I still want to improve
24454         this as currently the code is just not right.
24455
24456         (Expression::ResolveMemberAccess): Simplify, but it is still
24457         wrong. 
24458
24459         (Unary::Resolve): Catch errors in AddressOf operators.
24460
24461         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24462         index to a byte for the short-version, or the compiler will choose
24463         the wrong Emit call, which generates the wrong data.
24464
24465         (ParameterReference::Emit, ::Store): same.
24466
24467         (FieldExpr::AddressOf): Implement.
24468
24469         * typemanager.cs: TypeManager: made public variable instead of
24470         property.
24471
24472         * driver.cs: document --fatal.
24473
24474         * report.cs (ErrorMessage, WarningMessage): new names for the old
24475         Error and Warning classes.
24476
24477         * cs-parser.jay (member_access): Turn built-in access to types
24478         into a normal simplename
24479
24480 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24481
24482         * expression.cs (Invocation::BetterConversion): Fix to cope
24483         with q being null, since this was introducing a bug.
24484
24485         * expression.cs (ConvertImplicit): Do built-in conversions first.
24486
24487 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24488
24489         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24490
24491 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24492
24493         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24494         I had introduced long ago (what's new ?).
24495
24496         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24497         the work of all the checking. 
24498         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24499         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24500
24501         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24502         that is the right way. 
24503
24504         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24505         overloading resolution. Use everywhere instead of cutting and pasting code.
24506
24507         (Binary::ResolveOperator): Use MakeUnionSet.
24508
24509         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24510         we have to convert to bool types. Not complete yet.
24511
24512 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24513
24514         * typemanager.cs (TypeManager::CSharpName): support ushort.
24515
24516         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24517         to provide an expression that performsn an implicit constant int
24518         conversion (section 6.1.6).
24519         (Expression::ConvertImplicitRequired): Reworked to include
24520         implicit constant expression conversions.
24521
24522         (Expression::ConvertNumericExplicit): Finished.
24523
24524         (Invocation::Emit): If InstanceExpression is null, then it means
24525         that we perform a call on this.
24526
24527 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24528
24529         * expression.cs (Unary::Emit): Remove some dead code.
24530         (Probe): Implement Resolve and Emit for `is'.
24531         (Expression::ConvertImplicitRequired): Attempt to do constant
24532         expression conversions here.  Maybe should be moved to
24533         ConvertImplicit, but I am not sure.
24534         (Expression::ImplicitLongConstantConversionPossible,
24535         Expression::ImplicitIntConstantConversionPossible): New functions
24536         that tell whether is it possible to apply an implicit constant
24537         expression conversion.
24538
24539         (ConvertNumericExplicit): Started work on explicit numeric
24540         conversions.
24541
24542         * cs-parser.jay: Update operator constants.
24543
24544         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24545         (Parameters::GetSignature): Hook up VerifyArgs here.
24546         (Parameters::VerifyArgs): Verifies that no two arguments have the
24547         same name. 
24548
24549         * class.cs (Operator): Update the operator names to reflect the
24550         ones that the spec expects (as we are just stringizing the
24551         operator names).
24552
24553         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24554         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24555         previous usage did only work for our methods.
24556         (Expression::ConvertImplicit): Handle decimal implicit numeric
24557         conversions as well.
24558         (Expression::InternalTypeConstructor): Used to invoke constructors
24559         on internal types for default promotions.
24560
24561         (Unary::Emit): Implement special handling for the pre/post
24562         increment/decrement for overloaded operators, as they need to have
24563         the same semantics as the other operators.
24564
24565         (Binary::ResolveOperator): ditto.
24566         (Invocation::ConversionExists): ditto.
24567         (UserImplicitCast::Resolve): ditto.
24568
24569 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24570
24571         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24572         operator, return after emitting body. Regression tests pass again !
24573
24574         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24575         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24576         (Invocation::OverloadResolve): Ditto.
24577         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24578
24579         * everywhere : update calls to the above methods accordingly.
24580
24581 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24582
24583         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24584
24585         * expression.cs (ExpressionStatement): New base class used for
24586         expressions that can appear in statements, so that we can provide
24587         an alternate path to generate expression that do not leave a value
24588         on the stack.
24589
24590         (Expression::Emit, and all the derivatives): We no longer return
24591         whether a value is left on the stack or not.  Every expression
24592         after being emitted leaves a single value on the stack.
24593
24594         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24595         facilties of ExpressionStatement if possible.
24596
24597         * cs-parser.jay: Update statement_expression.
24598
24599 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24600
24601         * driver.cs: Change the wording of message
24602
24603 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24604
24605         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24606         the type of the expression to the return type of the method if
24607         we have an overloaded operator match ! The regression tests pass again !
24608         (Unary::ResolveOperator): Ditto.
24609
24610         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24611         to find "op_Implicit", not "implicit" ;-)
24612         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24613         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24614
24615         * everywhere : Correct calls to the above accordingly.
24616
24617         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24618         (ConvertImplicit): Do user-defined conversion if it exists.
24619
24620 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24621
24622         * assign.cs: track location.
24623         (Resolve): Use implicit conversions on assignment.
24624
24625         * literal.cs: Oops.  Not good, Emit of short access values should
24626         pass (Bytes) or the wrong argument will be selected.
24627
24628         * expression.cs (Unary::Emit): Emit code for -expr.
24629
24630         (Unary::ResolveOperator): Handle `Substract' for non-constants
24631         (substract from zero from the non-constants).
24632         Deal with Doubles as well. 
24633
24634         (Expression::ConvertImplicitRequired): New routine that reports an
24635         error if no implicit conversion exists. 
24636
24637         (Invocation::OverloadResolve): Store the converted implicit
24638         expressions if we make them
24639
24640 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24641
24642         * class.cs (ConstructorInitializer): Take a Location argument.
24643         (ConstructorBaseInitializer): Same here.
24644         (ConstructorThisInitializer): Same here.
24645
24646         * cs-parser.jay : Update all calls accordingly.
24647
24648         * expression.cs (Unary, Binary, New): Take location argument.
24649         Update accordingly everywhere.
24650
24651         * cs-parser.jay : Update all calls to the above to take a location
24652         argument.
24653
24654         * class.cs : Ditto.
24655
24656 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24657
24658         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24659         (Invocation::BetterConversion): Same here
24660         (Invocation::ConversionExists): Ditto.
24661
24662         (Invocation::ConversionExists): Implement.
24663
24664 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24665
24666         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24667         Also take an additional TypeContainer argument.
24668
24669         * All over : Pass in TypeContainer as argument to OverloadResolve.
24670
24671         * typemanager.cs (CSharpName): Update to check for the string type and return
24672         that too.
24673
24674         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24675         a given method.
24676
24677 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24678
24679         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24680         (Invocation::BetterFunction): Implement.
24681         (Invocation::BetterConversion): Implement.
24682         (Invocation::ConversionExists): Skeleton, no implementation yet.
24683
24684         Okay, things work fine !
24685
24686 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24687
24688         * typemanager.cs: declare and load enum_type, delegate_type and
24689         void_type. 
24690
24691         * expression.cs (Expression::Emit): Now emit returns a value that
24692         tells whether a value is left on the stack or not.  This strategy
24693         might be reveted tomorrow with a mechanism that would address
24694         multiple assignments.
24695         (Expression::report118): Utility routine to report mismatches on
24696         the ExprClass.
24697
24698         (Unary::Report23): Report impossible type/operator combination
24699         utility function.
24700
24701         (Unary::IsIncrementableNumber): Whether the type can be
24702         incremented or decremented with add.
24703         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24704         complemented. 
24705         (Unary::ResolveOperator): Implement ++, !, ~,
24706
24707         (Invocation::Emit): Deal with new Emit convetion.
24708
24709         * All Expression derivatives: Updated their Emit method to return
24710         whether they leave values on the stack or not.
24711
24712         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24713         stack for expressions that are statements. 
24714
24715 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * expression.cs (LValue): New interface.  Must be implemented by
24718         LValue objects.
24719         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24720         LValue interface.
24721
24722         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24723         interface for generating code, simplifies the code.
24724
24725 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24726
24727         * expression.cs (everywhere): Comment out return statements in ::Resolve
24728         methods to avoid the warnings.
24729
24730 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24731
24732         * driver.cs (parse): Report error 2001 if we can not open the
24733         source file.
24734
24735         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24736         not resolve it.
24737
24738         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24739         object. 
24740
24741         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24742         otherwise nested blocks end up with the same index.
24743
24744         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24745
24746         * expression.cs:  Instead of having FIXMEs in the Resolve
24747         functions, throw exceptions so it is obvious that we are facing a
24748         bug. 
24749
24750         * cs-parser.jay (invocation_expression): Pass Location information.
24751
24752         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24753         Use a basename for those routines because .NET does not like paths
24754         on them. 
24755
24756         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24757         already defined.
24758
24759 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24760
24761         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24762         are loading the correct data types (throws an exception if not).
24763         (TypeManager::InitCoreTypes): Use CoreLookupType
24764
24765         * expression.cs (Unary::ResolveOperator): return the child
24766         expression for expressions which are just +expr.
24767         (Unary::ResolveOperator): Return negative literals for -LITERAL
24768         expressions (otherwise they are Unary {Literal}).
24769         (Invocation::Badness): Take into account `Implicit constant
24770         expression conversions'.
24771
24772         * literal.cs (LongLiteral): Implement long literal class.
24773         (IntLiteral): export the `Value' of the intliteral. 
24774
24775 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24776
24777         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24778
24779         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24780         instead of 'Operator'
24781
24782         * expression.cs (Binary::ResolveOperator): Update accordingly.
24783         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24784         and 'Minus'
24785
24786         * cs-parser.jay (unary_expression): Update to use the new names.
24787
24788         * gen-treedump.cs (GetUnary): Same here.
24789
24790         * expression.cs (Unary::Resolve): Implement.
24791         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24792         operators are found instead of making noise ;-)
24793         (Unary::ResolveOperator): New method to do precisely the same thing which
24794         Binary::ResolveOperator does for Binary expressions.
24795         (Unary.method, .Arguments): Add.
24796         (Unary::OperName): Implement.   
24797         (Unary::ForceConversion): Copy and Paste !
24798
24799         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24800         a unary operator.
24801
24802         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24803         for the inbuilt operators. Only overloading works for now ;-)
24804
24805 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24806
24807         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24808         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24809
24810         * expression.cs (This::Emit): Implement. 
24811         (This::Resolve): Implement.
24812         (TypeOf:Resolve): Implement.
24813         (Expression::ResolveSimpleName): Add an implicit this to instance
24814         field references. 
24815         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24816         Bind instance variable to Field expressions.
24817         (FieldExpr::Instance): New field used to track the expression that
24818         represents the object instance.
24819         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24820         binding 
24821         (FieldExpr::Emit): Implement.
24822
24823         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24824         the last instruction contains a return opcode to avoid generating
24825         the last `ret' instruction (this generates correct code, and it is
24826         nice to pass the peverify output).
24827
24828         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24829         initializer for static and instance variables.
24830         (Constructor::Emit): Allow initializer to be null in the case of
24831         static constructors.  Only emit initializer for instance
24832         constructors. 
24833
24834         (TypeContainer::FindMembers): Return a null array if there are no
24835         matches.
24836
24837         Also fix the code for the MemberTypes.Method branch, as it was not
24838         scanning that for operators (or tried to access null variables before).
24839
24840         * assign.cs (Assign::Emit): Handle instance and static fields. 
24841
24842         * TODO: Updated.
24843
24844         * driver.cs: Stop compilation if there are parse errors.
24845
24846         * cs-parser.jay (constructor_declaration): Provide default base
24847         initializer for non-static constructors.
24848         (constructor_declarator): Do not provide a default base
24849         initializers if none was specified.
24850         Catch the fact that constructors should not have parameters.
24851
24852         * class.cs: Do not emit parent class initializers for static
24853         constructors, that should be flagged as an error.
24854
24855 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24856
24857         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24858         Move back code into TypeContainer::Populate.
24859
24860 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24861
24862         * class.cs (TypeContainer::AddConstructor): Fix the check to
24863         compare against Name, not Basename. 
24864         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24865
24866         * cs-parser.jay : Update accordingly.
24867
24868         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24869         for methods, don't forget to look into the operators too.
24870         (RegisterMethodBuilder): Helper method to take care of this for
24871         methods, constructors and operators.
24872         (Operator::Define): Completely revamp.
24873         (Operator.OperatorMethod, MethodName): New fields.
24874         (TypeContainer::Populate): Move the registering of builders into
24875         RegisterMethodBuilder.
24876         (Operator::Emit): Re-write.
24877
24878         * expression.cs (Binary::Emit): Comment out code path to emit method
24879         invocation stuff for the case when we have a user defined operator. I am
24880         just not able to get it right !
24881
24882 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24883
24884         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24885         argument. 
24886
24887         (Expression::MemberLookup): Provide a version that allows to
24888         specify the MemberTypes and BindingFlags. 
24889
24890         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24891         so it was not fetching variable information from outer blocks.
24892
24893         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24894         Beforefieldinit as it was buggy.
24895
24896         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24897         that Ravi put here.  
24898
24899         * class.cs (Constructor::Emit): Only emit if block is not null.
24900         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24901         deal with this by semantically definining it as if the user had
24902         done it.
24903
24904         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24905         constructors as we now "emit" them at a higher level.
24906
24907         (TypeContainer::DefineDefaultConstructor): Used to define the
24908         default constructors if none was provided.
24909
24910         (ConstructorInitializer): Add methods Resolve and Emit. 
24911
24912         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24913
24914 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24915
24916         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24917         the default constructor builder with our hashtable for methodbuilders
24918         to methodcores.
24919
24920         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24921         and argument_count is 0 in which case we have a match.
24922         (Binary::ResolveOperator): More null checking and miscellaneous coding
24923         style cleanup.
24924
24925 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24926
24927         * rootcontext.cs (IsNameSpace): Compare against null.
24928
24929         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24930
24931         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24932         and Unary::Operator.
24933
24934         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24935         accordingly.
24936
24937         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24938         we have overloaded operators.
24939         (Binary::ResolveOperator): Implement the part which does the operator overload
24940         resolution.
24941
24942         * class.cs (Operator::Emit): Implement.
24943         (TypeContainer::Emit): Emit the operators we have too.
24944
24945         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24946         the case when we have a user-defined operator.
24947
24948 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24949
24950         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24951
24952 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24953
24954         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24955         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24956         (Constructor::Emit): Implement.
24957         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24958         if we have no work to do. 
24959         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24960         Emit method.
24961
24962         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24963         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24964
24965         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24966         of parent.parent.
24967
24968 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24969
24970         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24971         in the source.
24972         (Tree::RecordNamespace): Method to do what the name says ;-)
24973         (Tree::Namespaces): Property to get at the namespaces hashtable.
24974
24975         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24976         keep track.
24977
24978         * rootcontext.cs (IsNamespace): Fixed it :-)
24979
24980 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24981
24982         * class.cs (TypeContainer::FindMembers): Add support for
24983         constructors. 
24984         (MethodCore): New class that encapsulates both the shared aspects
24985         of a Constructor and a Method.  
24986         (Method, Constructor): Factored pieces into MethodCore.
24987
24988         * driver.cs: Added --fatal which makes errors throw exceptions.
24989         Load System assembly as well as part of the standard library.
24990
24991         * report.cs: Allow throwing exceptions on errors for debugging.
24992
24993         * modifiers.cs: Do not use `parent', instead use the real type
24994         container to evaluate permission settings.
24995
24996         * class.cs: Put Ravi's patch back in.  He is right, and we will
24997         have to cope with the
24998
24999 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25000
25001         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25002         FamORAssem, not FamANDAssem.
25003
25004 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25005
25006         * driver.cs: Added --parse option that only parses its input files
25007         and terminates.
25008
25009         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25010         incorrect.  IsTopLevel is not used to tell whether an object is
25011         root_types or not (that can be achieved by testing this ==
25012         root_types).  But to see if this is a top-level *class* (not
25013         necessarly our "toplevel" container). 
25014
25015 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25016
25017         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25018         parent instead of a direct call to GetType.
25019
25020 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25021
25022         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25023         Modifiers.TypeAttr. This should just be a call to that method.
25024
25025         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25026         object so that we can determine if we are top-level or not.
25027
25028         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25029         TypeContainer too.
25030
25031         * enum.cs (Enum::Define): Ditto.
25032
25033         * modifiers.cs (FieldAttr): Re-write.
25034
25035         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25036         (TypeContainer::HaveStaticConstructor): New property to provide access
25037         to precisely that info.
25038
25039         * modifiers.cs (MethodAttr): Re-write.
25040         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25041
25042         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25043         of top-level types as claimed.
25044
25045 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25046
25047         * expression.cs (MemberLookup): Fruitless attempt to lookup
25048         constructors.  Maybe I need to emit default constructors?  That
25049         might be it (currently .NET emits this for me automatically).
25050         (Invocation::OverloadResolve): Cope with Arguments == null.
25051         (Invocation::EmitArguments): new function, shared by the new
25052         constructor and us.
25053         (Invocation::Emit): Handle static and instance methods.  Emit
25054         proper call instruction for virtual or non-virtual invocations.
25055         (New::Emit): Implement.
25056         (New::Resolve): Implement.
25057         (MemberAccess:Resolve): Implement.
25058         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25059         to track instances.
25060         (FieldExpr::Resolve): Set type.
25061
25062         * support.cs: Handle empty arguments.
25063                 
25064         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25065         SimpleLookup): Auxiliary routines to help parse a qualifier
25066         identifier.  
25067
25068         Update qualifier_identifier rule.
25069
25070         * codegen.cs: Removed debugging messages.
25071
25072         * class.cs: Make this a global thing, this acts just as a "key" to
25073         objects that we might have around.
25074
25075         (Populate): Only initialize method_builders_to_methods once.
25076
25077         * expression.cs (PropertyExpr): Initialize type from the
25078         PropertyType. 
25079
25080         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25081         Resolve pattern.  Attempt to implicitly convert value to boolean.
25082         Emit code.
25083
25084         * expression.cs: Set the type for the int32/int32 argument case.
25085         (Binary::ResolveOperator): Set the return type to boolean for
25086         comparission operators
25087
25088         * typemanager.cs: Remove debugging print code.
25089
25090         (Invocation::Resolve): resolve type.
25091
25092         * class.cs: Allocate a MemberInfo of the correct size, as the code
25093         elsewhere depends on the test to reflect the correct contents.
25094
25095         (Method::) Keep track of parameters, due to System.Reflection holes
25096
25097         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25098         mapping here.
25099
25100         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25101         of the exact size and return that.
25102
25103         (Class::LookupMethodByBuilder): New function that maps
25104         MethodBuilders to its methods.  Required to locate the information
25105         on methods because System.Reflection bit us again.
25106
25107         * support.cs: New file, contains an interface ParameterData and
25108         two implementations: ReflectionParameters and InternalParameters
25109         used to access Parameter information.  We will need to grow this
25110         as required.
25111
25112         * expression.cs (Invocation::GetParameterData): implement a cache
25113         and a wrapper around the ParameterData creation for methods. 
25114         (Invocation::OverloadResolve): Use new code.
25115
25116 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25117
25118         * class.cs (TypeContainer::EmitField): Remove and move into 
25119         (Field::Define): here and modify accordingly.
25120         (Field.FieldBuilder): New member.
25121         (TypeContainer::Populate): Update accordingly.
25122         (TypeContainer::FindMembers): Implement.
25123
25124 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25125
25126         * statement.cs: (VariableInfo::VariableType): New field to be
25127         initialized with the full type once it is resolved. 
25128
25129 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25130
25131         * parameter.cs (GetParameterInfo): Use a type cache to compute
25132         things only once, and to reuse this information
25133
25134         * expression.cs (LocalVariableReference::Emit): Implement.
25135         (OpcodeCast::Emit): fix.
25136
25137         (ParameterReference::Resolve): Implement.
25138         (ParameterReference::Emit): Implement.
25139
25140         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25141         that are expressions need to stay as Expressions.
25142
25143         * typemanager.cs (CSharpName): Returns the C# name of a type if
25144         possible. 
25145
25146         * expression.cs (Expression::ConvertImplicit): New function that
25147         implements implicit type conversions.
25148
25149         (Expression::ImplicitReferenceConversion): Implements implicit
25150         reference conversions.
25151
25152         (EmptyCast): New type for transparent casts.
25153
25154         (OpcodeCast): New type for casts of types that are performed with
25155         a sequence of bytecodes.
25156
25157         (BoxedCast): New type used for casting value types into reference
25158         types.  Emits a box opcode.
25159
25160         (Binary::DoNumericPromotions): Implements numeric promotions of
25161         and computation of the Binary::Type.
25162
25163         (Binary::EmitBranchable): Optimization.
25164
25165         (Binary::Emit): Implement code emission for expressions.
25166
25167         * typemanager.cs (TypeManager): Added two new core types: sbyte
25168         and byte.
25169
25170 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25171
25172         * class.cs (TypeContainer::FindMembers): Method which does exactly
25173         what Type.FindMembers does, only we don't have to use reflection. No
25174         implementation yet.
25175
25176         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25177         typecontainer objects as we need to get at them.
25178         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25179
25180         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25181         typecontainer object.
25182
25183         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25184         of just a Report object.
25185
25186 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25187
25188         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25189         "remove_"
25190         (TypeContainer::Populate): Now define the delegates of the type too.
25191         (TypeContainer.Delegates): Property to access the list of delegates defined
25192         in the type.
25193
25194         * delegates.cs (Delegate::Define): Implement partially.
25195
25196         * modifiers.cs (TypeAttr): Handle more flags.
25197
25198 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25199
25200         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25201         and not <=
25202         (Operator::Define): Re-write logic to get types by using the LookupType method
25203         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25204         (Indexer::Define): Ditto.
25205         (Event::Define): Ditto.
25206         (Property::Define): Ditto.
25207
25208 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25209
25210         * class.cs (TypeContainer::Populate): Now define operators too. 
25211         (TypeContainer.Operators): New property to access the list of operators
25212         in a type.
25213         (Operator.OperatorMethodBuilder): New member to hold the method builder
25214         for the operator we are defining.
25215         (Operator::Define): Implement.
25216
25217 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25218
25219         * class.cs (Event::Define): Make the prefixes of the accessor methods
25220         addOn_ and removeOn_ 
25221
25222         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25223         of the location being passed in too. Ideally, this should go later since all
25224         error reporting should be done through the Report object.
25225
25226         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25227         (Populate): Iterate thru the indexers we have and define them too.
25228         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25229         for the get and set accessors.
25230         (Indexer::Define): Implement.
25231
25232 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25233
25234         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25235         my previous implementation, did not work.
25236
25237         * typemanager.cs: Add a couple of missing types (the longs).
25238
25239         * literal.cs: Use TypeManager.bool_type instead of getting it.
25240
25241         * expression.cs (EventExpr): New kind of expressions.
25242         (Expressio::ExprClassFromMemberInfo): finish
25243
25244 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25245
25246         * assign.cs: Emit stores to static fields differently.
25247
25248 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25249
25250         * Merge in changes and adjust code to tackle conflicts. Backed out my
25251         code in Assign::Resolve ;-) 
25252
25253 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25254
25255         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25256         instead Report.Error and also pass in the location.
25257         (CSharpParser::Lexer): New readonly property to return the reference
25258         to the Tokenizer object.
25259         (declare_local_variables): Use Report.Error with location instead of plain 
25260         old error.
25261         (CheckDef): Ditto.
25262
25263         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25264         (Operator.CheckBinaryOperator): Ditto.
25265
25266         * cs-parser.jay (operator_declarator): Update accordingly.
25267
25268         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25269         (CheckBinaryOperator): Same here.
25270
25271         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25272         on the name without any prefixes of namespace names etc. This is because we
25273         already might have something already fully qualified like 
25274         'System.Console.WriteLine'
25275
25276         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25277
25278 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25279
25280         * cs-tokenizer.cs (location): Return a string which also contains
25281         the file name.
25282
25283         * expression.cs (ElementAccess): New class for expressions of the
25284         type 'element access.'
25285         (BaseAccess): New class for expressions of the type 'base access.'
25286         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25287         respectively.
25288
25289         * cs-parser.jay (element_access): Implement action.
25290         (base_access): Implement actions.
25291         (checked_expression, unchecked_expression): Implement.
25292
25293         * cs-parser.jay (local_variable_type): Correct and implement.
25294         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25295
25296         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25297
25298         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25299         name and the specifiers.
25300
25301         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25302
25303         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25304         making them all public ;-)
25305
25306         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25307         class anyways.
25308
25309 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25310
25311         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25312         PropertyExprs.
25313         (FieldExpr, PropertyExprs): New resolved expressions.
25314         (SimpleName::MemberStaticCheck): Perform static checks for access
25315         to non-static fields on static methods. Maybe this should be
25316         generalized for MemberAccesses. 
25317         (SimpleName::ResolveSimpleName): More work on simple name
25318         resolution. 
25319
25320         * cs-parser.jay (primary_expression/qualified_identifier): track
25321         the parameter index.
25322
25323         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25324         (EmitContext::EmitBoolExpression): Chain to expression generation
25325         instead of temporary hack.
25326         (::EmitStatementExpression): Put generic expression code generation.
25327
25328         * assign.cs (Assign::Emit): Implement variable assignments to
25329         local variables, parameters and fields.
25330
25331 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * statement.cs (Block::GetVariableInfo): New method, returns the
25334         VariableInfo for a variable name in a block.
25335         (Block::GetVariableType): Implement in terms of GetVariableInfo
25336
25337         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25338         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25339
25340 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25341
25342         * cs-parser.jay (operator_declaration): Continue on my quest : update
25343         to take attributes argument.
25344         (event_declaration): Ditto.
25345         (enum_declaration): Ditto.
25346         (indexer_declaration): Ditto.
25347
25348         * class.cs (Operator::Operator): Update constructor accordingly.
25349         (Event::Event): Ditto.
25350
25351         * delegate.cs (Delegate::Delegate): Same here.
25352
25353         * enum.cs (Enum::Enum): Same here.
25354
25355 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25356
25357         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25358
25359         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25360
25361         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25362         being passed around as an arraylist.
25363         (Attributes::AddAttribute): Method to add attribute sections.
25364
25365         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25366         (struct_declaration): Update accordingly.
25367         (constant_declaration): Update.
25368         (field_declaration): Update.
25369         (method_header): Update.
25370         (fixed_parameter): Update.
25371         (parameter_array): Ditto.
25372         (property_declaration): Ditto.
25373         (destructor_declaration): Ditto.
25374
25375         * class.cs (Struct::Struct): Update constructors accordingly.
25376         (Class::Class): Ditto.
25377         (Field::Field): Ditto.
25378         (Method::Method): Ditto.
25379         (Property::Property): Ditto.
25380         (TypeContainer::OptAttribute): update property's return type.
25381
25382         * interface.cs (Interface.opt_attributes): New member.
25383         (Interface::Interface): Update to take the extra Attributes argument.
25384
25385         * parameter.cs (Parameter::Parameter): Ditto.
25386
25387         * constant.cs (Constant::Constant): Ditto.
25388
25389         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25390         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25391         the attributes as a parameter.
25392         (InterfaceProperty): Update constructor call.
25393         (InterfaceEvent): Ditto.
25394         (InterfaceMethod): Ditto.
25395         (InterfaceIndexer): Ditto.
25396
25397         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25398         pass the attributes too.
25399         (interface_event_declaration): Ditto.
25400         (interface_property_declaration): Ditto.
25401         (interface_method_declaration): Ditto.
25402         (interface_declaration): Ditto.
25403
25404 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25405
25406         * class.cs (Method::Define): Track the "static Main" definition to
25407         create an entry point. 
25408
25409         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25410         EntryPoint if we find it. 
25411
25412         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25413         (EmitContext::ig): Make this variable public.
25414
25415         * driver.cs: Make the default output file be the first file name
25416         with the .exe extension.  
25417
25418         Detect empty compilations
25419
25420         Handle various kinds of output targets.  Handle --target and
25421         rename -t to --dumper.
25422
25423         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25424         methods inherited from Expression return now an Expression.  This
25425         will is used during the tree rewriting as we resolve them during
25426         semantic analysis.
25427
25428         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25429         the spec.  Missing entirely is the information about
25430         accessability of elements of it.
25431
25432         (Expression::ExprClassFromMemberInfo): New constructor for
25433         Expressions that creates a fully initialized Expression based on
25434         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25435         a Type.
25436
25437         (Invocation::Resolve): Begin implementing resolution of invocations.
25438
25439         * literal.cs (StringLiteral):  Implement Emit.
25440
25441 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25442
25443         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25444         member.
25445
25446 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25447
25448         * cs-parser.jay (attribute_arguments): Implement actions.
25449         (attribute): Fix bug in production. Implement action.
25450         (attribute_list): Implement.
25451         (attribute_target): Implement.
25452         (attribute_target_specifier, opt_target_specifier): Implement
25453         (CheckAttributeTarget): New method to check if the attribute target
25454         is valid.
25455         (attribute_section): Implement.
25456         (opt_attributes): Implement.
25457
25458         * attribute.cs : New file to handle attributes.
25459         (Attribute): Class to hold attribute info.
25460
25461         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25462         (attribute_section): Modify production to use 2 different rules to 
25463         achieve the same thing. 1 s/r conflict down !
25464         Clean out commented, useless, non-reducing dimension_separator rules.
25465
25466         * class.cs (TypeContainer.attributes): New member to hold list
25467         of attributes for a type.
25468         (Struct::Struct): Modify to take one more argument, the attribute list.
25469         (Class::Class): Ditto.
25470         (Field::Field): Ditto.
25471         (Method::Method): Ditto.
25472         (Property::Property): Ditto.
25473
25474         * cs-parser.jay (struct_declaration): Update constructor call to
25475         pass in the attributes too.
25476         (class_declaration): Ditto.
25477         (constant_declaration): Ditto.
25478         (field_declaration): Ditto.
25479         (method_header): Ditto.
25480         (fixed_parameter): Ditto.
25481         (parameter_array): Ditto.
25482         (property_declaration): Ditto.
25483
25484         * constant.cs (Constant::Constant): Update constructor similarly.
25485         Use System.Collections.
25486
25487         * parameter.cs (Parameter::Parameter): Update as above.
25488
25489 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25490
25491         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25492         (TypeContainer.delegates): New member to hold list of delegates.
25493
25494         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25495         this time as I seem to be on crack ;-)
25496
25497 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25498
25499         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25500         tell whether an identifier represents a namespace.
25501
25502         * expression.cs (NamespaceExpr): A namespace expression, used only
25503         temporarly during expression resolution.
25504         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25505         utility functions to resolve names on expressions.
25506
25507 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25508
25509         * codegen.cs: Add hook for StatementExpressions. 
25510
25511         * class.cs: Fix inverted test for static flag in methods.
25512
25513 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25514
25515         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25516         to make it coincide with MS' number.
25517         (Operator::CheckBinaryOperator): Ditto.
25518
25519         * ../errors/errors.txt : Remove error numbers added earlier.
25520
25521         * ../errors/cs1019.cs : Test case for error # 1019
25522
25523         * ../errros/cs1020.cs : Test case for error # 1020
25524
25525         * cs-parser.jay : Clean out commented cruft.
25526         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25527         used anywhere - non-reducing rule.
25528         (namespace_declarations): Non-reducing rule - comment out.
25529
25530         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25531         with TypeContainer::AddEnum.
25532
25533         * delegate.cs : New file for delegate handling classes.
25534         (Delegate): Class for declaring delegates.
25535
25536         * makefile : Update.
25537
25538         * cs-parser.jay (delegate_declaration): Implement.
25539
25540 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25541
25542         * class.cs (Event::Define): Implement.
25543         (Event.EventBuilder): New member.
25544
25545         * class.cs (TypeContainer::Populate): Update to define all enums and events
25546         we have.
25547         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25548         readonly fields for all these cases ?
25549
25550 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25551
25552         * class.cs (Property): Revamp to use the convention of making fields readonly.
25553         Accordingly modify code elsewhere.
25554
25555         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25556         the Define method of the Property class.
25557
25558         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25559         trivial bug.
25560         (TypeContainer::Populate): Update to define all the properties we have. Also
25561         define all enumerations.
25562
25563         * enum.cs (Define): Implement.
25564
25565 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25566
25567         * cs-parser.jay (overloadable_operator): The semantic value is an
25568         enum of the Operator class.
25569         (operator_declarator): Implement actions.
25570         (operator_declaration): Implement.
25571
25572         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25573         validity of definitions.
25574         (Operator::CheckBinaryOperator): Static method to check for binary operators
25575         (TypeContainer::AddOperator): New method to add an operator to a type.
25576
25577         * cs-parser.jay (indexer_declaration): Added line to actually call the
25578         AddIndexer method so it gets added ;-)
25579
25580         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25581         already taken care of by the MS compiler ?  
25582
25583 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25584
25585         * class.cs (Operator): New class for operator declarations.
25586         (Operator::OpType): Enum for the various operators.
25587
25588 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25589
25590         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25591         ostensibly handle this in semantic analysis.
25592
25593         * cs-parser.jay (general_catch_clause): Comment out
25594         (specific_catch_clauses, specific_catch_clause): Ditto.
25595         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25596         (catch_args, opt_catch_args): New productions.
25597         (catch_clause): Rewrite to use the new productions above
25598         (catch_clauses): Modify accordingly.
25599         (opt_catch_clauses): New production to use in try_statement
25600         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25601         and re-write the code in the actions to extract the specific and
25602         general catch clauses by being a little smart ;-)
25603
25604         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25605         Hooray, try and catch statements parse fine !
25606
25607 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25608
25609         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25610         string from the hashtable of variables.
25611
25612         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25613         I end up making that mistake ;-)
25614         (catch_clauses): Fixed gross error which made Key and Value of the 
25615         DictionaryEntry the same : $1 !!
25616
25617 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25618
25619         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25620
25621         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25622         when the add and remove accessors are specified. 
25623
25624 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25625
25626         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25627         information about indexer_declarator.
25628         (indexer_declarator): Implement actions.
25629         (parsing_indexer): New local boolean used to keep track of whether
25630         we are parsing indexers or properties. This is necessary because 
25631         implicit_parameters come into picture even for the get accessor in the 
25632         case of an indexer.
25633         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25634
25635         * class.cs (Indexer): New class for indexer declarations.
25636         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25637         (TypeContainer::indexers): New member to hold list of indexers for the
25638         type.
25639
25640 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25641
25642         * cs-parser.jay (add_accessor_declaration): Implement action.
25643         (remove_accessor_declaration): Implement action.
25644         (event_accessors_declaration): Implement
25645         (variable_declarators): swap statements for first rule - trivial.
25646
25647         * class.cs (Event): New class to hold information about event
25648         declarations.
25649         (TypeContainer::AddEvent): New method to add an event to a type
25650         (TypeContainer::events): New member to hold list of events.
25651
25652         * cs-parser.jay (event_declaration): Implement actions.
25653
25654 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25655
25656         * cs-parser.jay (dim_separators): Implement. Make it a string
25657         concatenating all the commas together, just as they appear.
25658         (opt_dim_separators): Modify accordingly
25659         (rank_specifiers): Update accordingly. Basically do the same
25660         thing - instead, collect the brackets here.
25661         (opt_rank_sepcifiers): Modify accordingly.
25662         (array_type): Modify to actually return the complete type string
25663         instead of ignoring the rank_specifiers.
25664         (expression_list): Implement to collect the expressions
25665         (variable_initializer): Implement. We make it a list of expressions
25666         essentially so that we can handle the array_initializer case neatly too.
25667         (variable_initializer_list): Implement.
25668         (array_initializer): Make it a list of variable_initializers
25669         (opt_array_initializer): Modify accordingly.
25670
25671         * expression.cs (New::NType): Add enumeration to help us
25672         keep track of whether we have an object/delegate creation
25673         or an array creation.
25674         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25675         members to hold data about array creation.
25676         (New:New): Modify to update NewType
25677         (New:New): New Overloaded contructor for the array creation
25678         case.
25679
25680         * cs-parser.jay (array_creation_expression): Implement to call
25681         the overloaded New constructor.
25682
25683 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25684
25685         * class.cs (TypeContainer::Constructors): Return member
25686         constructors instead of returning null.
25687
25688 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25689
25690         * typemanager.cs (InitCoreTypes): Initialize the various core
25691         types after we have populated the type manager with the user
25692         defined types (this distinction will be important later while
25693         compiling corlib.dll)
25694
25695         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25696         on Expression Classification.  Now all expressions have a method
25697         `Resolve' and a method `Emit'.
25698
25699         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25700         generation from working.     Also add some temporary debugging
25701         code. 
25702
25703 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25704
25705         * codegen.cs: Lots of code generation pieces.  This is only the
25706         beginning, will continue tomorrow with more touches of polish.  We
25707         handle the fundamentals of if, while, do, for, return.  Others are
25708         trickier and I need to start working on invocations soon.
25709
25710         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25711         s.InitStatement. 
25712
25713         * codegen.cs (EmitContext): New struct, used during code
25714         emission to keep a context.   Most of the code generation will be
25715         here. 
25716
25717         * cs-parser.jay: Add embedded blocks to the list of statements of
25718         this block.  So code generation proceeds in a top down fashion.
25719
25720 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25721
25722         * statement.cs: Add support for multiple child blocks.
25723
25724 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25725
25726         * codegen.cs (EmitCode): New function, will emit the code for a
25727         Block of code given a TypeContainer and its ILGenerator. 
25728
25729         * statement.cs (Block): Standard public readonly optimization.
25730         (Block::Block constructors): Link children. 
25731         (Block::Child): Child Linker.
25732         (Block::EmitVariables): Emits IL variable declarations.
25733
25734         * class.cs: Drop support for MethodGroups here, delay until
25735         Semantic Analysis.
25736         (Method::): Applied the same simplification that I did before, and
25737         move from Properties to public readonly fields.
25738         (Method::ParameterTypes): Returns the parameter types for the
25739         function, and implements a cache that will be useful later when I
25740         do error checking and the semantic analysis on the methods is
25741         performed.
25742         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25743         and made a method, optional argument tells whether this is a class
25744         or a structure to apply the `has-this' bit.
25745         (Method::GetCallingConvention): Implement, returns the calling
25746         convention. 
25747         (Method::Define): Defines the type, a second pass is performed
25748         later to populate the methods.
25749
25750         (Constructor::ParameterTypes): implement a cache similar to the
25751         one on Method::ParameterTypes, useful later when we do semantic
25752         analysis. 
25753
25754         (TypeContainer::EmitMethod):  New method.  Emits methods.
25755
25756         * expression.cs: Removed MethodGroup class from here.
25757
25758         * parameter.cs (Parameters::GetCallingConvention): new method.
25759
25760 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25761
25762         * class.cs (TypeContainer::Populate): Drop RootContext from the
25763         argument. 
25764
25765         (Constructor::CallingConvention): Returns the calling convention.
25766         (Constructor::ParameterTypes): Returns the constructor parameter
25767         types. 
25768
25769         (TypeContainer::AddConstructor): Keep track of default constructor
25770         and the default static constructor.
25771
25772         (Constructor::) Another class that starts using `public readonly'
25773         instead of properties. 
25774
25775         (Constructor::IsDefault): Whether this is a default constructor. 
25776
25777         (Field::) use readonly public fields instead of properties also.
25778
25779         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25780         track of static constructors;  If none is used, turn on
25781         BeforeFieldInit in the TypeAttributes. 
25782
25783         * cs-parser.jay (opt_argument_list): now the return can be null
25784         for the cases where there are no arguments. 
25785
25786         (constructor_declarator): If there is no implicit `base' or
25787         `this', then invoke the default parent constructor. 
25788
25789         * modifiers.cs (MethodAttr): New static function maps a set of
25790         modifiers flags into a MethodAttributes enum
25791         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25792         MethodAttr, TypeAttr to represent the various mappings where the
25793         modifiers are used.
25794         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25795
25796 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25797
25798         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25799         method arguments.
25800
25801         * interface.cs (PopulateIndexer): Implemented the code generator
25802         for interface indexers.
25803
25804 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25805
25806         * interface.cs (InterfaceMemberBase): Now we track the new status
25807         here.  
25808
25809         (PopulateProperty): Implement property population.  Woohoo!  Got
25810         Methods and Properties going today. 
25811
25812         Removed all the properties for interfaces, and replaced them with
25813         `public readonly' fields. 
25814
25815 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25816
25817         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25818         initialize their hashtables/arraylists only when they are needed
25819         instead of doing this always.
25820
25821         * parameter.cs: Handle refs and out parameters.
25822
25823         * cs-parser.jay: Use an ArrayList to construct the arguments
25824         instead of the ParameterCollection, and then cast that to a
25825         Parameter[] array.
25826
25827         * parameter.cs: Drop the use of ParameterCollection and use
25828         instead arrays of Parameters.
25829
25830         (GetParameterInfo): Use the Type, not the Name when resolving
25831         types. 
25832
25833 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25834
25835         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25836         and instead use public readonly fields.
25837
25838         * class.cs: Put back walking code for type containers.
25839
25840 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25841
25842         * class.cs (MakeConstant): Code to define constants.
25843
25844         * rootcontext.cs (LookupType): New function.  Used to locate types 
25845
25846
25847 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25848
25849         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25850         this System.Reflection code is.  Kudos to Microsoft
25851
25852         * typemanager.cs: Implement a type cache and avoid loading all
25853         types at boot time.  Wrap in LookupType the internals.  This made
25854         the compiler so much faster.  Wow.  I rule!
25855
25856         * driver.cs: Make sure we always load mscorlib first (for
25857         debugging purposes, nothing really important).
25858
25859         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25860         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25861
25862         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25863         on namespaces that have been imported using the `using' keyword.
25864
25865         * class.cs (TypeContainer::TypeAttr): Virtualize.
25866         (Class::TypeAttr): Return attributes suitable for this bad boy.
25867         (Struct::TypeAttr): ditto.
25868         Handle nested classes.
25869         (TypeContainer::) Remove all the type visiting code, it is now
25870         replaced with the rootcontext.cs code
25871
25872         * rootcontext.cs (GetClassBases): Added support for structs. 
25873
25874 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25875
25876         * interface.cs, statement.cs, class.cs, parameter.cs,
25877         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25878         Drop use of TypeRefs, and use strings instead.
25879
25880 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25881
25882         * rootcontext.cs: 
25883
25884         * class.cs (Struct::Struct): set the SEALED flags after
25885         checking the modifiers.
25886         (TypeContainer::TypeAttr): new property, returns the
25887         TypeAttributes for a class.  
25888
25889         * cs-parser.jay (type_list): Oops, list production was creating a
25890         new list of base types.
25891
25892         * rootcontext.cs (StdLib): New property.
25893         (GetInterfaceTypeByName): returns an interface by type name, and
25894         encapsulates error handling here.
25895         (GetInterfaces): simplified.
25896         (ResolveTree): Encapsulated all the tree resolution here.
25897         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25898         types. 
25899
25900         * driver.cs: Add support for --nostdlib, to avoid loading the
25901         default assemblies.
25902         (Main): Do not put tree resolution here. 
25903
25904         * rootcontext.cs: Beginning of the class resolution.
25905
25906 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25907
25908         * rootcontext.cs: Provide better error reporting. 
25909
25910         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25911
25912         * rootcontext.cs (CreateInterface): Handle the case where there
25913         are no parent interfaces.
25914
25915         (CloseTypes): Routine to flush types at the end.
25916         (CreateInterface): Track types.
25917         (GetInterfaces): Returns an array of Types from the list of
25918         defined interfaces.
25919
25920         * typemanager.c (AddUserType): Mechanism to track user types (puts
25921         the type on the global type hash, and allows us to close it at the
25922         end). 
25923
25924 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25925
25926         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25927         RecordInterface instead.
25928
25929         * cs-parser.jay: Updated to reflect changes above.
25930
25931         * decl.cs (Definition): Keep track of the TypeBuilder type that
25932         represents this type here.  Not sure we will use it in the long
25933         run, but wont hurt for now.
25934
25935         * driver.cs: Smaller changes to accomodate the new code.
25936
25937         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25938         when done. 
25939
25940         * rootcontext.cs (CreateInterface):  New method, used to create
25941         the System.TypeBuilder type for interfaces.
25942         (ResolveInterfaces): new entry point to resolve the interface
25943         hierarchy. 
25944         (CodeGen): Property, used to keep track of the code generator.
25945
25946 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25947
25948         * cs-parser.jay: Add a second production for delegate_declaration
25949         with `VOID'.
25950
25951         (enum_body): Put an opt_comma here instead of putting it on
25952         enum_body or enum_member_declarations so we can handle trailing
25953         commas on enumeration members.  Gets rid of a shift/reduce.
25954
25955         (type_list): Need a COMMA in the middle.
25956
25957         (indexer_declaration): Tell tokenizer to recognize get/set
25958
25959         * Remove old targets.
25960
25961         * Re-add the parser target.
25962
25963 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25964
25965         * cs-parser.jay: Add precendence rules for a number of operators
25966         ot reduce the number of shift/reduce conflicts in the grammar.
25967
25968 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25969
25970         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25971         and put it here.
25972
25973         Get rid of old crufty code.
25974
25975         * rootcontext.cs: Use this to keep track of the parsed
25976         representation and the defined types available to the program. 
25977
25978         * gen-treedump.cs: adjust for new convention.
25979
25980         * type.cs: Split out the type manager, and the assembly builder
25981         from here. 
25982
25983         * typemanager.cs: the type manager will live here now.
25984
25985         * cil-codegen.cs: And the code generator here. 
25986
25987 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25988
25989         * makefile: Fixed up for easy making.
25990
25991 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25992
25993         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25994         the 
25995
25996         (unary_expression): Expand pre_increment_expression and
25997         post_decrement_expression to reduce a shift/reduce.
25998
25999 2001-07-11  Simon Cozens
26000
26001         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26002
26003         Improve allow_keyword_as_indent name.
26004
26005 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26006
26007         * Adjustments for Beta2. 
26008
26009 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26010
26011         * decl.cs: Added `Define' abstract method.
26012         (InTransit): new property, used to catch recursive definitions. 
26013
26014         * interface.cs: Implement `Define'. 
26015
26016         * modifiers.cs: Map Modifiers.constants to
26017         System.Reflection.TypeAttribute flags.
26018
26019         * class.cs: Keep track of types and user-defined types.
26020         (BuilderInit): New method for creating an assembly
26021         (ResolveType): New function to launch the resolution process, only
26022         used by interfaces for now.
26023
26024         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26025         that are inserted into the name space. 
26026
26027 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26028
26029         * ARGH.  I have screwed up my tree so many times due to the use of
26030         rsync rather than using CVS.  Going to fix this at once. 
26031
26032         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26033         load types.
26034
26035 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26036
26037         * Experiment successful: Use System.Type rather that our own
26038         version of Type.  
26039
26040 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26041
26042         * cs-parser.jay: Removed nsAliases from here.
26043
26044         Use new namespaces, handle `using XXX;' 
26045
26046         * namespace.cs: Reimplemented namespace handling, use a recursive
26047         definition of the class.  Now we can keep track of using clauses
26048         and catch invalid using clauses.
26049
26050 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26051
26052         * gen-treedump.cs: Adapted for all the renaming.
26053
26054         * expression.cs (Expression): this class now has a Type property
26055         which returns an expression Type.
26056
26057         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26058         `Type', as this has a different meaning now in the base
26059
26060 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26061
26062         * interface.cs, class.cs: Removed from all the sources the
26063         references to signature computation, as we can not do method
26064         signature computation during the parsing time, as we are not
26065         trying to solve at that point distinguishing:
26066
26067         class X {
26068                 void a (Blah x) {}
26069                 void a (NS.Blah x) {}
26070         }
26071
26072         Which depending on the context might be valid or not, as we do not
26073         know if Blah is the same thing as NS.Blah at that point.
26074
26075         * Redid everything so the code uses TypeRefs now instead of
26076         Types.  TypeRefs are just temporary type placeholders, that need
26077         to be resolved.  They initially have a pointer to a string and the
26078         current scope in which they are used.  This is used later by the
26079         compiler to resolve the reference to an actual Type. 
26080
26081         * DeclSpace is no longer a CIR.Type, and neither are
26082         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26083         are all DeclSpaces, but no Types. 
26084
26085         * type.cs (TypeRefManager): This implements the TypeRef manager,
26086         which keeps track of all the types that need to be resolved after
26087         the parsing has finished. 
26088
26089 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26090
26091         * ARGH.  We are going to have to store `foreach' as a class rather
26092         than resolving it, as we need to verify error 1579 after name
26093         resolution.   *OR* we could keep a flag that says `This request to
26094         IEnumerator comes from a foreach statement' which we can then use
26095         to generate the error.
26096
26097 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26098
26099         * class.cs (TypeContainer.AddMethod): we now add methods to the
26100         MethodGroup instead of the method hashtable.  
26101
26102         * expression.cs: Add MethodGroup abstraction, which gets us one
26103         step closer to the specification in the way we handle method
26104         declarations.  
26105
26106         * cs-parser.jay (primary_expression): qualified_identifier now
26107         tried to match up an identifier to a local variable reference or
26108         to a parameter reference.
26109
26110         current_local_parameters is now a parser global variable that
26111         points to the current parameters for the block, used during name
26112         lookup.
26113
26114         (property_declaration): Now creates an implicit `value' argument to
26115         the set accessor.
26116
26117 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26118
26119         * parameter.cs: Do not use `param' arguments as part of the
26120         signature, per the spec.
26121
26122 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26123
26124         * decl.cs: Base class for classes, structs and interfaces.  This
26125         is the "Declaration Space" 
26126
26127         * cs-parser.jay: Use CheckDef for checking declaration errors
26128         instead of having one on each function.
26129
26130         * class.cs: Factor out some code for handling error handling in
26131         accordance to the "Declarations" section in the "Basic Concepts"
26132         chapter in the ECMA C# spec.
26133
26134         * interface.cs: Make all interface member classes derive from
26135         InterfaceMemberBase.
26136
26137 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26138
26139         * Many things: all interfaces are parsed and generated in
26140         gen-treedump.  Support for member variables, constructors,
26141         destructors, properties, constants is there.
26142
26143         Beginning of the IL backend, but very little done, just there for
26144         testing purposes. 
26145
26146 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26147
26148         * cs-parser.jay: Fix labeled statement.
26149
26150         * cs-tokenizer.cs (escape): Escape " and ' always.
26151         ref_line, ref_name: keep track of the line/filename as instructed
26152         by #line by the compiler.
26153         Parse #line.
26154
26155 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26156
26157         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26158         to match the values in System.CodeDOM.
26159
26160         Divid renamed to Divide.
26161
26162         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26163         statements. 
26164         (Statements.set): remove.
26165
26166         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26167         statements. 
26168
26169         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26170         falseStatements always have valid values. 
26171
26172         * cs-parser.jay: Use System.CodeDOM now.
26173