3d38719bb297fcab0daa753ec84fa03afd82fb06
[mono.git] / mcs / mcs / ChangeLog
1 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2
3         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4         internal error not an user error.
5          
6         * expression.cs (IsApplicable): Refactored to make debugging easier.
7
8         * support.cs: More tricks for non-mono runtimes.
9         
10         * typemanager.cs (CoreLookupType): Made public.
11         (InitSystemCore): All linq specific stuff moved to linq.cs
12
13 2007-06-05  Marek Safar  <marek.safar@gmail.com>
14
15         * typemanager.cs (CSharpSignature): One more missing build-in types
16         replacement.
17         More tricks for non-mono runtime.
18
19 2007-06-05  Raja R Harinath  <harinath@gmail.com>
20
21         * statement.cs (Block.CheckError136_InParents): Remove.
22         (Block.AddVariable): Use GetParameterInfo instead.
23         (ToplevelBlock.ProcessArguments): Likewise.
24
25 2007-06-04  Raja R Harinath  <rharinath@novell.com>
26
27         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
28         information too.
29         (ToplevelBlock.GetParameterInfo): Split out of ...
30         (ToplevelBlock.GetParameterRefernce): ... this.
31         (ToplevelBlock.ParameterMap): Remove.
32         * expression.cs (ParameterReference): Update to use
33         ToplevelParameterInfo.
34
35         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
36         regression.
37
38         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
39         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
40
41         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
42         (ToplevelBlock.ProcessParameters) ... here.
43         (ToplevelBlock..ctor): Invoke it.
44
45         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
46         new parameters.
47
48         * statement.cs (IKnownVariable): New interface.
49         (LocalInfo): Implement it.
50         (ToplevelParameterInfo): New class.
51         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
52         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
53         GetKnownVariableInfo.
54
55 2007-06-03  Raja R Harinath  <harinath@gmail.com>
56
57         Partly speed up CS0136 error checks.
58         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
59         'recurse' parameter.
60         (Block.DoCheckError136): Only check errors in parameters.  Move
61         local variable checks ...
62         (Block.AddVariable): ... here, and ...
63         (ToplevelBlock.ResolveMeta): ... here.
64
65 2007-06-02  Raja R Harinath  <harinath@gmail.com>
66
67         * statement.cs (Block.IsChildOf): Remove.
68
69         * statement.cs (Statement.Clone): Move special case code ...
70         (Block.CloneTo): ... here.
71
72 2007-05-29  Raja R Harinath  <rharinath@novell.com>
73
74         * statement.cs (ToplevelBlock.container): Remove field.  It's
75         redundant with 'Parent'.
76         (ToplevelBlock.ContainerBlock): Remove accessor.
77         (ToplevelBlock..ctor): Update to changes.  Register anonymous
78         child with parent here, ...
79         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
80         current_block.
81         (start_anonymous): Don't save current_block.
82         (top_current_block): Remove.
83
84         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
85         (Block.Resolve): Update to changes.
86         (Block..ctor): Move setting of "correct" 'Toplevel'
87         and 'Explicit' fields to ...
88         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
89
90 2007-05-27  Raja R Harinath  <harinath@gmail.com>
91
92         Kill Block.Implicit
93         * statement.cs (Block.Implicit): Remove.
94         (Block): Update to changes.
95         * flowanalysis.cs: Likewise.
96
97         Mildly speed up CheckInvariantMeaningInBlock
98         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
99         Recursively call AddKnownVariable to all enclosing blocks.
100         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
101         Remove recursive calls.
102         (Block): Update to changes.
103
104         New ExplicitBlock invariants
105         * statement.cs (Block.Explicit): New field.  It points to the
106         immediately enclosing non-implicit block.
107         (Block..ctor): Maintain the invariant.
108         * cs-parser.jay: Take advantage of invariant.
109
110         Introduce ExplicitBlock
111         * statement.cs (ExplicitBlock): New.
112         (ToplevelBlock): Derive from it.
113         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
114         sense of flag.
115         (Block.Implicit): Update to changes.
116         * cs-parser.jay: Update to changes.
117
118         Remove unused field
119         * codegen.cs (EmitContext.IsLastStatement): Remove.
120         * statement.cs (Block.DoEmit): Update to changes.
121
122 2007-05-25  Raja R Harinath  <rharinath@novell.com>
123
124         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
125         modifying current_block directly.
126
127 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
128         
129         * class.cs: Implemented automatic properties (C# 3.0)
130           Thanks to Marek for the help.
131
132 2007-05-23  Raja R Harinath  <rharinath@novell.com>
133
134         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
135         variable as assigned, note also that all its components are
136         assigned too.
137         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
138
139 2007-05-19  Marek Safar  <marek.safar@gmail.com>
140
141         * anonymous.cs, class.cs: Emit Compiler generated attribute when
142         member is marked as compiler generated.
143         
144         * decl.cs (MemberCore): Refactored ModFlags into property.
145
146         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
147         (Check): Check only accessibility modifiers.
148
149 2007-05-18  Raja R Harinath  <rharinath@novell.com>
150
151         Track all assignable slots in one bit array
152         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
153         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
154         logic from VariableMap constructor here.  Use the same 'offset'
155         variable that's later used for computing offsets of local
156         variables.
157         * flowanalysis.cs (UsageVector.parameters): Remove.
158         (UsageVector): Update to changes.
159         (VariableMap): Remove.
160
161         Avoid creating ParameterMap in every block
162         * statement.cs (Block.ParameterMap): Move ...
163         (ToplevelBlock.ParameterMap): ... here.
164         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
165         only once.
166         * flowanalysis.cs (FlowBranching.param_map): Remove.
167         (FlowBranching.UsageVector): Update to changes.
168         (FlowBranchingToplevel.CheckOutParameters): Likewise.
169
170         * statement.cs (Block.CloneTo): Clone Toplevel field too.
171
172         * expression.cs (ParameterReference): Distinguish between block
173         where parameter was referenced and declared.
174
175 2007-05-18  Marek Safar  <marek.safar@gmail.com>
176
177         * flowanalysis.cs, statement.cs: Put back improved error handling.
178
179 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
180         
181         * assign.cs:
182         * expression.cs:
183           Imporved object and collection initialization (C# 3.0).
184
185 2007-05-15  Marek Safar  <marek.safar@gmail.com>
186
187         A fix for bug #81380
188         * expression.cs (Is.DoResolve): Only value types have constant `is'
189         behaviour.
190
191 2007-05-15  Raja R Harinath  <rharinath@novell.com>
192
193         * statement.cs (ToplevelBlock.child): Remove.
194
195 2007-05-15  Raja R Harinath  <harinath@gmail.com>
196
197         Rationalize ResolveMeta: refactoring
198         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
199         out constant handling code into ...
200         (Block.DoResolveConstants): ... this.
201
202         Rationalize ResolveMeta: kill local_map
203         * statement.cs (Block.local_map, Block.LocalMap): Remove.
204         (Block.AssignableSlots): New.
205         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
206         for locals -- move code from VariableMap here.  Avoid unnecessary
207         allocations.
208         * flowanalysis.cs (FlowBranching.local_map): Remove.
209         (FlowBranching..ctor): Use Block.AssignableSlots.
210         (VariableMap): Remove unused constructors.
211
212 2007-05-11  Raja R Harinath  <rharinath@novell.com>
213
214         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
215
216 2007-05-11  Marek Safar  <marek.safar@gmail.com>
217
218         * typemanager.cs (IsFriendAssembly): Should not be called for building
219         assembly.
220
221 2007-05-09  Marek Safar  <marek.safar@gmail.com>
222
223         * literal.cs (NullConstant): Print null in all cases.
224         
225         * expression.cs (Binary.ResolveOperator): Implemented delegate
226          comparison based on C# 2.0 changes.
227
228 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
229
230         This code is contributed under the MIT X11 license
231         
232         The following enables support for several C# 3.0 language features:
233         
234         * cs-tokenizer.cs: Added support for the "var" keyword.
235         
236         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
237           Added VarExpr class to facilitate type inferencing.
238         
239         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
240           to support anonymous types.
241         
242         * assign.cs: Added support for type inferencing and initialization.
243         
244         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
245         
246         * expression.cs: Added implicit array support to ArrayCreation.
247           Added 5 types and 1 interface:
248           
249           IInitializable                Implementing classes can inject initializing
250                                         statements after object instantiation.
251           
252           Initializer                   Stores data for object initialization.
253           
254           AnonymousType                 An expression for anonymous types.
255           
256           AnonymousTypeParameter        Stores data about an anonymous type's field.
257           
258           NewInitialize                 An expression for object initialization.
259           
260           CollectionInitialize          An expression for collection initialization.
261         
262         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
263           statements.
264
265 2007-05-06  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #81500
268         * cs-tokenizer.cs: Add special handling for coalescing operator.
269
270 2007-05-06  Marek Safar  <marek.safar@gmail.com>
271
272         A fix for bug #81529
273         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
274         its value from base class until it is redefined.
275
276 2007-05-02  Raja R Harinath  <rharinath@novell.com>
277
278         Fix regression in cs0631-3.cs
279         * cs-parser.jay (operator_declarator): Add opt_attributes to error
280         fallback.  Make error fallback catch more cases.
281
282 2007-05-01  Miguel de Icaza  <miguel@novell.com>
283
284         * cs-parser.jay: Allow parameters in operator declarations to have
285         attributes. 
286
287 2007-04-27  Miguel de Icaza  <miguel@novell.com>
288
289         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
290         exists. 
291
292         * lambda.cs (ContextualReturn.Resolve): An expression is valid
293         inside the ContextualReturn, it does not have to be an
294         ExpressionStatement. 
295
296 2007-04-24  Miguel de Icaza  <miguel@novell.com>
297
298         * lambda.cs (ContextualReturn.Resolve): if the return type is not
299         set, set it.
300
301 2007-04-23  Miguel de Icaza  <miguel@novell.com>
302
303         * anonymous.cs (AnonymousContainer): split the virtual Resolve
304         method in two methods: ResolveNoDefine and Resolve.
305
306         ResolveNoDefine will stop just after ResolveTopBlock has been
307         called.   
308
309         Resolve will then continue by creating a method and issuing the
310         call to method.Define ().
311
312         (AnonymousMethod): Split and implement the new Resolve and
313         ResolveNoDefine as well.
314
315         * lambda.cs (LambdaExpression): Split the anonymous method
316         resolution code into a separate routine (CoreCompatibilityTest)
317         from DoCompatibleTest.
318
319         (LambdaExpression.TryBuild): New method, this method tries to
320         build the LambdaExpression with the given set of types to be used
321         as the types for the various parameters of the lambda expression. 
322
323         If the compilation succeed with the given types, the infered type
324         of the Anonymous method is returned, otherwise null is returned.
325
326 2007-04-23  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #81414
329         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
330
331 2007-04-22  Miguel de Icaza  <miguel@novell.com>
332
333         * cs-tokenizer.cs: Change various identifiers here from the
334         camelCasing to the recommended Linux-like style for instance
335         variables from the Coding Guidelines. 
336
337 2007-04-19  Martin Baulig  <martin@ximian.com>
338
339         * convert.cs
340         (Convert.ImplicitReferenceConversionCore): Allow conversions from
341         System.Enum to System.ValueType.
342
343 2007-04-13  Martin Baulig  <martin@ximian.com>
344
345         Rewrote implicit reference conversions.  We need to distinguish
346         between implicit reference conversions (13.1.4) and implicit
347         boxing conversions (13.1.5).
348
349         According to the spec, there's an an implicit conversion
350         "From a one-dimensional array-type S[] to IList<T> and base
351         interfaces of this interface, provided there is an implicit
352         reference conversion from S to T."  Note that this does not
353         include boxing conversions.
354
355         * convert.cs
356         (Convert.ImplicitTypeParameterBoxingConversion): New method.
357         (Convert.ImplicitReferenceConversion): Split into
358         ImplicitReferenceConversionCore() and
359         ImplicitBoxingConversionExist().
360         (Convert.ImplicitReferenceConversionExists): Use the new
361         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
362
363 2007-04-12  Martin Baulig  <martin@ximian.com>
364
365         * convert.cs (Convert.ImplicitReferenceConversion): Move the
366         `TypeManager.null_type' checks up to the top of the method.
367
368 2007-04-11  Marek Safar  <marek.safar@gmail.com>
369
370         A fix for bug #81350
371         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
372         extension methods.
373
374 2007-04-11  Martin Baulig  <martin@ximian.com>
375
376         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
377         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
378         to make this work for generic classes; fixes #79561.
379
380 2007-04-11  Martin Baulig  <martin@ximian.com>
381
382         * expression.cs (As): Add support for nullable types; fixes #79371.
383
384 2007-04-11  Martin Baulig  <martin@ximian.com>
385
386         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
387         `type.FullName' is null; fixes #80243.
388
389 2007-04-11  Martin Baulig  <martin@ximian.com>
390
391         * expression.cs (Invocation.IsApplicable): Don't modify the method
392         if type inference succeeded, but the method was not applicable.
393         Fixes #81250.
394
395 2007-04-10  Marek Safar  <marek.safar@gmail.com>
396
397         A fix for bug #81324
398         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
399         internal and external namespaces containers.
400
401 2007-04-10  Martin Baulig  <martin@ximian.com>
402
403         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
404         TypeManager.DropGenericMethodArguments() so we also call
405         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
406
407 2007-04-10  Martin Baulig  <martin@ximian.com>
408
409         * iterators.cs (Iterator.CreateIterator): Don't crash if
410         `method.ReturnType' is null.  This happens if something went wrong
411         while resolving that typ (we already reported an error in this case).
412
413 2007-04-10  Martin Baulig  <martin@ximian.com>
414
415         * expression.cs (New.DoResolve): Don't call CheckComImport() on
416         generic interfaces; report the CS0144 directly.
417
418 2007-04-10  Martin Baulig  <martin@ximian.com>
419
420         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
421         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
422
423 2007-04-10  Martin Baulig  <martin@ximian.com>
424
425         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
426
427 2007-04-09  Raja R Harinath  <rharinath@novell.com>
428
429         A better fix
430         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
431         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
432
433         Fix #81338
434         * statement.cs (For.Resolve): If resolution fails, use
435         KillFlowBranching.
436
437 2007-04-08  Marek Safar  <marek.safar@gmail.com>
438
439         * anonymous.cs (MakeName): Make faster and zero-based.
440         (VerifyExplicitParameterCompatibility): Back to mode where generic
441         parameter is ignored.
442         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
443
444         * class.cs (EmitType): Method can emit another new method.
445
446         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
447
448         * driver.cs: Updated.
449
450         * lambda.cs: Reuse predefined empty parameters.
451
452         * parameter.cs: Updated
453
454         * support.cs: Implemented InflateTypes.
455
456         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
457         (InitSystemCore): Introduced to isolate 3.0 dependencies.
458
459 2007-04-03  Martin Baulig  <martin@ximian.com>
460
461         Fix #80632.
462
463         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
464         version of TypeManager.IsOverride() which also works with generic
465         types.  
466
467 2007-04-03  Martin Baulig  <martin@ximian.com>
468
469         Fix #81044.
470
471         * convert.cs
472         (Convert.ExplicitReferenceConversion): We need to cast when
473         converting from IList<T> to S[].
474
475 2007-04-01  Marek Safar  <marek.safar@gmail.com>
476
477         * decl.cs (FindExtensionMethods): Consider all candidates with same name
478         at this level.
479         
480         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
481
482 2007-03-31  Marek Safar  <marek.safar@gmail.com>
483
484         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
485         argument and return type inferring.
486
487         * codegen.cs (InferReturnType): Flag whether return can be inferred.
488         (ReturnType): Turned to property.
489
490         * statement.cs (Return): Implemented return type inferring.
491
492         * support.cs (ReflectionParameters): Use local types if possible.
493
494 2007-03-30  Raja R Harinath  <rharinath@novell.com>
495
496         * flowanalysis.cs (FlowBranching.Reachability): Remove.
497         (FlowBranching.UsageVector): Update to changes.
498
499         Prepare to kill 'Reachability'
500         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
501         argument of constructor.
502
503 2007-03-29  Raja R Harinath  <rharinath@novell.com>
504
505         Prepare to kill 'Reachability'
506         * flowanalysis.cs (UsageVector.is_unreachable): New.
507         (UsageVector): Update to maintain 'is_unreachable' in parallel to
508         'reachability', and verify they're consistent.
509
510         Fix #81121
511         * expression.cs (New.EmitStatement): Handle type parameters here too.
512
513 2007-03-29  Martin Baulig  <martin@ximian.com>
514
515         Fix #79148.
516
517         * anonymous.cs
518         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
519         CompilerGeneratedClass.
520         (ScopeInfo.EmitScopeInstance): Make this protected.
521         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
522         `ec.CurrentAnonymousMethod.Scope == Scope'.
523
524         * statement.cs (Block.ScopeInfo): Make this a property.
525
526 2007-03-27  Raja R Harinath  <harinath@gmail.com>
527
528         Prepare to kill 'Reachability'
529         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
530         (FlowBranching.UsageVector.Reachability): Remove property.
531         (FlowBranching.UsageVector.IsUnreachable): New property.
532         (FlowBranching.UsageVector.ResetBarrier): New.
533         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
534         * codegen.cs, statement.cs: Update to changes.
535
536 2007-03-27  Martin Baulig  <martin@ximian.com>
537
538         Fix #81209.
539
540         * decl.cs
541         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
542         generic types.
543
544 2007-03-26  Raja R Harinath  <rharinath@novell.com>
545
546         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
547         instead of TriState.  Remove all mention of TriState.
548
549         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
550         replaced by a boolean.  Add boolean 'is_unreachable' field, check
551         and maintain invariants.
552
553 2007-03-25  Marek Safar  <marek.safar@gmail.com>
554
555         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
556
557 2007-03-25  Marek Safar  <marek.safar@gmail.com>
558
559         * expression.cs: Stop using obsolete 2.0 opcodes.
560
561 2007-03-25  Marek Safar  <marek.safar@gmail.com>
562
563         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
564         one of the latests Martin's fixes.
565
566 2007-03-23  Miguel de Icaza  <miguel@novell.com>
567
568         * expression.cs: On BigEndian systems, swap the bytes, temporary
569         solution until we get a new bitconverter class.
570
571 2007-03-23  Martin Baulig  <martin@ximian.com>
572
573         Fix #81158.
574
575         * decl.cs (MemberCache.AddMembers): Add generic methods both as
576         "Method" and "Method`1".  Normally, a cache lookup is done on the
577         "Method" form (ie. without the generic arity), but this one makes
578         lookups on the full form work as well.
579
580 2007-03-22  Raja R Harinath  <rharinath@novell.com>
581
582         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
583         unused properties.
584
585 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
586         * class.cs: 
587         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
588         ordered_member_list, to TypeBuilder to store members to be defined
589         in the order they were parsed in.
590         - ordered_explicit_member_list contains all properties indexers
591           and methods that are defined as explicit implementation of an
592           interface or base class.
593         - ordered_member_list contains all properties indexers and methods
594           that are not defined as explicit implementation of an interface
595           or base class.
596
597         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
598         functionality in these removed classes has been replaced with 
599         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
600         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
601
602         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
603         to CheckForDuplications inside GetMethod and SetMethod Define Method
604         to handle method property and indexer name conflicts.
605
606         Fixes #79434
607
608         All code is contributed under the MIT/X11 license.
609
610 2007-03-20  Martin Baulig  <martin@ximian.com>
611
612         * class.cs (TypeContainer.Interfaces): Removed; they're now
613         included in `TypeContainer.Types'.
614
615 2007-03-20  Martin Baulig  <martin@ximian.com>
616
617         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
618
619         * class.cs (TypeContainer.CreateType): New public method.  This is
620         now called before DefineType() to create the TypeBuilders.
621         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
622         has already been created by CreateType().
623         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
624         don't resolve our base classes here; this has been moved into
625         DefineBaseTypes().  We're now called from CreateType().
626         (TypeContainer.DefineBaseTypes): New private method; resolve our
627         base classes here.  We're now called from DefineType().
628
629         * rootcontext.cs
630         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
631         our types first to create all the TypeBuilders.  After that, call
632         TypeContainer.DefineType() on all the types which'll resolve their
633         base classes and setup the resolve order.
634
635 2007-03-20  Martin Baulig  <martin@ximian.com>
636
637         * class.cs (TypeContainer.Enums): Removed; they're now included in
638         `TypeContainer.Types'.  
639
640 2007-03-20  Martin Baulig  <martin@ximian.com>
641
642         * class.cs
643         (TypeContainer.DefineType): Don't call ResolveMembers() here.
644         (TypeContainer.DoResolveMembers): Call DefineType() on our
645         `compiler_generated' classes; moved here from DefineNestedTypes().
646
647         * rootcontext.cs
648         (RootContext.ResolveTree): Call ResolveMembers() on all
649         TypeContainer's in the `type_container_resolve_order'.
650
651 2007-03-19  Marek Safar  <marek.safar@gmail.com>
652
653         * class.cs: Use corlib to handle InternalMethodImplAttribute.
654
655 2007-03-17  Marek Safar  <marek.safar@gmail.com>
656
657         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
658         implementation flags.
659
660 2007-03-17  Marek Safar  <marek.safar@gmail.com>
661
662         * class.cs: More optimizations for type parameters.
663
664 2007-03-15  Marek Safar  <marek.safar@gmail.com>
665
666         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
667
668         * ecore.cs, parameter.cs: More common code for both corlibs.
669
670         * typemanager.cs (IsGenericMethod): Simplified.
671
672 2007-03-15  Raja R Harinath  <rharinath@novell.com>
673
674         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
675         'returns'.
676         * statement.cs, iterators.cs, lambda.cs: Update to changes.
677
678         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
679         unconditionally.  Simplify explanation.
680         (Try.Resolve, Using.Resolve): Likewise.
681
682 2007-03-15  Martin Baulig  <martin@ximian.com>
683
684         Fix #80731.
685
686         * decl.cs (DeclSpace): If we're a partial class, use our
687         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
688
689 2007-03-15  Raja R Harinath  <rharinath@novell.com>
690
691         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
692         'throws'.
693         (FlowBranching.UsageVector): Update to changes.
694         (FlowBranching.MergeSiblings): Likewise.
695         * statement.cs: Likewise.
696
697 2007-03-15  Martin Baulig  <martin@ximian.com>
698
699         Fix #79302.
700
701         * decl.cs
702         (MemberCache): Added a special .ctor for type parameters.
703
704         * typemanager.cs
705         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
706         `MemberCache'.  
707
708 2007-03-09  Martin Baulig  <martin@ximian.com>
709
710         * enum.cs (Enum): Make this a TypeContainer.
711         (EnumMember): Derive from `Const'.
712
713         * const.cs
714         (Const.DoResolveValue): New protected virtual method; move most of
715         the functionality of ResolveValue() here so we can override it in
716         `EnumMember'.
717         (Const.CreateConstantReference): Make this virtual.
718
719         * class.cs (Kind): Add `Kind.Enum'.
720         (TypeContainer.Emit): Don't emit the enums here; they're already
721         in the `RootContext.typecontainer_resolve_order'.
722
723         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
724         here; they're already in the `typecontainer_resolve_order'.
725
726         * ecore.cs (EnumConstant.ConvertImplicitly): Add
727         TypeManager.DropGenericTypeArguments().
728
729         * typemanager.cs
730         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
731         (TypeManager.IsEnumType): Likewise.
732         (TypeManager.EnumToUnderlying): Likewise.
733         (TypeManager.IsEqual): Add support for enums.
734
735 2007-03-12  Raja R Harinath  <rharinath@novell.com>
736
737         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
738         DefaultParameterValueAttribute to be undefined, say if System.dll
739         is not referenced.
740
741 2007-03-11  Marek Safar  <marek.safar@gmail.com>
742
743         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
744         any mscorlib.
745
746 2007-03-10  Marek Safar  <marek.safar@gmail.com>
747
748         * class.cs, parameter.cs: Unified parameters verification.
749
750 2007-03-08  Martin Baulig  <martin@ximian.com>
751
752         * cs-parser.jay (constructor_header): Pass the location to the
753         newly created TopLevelBlock.
754
755 2007-03-07  Martin Baulig  <martin@ximian.com>
756
757         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
758
759 2007-03-06  Miguel de Icaza  <miguel@novell.com>
760
761         * convert.cs (ExplicitReferenceConversionExists): Sync this method
762         with the changes from David, fixes the build.
763
764 2007-03-05  David Mitchell  <dmitchell@logos.com>
765
766         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
767         and its base interfaces to a one-dimensional array type S[],
768         provided there is an implicit or explicit reference conversion
769         from S to T.
770
771 2007-03-03  Marek Safar  <marek.safar@gmail.com>
772
773         * cs-tokenizer.cs: Implemented basic linq grammar.
774
775         * driver.cs: Set linq lang version on demand.
776
777 2007-02-26  Marek Safar  <marek.safar@gmail.com>
778
779         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
780
781 2007-02-25  Marek Safar  <marek.safar@gmail.com>
782
783         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
784         (Fixes #80455)
785
786         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
787         here.
788         Check property and event extern attributes.
789
790         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
791         charset.
792
793 2007-02-24  Marek Safar  <marek.safar@gmail.com>
794
795         A fix for bug #80407
796         * ecore.cs: Don't report ambiguity error when methods have same parent.
797
798 2007-02-23  Marek Safar  <marek.safar@gmail.com>
799
800         A fix for bug #80878
801         * class.cs, cs-parser.jay: Event property can host anonymous methods.
802
803 2007-02-22  Marek Safar  <marek.safar@gmail.com>
804
805         * attribute.cs: Enable ExtensionAttribute presence test.
806
807 2007-02-22  Marek Safar  <marek.safar@gmail.com>
808
809         * class.cs: Warn about missing GetHashCode only when Equals is override.
810
811         * decl.cs: Check accessibility of type arguments.
812
813         * typemanager.cs: Correctly report nullable array.
814
815 2007-02-20  Marek Safar  <marek.safar@gmail.com>
816
817         * class.cs, report.cs: Capture more details when things go wrong.
818
819 2007-02-20  Marek Safar  <marek.safar@gmail.com>
820
821         A fix for bug #80650
822         * cs-parser.jay: Anonymous container starts at constructor declaration
823         and not at block beginning because it has to be usable in constructor
824         initializer.
825
826         * statement.cs: Use context location and not block one for error reporting.
827
828 2007-02-18  Marek Safar  <marek.safar@gmail.com>
829
830         A fix for bug #78712
831         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
832         too.
833
834 2007-02-18  Marek Safar  <marek.safar@gmail.com>
835
836         A fix for bug #80493 by Atsushi Enomoto
837         * cs-parser.jay: Ignore invalid attribute target.
838
839 2007-02-18  Marek Safar  <marek.safar@gmail.com>
840  
841         * cs-tokenizer.cs: Ignore '\0' as white space character.
842
843 2007-02-17  Miguel de Icaza  <miguel@novell.com>
844
845         * cs-parser.jay: Add support for lambda expressions to the mcs
846         compiler as well.
847
848         * lambda.cs: Only clone when we are probing, not on the final call
849         (Compatible is the final call). 
850
851         * statement.cs (CloneContext): Introduce class to provide block
852         remapping during clone.
853
854         All statements Clone themselves now.
855
856         (Clone): special handling for blocks, when we clone a block, we
857         register the block inside this routine, as children of the block
858         might trigger a lookup. 
859         
860         * expression.cs: Add support for CloneContext in all expressions. 
861         
862 2007-02-17  Marek Safar  <marek.safar@gmail.com>
863  
864         A fix for bug #80493
865         * statement.cs: Report ambiguous warning when interfaces are not related.
866
867 2007-02-15  Marek Safar  <marek.safar@gmail.com>
868
869         C# 3.0 extension methods.
870
871         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
872         cannot be used directly.
873
874         * class.cs (Class.Emit): Emit extension attribute if any class method
875         is extension method.
876         (Method.Define): Add basic extension method validation conditions.
877         (Method.Emit): Emit extension attribute for method.
878
879         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
880         extension method exists. Currently we follow same approach as Microsoft
881         does, emit even if a method or a class are private but this can change
882         later.
883
884         * cs-parser.jay: Add handling of `this' keyword in method parameters
885         context.
886
887         * decl.cs (DeclSpace.IsStaticClass): New property.
888         (MemberCache.FindExtensionMethods): Looks for extension methods with
889         defined name and extension type.
890
891         * doc.cs: Updated after OverloadResolve changes.
892
893         * driver.cs: Add new soft reference to System.Core.dll.
894
895         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
896         (ExtensionMethodGroupExpr): Represents group of extension methods.
897
898         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
899         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
900         to MethodGroupExpr and made non-static for easier customization.
901         (Invocation.DoResolve): Add extension method lookup when no standard
902         method was found.
903         (MemberAccess.DoResolve): Try extension methods if no member exists.
904
905         * modifiers.cs: Add METHOD_EXTENSION modifier.
906
907         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
908         as well as candidate extension type.
909         (ComputeNamespaces): When assembly constains extension methods registers
910         them.
911         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
912         extension method lookup.
913         (Namespace.LookupExtensionMethod): Looks for extension method in this
914         namespace.
915         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
916         find a method which matches name and extensionType.
917
918         * parameter.cs (Parameter): Add This modifer.
919         (HasExtensionMethodModifier): New property.
920         (Resolve): Add extension parameter check.
921         (ModFlags): turned to property to exclude this modifier as it is not real
922         parameter modifier.
923         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
924
925         * support.cs (ParameterData): Add ExtensionMethodType.
926         (ReflectionParameters): Implemented ExtensionMethodType interface property.
927
928         * typemanager.cs: Add type and ctor extension attribute type.
929
930 2007-02-15  Miguel de Icaza  <miguel@novell.com>
931
932         * report.cs (DisableErrors, EnableErrors): used to prevent error
933         output when we are "trying" to compile various methods with
934         different types. 
935
936         * ecore.cs (Expression): Add Clone method that calls the virtual
937         CloneTo method.  The current CloneTo method in Expression throws
938         an exception so we can track down all the places where this must
939         be implemented (not using abstract, because that would be a lot of
940         up-front-work before we can start testing the implementation
941         idea). 
942
943         Important: we only need Clone capabilities for expressions created
944         by the parser, as the expressions we will be cloning are
945         expressions in the pre-resolved state.   This vastly simplifies
946         the work required. 
947         
948         (SimpleName): Add CloneTo that does nothing.
949         (EmptyCast): Add CloneTo.
950         
951         * expression.cs (Binary): Implement CloneTo.
952         (Invocation.IsApplicable): Store the current ec in
953         EmitContext.TempEc and restore it on return.  This is used so we
954         do not have to sprinkle hundres of methods with an extra
955         EmitContext, we know that the only user is the lambda expression
956         ImplicitConversionExists code. 
957         
958         (Argument): Add Cloning capabilities.
959         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
960         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
961         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
962         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
963         IndexerAccess): Add Clone capability.
964
965         (LocalVariableReference, This): TODO: needs cloned Block mapping.
966
967         (Argument): Add cloning capability.
968
969         * assign.cs (Assign): Implement CloneTo.
970
971         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
972         
973         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
974         version by calling Convert with the EmitContext (that we are
975         currently storing in ec, this is not great, but will do for now,
976         to avoid passing EmitContext parameters to hundreds of functions
977         that do not need them now).
978
979         (SetExpression): Remove, it is not needed.
980         
981         (ContextualReturn): Implement CloneTo.
982
983         * statement.cs (Statement): Implement cloning infrastructure,
984         similar to expressions.
985
986         (Block): Partial implementation of Clone for statements.
987
988         (Return): Implement clone.
989         
990         * constant.cs (Constant.CloneTo): New method, does nothing.
991
992         * codegen.cs (TempEc): Add a static EmitContext as a temporary
993         solution, until we decide how to exactly do this.  
994         
995 2007-02-14  Marek Safar  <marek.safar@gmail.com>
996  
997         A fix for bug #80493
998         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
999         a property is override we need to use second accessor.
1000
1001 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1002  
1003         A fix for bug #80418
1004         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1005         methods.
1006
1007 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1008
1009         Another fix for bug #80749
1010         * pending.cs: Abstract class has priority over interfaces.
1011
1012 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1013
1014         Another fix for bug #80749
1015         * pending.cs: Abstract class has priority over interfaces.
1016
1017 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1018
1019         Another fix for bug #80749
1020         * pending.cs: Abstract class has priority over interfaces.
1021
1022 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1023
1024         Another fix for bug #80749
1025         * pending.cs: Abstract class has priority over interfaces.
1026
1027 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1028
1029         * class.cs Better error message.
1030
1031         * driver.cs: Add shorter versions of -optimize option.
1032
1033 2007-02-13  Martin Baulig  <martin@ximian.com>
1034
1035         * class.cs (Constructor.Emit): Check the return value of
1036         ec.ResolveTopBlock() and return on error.
1037
1038 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1039
1040         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1041         message to fix error message regression.
1042
1043 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1044
1045         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1046
1047 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1048
1049         A fix for bug #80749
1050         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1051         its parent container.
1052
1053         * class.cs (DefineFieldInitializers): Each initializer can has different
1054         resolve context.
1055
1056         * const.cs: Updated.
1057
1058 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1059
1060         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1061         now all the heavy lifting to check that embedded statements or
1062         expressions have the right form is done in the ContextualReturn.
1063
1064         (ContextualReturn): New class.  
1065
1066         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1067         method that can be invoked to report 201, so we do not replicate
1068         this everywhere.
1069
1070         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1071         
1072         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1073         treating tabs as spaces. 
1074
1075 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1076
1077         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1078         * assign.cs: Use full implicit conversion for right side check.
1079
1080 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1081
1082         * statement.cs (Switch): Switch over boolean type is not standardized.
1083
1084 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1085
1086         A fix for bug #80755
1087         * decl.cs (FindBaseEvent): Don't use method cache for events.
1088
1089 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1090
1091         * cs-parser.jay: Better syntax error handling.
1092
1093         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1094         instead of underlying type value.
1095
1096 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1097
1098         * driver.cs: Check define identifier before is registered.
1099
1100         * namespace.cs: Use existing error message.
1101
1102         * report.cs: New warning.
1103
1104 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1105
1106         A fix for bug #80742
1107         * expression.cs: Delegate Invoke method can be called directly.
1108
1109 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1110
1111         A fix for bug #80676
1112         * class.cs (IsEntryPoint): The Main method can have params modifier.
1113
1114 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1115
1116         * parameter.cs (Parameter, Parameters): Add Clone method.
1117
1118         * anonymous.cs (Compatible): Turn method into virtual method, so
1119         LambdaExpression can implement a different behavior.
1120
1121         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1122         out the basic checking here, so it can be used by
1123         LambdaExpressions.
1124         
1125         * lambda.cs: Introduce "Compatible" function that will do the
1126         heavy lifting.
1127
1128 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1129
1130         * attribute.cs: Unified one error message.
1131
1132         * class.cs (Class): Use type attributes and not properties to test static
1133         class.
1134         (IsEntryPoint): Don's pass local variable.
1135
1136         * convert.cs: Removed duplicate check.
1137
1138         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1139
1140         * driver.cs: Don't crash when soft reference does not exist.
1141
1142         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1143         (UsingEntry): Removed redundant allocation.
1144
1145         * parameter.cs: Add fast path for type parameters.
1146
1147         * support.cs: Don't allocate attribute when it's not used.
1148
1149 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1150
1151         * anonymous.cs
1152         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1153         this into a virtual method, so we can override it in LambdaExpression.
1154
1155         * driver.cs: Improve diagnostics in case of failure. 
1156
1157         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1158         write a function that is slightly more complex and that parses:
1159
1160         type identifier [, type identifier]* )
1161
1162         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1163         this expression:
1164
1165                 (canEmpty ? i >= 0 : i > 0)
1166
1167 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1168
1169         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1170         exception on possibly valid code.
1171
1172 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1173
1174         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1175         Push/PopPosition.
1176         (parse_opt_type_arguments): Remove.  It's almost the same as
1177         parse_less_than.
1178         (parse_namespace_or_typename): Use parse_less_than.
1179
1180 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1181
1182         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1183         this bug took a few hours to find, because the state saved and
1184         restored by PushPosition and PopPosition was ignoring the state of
1185         parse_generic_less_than.
1186
1187         I can also now remove the handling of OP_LT and OP_GT, this solves
1188         the big mistery.
1189         
1190         * cs-tokenizer.cs: store the location for the ARROW token, we use
1191         that in the parser.
1192
1193         (PushPosition, PopPosition): save/restore also `current_token',
1194         restore `parse_generic_less_than' (was missing).
1195
1196         (parse_opt_type_arguments): use parse_type, not
1197         parse_namespace_or_typename to parse types.
1198
1199         * lambda.cs: Empty new file, will eventually have the lambda
1200         expression implementation.
1201
1202         * lambda.test: used to test the internal tokenizer. 
1203
1204         * report.cs (FeatureIsNotISO1): Rename from
1205         FeatureIsNotStandardized, because it was about the language level
1206         (1 vs 2) it was not about standarization.
1207
1208         (FeatureRequiresLINQ): New.
1209
1210         * support.cs (SeekableStreamReader): Only require that the reader
1211         is a TextReader, not a StreamReader, so we can plug StringReader. 
1212
1213         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1214         given position in the input stream the following tokens can be
1215         parsed as a type followed by an identifier.
1216
1217         (is_punct): after a '(' if parse_type_and_parameter returns true,
1218         then return a special token OPEN_PARENS_LAMBDA which is used to
1219         avoid reduce/reduce errors in the grammar for the
1220         lambda_expression rules.
1221
1222         (parse_type): implement a type parser inside the
1223         tokenizer, the parser only returns true or false depending on
1224         whether the input at a given position can be parsed as a type.
1225
1226         (peek_token): new method used during type parsing.
1227
1228 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1229
1230         Fix #80531
1231         * anonymous.cs (ScopeInfo.InflateParameters): New.
1232         (AnonymousContainer.Resolve): Use it to redirect types of
1233         delegate parameters.
1234
1235 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1236
1237         Fix #80530
1238         * expression.cs (Error_InvalidArguments): Don't use two different
1239         messages for CS1503.  Use ExtraInformation and
1240         SymbolRelatedToPreviousError instead.
1241
1242         Fix #80358
1243         * decl.cs (DeclSpace.initialize_type_params): Don't access
1244         'type_params' of a partial class directly.
1245
1246 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1247
1248         * constant.cs: Removed a handful of out-of-range checks that were
1249         not necessary. 
1250
1251 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1252
1253         * expression.cs (CheckUselessComparison): Add additional check for char
1254         constants.
1255
1256         * namespace.cs: Fixed typo.
1257
1258 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1259
1260         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1261         gone, instead we inline the test, preventing the needless casts to
1262         longs, ulongs and doubles for the parameters, avoiding calls to
1263         methods that overchecked stuff, and instead inlined things
1264         nicely. 
1265
1266 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1267
1268         * cs-parser.jay: Better parameter error handling.
1269
1270 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1271
1272         A fix for bug #80368, #80522
1273         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1274         whether array initializer contains constants only.
1275         (ArrayCreation.Emit): Use better formula to decide when
1276         are array initializers for static initialization.
1277         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1278         have to emit even constants otherwise they are pre-initialized.
1279
1280 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1281             Raja R Harinath  <rharinath@novell.com>
1282
1283         Fix emit order of 'get' vs. 'set'.
1284         * support.cs (Accessors): New.
1285         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1286         Note the order in which accessors are declared in the source.
1287         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1288         Refactored from Property.Define and Indexer.Define.
1289         (PropertyBase.DefineAccessors): New helper that calls the above in
1290         appropriate order as noted by the parser.
1291         (Property.Define, Indexer.Define): Update to changes.
1292         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1293
1294 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1295
1296         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1297         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1298         there's an implicit conversion from the current type to the target
1299         type before converting the underlying constant.
1300
1301 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1302
1303         * const.cs (ResolveValue): Updated after constant conversion was made more
1304         generic.
1305
1306         * constant.cs (GetAttributableValue): constant to object conversion is
1307         used for attributes only.
1308         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1309         constant conversions.
1310         (LongConstant.ConvertImplicitly): Ditto.
1311
1312         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1313         (ImplicitConversionStandard): Handle constant conversion as extra step.
1314         It solves the issue when constant conversion was called indirectly like
1315         inside array initializer and constant folding was skipped.
1316
1317         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1318         this change.
1319
1320         * statement.cs(ImplicitConversionStandard): Updated after constant
1321         conversion was made more generic.
1322
1323 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1324
1325         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1326         Constraints, solves the problem where the compiler incorrectly
1327         reported that a type parameter was not constrained to a class (Bug
1328         80518)
1329
1330 2007-01-14  Marek Habersack  <grendello@gmail.com>
1331
1332         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1333
1334 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1335
1336         A fix for bug #80368
1337         * assign.cs (FieldInitializer): New class implements field
1338         initializer statement.
1339
1340         * attribute.cs: Update after FieldMember rename.
1341
1342         * class.cs (PropertyBasedMember): New common class for property based
1343         types.
1344         (InterfaceMemberBase): New base class for all members which can be used as
1345         an interface members.
1346         (MethodCore): Moved really common code to InterfaceMemberBase.
1347         (Method.Define): Equal and GetHasCode detection is relevant for methods
1348         only.
1349         (MethodData.Define): Don't assume that public event implements an
1350         interface automatically.
1351         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1352         modifier is used.
1353         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1354         (FieldMember): Merged with FieldBase.
1355         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1356         event extern modifier can be used.
1357         (EventField.EventFieldAccessor): Moved event field specific code here.
1358         (Event.AllowedModifiers): Even event can be extern.
1359         (Event.FindOutBaseMethod): New override specific to events.
1360         (Indexer.parameters): Reintroduce parameters because base class holds
1361         only properties common data.
1362         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1363         need do extra parameters check.
1364
1365         * const.cs: Update after FieldMember rename.
1366
1367         * decl.cs (MemberCache.FindBaseEvent): New method.
1368
1369         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1370         to reflect that indexer is now derived from PropertyBased.
1371
1372         * ecore.cs (GetMemberType): Made public.
1373         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1374         obsolete event.
1375
1376         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1377         
1378         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1379         (RegisterEvent): Removed.
1380         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1381         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1382
1383 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1384
1385         Fix #80249
1386         * statement.cs (CollectionForeach.TryType): Prefer generic
1387         GetEnumerator over non-generic variant.  Fix code to follow comments.
1388
1389 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1390
1391         Fix #80446
1392         * support.cs (ReflectionParameter): Don't use an invalid index on
1393         the generic parameter data.
1394
1395 2007-01-08  Miguel de Icaza  <miguel@novell.com>
1396
1397         * driver.cs: Just add a tiny bit of infrastructure.
1398
1399 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1400
1401         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1402         where field type is struct from current assembly.
1403         
1404         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1405         it is possible.
1406
1407 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1408
1409         A fix for bug #80381
1410         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1411         the core types.
1412
1413         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1414         messages.
1415         (Namespace.LookupType): Always use core types from corlib when speficied.
1416
1417         * report.cs: A new warning.
1418
1419         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1420         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1421         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1422
1423         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1424         (InitCoreTypes): Set expression type of object_type and value_type
1425         immediately after lookup.
1426
1427 2007-01-01  Miguel de Icaza  <miguel@novell.com>
1428
1429         * cs-tokenizer.cs: Accept Pc class characters (Connector
1430         Punctuation) as valid identifiers.  Fixes #78259
1431
1432         * expression.cs (Invocation.DoResolve): Moved the check for the
1433         use of `this' for doing method calls to the Invocation resolution
1434         step, after overload resolution has taken place instead of doing
1435         the check at the low-level `This.DoResolve' level.
1436
1437         The `This.DoResolve'(appens before overload resolution, so it has
1438         no way of knowing if the method that will be called will be
1439         instace or static, triggering an erroneous report for cs0188 (Bug
1440         78113).
1441
1442         We now do the check for instance method invocations after we know
1443         what method will be called.
1444
1445         (This.CheckThisUsage): Move the actual use of this structure
1446         checking into its own method and expose it. 
1447
1448         * Everywhere that called Error_ValueCannotBeConverted: pass a new
1449         EmitContext.
1450
1451         Exceptions: Null.ConvertImplicitly,
1452         Constant.ImplicitConversionRequired as there are too many call
1453         sites for passing the ec. 
1454
1455         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1456         EmitContext, if the value is null, then we do not try to provide
1457         the extra information from the error (If a userdefined conversion
1458         exists, as UserDefinedConversion requires a non null-EmitContext).
1459
1460         Fixes: #80347
1461
1462 2006-12-30  Raja R Harinath  <rharinath@novell.com>
1463
1464         * flowanalysis.cs (MyBitVector): Document some invariants.
1465         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1466         introduced below, and add a couple of others, 
1467
1468 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1469
1470         * attribute.cs (GetMethodObsoleteAttribute): Uses new
1471         GetPropertyFromAccessor and GetEventFromAccessor.
1472         
1473         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1474         overrides non-obsolete one.
1475         (Indexer.Define): Error message has been moved to the parser.
1476
1477         * cs-parser.jay: Better syntax errors handling.
1478
1479         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1480         when an invocation has no arguments.
1481
1482         * ecore.cs: Removed not used caching.
1483
1484         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1485         implementation.
1486
1487         * report.cs: Add a new warning.
1488
1489         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1490
1491         * typemanager.cs (enumeration_type): Removed.
1492         (CSharpSignature): Reuses IsSpecialMethod.
1493         (IsEqual): Hack for MS BCL.
1494         (GetPropertyFromAccessor): New method.
1495         (GetEventFromAccessor): New method.
1496         (IsSpecialMethod): Fixed to handle more cases.
1497
1498 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1499
1500         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1501         Made white spaces array static.
1502
1503         * ecore.cs (RemoveGenericArity): Optimized.
1504
1505         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1506         10 times faster).
1507         (MyBitVector.initialize_vector): Simplified.
1508
1509 2006-12-22  Miguel de Icaza  <miguel@novell.com>
1510
1511         * ecore.cs: Am not entirely happy with this hack, but it seems to
1512         address the issue in 80257 (a small test case for
1513         CreativeDocs.NET). 
1514
1515         I set the MethodGroupExpr.Type to an internal compiler type
1516         (itself in this case) to force the resolution to take place.   Why
1517         it does not take place with a null is beyond me.
1518
1519 2006-12-20  Marek Safar  <marek.safar@gmail.com>
1520
1521         A fix for bug #80288
1522         * expression.cs (ResolveOperator): Consider user defined conversion for
1523         logical and operator too.
1524         (EmitBranchable): Optimization for logical and when full constant folding
1525         could not be applied but one operand is constant.
1526
1527 2006-12-19  Marek Safar  <marek.safar@gmail.com>
1528
1529         * class.cs (GetClassBases): Write 5 times every day, will never use
1530         FullName for error reporting.
1531
1532         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1533
1534 2006-12-19  Martin Baulig  <martin@ximian.com>
1535
1536         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1537         the symbol file info here.
1538
1539 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1540
1541         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1542         of `elseif' is taking then following sections are not taking.
1543         Fixes an issue reported on mono mailing list.
1544
1545 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1546
1547         A fix for bug #80300
1548         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1549         a caller is not taking.
1550
1551 2006-12-18  Raja R Harinath  <rharinath@novell.com>
1552
1553         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1554         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1555         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1556         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1557         * class.cs: Update to changes.
1558
1559 2006-12-17  Marek Safar  <marek.safar@gmail.com>
1560
1561         A fix for bug #79934
1562         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1563         partial container.
1564
1565         * class.cs (ResolveMembers): Register an iterator in current container and
1566         not in shared one.
1567
1568 2006-12-16  Raja R Harinath  <rharinath@novell.com>
1569
1570         Fix test-543.cs
1571         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1572         satisfy a params annotated parameter.
1573
1574 2006-12-16  Marek Safar  <marek.safar@gmail.com>
1575
1576         A fix for bug #77014
1577         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1578         paramters correctly and not rely on hacks in Parameters class.
1579         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1580         at any possition.
1581         (Invocation.VerifyArgumentsCompat): Ditto.
1582         (Invocation.EmitArguments): Changed to correctly emit params arguments at
1583         any possition.
1584
1585         * parameter.cs (HasParams): Don't assume that params is the last one.
1586
1587         * support.cs (ReflectionParameters.ctor): Look for params attribute
1588         correctly.
1589         (ReflectionParameters.ParameterType): Removed hack when we returned last
1590         parameter for out of range parameters.
1591         (ParameterName, ParameterModifier): Ditto.
1592
1593 2006-12-14  Marek Safar  <marek.safar@gmail.com>
1594
1595         A fix for bug #79987
1596         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1597         when assembly is not CLS compliant but type is. I have no idea why is this
1598         allowed.
1599
1600         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1601
1602 2006-12-13  Miguel de Icaza  <miguel@novell.com>
1603
1604         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1605         in struct constructors, they are basically no-ops.
1606
1607 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1608
1609         * cs-tokenizer.cs (Position): Save preprocessor status too.
1610
1611 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1612
1613         A fix for bug #77794
1614         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1615
1616 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1617
1618         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1619         Fixes #69299.
1620         (pp_expr): Report error for an invalid expression.
1621         (handle_preprocessing_directive): Simplified; add more error checking.
1622
1623 2006-12-11  Marek Safar  <marek.safar@gmail.com>
1624
1625         A fix for bug #74939
1626         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1627         directives handling.
1628
1629 2006-12-10  Marek Safar  <marek.safar@gmail.com>
1630
1631         A fix for bugs #80093, and #75984
1632         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1633         logic, it seems to me as it worked before "by coincidence".
1634         (xtoken): Simplified to use reworked handle_preprocessing_directive.
1635         (cleanup): Enabled endif check.
1636
1637 2006-12-09  Marek Safar  <marek.safar@gmail.com>
1638
1639         A fix for bug #80162
1640         * statement.cs (CollectionForeach.TryType): Generics and non-generics
1641         enumerators are never ambiguous.
1642
1643 2006-12-08  Raja R Harinath  <rharinath@novell.com>
1644
1645         Fix #80060
1646         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1647
1648 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1649
1650         A fix for bug #80144
1651         * class.cs (EventProperty.Define): Explicit implementation means
1652         that an even is used.
1653
1654 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1655
1656         Fixes the operators implementation (part II)
1657
1658         * cfold.cs (DoConstantNumericPromotions): Renamed to
1659         DoBinaryNumericPromotions and simplified.
1660         (BinaryFold): Couple of conversion fixes; simplified.
1661
1662         * constant.cs, ecore.cs, literal.cs
1663         (ToType): Renamed to ConvertImplicitly.
1664         (Reduce): Renamed to ConvertExplicitly.
1665
1666         * class.cs, convert.cs: Updated.
1667
1668         * expression.cs: TryReduce doesn't throw an exception.
1669
1670 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1671
1672         A fix for bug #80108
1673         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1674         compatible.
1675
1676 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1677
1678         Fixes unary operators implementation (part I)
1679         Also fixes #80026
1680
1681         * cfold.cs (Error_CompileTimeOverflow): Made internal
1682
1683         * const.cs (IConstant): Changed to use reference to constant and
1684         not constant itself.
1685         Updated IConstant implementations.
1686
1687         * constant.cs (CreateConstant): New factory method.
1688         Updated IConstant implementation.
1689
1690         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1691
1692         * ecore.cs: Updated to use CreateConstantReference.
1693
1694         * enum.cs: Reflects IConstant changes.
1695
1696         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1697
1698         * literal.cs (NullConstant): Change to be independently usable.
1699
1700 2006-11-29  Martin Baulig  <martin@ximian.com>
1701
1702         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1703         we need to emit the scope initializer before calling the base .ctor.
1704
1705         * anonymous.cs: Merged back from the new anonymous methods branch.
1706         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1707
1708         * expression.cs (ParameterReference.DoResolveBase): Create a
1709         "normal" ScopeInfo when capturing parameters rather than using the
1710         root scope; this makes things work with anonymous methods having
1711         parameters.
1712
1713         * statement.cs
1714         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1715
1716 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1717
1718         A fix for bug #79987
1719         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1720         check to a base class.
1721         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1722         only when assembly has missing attribute.
1723         * report.cs: Update.
1724
1725 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1726
1727         * cs-tokenizer.cs: Merged with gmcs version.
1728
1729 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1730
1731         * cs-tokenizer.cs,
1732         * cs-parser.jay: Better error message when partial keyword is misplaced.
1733
1734 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1735
1736         A fix for bug #79810
1737         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1738         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1739         a RuntimeWrappedException by default.
1740
1741 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1742
1743         A fix for bug #79843
1744         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1745         implementation.
1746         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1747
1748 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1749
1750         * driver.cs, namespace.cs: Uses faster IndexOf version.
1751
1752 2006-11-17  Marek Safar  <marek.safar@gmail.com>
1753
1754         A fix for bug #79941
1755         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1756         operators.
1757         (Operator.Define): Implicit/Explicit operator of same type is duplicate
1758         even if internal name is different.
1759         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1760         (UserDefinedConversion): Simplified as the operators cannot be internal.
1761         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1762         conversions.
1763         (MethodLookup): Replaced EmitContext with parentType.
1764         * expression.cs: Updated.
1765
1766 2006-11-09  Raja R Harinath  <rharinath@novell.com>
1767
1768         * driver.cs (BadAssembly): Handle all the ugliness of
1769         DefineDynamicAssembly.
1770
1771 2006-11-08  Raja R Harinath  <rharinath@novell.com>
1772
1773         Address parts of #58244 -- most of what's left is in the runtime
1774         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
1775         CS1509 error checks, and handle them for all assembly loads, not
1776         just the first invocation.
1777         (LoadModule): Likewise.  Move handling of 'adder_method' ...
1778         * codegen.cs (AssemblyClass.AddModule): ... here.
1779
1780 2006-11-02  Marek Safar  <marek.safar@gmail.com>
1781
1782         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1783         IEnumerable<T> is ambiguous.
1784
1785 2006-10-31  Marek Safar  <marek.safar@gmail.com>
1786
1787         A fix for bug #67689
1788         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1789         GetEnumerator is ambiguous.
1790
1791         * report.cs: Add new warning.
1792
1793 2006-10-29  Marek Safar  <marek.safar@gmail.com>
1794
1795         A fix for bug #78602
1796         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1797         to protected member can be nested type.
1798
1799 2006-10-28  Marek Safar  <marek.safar@gmail.com>
1800
1801         A fix for bug #78965
1802         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1803         to protected member must derive from current type.
1804
1805 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1806
1807         assign.cs: Reuses error method.
1808
1809         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1810         instead of type for constants.
1811         (Expression.Error_ValueAssignment): Common error method.
1812
1813         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1814         for any assignment.
1815
1816 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1817
1818         A fix for bug #79081
1819         * expression.cs (MemberAccess.DoResolve): Check nested type
1820         accessibility.
1821
1822 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1823
1824         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1825
1826 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1827
1828         A fix for bug #76591
1829         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1830
1831 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1832
1833         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1834         type forwarder of the same type multiple times.
1835
1836 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix #78820
1839         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1840         instance as an rvalue, even when we later resolve as an lvalue.
1841
1842 2006-10-25  Martin Baulig  <martin@ximian.com>
1843
1844         * anonymous.cs: Fix #79673.
1845
1846 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1847
1848         A fix for bug #79666
1849         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1850         ignored when is optimized (= default value) as its value is already set.
1851
1852 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1853
1854         A fix for bug #79724
1855         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1856         TypeContainer for type lookup.
1857
1858 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1859
1860         A fix for bug #79231
1861         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1862         * expression.cs (OverloadResolve): Always convert type name for
1863         an error message.
1864         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1865         other member.
1866
1867 2006-10-18  Martin Baulig <martin@ximian.com>
1868
1869         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1870
1871 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1872
1873         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1874         an int32, but requesting an int64 from the conversion
1875
1876 2006-10-12  Martin Baulig  <martin@ximian.com>
1877
1878         * anonymous.cs
1879         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1880         
1881 2006-10-12  Martin Baulig  <martin@ximian.com>
1882
1883         * statement.cs
1884         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1885
1886 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1887
1888         * convert.cs: Remove broken code: I was doing the "Existance"
1889         tests for Implicit conversions.
1890
1891 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1892
1893         * convert.cs: Added one missing case in
1894         ImplicitStandardConversionExists uint64 to intptr.
1895
1896         Fixes #59800
1897         
1898         * typemanager.cs (uintptr_type): another core known type.   
1899
1900         * ecore.cs (OperatorCast): routine used to do cast operations that
1901         depend on op_Explicit.  We could change some of the Decimal
1902         conversions to use this.
1903
1904         This one has a probe mechanism that checks both types for an op_
1905         which it coudl be used to eliminate two classes: CastToDecimal
1906         and CastFromDecimal.
1907
1908         * convert.cs: Implement the conversions documented in #59800
1909         
1910 2006-10-10  Martin Baulig  <martin@ximian.com>
1911
1912         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1913         before RootScope.ResolveMembers().
1914
1915         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1916         `CurrentType' if appropriate.
1917
1918 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1919
1920         A fix for bug #78568
1921         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1922         when contains binary operators.
1923         * cs-parser.jay: Updated.
1924
1925 2006-10-09  Martin Baulig  <martin@ximian.com>
1926
1927         * delegate.cs
1928         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1929         moved that into Define() and also do the other type parameter
1930         checks there.  Fixes #79094.  Added gtest-292.cs.
1931
1932         * expression.cs
1933         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1934         since that doesn't include type parameters; don't use `Ldelema'
1935         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1936
1937 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1938
1939         A fix for #77796
1940         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1941         conversion is allowed.
1942
1943 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1944
1945         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1946         error reporting when no error occurs.
1947
1948 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1949
1950         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1951         does not exist.
1952
1953 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1954
1955         Fix #79584
1956         * class.cs (DefineTypeBuilder): Check circular dependencies before
1957         setting the parent of the TypeBuilder.
1958         (CheckRecursiveDefinition): Don't use 'BaseType', since
1959         it may not be valid until after DefineTypeBuilder.  Use
1960         'base_type' instead.
1961
1962 2006-10-04  Martin Baulig  <martin@ximian.com>
1963
1964         Merged the Anonymous Methods patch.
1965
1966         * anonymous.cs, iterators.cs: The new anonymous methods code.
1967
1968         * statement.cs (Variable): New public abstract class.
1969         (LocalInfo.Variable): New public property.
1970         (LocalInfo.ResolveVariable): New public method.
1971         (Block.Flags): Add `IsIterator'.
1972         (Block.AddVariable): Improved the CS0136 check.
1973         (Block.AnonymousChildren): New public property.
1974         (Block.AddAnonymousChild): New public method.
1975         (ToplevelBlock): Update to use the new anonymous method framework.
1976         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1977         `ToplevelBlock'; this is required to correctly implement the
1978         CS0136 check.
1979         (Fixed, Using): Use `TemporaryVariable' instead of directly
1980         creating the `LocalBuilder'.
1981
1982         * parameter.cs (Parameter.ResolveVariable): New public method.
1983         (Parameters.ResolveVariable): Likewise.
1984
1985         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1986
1987         * class.cs (TypeContainer): Replaced the `iterators' list and
1988         corresponding methods with a list of `CompilerGeneratedClass'es.
1989         (TypeContainer.ResolveMembers): New public method.
1990         (Method): `IIteratorContainer' has been replaced by
1991         `IAnonymousHost'.
1992
1993         * expression.cs (VariableReference): New public abstract base
1994         class for `LocalVariableReference', `ParameterReference' and
1995         `This'.
1996
1997         * codegen.cs (EmitContext): Removed `capture_context',
1998         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1999         (EmitContext.EmitThis): Removed.
2000
2001         * cs-parser.jay: Replace `iterator_container' with
2002         `anonymous_host'.       
2003
2004 2006-10-04  Martin Baulig  <martin@ximian.com>
2005
2006         * generic.cs (GenericMethod): Don't make this abstract.
2007         (Constraints.Clone): Added dummy implementation.
2008
2009 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2010
2011         Fix #79577
2012         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2013         'declspaces'.  Avoid allocating arrays willy-nilly.
2014
2015         Fix #79553
2016         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2017         cases out of the switch.
2018
2019 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2020
2021         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2022         message when non-generic type is used with the type arguments.
2023         * expression.cs: Updated.
2024
2025 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2026
2027         Fix #79013
2028         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2029         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2030         Change semantics slightly.  Don't insist on having only one
2031         temporary EmptyExpression -- just throttle the creation of new ones.
2032
2033         Fix #79451
2034         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2035         non-interfaces too.  If no methods are found, don't try to create
2036         a MethodGroupExpr.
2037
2038 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2039
2040         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2041         generic type.
2042
2043         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2044         us produce better error message.
2045
2046 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2047
2048         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2049         of the `|' operator.
2050
2051         * report.cs: A new warning added.
2052
2053 2006-09-27  Martin Baulig  <martin@ximian.com>
2054
2055         * generic.cs (GenericMethod): Don't make this abstract.
2056
2057 2006-09-27  Martin Baulig  <martin@ximian.com>
2058
2059         * report.cs
2060         (InternalErrorException): Added overloaded ctor taking a params array.
2061
2062 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2063
2064         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2065         Fixed the cases when same error was reported twice.
2066
2067         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2068         now report symbol information.
2069
2070 2006-09-25  Martin Baulig  <martin@ximian.com>
2071
2072         * class.cs: Completely unified with the gmcs version.
2073
2074 2006-09-25  Martin Baulig  <martin@ximian.com>
2075
2076         * typemanager.cs (TypeManager.IsNullableType): New public function.
2077         (TypeManager.IsNullableTypeOf): Likewise.
2078         (TypeManager.IsNullableValueType): Likewise.
2079
2080         * class.cs (MethodCore): Added the `GenericMethod' argument from
2081         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2082
2083 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2084
2085         * convert.cs: Unify with gmcs version.
2086
2087 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2088
2089         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2090         verify them as well.
2091
2092         * report.cs: New warning.
2093
2094 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2095
2096         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2097         for anonymous block with out argument.
2098
2099 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2100
2101         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2102         not used private events only.
2103
2104 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2105
2106         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2107
2108         * const.cs (Const.Define): Check for constant type.
2109         (Const.IsConstantTypeValid): Looks for valid constant types.
2110
2111         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2112
2113         * ecore.cs (EmptyConstantCast): New common class for all constant based
2114         EmptyCast(s).
2115
2116         * expression.cs (Is.DoResolve): Handle null constant especially.
2117         (New.DoResolve): Check for new void().
2118         (MemberAccess.DoResolve): Cope with all kind of nulls.
2119
2120         * literal.cs (NullConstant): Uses EmptyConstantCast.
2121         (NullDefault): Based on EmptyConstantCast.
2122         (NullLiteral): Uses EmptyConstantCast.
2123
2124         * statement.cs (Block.ResolveMeta): Check for constant type.
2125
2126 2006-09-22  Martin Baulig  <martin@ximian.com>
2127
2128         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2129
2130 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2131
2132         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2133         not the null type.
2134
2135         Fix part of #79451
2136         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2137         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2138         code slightly.
2139
2140 2006-09-22  Martin Baulig  <martin@ximian.com>
2141
2142         * ecore.cs: Merged with the gmcs version.
2143
2144         * generic.cs (ConstructedType): New dummy class.
2145         (TypeArguments): Don't make this abstract.
2146
2147         * typemanager.cs
2148         (TypeManager.IsGenericTypeDefinition): New method.
2149         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2150
2151 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2152
2153         * expression.cs (ComposedCast): Check for arrays of TypedReference
2154         before creating the type, not after.
2155
2156 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2157
2158         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2159         after ToType change.
2160
2161         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2162         when constant must be implicitly convertible.
2163
2164         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2165
2166         * ecore.cs (NullCast): Derives from NullConstant.
2167
2168         * expression.cs (Is.DoResolve): Removed useless variables.
2169         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2170         (New.Constantify): Add enum support.
2171         (MemberAccess.DoResolve): Add warning when accessing null constant or
2172         variable.
2173
2174         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2175         property.
2176
2177         * literal.cs (NullConstant): New abstract class with common
2178         functionality for all null specializations.
2179         (NullDefault): Represents default(X) when result can be
2180         reduced to null.
2181         (NullLiteral): Updated.
2182
2183         * report.cs: Add new warning.
2184
2185 2006-09-21  Martin Baulig  <martin@ximian.com>
2186
2187         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2188
2189 2006-09-21  Martin Baulig  <martin@ximian.com>
2190
2191         * generic.cs (GenericConstraints): New dummy class.
2192         (Constraints): Likewise.
2193         (TypeParameter): Likewise.
2194         (TypeParameterName): Likewise.
2195         (GenericMethod): Likewise.
2196
2197         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2198
2199         * decl.cs: Merged with the gmcs version.
2200
2201 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2202
2203         * generic.cs (TypeParameter): Implement IMemberContainer.
2204         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2205
2206         * rootcontext.cs: Unify with gmcs version.
2207
2208         * report.cs: Unify with gmcs version.
2209         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2210         from gmcs/generics.cs.
2211         * generics.cs (TypeParameter): New dummy class.
2212
2213         * support.cs: Unify with gmcs version.
2214
2215 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2216
2217         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2218         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2219
2220         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2221         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2222         * mcs.exe.sources: Add generic.cs.
2223
2224         * codegen.cs: Unify with gmcs version.
2225
2226         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2227         (EmitContext): Add GenericDeclContainer implementation.
2228         * decl.cs (MemberCore, DeclSpace): Likewise.
2229         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2230
2231         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2232         MCS TypeManager has a corresponding dummy method.
2233
2234 2006-09-19  Martin Baulig  <martin@ximian.com>
2235
2236         * expression.cs: Completely merged with the gmcs version.
2237
2238 2006-09-19  Martin Baulig  <martin@ximian.com>
2239
2240         * expression.cs (Invocation): Merged with the gmcs version.
2241         (ArrayAccess.GetStoreOpcode): Likewise.
2242
2243 2006-09-19  Martin Baulig  <martin@ximian.com>
2244
2245         * typemanager.cs
2246         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2247         (TypeManager.IsGenericMethodDefinition): Likewise.
2248
2249 2006-09-19  Martin Baulig  <martin@ximian.com>
2250
2251         * typemanager.cs
2252         (TypeManager.IsEqual): Moved the gmcs implementation here.
2253         (TypeManager.DropGenericTypeArguments): Likewise.
2254         (TypeManager.DropGenericMethodArguments): Likewise.
2255         (TypeManager.GetTypeArguments): Moved here from gmcs.
2256         (TypeManager.HasGenericArguments): Likewise.
2257
2258 2006-09-19  Martin Baulig  <martin@ximian.com>
2259
2260         * expression.cs (Binary): Merged with the gmcs version.
2261
2262 2006-09-19  Martin Baulig  <martin@ximian.com>
2263
2264         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2265
2266 2006-09-19  Martin Baulig  <martin@ximian.com>
2267
2268         * typemanager.cs: Merged with the gmcs version.
2269
2270 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2271
2272         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2273         * driver.cs: Likewise.
2274
2275 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2276
2277         A fix for #79401
2278         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2279         only if parent type is class.
2280         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2281         update.
2282
2283 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2284
2285         * cs-parser.jay,
2286         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2287         keywords are used.
2288         * typemanager.cs(CSharpName): Converts NullType to null.
2289
2290 2006-09-15  Martin Baulig  <martin@ximian.com>
2291
2292         * typemanager.cs
2293         (TypeManager.GetMethodName): Added mcs implementation.
2294         (TypeManager.IsEqual): Likewise.
2295
2296         * ecore.cs
2297         (SimpleName.RemoveGenericArity): Added dummy implementation.
2298
2299         * pending.cs: Merged with the gmcs version.     
2300
2301 2006-09-15  Martin Baulig  <martin@ximian.com>
2302
2303         * statement.cs: Merge with the gmcs version.
2304
2305 2006-09-15  Martin Baulig  <martin@ximian.com>
2306
2307         * statement.cs (Switch): Merge with the gmcs implementation
2308         (without nullables), which is newer.
2309
2310 2006-09-15  Martin Baulig  <martin@ximian.com>
2311
2312         * statement.cs (Block.Variables): Make this public.
2313         (ToplevelBlock.Parameters): Make this a property.
2314         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2315
2316 2006-09-15  Martin Baulig  <martin@ximian.com>
2317
2318         * namespace.cs: Merge with the gmcs version.
2319
2320 2006-09-15  Martin Baulig  <martin@ximian.com>
2321
2322         * decl.cs (MemberName): Minor code cleanups.
2323
2324 2006-09-15  Martin Baulig  <martin@ximian.com>
2325
2326         * parameter.cs: Merge with the gmcs version.
2327
2328 2006-09-15  Martin Baulig  <martin@ximian.com>
2329
2330         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2331         and an error in mcs.
2332
2333 2006-09-15  Martin Baulig  <martin@ximian.com>
2334
2335         * flowanalysis.cs: Merged from GMCS; added the generics code into
2336         a `GMCS_SOURCE' conditional so we can share this file.
2337
2338 2006-09-08  Martin Baulig  <martin@ximian.com>
2339
2340         * typemanager.cs (TypeManager.interlocked_type): New public field.
2341         (TypeManager.int_interlocked_compare-exchange): New public field.
2342         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2343         enumerator types here and call InitGenericCoreTypes().
2344         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2345         after calling InitEnumUnderlyingTypes().
2346
2347         * rootcontext.cs
2348         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2349         `classes_second_stage'. 
2350
2351 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2352
2353         * assign.cs, ecore.cs, expression.cs: Share error message text.
2354         * class.cs (FieldMember.Define): Check for varible of static type.
2355         * driver.cs (LoadAssembly): Uses error output for errors.
2356         * statement.cs: Updated.
2357
2358 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2359
2360         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2361         type instance.
2362
2363 2006-09-07  Martin Baulig  <martin@ximian.com>
2364
2365         * driver.cs
2366         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2367
2368 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2369
2370         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2371         
2372 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2373
2374         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2375         #52019 and #79064, the use of the \uXXXX sequence in source code
2376         to represent unicode characters.
2377
2378 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2379
2380         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2381         support.
2382         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2383
2384 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2385
2386         * assign.cs: Catch attempts to assign to a method groups in += and
2387         report as 1656
2388
2389 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2390
2391         A fix for #79056
2392         * cs-parser.jay: Don't destroy current array type by typeof of array's.
2393
2394 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
2395
2396         * class.cs (Method.Define): Issue a warning when generic method looks like
2397         an entry point.
2398         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2399         as well.
2400
2401 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
2402  
2403         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2404         looking for ctor.
2405         * decl.cs (MemberCache.FindMembers): When container is interface we need to
2406         search all base interfaces as a member can be ambiguous.
2407         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2408         Constructor member type filter. 
2409         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2410         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2411         reporting for returned memberinfos.
2412         * report.cs: Updated.
2413         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2414         version to work on all runtimes.
2415         (TypeManager.RealMemberLookup): Removed members filtering.
2416
2417 2006-08-08  Raja R Harinath  <rharinath@novell.com>
2418
2419         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2420         (PropertyExpr.EmitAssign): Likewise.
2421         * expression.cs (Indirection.EmitAssign): Likewise.
2422         (LocalVariableReference.EmitAssign): Likewise.
2423         (ParameterReference.EmitAssign): Likewise.
2424         (Invocation.EmitArguments): Likewise.
2425         (ArrayAccess.EmitAssign): Likewise.
2426         (IndexerAccess.EmitAssign): Likewise.
2427         (This.EmitAssign): Likewise.
2428         (ConditionalLogicalOperator.Emit): Likewise.
2429
2430         Fix #79026
2431         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
2432         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
2433         leave it in after returning it.
2434         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
2435
2436 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
2437
2438         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2439         message.
2440
2441 2006-08-03  Raja R Harinath  <rharinath@novell.com>
2442
2443         Fix cs0146-3.cs and cs0146-4.cs.
2444         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2445         enclosing types don't depend on the current type.
2446
2447 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2448
2449         Fix #77963
2450         * class.cs (TypeContainer.DoDefineMembers): Use
2451         FindBaseMemberWithSameName on Parent, since we're interested in
2452         whether we hide inherited members or not.
2453         (FindBaseMemberWithSameName): Make slightly more robust.
2454
2455         Fix the non-generic testcase from #77396
2456         * decl.cs (DeclSpace.DeclContainer): Remove override.
2457
2458         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2459         declspaces for doppelgangers too.
2460         (UsingEntry): Implement IResolveContext.
2461         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
2462         'this' as the resolve context.
2463         (LocalAliasEntry): Likewise.
2464
2465         Implement parts of #77403
2466         * roottypes.cs (RootDeclSpace): New.  Used to represent the
2467         toplevel declaration space.  Each namespace declaration introduces
2468         a "partial" root declaretion space.
2469         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2470         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2471         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2472         from 'current_namespace.SlaveDeclSpace'.
2473         (namespace_declaration): Likewise.
2474         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2475         check.  It can't happen now.
2476         * decl.cs (DeclSpace.LookupType): Likewise.
2477         * driver.cs (MainDriver): Sanity check.
2478
2479 2006-08-01  Raja R Harinath  <rharinath@novell.com>
2480
2481         * decl.cs (DeclSpace.FindNestedType): Remove.
2482         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2483         LookupTypeContainer to get the container of the nested type.
2484         * class.cs (TypeContainer.FindNestedType): Make non-override.
2485
2486 2006-07-31  Raja R Harinath  <rharinath@novell.com>
2487
2488         * decl.cs (DeclSpace.PartialContainer): Move field from ...
2489         * class.cs (TypeContainer.PartialContainer): ... here.
2490         (TypeContainer.AddBasesForPart): New helper.
2491         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
2492         instead.
2493         * cs-parser.jay (current_class): Convert to DeclSpace.
2494         (struct_declaration, interface_declaration, class_declaration):
2495         Use AddBasesForPart instead of .Bases directly.
2496         * const.cs, iterators.cs: Update to changes.
2497
2498 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2499
2500         * class.cs (TypeContainer.AddMemberType): Rename from
2501         AddToTypeContainer.
2502         (TypeContainer.AddMember): Rename from AddToMemberContainer.
2503         (AddTypeContainer): New.  Combine AddClassOrStruct and
2504         AddInterface.
2505         (AddPartial): Update.  Add 'is_partial' argument.
2506         * roottypes.cs: Update to changes.
2507         * cs-parser.jay (push_current_class): New helper for handling
2508         current_container and current_class.
2509         (struct_declaration, interface_declaration, class_declaration):
2510         Use it.
2511
2512 2006-07-26  Raja R Harinath  <rharinath@novell.com>
2513
2514         * roottypes.cs: Rename from tree.cs.
2515
2516         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2517         * tree.cs (Tree, ITreeDump): Remove types.
2518         * rootcontext.cs (tree, Tree): Remove fields.
2519         (root, ToplevelTypes): New.
2520         * *.cs: Update to rename.
2521
2522         * tree.cs (Tree.RecordDecl): Remove.
2523         (RootTypes.AddToTypeContainer): Record the toplevel type in its
2524         namespace here.
2525         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2526
2527 2006-07-23  Raja R Harinath  <harinath@gmail.com>
2528
2529         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2530         DoFlowAnalysis and OmitStructFlowAnalysis here.
2531         (ec.With): Rename from WithUnsafe and generalize.
2532         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
2533         (ec.WithFlowAnalyis): New.
2534         * ecore.cs, expression.cs, statement.cs: Update.
2535
2536 2006-07-22  Raja R Harinath  <harinath@gmail.com>
2537
2538         * statement.cs (Block.ResolveMeta): Simplify slightly.
2539
2540         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
2541         multiple boolean fields.  Convert InUnsafe, constant_check_state,
2542         check_state to flags.
2543         (CheckState, ConstantCheckState): Update.
2544         (InUnsafe): New read-only property.
2545         (FlagsHandle): Rename from CheckStateHandle and convert to handle
2546         arbitrary flags.
2547         (WithUnsafe): New helper similar to WithCheckState.
2548         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2549         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2550
2551 2006-07-21  Raja R Harinath  <rharinath@novell.com>
2552
2553         Make comparisons use the same IL irrespective of whether they're
2554         in a 'checked' or 'unchecked' context: one of the issues in #78899
2555         * codegen.cs (EmitContext.CheckState): Make read-only property.
2556         (EmitContext.ConstantCheckState): Likewise.
2557         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2558         helper that implement a save/restore stack for CheckState
2559         values.  This is the only way to change check-state.
2560         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2561         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2562         (CheckedExpr.EmitBranchable): New forwarding method.
2563         (UnCheckedExpr): Likewise.
2564         * statement.cs (Block.ResolveMeta): Use WithCheckState.
2565         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2566         (Checked.Resolve, checked.DoEmit): Likewise.
2567
2568 2006-07-20  Miguel de Icaza  <miguel@novell.com>
2569
2570         * anonymous.cs: Cache the resolved anonymous delegate, and return
2571         this so that the ResolveTopBlock is only triggered once, not
2572         twice.
2573
2574         Currently we trigger ResolvetopBlock twice due to a first pass of
2575         argument check compatibility, and a second pass that does the
2576         actual resolution.   
2577         
2578 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2579
2580         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2581         modifiers.
2582         * rootcontext.cs (Reset): Add helper_classes.
2583
2584 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2585
2586         A fix for #78860
2587         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2588         correctly.
2589
2590 2006-07-13  Miguel de Icaza  <miguel@novell.com>
2591
2592         * statement.cs (Lock): Handle expressions of type
2593         TypeManager.null_type specially.  Fixes #78770
2594
2595 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2596
2597         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2598         to an event.
2599
2600 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2601
2602         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2603         for accessors as well.
2604         * ecore.cs (EventExpr): Add AccessorTable.
2605
2606 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
2607
2608         A fix for #78738
2609         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2610         for CS0122 where appropriate.
2611         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2612         level attributes.
2613         (Filter): Assembly can be null in the case of top level attributes.
2614
2615 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2616
2617         A fix for #78690
2618
2619         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2620         is done at global level.
2621
2622 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2623
2624         A fix for #77002, Implemented TypeForwarder support.
2625
2626         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2627         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2628         * typemanager.cs (): Add type_forwarder_attr_type.
2629
2630 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * report.cs: Add CS0469 warning.
2633
2634 2006-06-21  Martin Baulig  <martin@ximian.com>
2635
2636         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2637         the `try'-block, so we also report CS0016 etc. there.
2638
2639 2006-06-21  Martin Baulig  <martin@ximian.com>
2640
2641         * delegate.cs
2642         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2643
2644 2006-06-21  Martin Baulig  <martin@ximian.com>
2645
2646         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2647         also report CS1686 for parameters.
2648
2649 2006-06-21  Martin Baulig  <martin@ximian.com>
2650
2651         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2652         instead of an error if the value is not implicitly convertible to
2653         the switch types; fixes #77964.
2654
2655 2006-06-21  Raja R Harinath  <rharinath@novell.com>
2656
2657         Fix #78673
2658         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2659         FieldBuilder is null.
2660
2661         Fix #78662
2662         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2663         'left' and 'right' before error-checking.
2664
2665 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
2666
2667         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2668         Fixed bug #78601.
2669         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2670         (FieldExpr.DoResolve): likewise.
2671         (PropertyExpr.InstanceResolve): likewise.
2672         (EventExpr.InstanceResolve): likewise. 
2673
2674 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2675
2676         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2677         attribute applicable tests for attribute argument.
2678
2679 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2680
2681         Fix #78079
2682         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2683         (Binary.OverloadResolve_PredefinedIntegral): New.
2684         (Binary.OverloadResolve_PredefinedFloating): New.
2685         (Binary.OverloadResolve_PredefinedString): New.
2686         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2687         Follow the standard more closely, and treat numeric promotions in
2688         terms of overload resolution.
2689         (Binary.CheckShiftArguments): Simplify.
2690
2691 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2692
2693         * flowanalysis.cs (MyBitVector): Simplify representation.
2694         (MyBitVector.Clone): Avoid allocating BitArray.
2695         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2696         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2697         (*): Update.  Change all references to MyBitVector.And and
2698         MyBitVector.Or to &= and |=.
2699
2700 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2701
2702         Fix cs0231-[34].cs.
2703         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2704         to param arguments too.
2705
2706 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2707
2708         * cs-parser.jay: Catch another parsing form for arglist being
2709         followed by other arguments.  Fixes #78313.
2710
2711 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2712
2713         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2714         checking of out parameters to ...
2715         (FlowBranchingToplevel.Merge): ... here.
2716         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2717         set, propagate the origin upward, and only complain if there was
2718         no other error.
2719         (FlowBranchingException.AddContinueOrigin): Likewise.
2720         (FlowBranchingException.AddReturnOrigin): Likewise.
2721         (FlowBranchingException.AddGotoOrigin): Likewise.       
2722
2723 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2724
2725         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2726         unreachable, skip it.
2727         (FlowBranchingException.Merge): Always propagate jumps, even if
2728         the finally block renders subsequent code unreachable.
2729
2730 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2731
2732         Fix #77601
2733         * statement.cs (Goto.Resolve): Move responsibility for resolving
2734         'goto' to FlowBranching.AddGotoOrigin.
2735         (Goto.SetResolvedTarget): New.  Callback to set the
2736         LabeledStatement that's the target of the goto.
2737         (Goto.DoEmit): Use Leave instead of Br when crossing an
2738         unwind-protect boundary.
2739         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2740         LookupLabel and adjust to new semantics.
2741         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2742         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2743         Goto.SetResolvedTarget to update target.
2744         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2745         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2746         AddBreakOrigin & co.  Delay propagation until ...
2747         (FlowBranchingException.Merge): ... this.
2748
2749         * statement.cs (Block.Resolve): Always depend on flow-branching to
2750         determine unreachability.  Kill workaround that originally emitted
2751         only one statement after an "unreachable" label (see infloop in
2752         test-515.cs).
2753
2754         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2755         This is still "wrong", but anything better would probably need a
2756         multi-pass algorithm.
2757         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2758         usage vector.  Force current usage vector to be reachable, to
2759         optimistically signify backward jumps.
2760         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2761         detected.
2762         (FlowBranchingLabeled.Merge): New.  If no backward jump was
2763         detected, return the original salted-away usage vector instead,
2764         updated with appropriate changes.  Print unreachable warning if
2765         necessary.
2766         * statement.cs (Block.Resolve): Don't print unreachable warning on
2767         a labeled statement.
2768
2769 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
2770
2771         * driver.cs: Pass filename without path to AssemblyBuilder's 
2772         AddResourceFile. Fixes bug #78407.
2773
2774 2006-05-17  Raja R Harinath  <rharinath@novell.com>
2775
2776         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2777         * flowanalysis.cs (FlowBranchingLabeled): ... here.
2778         (FlowBranching.MergeChild): Overwrite
2779         reachability information from Labeled branchings too.
2780
2781 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2782
2783         * statement.cs (Goto.Resolve): Merge jump origins here ...
2784         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2785
2786         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2787         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
2788         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
2789         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2790         here, ...
2791         * statement.cs (Goto.Resolve): ... not here.
2792         (Goto.Emit): Remove CS1632 check.
2793
2794 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
2795
2796         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2797         error message.
2798
2799 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2800
2801         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2802         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2803         (FlowBranchingException.Label): Likewise.
2804
2805         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
2806         given value.
2807         (MyBitVector.Or): Use it to avoid losing information (Count).
2808         (FlowBranching.MergeOrigins): Likewise.
2809
2810         * flowanalysis.cs (UsageVector.IsDirty): Remove.
2811         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2812         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2813         (UsageVector.ToString): Simplify.
2814         (UsageVector.MergeSiblings): Move here from ...
2815         (FlowBranching.Merge): ... here.
2816         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2817         not a MyBitVector.
2818
2819 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2820
2821         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2822         null bitvector is treated as all-true.
2823
2824         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2825         (MyBitVector): Rationalize invariants.  'vector != null' implies
2826         that we have our own copy of the bitvector.  Otherwise,
2827         'InheritsFrom == null' implies all inherited bits are true.
2828
2829 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2830
2831         * statement.cs (LocalInfo): Add IsConstant.
2832         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2833         local variable for constants.
2834
2835 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2836
2837         * flowanalysis.cs (MyBitVector.Empty): New.
2838         (MyBitVector): Don't allow InheritedFrom to be null.
2839         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2840         (UsageVector, FlowBranching): Update to changes.
2841
2842         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2843         recursion.  The 'Parent == null' condition isn't sufficient for
2844         anonymous methods.
2845         (FlowBranching.AddBreakOrigin): Likewise.
2846         (FlowBranching.AddContinueOrigin): Likewise.
2847         (FlowBranching.AddReturnOrigin): Likewise.
2848         (FlowBranching.StealFinallyClauses): Likewise.
2849         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2850         (FlowBranching.CheckOutParameters): Likewise.
2851         (FlowBranchingToplevel): Terminate all the above recursions here.
2852         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2853         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2854
2855         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2856         toplevel block.
2857         (FlowBranchingToplevel): New.  Empty for now.
2858         (FlowBranching.MergeTopBlock): Update.
2859         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2860         branching for the anonymous delegate.
2861         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2862
2863         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2864         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2865         information at the start of the merge.  Reorganize.
2866
2867 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2868
2869         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2870
2871 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2872
2873         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2874         to newly introduced ctor.
2875
2876         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2877         message to one place.
2878         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2879         global namespace.
2880
2881 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2882
2883         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2884
2885         * ecore.cs (Expression.ResolveAsConstant): Updated.
2886
2887         * statement.cs (ResolveMeta): Updated.
2888
2889 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2890
2891         * cs-parser.jay: __arglist cannot be used in initializer.
2892
2893 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2894
2895         A fix for #77879
2896         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2897         private types.
2898
2899 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2900
2901         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2902         (LabeledStatement): Add 'name' parameter.
2903         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2904         (Block.AddLabel): Update to changes.
2905         * cs-parser.jay (labeled_statement): Likewise.
2906
2907         * flowanalysis.cs (BranchingType.Labeled): New.
2908         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2909         (FlowBranchingLabeled): New.  Does nothing for now, but will
2910         eventually handle 'goto' flows.
2911         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2912         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2913         that's terminated ...
2914         (Block.Resolve): ... here.
2915
2916         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2917         (UsageVector.MergeFinallyOrigins): Likewise.
2918         (FlowBranching.InTryOrCatch): Likewise.
2919         (FlowBranching.AddFinallyVector): Likewise.
2920         (FlowBranchingException): Update to changes.
2921
2922         Fix #78290
2923         * statement.cs (Return.Resolve): Move error checking to ...
2924         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2925         (FlowBranchingException): Handle return origins like break and
2926         continue origins.
2927         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2928
2929 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2930
2931         A fix for #76122
2932         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2933         filter.
2934
2935 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2936
2937         A fix for #77543
2938         * class.cs (MethodData.Define): Do public accessor check only when method
2939         implements an interface.
2940
2941 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2942
2943         Remove special handling of 'break'
2944         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2945         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2946         (UsageVector.Break): Remove.
2947         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2948         reachability.
2949         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2950
2951         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2952         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2953
2954 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2955
2956         A fix for #75726
2957         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2958         be the interface member.
2959
2960 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2961
2962         A fix for #60069
2963         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2964         for emitting small (int) values.
2965
2966 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2967
2968         Fix #59427
2969         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2970         control-flow passes through the 'finally' after merging-in all the
2971         control-flows from 'try' and the 'catch' clauses.
2972
2973         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2974         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2975         always true at the only non-recursive entry point.
2976         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2977         FlowBranchingBreakable.
2978         (FlowBranchingLoop): Remove.
2979         * statement.cs (Return.DoResolve): Update to changes.
2980
2981         Fix #76471, #76665
2982         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2983         (FlowBranching.CreateBranching): Handle it: create a
2984         FlowBranchingContinuable.
2985         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2986         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2987         except that it handles the 'continue' command.
2988         (FlowBranching.UsageVector.MergeOrigins): Rename from
2989         MergeBreakOrigins.
2990         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2991         except that it overrides AddContinueOrigin.
2992         (FlowBranchingException): Override AddContinueOrigin, similar to
2993         AddBreakOrigin.
2994         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2995         Create a new branching around the embedded statement.
2996         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2997         control flow after the embedded statement.
2998         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2999
3000         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3001         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3002         FlowBranchingBreakable.
3003         (FlowBranchingSwitch): Remove.
3004
3005         Fix test-503.cs
3006         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3007         error reporting to ...
3008         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3009         Rename from 'AddBreakVector'.  Add new location argument.  Return
3010         a bool indicating whether the 'break' crosses an unwind-protect.
3011         (FlowBranchingException.AddBreakOrigin): Add.
3012         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3013         flowbranching after updating with the effects of the 'finally'
3014         clause.
3015         (FlowBranchingBreakable): New common base class for
3016         FlowBranchingLoop and FlowBranchingSwitch.
3017
3018         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3019         embedded statement.
3020         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3021
3022 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3023
3024         * statement.cs (Do.Resolve): If the loop is infinite, set the
3025         barrier.
3026         (While.Resolve, For.Resolve): Set a barrier after the embedded
3027         statement.  There's no direct control flow that goes from the end
3028         of the embedded statement to the end of the loop.
3029         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3030         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3031         above ensure that the reachability is correctly computed.
3032
3033         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3034         (UsageVector.MergeBreakOrigins): If the current path is
3035         unreachable, treat it as if all parameters/locals are initialized.
3036         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3037         infinite loops before merging-in break origins.
3038
3039         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3040         (Reachability.Reachable): Split part into ...
3041         (Reachability.Unreachable): ... this.  Simplify.
3042         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3043
3044         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3045         (Reachability.SetThrowsSometimes): Likewise.
3046         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3047         TriState.Always, use corresponding property.
3048         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3049         (Block.Resolve): Likewise.  Remove some redundant checks.
3050
3051 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3052
3053         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3054         (Reachability.Meet): Don't bother checking AlwaysThrows --
3055         barrier is always set.
3056         (FlowBranchingBlock.Merge): Likewise.
3057
3058 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3059
3060         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3061         checks for unreachable.
3062
3063 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3064
3065         A fix for #77980
3066         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3067
3068         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3069         whether field is really assigned.
3070
3071 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3072
3073         * flowanalysis.cs (Reachability): Make 4-argument constructor
3074         private.
3075         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3076         (Reachability.Always): Rename from the highly misleading
3077         'Reachability.Never'.
3078         (FlowBranching.Merge): Update to changes.  Mark an impossible
3079         situation with a 'throw'.
3080         (*): Update to changes.
3081
3082 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3083
3084         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3085         Remove 'Undefined'.
3086         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3087         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3088         (*): Update to changes.
3089         * statement.cs: Update to changes.
3090
3091 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3092
3093         A fix for #78049
3094         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3095
3096 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3097
3098         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3099         dummy UsageVector.
3100
3101         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3102         argument to two arguments: an usage-vector and a bool.  Move call
3103         to FlowBranching.Merge () ...
3104         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3105
3106         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3107         handling of loop and switch reachability to ...
3108         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3109
3110 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3111
3112         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3113         handling to FlowBranchingLoop.InLoop.
3114         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3115
3116 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3117
3118         A fix for #78115
3119         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3120         anonymous method is allowed from AnonymousContainer here.
3121
3122         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3123
3124 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3125
3126         Fix #78156
3127         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3128
3129 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3130
3131         A fix for #49011.
3132         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3133         (DoubleConstant.Reduce): Ditto.
3134
3135 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3136
3137         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3138         Remove 'lvalue_right_side' argument.  Move parts to ...
3139         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3140         (LocalVariable.DoResolveLValue): ... these.
3141
3142 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3143
3144         Fix cs1655.cs
3145         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3146         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3147         (LocalVariableReference.DoResolveBase): Use it to implement new
3148         CS1655 check.
3149         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3150         (Argument.Resolve): Simplify.  Move CS1510 check ...
3151         * ecore.cs (Expression.ResolveLValue): ... here.
3152         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3153         (PropertyExpr.DoResolveLValue): Likewise.
3154         (FieldExpr.Report_AssignToReadonly): Likewise.
3155         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3156         LValueMemberAccess or LValueMemberOutAccess on instance depending
3157         on it.
3158         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3159         DoResolve as appropriate.
3160
3161 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3162
3163         Fix #75800
3164         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3165         implicit conversions on 'out' and 'ref' arguments.
3166
3167         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3168         improve clarity.  Remove dead code.
3169
3170         Fix #66031
3171         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3172         (Catch.Resolve): Resolve VarBlock if it exists.
3173
3174 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3175
3176         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3177         twice, this was some residual code, the enumerator was emitted
3178         properly in the two branche of if later.
3179
3180 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3181
3182         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3183         cast is never an lvalue.
3184         (Cast.DoResolve, Cast.ResolveRest): Combine.
3185         (Argument.Emit): Simplify slightly.  Move 'Expr is
3186         IMemoryLocation' check ...
3187         (Argument.Resolve): ... here.
3188         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3189
3190         Simplifications.  Fix cs0191-2.cs
3191         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3192         CS1649 and CS1651 to ...
3193         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3194         the actual selection of the error code and message to a lookup
3195         table.  Add a dummy return value to simplify callsites.
3196         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3197         readonly fields of other instances of the same type.  Move CS0197
3198         warning from ...
3199         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3200         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3201         resolution of an out or ref argument.  The code simplification
3202         above uses this invariant.
3203
3204 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3205
3206         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3207         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3208         CheckMarshallByRefAccess.  Drop parameter.
3209         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3210         warning.
3211         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3212         InstanceExpression.
3213         * report.cs (AllWarnings): Add CS1690.
3214         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3215         for ref access too.
3216         (LocalVariableReference.DoResolveBase): Update.
3217
3218 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * class.cs (MethodOrOperator): Moved common parts from method class.
3221         detect obsolete attributes.
3222         (Method.Define): Simplified as it reuses code from base.
3223         (Constructor.ValidAttributeTargets): Fixed issue found during
3224         refactoring.
3225         (Destructor.ValidAttributeTargets): Fixed issue found during
3226         refactoring.
3227         (Operator): Finished refactoring set off by #78020. Operator class is now
3228         ordinary method class.
3229
3230         * anonymous.cs: Updated.
3231
3232         * decl.cs (DeclSpace): Add IsGeneric
3233
3234 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3235
3236         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3237
3238 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3241         detect obsolete attributes.
3242         (Method.CreateEmitContext): Moved to MethodOrOperator.
3243
3244 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3245
3246         A fix for #78048.
3247         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3248         customized exception to make crash detection easier.
3249         (MethodOrOperator): Started to work on new base class for methods and
3250         operators.
3251         (Method): Derives from MethodOrOperator.
3252         (Constructor.Emit): Emits its own attributes.
3253         (AbstractPropertyEventMethod.Emit): Ditto.
3254         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3255         patch.
3256         (Operator.Emit): It's temporary more tricky than should be.
3257         
3258         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3259
3260         * report.cs (InternalErrorException): Add ctor with inner exception.
3261
3262 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3263
3264         A fix for #76744.
3265         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3266         only not visible.
3267
3268 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3269
3270         A fix for #77916.
3271         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3272         array.
3273
3274 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3275
3276         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3277         attribute is present and Guid not.
3278         (Interface.ApplyAttributeBuilder): Ditto.
3279
3280         * attribute.cs: Add error message.
3281
3282 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3283
3284         A fix for #78020.
3285
3286         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3287         sources (it's composite) so hold them in extra array as they are used in
3288         Emit phase only. It worked in the previous versions by mistake.
3289         (Attribute.Emit): Emit attribute for more owners when exist.
3290
3291         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3292         it has now different behaviour.
3293
3294 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3295
3296         * constant.cs (Constant.IsDefaultInitializer): New method.
3297
3298         * class.cs: Updated.
3299
3300         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3301         re-initialize default values. It saves KBs almost for every assembly.
3302         Thanks Zoltan for the idea.
3303         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3304         (ArrayCreation.DoResolve): Resolve only once.
3305         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3306         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3307
3308 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3309
3310         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3311         From #77961.
3312
3313 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3314
3315         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3316         in an embedded statement too.
3317
3318 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3319
3320         Fix #77958
3321         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3322
3323 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3324
3325         A fix for #77966.
3326
3327         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3328         was not specified.
3329
3330         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3331
3332 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3333
3334         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3335         phase.
3336
3337         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3338         LocalTemporary change.
3339
3340         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3341         TypeContainer.
3342         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3343         initializers optimization.
3344         (ClassOrStruct.TypeAttr): Moved from modifiers.
3345         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3346         (FieldBase.ResolveInitializer): Resolves initializer.
3347         (FieldBase.HasDefaultInitializer): New property.
3348
3349         * cs-parser.jay: Removed message.
3350
3351         * expression.cs (CompilerGeneratedThis): New specialization.
3352
3353         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3354
3355 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3356
3357         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3358
3359 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3360
3361         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3362         be now EnumConstants only.
3363
3364 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3365
3366         * attribute.cs, driver.cs: Reset more caches.
3367
3368 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3369
3370         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3371
3372 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3373
3374         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3375         for easier reuse. Updated all overrides.
3376         (IntegralConstant): New base class for all integral constants.
3377         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3378         of the constant range, report custom error.
3379         (UIntConstant.Reduce): Fixed uint conversion.
3380
3381         * ecore.cs, literal.cs: Reduce updates.
3382
3383 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3384
3385         A fix for #75813.
3386
3387         * class.cs (Constructor.Define): Removed extra if for default ctors.
3388         A patch from Atsushi Enomoto.
3389
3390 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3393         GetAttributableValue.
3394
3395         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3396         when required.
3397
3398         * convert.cs (ImplicitConversionRequired): Error message moved to
3399         DoubleLiteral.
3400
3401         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3402         automatic implicit conversion of an output value.
3403         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3404
3405         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3406         conversion.
3407         (TypeOf.GetAttributableValue): Add extra handling for object type.
3408
3409         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3410         special error message.
3411
3412 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
3413
3414         * class.cs (Constructor.Emit): Don't crash when struct ctor is
3415         InternalCall.
3416         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3417         compatible with MS runtime.
3418
3419 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
3420
3421         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3422         attribute arguments here.
3423
3424         * class.cs (Indexer.Define): The check was moved to attribute class.
3425
3426 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
3427
3428         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3429         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3430         easier.
3431
3432 2006-03-22  Raja R Harinath  <rharinath@novell.com>
3433
3434         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
3435         mcs to keep code differences small.
3436         * attribute.cs (Attribute.GetParameterDefaultValue): New.
3437         * typemanager.cs (parameter_default_value_attribute_type): New.
3438         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
3439         CS1908 check.
3440
3441 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3442
3443         * expression.cs (StringConcat.Append): Reverted back to no warning state.
3444
3445 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3446
3447         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3448
3449         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3450         the blocks too.
3451
3452 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
3453
3454         * doc-bootstrap.cs : fix build.
3455
3456 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3457
3458         * expression.cs (StringConcat.Append): Issue a warning when empty string
3459         is going to append.
3460
3461 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3462
3463         * assign.cs (CompoundAssign.ResolveSource): Removed.
3464
3465         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3466         clean up.
3467
3468         * class.cs (TypeContainer.FindMethods): Removed.
3469         (TypeContainer.CheckMemberUsage): Made static.
3470
3471         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3472
3473         * constant.cs (CheckRange): Removed unused type argument.
3474         (CheckUnsigned): Removed unused type argument.
3475
3476         * cs-parser.jay: Updated after MemberAccess clean up.
3477         Uses Length for empty string test.
3478
3479         * cs-tokenizer.cs: Uses Length for empty string test.
3480         (IsCastToken): Made static.
3481         (is_hex): Made static.
3482         (real_type_suffix): Made static.
3483
3484         * decl.cs (SetupCache): Made static.
3485         (OnGenerateDocComment): Removed unused ds argument.
3486
3487         * delegate.cs (VerifyDelegate): Removed unused argument.
3488
3489         * doc.cs: Uses Length for empty string test.
3490
3491         * driver.cs: Uses Length for empty string test.
3492
3493         * enum.cs (IsValidEnumType): Made static
3494
3495         * expression.cs (EnumLiftUp): Removed unused argument.
3496         (ResolveMethodGroup): Ditto.
3497         (BetterConversion): Ditto.
3498         (GetVarargsTypes): Ditto.
3499         (UpdateIndices): Ditto.
3500         (ValidateInitializers): Ditto.
3501         (MemberAccess.ctor): Ditto.
3502         (GetIndexersForType): Ditto.
3503
3504         * flowanalysis.cs: (MergeFinally): Removed unused argument.
3505
3506         * iterators.cs: Updated after MemberAccess clean up.
3507
3508         * location.cs: Uses Length for empty string test.
3509
3510         * namespace.cs: Uses Length for empty string test.
3511
3512          * report.cs (CheckWarningCode): Made static.
3513
3514         * statement.cs (LabeledStatement): Removed unused argument.
3515
3516         * typemanager.cs (FilterNone): Removed.
3517
3518 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3519
3520         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3521         obsolete.
3522
3523         * class.cs: Updated.
3524
3525 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3526
3527         * cs-parser.jay.cs: __arglist is not allowed for delegates.
3528
3529 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3530
3531         A fix for #77822.
3532
3533         * expression.cs (VerifyArgumentsCompat): Reverted to double error
3534         reporting, it's more tricky than I thought.
3535
3536 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3537
3538         A fix for #77816.
3539
3540         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
3541         host container.
3542         (AnonymousMethod.ImplicitStandardConversionExists): New method.
3543         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3544         Add more error reporting; Fixed issue with params.
3545
3546         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3547
3548         * cs-parser.jay: AnonymousMethod requires host container.
3549
3550         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3551
3552 2006-03-18  Raja R Harinath  <harinath@gmail.com>
3553
3554         * class.cs: Change 'TypeContainer ds' constructor argument to
3555         'DeclSpace parent'.  Some classes were missed below due to
3556         different naming convention.
3557
3558         * class.cs (MemberCore.Parent): Delete.  This makes the
3559         ParentContainer changes below enforceable by the compiler.
3560
3561         Treat pointers to enclosing declaration space as 'DeclSpace', not
3562         'TypeContainer'.
3563         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3564         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3565
3566         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3567         of TypeContainer.
3568         (Block.AddThisVariable): Likewise.
3569         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3570         (AbstractPropertyEventMethod.Emit): Likewise.
3571         (AbstractPropertyEventMethod.EmitMethod): Likewise.
3572         (GetMethod.Define, SetMethod.Define): Likewise.
3573         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3574         (DelegateMethod.EmitMethod): Likewise.
3575
3576         Fix regression test-partial-13.cs.
3577         Rationalize use of PartialContainer.  Ensure that the partial
3578         class semantics can be tied to type-correctness, i.e., any
3579         violation will cause a compile error.
3580         * class.cs, const.cs: Access all fields that belong to class
3581         TypeContainer via ParentContainer.  Arguments of EmitContexts and
3582         Resolve()-like functions still use 'Parent'.
3583
3584         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3585         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3586         (PropertyMethod.CheckModifiers): Remove unused argument.
3587         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3588         DeclSpace.
3589
3590 2006-03-17  Raja R Harinath  <harinath@gmail.com>
3591
3592         Make semantics of PartialContainer simpler.
3593         * decl.cs (DeclSpace.IsPartial): Remove.
3594         * class.cs (TypeContainer.IsPartial): Likewise.
3595         (TypeContainer..ctor): Set PartialContainer to point to self.
3596         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3597         (TypeContainer.FindNestedType): Likewise.
3598         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
3599
3600 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
3601
3602         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3603
3604 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3605
3606         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3607         classes.
3608
3609 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3610
3611         * class.cs (Operator.Define): An error for base conversion was not
3612         reported correctly.
3613
3614 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3615
3616         * iterator.cs : yield break is allowed in try statement which has
3617           catch clauses. Fixed bug #77767.
3618
3619 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3620
3621         A fix for #77593, #77574.
3622
3623         * class.cs (MethodCore.CheckBase): Another if for operator.
3624
3625 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
3626
3627         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3628         were not resolved
3629
3630         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3631         (DelegateCreation.ImplicitStandardConversionExists): New method for just
3632         conversion test.
3633         
3634         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3635         not needed.
3636
3637         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3638         Updated after another emitcontext usage was clean up. It should help us to
3639         synchronize with gmcs easier.
3640
3641 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
3642
3643         A fix for #77353.
3644
3645         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3646         (Event.Define): ditto
3647         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3648
3649         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3650         Removed redundant code and set NewSlot for Invoke method too.
3651
3652         * parameter.cs (Parameters.ctor): Add custom, type ctor.
3653         (Parameters.MergeGenerated): New method. Use this method when you merge
3654         compiler generated argument with user arguments.
3655
3656 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
3657
3658         * attribute.cs (ResolveAsTypeTerminal): Removed.
3659
3660         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3661         specialization for predefined types; 30% speed up.
3662         Finally placed obsolete check to right place.
3663         (Expression.ResolveType): Removed.
3664
3665         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3666         Updated after ResolveType was removed.
3667
3668         * expression.cs (Cast.ctor): Check void cast.
3669         (Binary.ResolveAsTypeTerminal): Is never type.
3670         (Conditional.ResolveAsTypeTerminal): Is never type.
3671
3672         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3673
3674 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3675
3676         Fix #77679.
3677         * expression.cs (ParameterReference.DoResolveBase): Change return
3678         type to bool.
3679         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3680         Update.
3681
3682         Fix #77628.
3683         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3684
3685         Fix #77642.
3686         * typemanager.cs (GetFullNameSignature): Don't nullref on
3687         protected accessors.
3688
3689 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3690
3691         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3692         these two separated members to simplify the code.
3693         (Attribute.Resolve): Refactored to use new fields and methods.
3694         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3695         implemented obsolete attribute checking.
3696         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3697         implemented obsolete checking again. It look line never ending quest ;-)
3698         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3699
3700         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3701
3702         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3703
3704         *class.cs (Property.Define): Add RegisterProperty call.
3705
3706         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3707         argument groups (only 2).
3708
3709         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3710         encoding expression to arguments.
3711         (Expression.ExprClassToResolveFlags): Just turned to property.
3712
3713         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3714         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3715         optimized as well as implemented support for zero-length attributes.
3716
3717         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3718         Add caching of PropertyInfo's.
3719
3720 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3721
3722         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3723         error multiple times.
3724
3725 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3726
3727         New partial class implementation.
3728         A fix for #77027, #77029, #77403
3729
3730         * attribute.cs (Attributable): Made attributes protected.
3731
3732         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3733         the replacements of ClassPart and PartialContainer.
3734         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3735         (TypeContainer.AddInterface): Ditto.
3736         (TypeContainer.AddPartial): The main method for partial classes. It checks
3737         for errors and merges ModFlags and attributes. At the end class is added to
3738         partial_parts list.
3739         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3740         required here.
3741         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3742         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3743         from the rest of partial classes.
3744         (TypeContainer.GetClassBases): Simplified.
3745         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3746         DefineType.
3747         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3748         (TypeContainer.HasExplicitLayout): Uses Flags now.
3749         (PartialContainer): Removed.
3750         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3751         (StaticClass): Was merged with Class.
3752         (Class.GetClassBases): class and static class bases are verified here.
3753         (Class.TypeAttr): Added static attributes when class is static.
3754         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3755         (MemberBase): In some cases we need to call parent container for partial
3756         class. It should be eliminated but it's not easy now.
3757
3758         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3759
3760         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3761         partial classed to accumulate class comments.
3762         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3763
3764         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3765
3766         * driver.cs (MainDriver): Tree.GetDecl was removed.
3767
3768         * modifiers.cs (Modifiers): Add partial modifier.
3769
3770         * tree.cs (Tree.decl): Removed.
3771         (RootTypes): Started to use this class more often for root types
3772         specializations.
3773
3774 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3775
3776         A fix for #77615
3777
3778         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3779         external interface does not have an attribute.
3780
3781 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3782
3783         Another prerequisites for new partial classs implementation.
3784         
3785         * attribute.cs (Attribute.Equal): Implemented.
3786         (Attribute.Emit): Changed as attributes can be applied more than twice.
3787         (Attributes.Emit): Check for duplicate attributes here.
3788
3789         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3790         as a parameter, clean-up.
3791
3792 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3793
3794         A fix for #77485
3795
3796         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3797         contains obsolete attribute check which can in some cases look for base
3798         type of current class which is not initialized yet.
3799         (TypeContainer.BaseType): Replacement of ptype.
3800
3801         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3802
3803 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3804
3805         First of prerequisites for new partial classs implemention.
3806         
3807         * attribute.cs (Attributable): Extended by ResolveContext;
3808         Attributes finally have correct context for resolving in all cases.
3809         (AttachTo): Attribute owner is assigned here.
3810
3811         * codegen.cs (IResolveContext): Introduce new interface to hold
3812         all information needed in resolving phase.
3813         (EmitContext): Implements IResolveContext; more clean-up needed here.
3814         
3815         * decl.cs (MemberCore): Implemented IResolveContext.
3816
3817         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3818         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3819         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3820         Refactored to use new IResolveContext instead of EmitContext; cleanup
3821
3822 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3823
3824         * codegen.cs (EmitScopeInitFromBlock): check here the
3825         capture_context, there is no need to make two calls to the
3826         EmitContext. 
3827
3828         * anonymous.cs: Add some debugging messages that might help me
3829         track other instances of this problem in the future (the
3830         regression of test 467).
3831
3832         * cs-parser.jay: track the variable block, as we need to initalize
3833         any captured variables declared in this block for the "catch"
3834         portion of the "Try" statement.
3835
3836         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3837         scope initialization for captured variables. 
3838
3839         Also, move the emit for the variables after the block location has
3840         been marked.
3841
3842 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3843
3844         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3845
3846 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3847
3848         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3849         commit yesterday, the initialization for the roots is necessary.
3850         What is not necessary is the scope activation.
3851
3852 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3853
3854         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3855         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3856         CS0206 checks.
3857         (Argument.Resolve): Remove CS0206 checks.
3858
3859 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3860
3861         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3862         scopes for all the roots, the scopes will now be emitted when the
3863         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3864
3865         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3866         code.  This reduces a lot of existing cruft.
3867         
3868         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3869         that the ScopeInfo is generated as we enter the scope, not at the
3870         time of use, which is what we used to do before.
3871
3872         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3873         every time a Block is about to be emitted if we have a
3874         CaptureContext. 
3875
3876 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3877
3878         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3879         (Reset): Update.
3880         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3881
3882         * typemanager.cs (cons_param_array_attribute): Make private.
3883         (Reset): Set it to null.
3884         (InitCoreHelpers): Don't initialize it.
3885         (ConsParamArrayAttribute): New.  Initialize it as needed.
3886         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3887
3888 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3889
3890         * expression.cs: There might be errors reported during the
3891         selection of applicable methods.  If there are errors, do not
3892         continue execution as it will lead the compiler to crash.
3893
3894 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3895
3896         * expression.cs: Member access is not allowed on anonymous
3897         methods.  Fixes #77402.
3898
3899 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3900
3901         Fix #77401
3902         * cs-parser.jay (VariableDeclaration): Don't set
3903         current_array_type to null.
3904         (field_declaration, event_declaration, declaration_statement):
3905         Set it to null here.
3906
3907 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3908
3909         * typemanager.cs (GenericParameterPosition): New.
3910         * doc.cs: Use it.
3911
3912 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3913
3914         * doc.cs : To process "include" elements, first we should create
3915           another list than XmlNodeList, because it could result in node
3916           removal, which could result in that the XmlNodeList gives up
3917           yielding next node.
3918
3919           (Also made code identical to gmcs again.)
3920
3921 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3922
3923         * ecore.cs: Introduce an error report that we were not catching
3924         before, if not silent, we must report the error.  Gonzalo ran into
3925         it.
3926
3927 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3928
3929         A fix for bug: #76957
3930         
3931         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3932         ComputeMethodHost before creating the method, this is a new
3933         requirement. 
3934
3935         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3936         that this method references (RegisterScope).  The actual scope
3937         where the method is hosted is computed with the ComputeMethodHost
3938         before we create the method.
3939
3940         Moved the Deepest routine here.
3941
3942         (AnonymousContainer.ComputeMethodHost): New routine used to
3943         compute the proper ScopeInfo that will host the anonymous method.
3944
3945         (ScopeInfo): Deal with multiple roots.  The problem was that we
3946         did not have a unique root where all ScopeInfos could be hanged
3947         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3948         of roots.  
3949
3950         Remove AdjustMethodScope which is now computed at the end.  Remove
3951         LinkScope which did a partial link, instead link all ScopeInfos
3952         before code generation from the new "LinkScopes" routine. 
3953
3954         Simplify all the Add* routines as they no longer need to maintain
3955         the tree, they just need to record that they are using variables
3956         from a ScopeInfo.
3957
3958         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3959         routines to produce the forest of ScopeInfo trees.
3960
3961         * class.cs (TypeContainer.AppendMethod): This is just like
3962         AddMethod, but ensures that an interface implementation method
3963         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3964         methods, but at the end.
3965
3966         We use this functionality to ensure that the generated MoveNext
3967         method in the iterator class is resolved/emitted before the
3968         enumerator methods created.   
3969
3970         This is required because the MoveNext method computes the right
3971         ScopeInfo for the method.  And the other methods will eventually
3972         need to resolve and fetch information computed from the anonymous
3973         method. 
3974
3975 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3976             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3977
3978         Fix rest of #76995.
3979         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3980         the 'aliases' hash.
3981         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3982         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3983
3984 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3985
3986         Fix #76656, cs0231-2.cs.
3987         * cs-parser.jay (formal_parameter_list): Make error case catch
3988         more issues.
3989         (parenthesized_expression_0): Add CS1026 check.
3990         (invocation_expression): Remove unused { $$ = lexer.Location }.
3991
3992 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3993
3994         Fix #76824.
3995         * cs-parser.jay (statement_expression): Don't list out the
3996         individual statement-expressions.  Convert syntax error into
3997         CS0201 check.
3998
3999 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4000
4001         Fix #76874.
4002         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4003         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4004         CheckIntermediateModification.
4005         (FieldExpr.DoResolve): Add new two-argument version that
4006         allows us to resolve the InstanceExpression as an lvalue.
4007         The one-argument variant is now just a wrapper.
4008         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4009         Resolve the lhs as an lvalue if the it has a value type.
4010         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4011         from Assign.DoResolve.
4012         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4013         resolved as an lvalue.
4014         (PropertyExpr.DoResolve): Update.
4015         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4016         has a value type.  Move CS1612 check here from
4017         CheckIntermediateModification.
4018         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4019         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4020         'right_side' of a ResolveLValue on an 'out' argument.
4021         (EmptyExpression.LValueMemberAccess): New.  Used as the
4022         'right_side' of a propagated ResolveLValue on a value type.
4023         (LocalVariableReference.DoResolveBase): Recognize
4024         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4025         Add CS1654 check.
4026         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4027         EmptyExpression.Null.
4028
4029 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4030
4031         * typemanager.cs : added IsGenericParameter(). In mcs it always
4032           return false.
4033         * doc.cs : for generic parameters, use GenericParameterPosition,
4034           not FullName.
4035
4036 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4037
4038         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4039
4040 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4041
4042         This fixes the problem where we used ldfld instead of ldflda to
4043         load the "THIS" pointer on captured parameters, when THIS is a
4044         value type.  See bug #77205.
4045         
4046         * iterators.cs (CapturedThisReference.Emit): Pass false to
4047         EmitThis (we do not need the address).
4048
4049         * codegen.cs (EmitThis): it needs to know whether we need the
4050         address of `this' or not.  This is used by value types.  
4051
4052         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4053         every other call passes false.
4054
4055 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4056
4057         Fix #77221.
4058         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4059         GetOverride.
4060         * expression.cs (Invocation.OverloadResolve): Update.
4061         (Invocation.DoResolve): Avoid double resolution of invocation.
4062
4063 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4064
4065         Fix #77180.
4066         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4067         unary negation of floating point types as 0-expr; negation cannot
4068         overflow in floating point types.
4069
4070         Fix #77204.
4071         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4072         on operands of 'void' type.
4073
4074         Fix #77200.
4075         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4076         and ExclusiveOr for boolean constants too.
4077
4078 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4079
4080         Fix #75636.
4081         * expression.cs (Invocation.OverloadResolve): Replace reflected
4082         override methods with their base virtual methods, rather than
4083         skipping over them.
4084         * typemanager.cs (TypeManager.GetOverride): New.
4085
4086 2006-01-05  Jb Evain  <jbevain@gmail.com>
4087
4088         * class.cs (Property.Define, Indexer.Define): do not tag the
4089         properties as SpecialName | RTSpecialName.
4090
4091 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4092
4093         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4094         doing a low-level comparission of parameter types.  It was lacking
4095         a check for __argslist. 
4096
4097 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4098
4099         * expression.cs (ParameterReference.DoResolveBase): Allow
4100         reference parameters if they are local to this block. 
4101
4102         This allows the ref and out parameters of a delegate to be used in
4103         an anonymous method, for example:
4104
4105         delegate void set (out int x);
4106
4107         set s = delegate (out int x){
4108                 x = 0;
4109         };
4110
4111         This is used by functionality introduced late in the C# language.
4112         
4113         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4114         method that take ref and out parameters. 
4115
4116         Fixes #77119 which was a late change in the spec.
4117
4118 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4119
4120         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4121         parent if its the same scope.  Fixes #77060.
4122
4123 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4124
4125         * driver.cs: Report the case of no source files and no -out:
4126         argument provided.
4127
4128 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4129
4130         Fix #77035.
4131         * expression.cs (ComposedCast.GetSignatureForError): Define.
4132
4133 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4134
4135         Fix #76995
4136
4137         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4138         ListDictionary, to contain the ExternAliasEntry entries (in
4139         addition to the NamespaceEntry.aliases hashtable). This field is
4140         shared between the original entry and its doppelganger (bodyless 
4141         copy of it).
4142         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4143         extern_aliases field.
4144         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4145         lookup in extern_aliases.
4146
4147 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4148
4149         Fix #77006.
4150         * class.cs (TypeContainer.Mark_HasEquals): New.
4151         (TypeContainer.Mark_HasGetHashCode): New.
4152         (ClassPart): Override them.
4153         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4154
4155         Fix #77008.
4156         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4157         'parent' argument to the base constructor.
4158
4159         Remove all mention of TypeContainer from decl.cs.
4160         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4161         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4162         (DeclSpace.DeclSpace): Likewise.
4163         (DeclSpace.DefineMembers): Remove unused argument.
4164         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4165         debugging check -- we don't care if the debug code throws an
4166         InvalidCastException instead of an InternalErrorException.
4167         * class.cs (TypeContainer.DefineMembers): Update to changes.
4168         (TypeContainer.DoDefineMembers): Likewise.
4169         (TypeContainer.GetMethods): Likewise.
4170         (PropertyMember.Define): Likewise.
4171         (MemberBase.Parent): New property that forwards to
4172         MemberCore.Parent, but ensures that we get a TypeContainer.
4173         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4174         (RootContext.PopulateTypes): Likewise.  Remove special case code
4175         for !RootContext.StdLib: DefineMembers is idempotent.
4176
4177 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4178
4179         * convert.cs (ExplicitConversionCore): Check the return value from
4180         ExplicitConversionCore which can return null on failure.  Fixes #76914
4181
4182 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4183
4184         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4185
4186 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4187
4188         * doc.cs : The search for referenced namespace was insufficient to
4189           get global one as it used to do. Fixed bug #76965.
4190
4191 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4192
4193         * doc.cs : check name in cref in the last phase that whether it is
4194           namespace or not.
4195
4196 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4197
4198         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4199           Mono.C5.
4200
4201 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4202
4203         * doc.cs : so it turned out that we cannot skip override check for 
4204           interface members. Fixed bug #76954.
4205
4206 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4207
4208         * cs-tokenizer.cs : fixed bug #75984:
4209           - #warning and #error should not be handled when the source line
4210             is disabled.
4211           - #line is not checked strictly when the source line is disabled.
4212           - #define and #undef is on the other hand checked strictly at any
4213             state.
4214
4215 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4216
4217         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4218           CS1027 report.
4219
4220 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4221
4222         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4223
4224         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4225         event initializers.
4226         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4227         (FieldBase.Initializer): Initializer is now optional.
4228         (EventField.Define): Only event field can have initializer.
4229
4230         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4231
4232         * const.cs (Const): Reuse initializer.
4233
4234         * cs-parser.jay: Updated after FieldBase changes.
4235         Added current_array_type to simplify array initializers.
4236
4237         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4238
4239         * expression.cs, iterators.cs: Updated.
4240
4241         * namespace.cs (NamespaceEntry): Made UsingFound private.
4242
4243 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4244
4245         * parameterCollection.cs: Obsolete, removed.
4246         * parser.cs: Obsolete, removed.
4247
4248 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4249
4250         Fix #76849.
4251         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4252
4253         * enum.cs (Enum.Define): Set obsolete context here.
4254
4255 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4256
4257         * doc.cs :
4258           - FindDocumentedMember() now expects 1) paramList as null
4259             when "we don't have to check the number of parameters" and
4260             2) Type.EmptyTypes when "there is no arguments".
4261           - Introduced FoundMember struct to hold the exact type which was
4262             used to find the documented member (the above change broke
4263             test-xml-044; it might be better just to use DeclaringType than
4264             what MS does, like this change does, but it depends on usage.)
4265
4266 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4267
4268         * doc.cs : documented member might be from DeclaringType for nested
4269           types. Fixed bug #76782.
4270
4271 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4272
4273         * anonymous.cs: Have the param code handle leaving copies on the
4274         stack etc. Allows anonymous params to take part in the assignment
4275         code (++, +=, etc). Fixes bug #76550
4276
4277         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4278         it down to the anon code.
4279
4280         * iterators.cs: Use dummy var here
4281
4282         * codegen.cs: Handle new vars
4283
4284 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4285
4286         Fix #76849.
4287         * class.cs (MethodData.Define): Set proper Obsolete context.
4288
4289         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4290         obsolete context.
4291         (FieldExpr.DoResolve): Ditto.
4292
4293 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4294
4295         Fix #76849.
4296         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4297         parent is not obsolete.
4298
4299 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4300
4301         * doc.cs : (FindDocumentedMember) find parameterless members first
4302           and get CS0419 in the early stage. Fixed first case of bug #76727.
4303
4304 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4305
4306         Fix #76859.
4307         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4308         no error was reported.
4309
4310         *expression.cs (Binary.DoResolve): left can be null.
4311
4312 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4313
4314         Fix #76783.
4315         * class.cs (MethodData.Emit): Parameters should be labeled first.
4316
4317 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4318
4319         Fix #76761.
4320         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4321
4322 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4323
4324         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4325
4326         * class.cs (MethodCore): Parameter clean up.
4327         (IMethodData): Added ParameterInfo.
4328         (MethodData): Parameter clean up.
4329         (Indexer.Define): Parameter clean up.
4330
4331         * anonymous.cs,
4332         * codegen.cs,
4333         * cs-parser.jay,
4334         * decl.cs,
4335         * doc.cs,
4336         * ecore.cs,
4337         * flowanalysis.cs,
4338         * iterators.cs,
4339         * pending.cs,
4340         * statement.cs,
4341         * typemanager.cs: Parameter clean up.
4342
4343         * delegate.cs (Define): Get rid of duplicated code.
4344
4345         * expression.cs (ParameterReference): Removed useless parameters
4346         and simplified.
4347         (Invocation): Ditto.
4348
4349         * parameter.cs (ParamsParameter): New class, params specialization.
4350         (ArglistParameter): Attemp to separate arglist.
4351         (Parameter): Refactored to be reusable and faster.
4352         (Parameter.Modifier): Made understandable.
4353         (Parameters): Changed to be used as a class for `this' assembly
4354         parameters. Refactored to use new specialized classes.
4355
4356         * support.cs (ParameterData): Added Types property.
4357         (InternalParameters): Deleted.
4358
4359 2005-08-20  Martin Baulig  <martin@ximian.com>
4360
4361         Merging this patch from GMCS to fix #75867.
4362
4363         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4364         scope if we don't already have it.
4365
4366 2005-11-17  Martin Baulig  <martin@ximian.com>
4367
4368         * anonymous.cs
4369         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4370         inherit the scope from our parent.  Fixes #76653.
4371
4372 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4373
4374         * doc.cs : the previous patch does not actually fix the bug.
4375           PropertyInfo override check is now implemented and really fixed it.
4376         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4377
4378 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4379
4380         * doc.cs : apply "override filter" also to properties.
4381           Fixed bug #76730.
4382
4383 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4384
4385         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4386           no need to check overrides. For classes, omit those results from 
4387           interfaces since they must exist in the class. Fixed bug #76726.
4388
4389 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4390
4391         * typemanager.cs : (GetFullNameSignature) differentiate indexers
4392           with different parameters. Fixed the second problem in #76685.
4393
4394 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4395
4396         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4397           get expected 'protected' access in CheckValidFamilyAccess()).
4398           Fixed bug #76692.
4399
4400 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4401
4402         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4403           Fixed bug #76705.  CS1569 was incorrectly commented out.
4404
4405 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4406
4407         * doc.cs : use Invocation.IsOverride() to do real override check.
4408         * expression.cs : made Invocation.IsOverride() internal.
4409
4410 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4411
4412         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4413           TypeBuilder.FindMembers() and filter overriden base members out.
4414           Fixed bug #76990.
4415
4416 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4417
4418         * doc.cs : ref/out parameters are represented as '@' (instead of
4419           '&' in type FullName). Fixed bug #76630 (additionally crefs).
4420
4421 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4422
4423         * doc.cs : when there was no '.' in cref to methods in doc comment,
4424           then parameters were missing in the output. Fixed bug #76691.
4425
4426 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4427
4428         * driver.cs : don't output docs when there is an error.
4429           Fixed bug #76693.
4430
4431 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4432
4433         * doc.cs :
4434           Now it should detect indexers. Fixed primary concern in bug #76685.
4435           Fixed CS0419 message to not show the identical member signature in
4436           the message.
4437
4438 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4439
4440         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4441           instead of Type.FindMembers() since it does not handle events.
4442           Fixed bug #71604.
4443
4444 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
4445
4446         * codegen.cs: Fixed typo (speficied -> specified).
4447
4448 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4449
4450         Fix #76369.
4451         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4452
4453 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4454
4455         * attribute.cs: Changed error message.
4456
4457         * cs-tokenizer.cs: One more check.
4458
4459 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4460
4461         * statement.cs (Block.Resolve): Ignore empty statement.
4462
4463 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4464
4465         * report.cs: Made error/warning methods more strict to avoid
4466         their misuse.
4467
4468         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4469         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4470         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4471         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4472
4473 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
4474
4475         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4476         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4477
4478         * class.cs (TypeContainer.IsComImport): New property.
4479         (Constructor.Define): Create proper ctor for ComImport types.
4480
4481         * expression.cs (New.CheckComImport): Fixed.
4482
4483 2005-11-07  Miguel de Icaza  <miguel@novell.com>
4484
4485         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4486         that a parameter has been captured does not mean that we do not
4487         have to do the rest of the processing.  This fixes the second part
4488         of #76592.  If there was another anonymous method capturing
4489         values in the past, the Scope would never be set for the second
4490         method that captured the same parameter.
4491
4492         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4493         properly manipulate the stack.   Second part of fix for #76592.
4494
4495         * expression.cs (New): Add support for invoking "new" on
4496         interfaces that have been flagged with the ComImport attribute and
4497         the CoClass.  Fixes #76637 
4498
4499         * statement.cs (Try.DoEmit): When a variable is captured, do not
4500         try to emit the vi.LocalBuilder variable as it has been captured.
4501         Create a temporary variable and store the results on the
4502         FieldBuilder.  Fixes #76642
4503
4504 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
4505
4506         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4507
4508         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4509
4510         * expression.cs (Binary.DoResolve): Added && optimalization.
4511     
4512         * typemanager.cs (AddUserType): Removed useless argument.
4513
4514 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
4515
4516         * statement.cs (Block.variables): Uses ListDictionary.
4517
4518 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4519
4520         Fix #75969.
4521         * class.cs (PartialContainer.EmitType): Customized to emit
4522         security attributes.
4523         (ClassPart.ApplyAttributeBuilder): Transform security attribute
4524         for partial classes.
4525
4526 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4527
4528         Fix #76599.
4529         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4530         access has to be fixed.
4531         
4532         * typemanager.cs (IsUnmanagedType): Wrong common field type.
4533
4534 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
4535
4536         Fix #76590.
4537         * ecore.cs (NullCast.Reduce): Implemented.
4538
4539         * expression.cs (ArrayCreation.CheckIndices): Correcly check
4540         constant type.
4541         
4542         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4543         properly.
4544         (Foreach.Resolve): Catch null properly.
4545
4546 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4547  
4548         * cs-tokenizer.cs: Warning text fix.
4549
4550         * driver.cs: AllWarningNumbers exposed on public interface.
4551
4552         * report.cs (): Reviewed warning numbers.
4553         (IsValidWarning): Use binary search.
4554
4555 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4556  
4557         * driver.cs: Implemeted resource visibility.
4558         (Resources): New class for code sharing between /res: and
4559         /linkres:
4560  
4561 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
4562
4563         Fix #76568.
4564         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4565         folding.
4566         
4567         * convert (Convert.ImplicitReferenceConversion): NullCast holds
4568         contants only.
4569         
4570         * ecore.cs (NullCast): Child is contant only.
4571         
4572         * literal.cs (NullLiteral.Reduce): null can be converted to any
4573         reference type.
4574
4575 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
4576
4577         * driver.cs: Use Encoding.Default as default code page instead
4578           of ISO-28591.
4579
4580 2005-10-27  Raja R Harinath  <rharinath@novell.com>
4581
4582         Fix #76085.
4583         * expression.cs (Invocation.Error_InvalidArguments): Handle
4584         __arglist parameters.
4585         (Invocation.VerifyArgumentsCompat): Likewise.
4586         * support.cs (ReflectionParameters.GetSignatureForError): Print
4587         __arglist parameters.
4588         (InternalParamters.GetSignatureForError): Likewise.
4589         * parameter.cs (Parameters.GetSignatureForError): Likewise.
4590
4591 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
4592
4593         * attribute.cs (GetPropertyValue): Made public.
4594
4595         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4596         Resolve.
4597         Add new property WrapNonExceptionThrows to handle 2.0 assembly
4598         attribute.
4599         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4600         is not defined.
4601         
4602         * driver.cs: Reflect method name change.
4603         
4604         * statement.cs (Try.Resolve): Warn when try has both general
4605         exception handlers.
4606         
4607         * typemanager.cs: runtime_compatibility_attr_type new predefined
4608         type.
4609
4610 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4611
4612         Fix #76419.
4613         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4614         treat it as an empty parameter list.
4615
4616 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4617
4618         Fix #76271.     
4619         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4620         ResolveAsTypeStep silent.
4621         * statement.cs (Block.AddConstant): Mark block as used.
4622         (Block.ResolveMeta): Avoid piling on error messages
4623         if a constant initializer resolution fails.
4624
4625 2005-10-25  Raja R Harinath  <rharinath@novell.com>
4626
4627         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4628         Remove.
4629         (NamespaceEntry.VerifyAllUsing): New.
4630         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
4631         behaviour.  Delegates actual resolution of alias to ...
4632         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
4633         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4634         Update.
4635         * driver.cs (Driver.MainDriver): Update.
4636         
4637         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4638         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4639         property.
4640         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4641         Remove.
4642         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4643         RootNamespace.DefineNamespacesForAll.
4644
4645 2005-10-24  Raja R Harinath  <harinath@gmail.com>
4646
4647         * typemanager.cs (assemblies, external_aliases, modules)
4648         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4649         (ComputeNamespaces, GetRootNamespace): Remove extra staging
4650         overhead.  Move resposibility ...
4651         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
4652         * driver.cs, attribute.cs, codegen.cs: Update to changes.
4653
4654 2005-10-23  Raja R Harinath  <harinath@gmail.com>
4655
4656         * namespace.cs (RootNamespace.all_namespaces): Renamed from
4657         cached_namespaces.  Improve usage.
4658         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4659         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4660         Move from GlobalRootNamespace and simplify.
4661         (RootNamespace.Global): Make instance variable.
4662         (RootNamespace.RootNamespace): Add "alias name" parameter.
4663         (GlobalRootNamespace): Simplify drastically.
4664         (Namespace.Lookup): Don't use GetNamespace.
4665         * typemanager.cs (GetRootNamespace): Rename from
4666         ComputeNamespaceForAlias.
4667         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4668
4669 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4670
4671         * anonymous.cs (AnonymousContainer): Don't crash when container
4672         doesn't exist.
4673
4674 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4675
4676         * expression.cs (Binary.DoResolve): Warn when comparing same
4677         values.
4678
4679 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4680
4681         Fix #76486.
4682         * expression.cs (Binary.DoResolve): It looks like there are no
4683         convetsion rules in enum context.
4684
4685 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4686
4687         Add support for extern alias qualifiers.
4688         * typemanager.cs: Move some LookupTypeReflection code
4689         to namespace.cs, to have cleaner code. Added some methods
4690         to help us keep track of the extern aliased references.
4691         * driver.cs: Add suport for extern alias assemblies on command
4692         line and check for their warnings/errors. Also keep track of the
4693         extern aliased assemblies.
4694         * namespace.cs: Move the global functionality of Namespace
4695         to GlobalRootNamespace/RootNamespace. Now the global namespace
4696         is GlobalRootNamespace.Globa. Also the code moved from 
4697         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4698         Finally added LocalAliasEntry (AliasEntry before) and
4699         ExternAliasEntry, to handle alias statements.
4700         * cs-parser.jay: Add support in the grammar for extern alias
4701         statement.
4702         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4703         Update callings to Namespace (now in GlobalRootNamespace).
4704
4705 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4706
4707         Fix #76371.
4708         * class.cs (TypeContainer.DefineType): Move updating of
4709         topological sort earlier in the code.
4710         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4711
4712 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4713
4714         Fix #76273.
4715         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4716         
4717         * constant.cs (Constant.TryReduce): Moved from Cast class.
4718         (Reduce): Made little bit more OO and fixed missing conversions.
4719         
4720         * ecore.cs (Reduce): Implemented.
4721         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4722         
4723         * literal.cs (Reduce): Implemented.
4724         
4725         * class.cs: Reverted Miguel's wrong commit.
4726
4727 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4728
4729         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4730
4731 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4732
4733         * cs-parser.jay, expression.cs : CS0214 was missing error location
4734           for constants. Fixed bug #76404.
4735
4736 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4737
4738         Fix #76370.
4739         * convert.cs (ExplicitConversionCore): Fixed object->enum
4740         conversion.
4741
4742 2005-10-10  Raja R Harinath  <rharinath@novell.com>
4743
4744         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4745         InstanceExpression.
4746         (PropertyExpr.EmitCall): Likewise.
4747         * expression.cs (Invocation.EmitArguments): Handle case where
4748         arguments == null.
4749         (Invocation.EmitCall): Avoid allocating temporary variable if
4750         there are no arguments.
4751
4752 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4753
4754         Fix #76323.
4755         * convert.cs (ImplicitConversionStandard): Move conversion of
4756         void* to arbitrary pointer types ...
4757         (ExplicitConversionStandard): .. here.
4758         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4759         error to always print typenames.
4760
4761 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4762
4763         * convert.cs (GetConversionOperator): Rename from
4764         GetConversionOperators.  Move operator selection code from ...
4765         (UserDefinedConversion): ... here.
4766
4767 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
4768
4769         * convert.cs (ExplicitConversionCore): Removed duplicate enum
4770         conversion.
4771
4772 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
4773
4774         * assign.cs (Assign.DoResolve): Error method changed.
4775
4776         * cfold.cs (DoConstantNumericPromotions): Error method changed.
4777         
4778         * const.cs (ResolveValue): Reset in_transit immediately.
4779         
4780         * constant.cs: Error method changed.
4781         
4782         * convert.cs: Removed useless location parameter.
4783         (ExplicitNumericConversion): Don't do double enum check.
4784         (ExplicitConversionCore): Renamed from ExplicitConversion.
4785         (ExplicitUnsafe): Extracted from ExplicitConversion.
4786         (ExplicitConversion): Uses for error reporting.
4787         
4788         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4789         error messages.
4790         (ResolveBoolean): Uses common error method.
4791         (CastToDecimal): Get rid of ec.
4792         (CastFromDecimal): Optimized.
4793         (ConvCast): Get rid of ec.
4794         
4795         * enum.cs (ResolveValue): Reset in_transit immediately.
4796         (Emit): Return after first error.
4797         
4798         * expression.cs: Convert changes.
4799         
4800         * literal.cs: Error method changed.
4801         
4802         * statement.cs: Error method changed.
4803
4804 2005-10-03  Raja R Harinath  <rharinath@novell.com>
4805
4806         * support.cs (SeekableStreamReader.Position): Don't error out when
4807         the requested position is just beyond the end of the current
4808         buffered data.
4809
4810 2005-09-28  Raja R Harinath  <rharinath@novell.com>
4811
4812         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
4813         try to keep in sync with the byte count of the underlying Stream.
4814         However, this limits us to a window size of 2048 characters: i.e.,
4815         the maximum lookahead of our lexer/parser can be 2048 characters.
4816
4817 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4818
4819         Fix #76255.
4820         * driver.cs: Fix compilation files with full root path.
4821
4822 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4823
4824         * report.cs (SymbolRelatedToPreviousError): Format the output so
4825         it does not use an open parenthesis that is never closed. 
4826
4827         * driver.cs: Follow coding guidelines
4828
4829 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4830
4831         Fix #72930.
4832         * const.cs (Const.ResolveValue): Check for assigning non-null
4833         value to reference type.
4834
4835 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4836
4837         * anonymous.cs: Implemented ExprClassName.
4838         
4839         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4840         delegate.
4841         
4842         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4843         check.
4844         
4845         * class.cs (StaticClass.DefineContainerMembers): Report protected
4846         members as error.
4847         
4848         * codegen.cs: if(ed) PRODUCTION.
4849         
4850         * convert.cs (Error_CannotImplicitConversion): Better error
4851         distinction.
4852         
4853         * cs-parser.jay: More error checks.
4854         
4855         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4856         
4857         * driver.cs (CSCParseOption): Enabled wrong option check.
4858         
4859         * ecore.cs (Expression.ExprClassName): Turned to property.
4860         (MemberExpr.CheckIntermediateModification): For checking boxed
4861         value types     modification.
4862         
4863         * statement.cs (Fixed.Resolve): Expression type must be
4864         convertible to fixed type.
4865         (CollectionForeach.GetEnumeratorFilter,TryType):
4866         Small refactoring for easier error checking.
4867
4868 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4869
4870         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4871         attributes.
4872         
4873         * class.cs (GeneratedBaseInitializer): New class for customization
4874         compiler generated initializers.
4875         (MemberBase.DoDefine): Check Obsolete attribute here.
4876         (FieldMember.DoDefine): Ditto.
4877         
4878         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4879         constants.
4880         
4881         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4882         (MemberCore.GetObsoleteAttribute): Removed argument.
4883         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4884         (MemberCore.CheckObsoleteType): New helper.
4885         
4886         * delegate.cs,
4887         * enum.cs,
4888         * statement.cs: Updates after MemberCore changes.
4889         
4890         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4891         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4892         
4893         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4894         obsolete attribute for compiler construct.
4895         (As.DoResolve): Cache result.
4896         
4897         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4898
4899 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4900
4901         Fix #76133.
4902         * expression.cs (This.VerifyFixed): In a value type T, the type of
4903         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4904         value type R, 'this' is treated as a value parameter.
4905
4906 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4907
4908         * statement.cs (Lock): Use the TemporaryVariable class instead of
4909         manually using local variables as those do not work when variables
4910         are captured.
4911
4912         * ecore.cs: Moved the TemporaryVariable class from being a nested
4913         class inside Foreach to be a public class that can be employed in
4914         other places. 
4915
4916 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4917
4918         * cs-parser.jay: interface_accessors replaced by
4919         accessor_declarations.
4920
4921         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4922         location.
4923         
4924         * statement.cs (GotoCase.Resolve): Convert null constant to
4925         null case.
4926         (SwitchLabel.ResolveAndReduce): Ditto.
4927         (SwitchLabel.NullStringCase): Custom null stamp.
4928         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4929         
4930         typemanager.cs (CSharpSignature): Don't skip first argument
4931         for full names.
4932
4933 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4934
4935         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4936
4937         * location.cs (InEmacs): in this mode, do not report column
4938         location as it confuses Emacs.
4939
4940 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4941
4942         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4943         expression.cs, iterators.cs, literal.cs: Store constants and
4944         literals location.
4945         
4946         * class.cs (MemberBase.ShortName): Pass location.
4947         
4948         * cs-parser.jay: Some location fixes.
4949         
4950         * ecore.cs (Expression.Location): Made virtual.
4951
4952 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4953
4954         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4955         if the underlying types are the same, otherwise we need to produce
4956         code that will do the proper cast.
4957
4958         This was exposed by Marek's constant rewrite which produced
4959         invalid code for the call site:
4960
4961         enum X : long { a }
4962         void Method (X v) {}
4963
4964         Method ((X) 5)
4965
4966         This fixes test-49.cs
4967
4968 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4969
4970         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4971           Type/Object should be allowed as well. Fixed bug #75968.
4972
4973 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4974
4975         * expression.cs : (Binary.DoResolve): when one is enum constant and
4976           another is constant 0, then return enum one *as enum type*.
4977           Fixed bug 74846.
4978
4979 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4980
4981         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4982         internal.
4983
4984         Fix #75941.
4985         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4986         flow-branching for LocalVariableReferences in case we were invoked
4987         from a MemberAccess.
4988         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4989         Carved out of ...
4990         (LocalVariableReference.DoResolveBase): ... this.
4991         (MemberAccess.Resolve): Do the check that was disabled during
4992         SimpleNameResolve.
4993
4994 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4995
4996         * class.cs :
4997           (PartialContainer.Create): check abstract/sealed/static strictly
4998           but abstract/sealed can exist only at one side. Fixed bug #75883.
4999
5000 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5001
5002         Fix #75945.
5003         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5004         specified, don't default to UnmanagedType.I4.
5005
5006 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5007
5008         * expression.cs : conditional operator should check possibly
5009           incorrect assign expression. Fixed bug #75946.
5010
5011 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5012
5013         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5014           Reverting the change. gmcs is much complex than mcs on this matter.
5015
5016 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5017
5018         * cs-tokenizer.cs : To read another token ahead of the actual 
5019           consumption, use new SavedToken and cache token instead of moving
5020           back the stream with SeekableStreamReader (it seemed problematic).
5021         * cs-parser.jay,
5022           driver.cs : Thus use StreamReader directly.
5023         * support.cs : Thus removed SeekableStreamReader.
5024
5025 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5026
5027         Fix #75934.
5028         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5029         (ScopeInfo.EmitScopeType): Use it to construct field names from
5030         names of captured locals.
5031
5032         Fix #75929.
5033         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5034         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5035         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5036         (ExplicitConversion): Remove enum cases already handled by
5037         implicit conversion.  Move implicit conversion check to the beginning.
5038         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5039         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5040         Don't treat System.Enum as a struct.
5041
5042 2005-08-30  Jb Evain  <jbevain@gmail.com>
5043
5044         * attribute.cs: handles as expression in parameters.
5045
5046 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5047
5048         Fix #75802.
5049         * class.cs (TypeContainer.VerifyClsName): Don't use a
5050         PartialContainer when verifying CLS compliance.
5051         (AbstractPropertyEventMethod): Set Parent here, ...
5052         (PropertyMethod): ... not here.
5053
5054 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5055
5056         * attribute.cs : escaped attribute name should not be allowed to be
5057           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5058
5059 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5060
5061         Fix #75927.
5062         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5063         when converting a long constant to unsigned long.
5064         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5065         detect where IsApplicable and VerifyArgumentsCompat disagree.
5066
5067 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5068         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5069
5070         Fix #75848.
5071         * class.cs (TypeContainer.CanElideInitializer): New helper.
5072         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5073         can safely emitting the initializer of a field.
5074
5075 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5076
5077         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5078           allowed inside a switch (without loop). Fixed bug #75433.
5079
5080 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5081
5082         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5083         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5084
5085 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5086
5087         * driver.cs : kinda reverting the default encoding changes (not exact 
5088           revert since I noticed that "codepage:reset" might not work fine).
5089
5090 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5091
5092         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5093           Location. Now getter and setter store location correctly.
5094           (errors/cs0111-12.cs now reports the expected location.)
5095
5096 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5097
5098         * driver.cs : Use default encoding on the environment.
5099           Removed (now that) extra parameter for SeekableStreamReader.
5100         * support.cs : (SeekableStreamReader) third .ctor() argument for
5101           StreamReader is not required (always true). preamble size could
5102           be acquired in simpler and safe way.
5103
5104 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5105
5106         * cs-parser.jay: report CS0642 at warning level 3
5107           and report CS0642 for an if else statement also
5108           fixes bug #74745. Patch by John Luke (and a bit
5109           modified by me).
5110           Removed extra CS0642 warning check for "while",
5111           "for" and "fixed".
5112         * statement.cs: In Block.Resolve(), CS0642 check
5113           is reimplemented to check a sequence of an empty
5114           statement and a block.
5115
5116           Both fix bug #66777.
5117
5118 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5119
5120         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5121         detection until I fix it.
5122         
5123         * cs-tokenizer.cs: Changed error message.
5124         
5125         * cs-parser.jay: Fixed 2 error locations.
5126         
5127         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5128         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5129         properties.
5130         
5131         * enum.cs (GetSignatureForError): Fixed.
5132         
5133         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5134         method detection.
5135         
5136         * class.cs,
5137         * typemanager.cs (RegisterProperty): Removed.
5138         
5139         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5140
5141 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5142
5143         Fix #75874.
5144         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5145         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5146
5147 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5148
5149         * expression.cs : tiny fix is required for not warning positive ulong.
5150           See test-441.cs.
5151
5152 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5153
5154         * expression.cs : add CS0652 check for constant and integral
5155           expression. Fixed bug #53974.
5156
5157 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5158
5159         * expression.cs : in DoNumericPromotions(), check if there is implicit
5160           conversion overload for string (to check CS0034). Fixed bug #52492.
5161
5162 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5163
5164         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5165
5166 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5167
5168         * ecore.cs : report location when it is *not* Null.
5169
5170 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5171
5172         * codegen.cs,
5173           ecore.cs,
5174           flowanalysis.cs,
5175           expression.cs:
5176           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5177           correctly. Fixed bug #75721.
5178
5179 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5180
5181         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5182         loop that performs 'min (pos, char_count)'.
5183
5184         Fix #75862.
5185         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5186         converted value in Operator.OnesComplement.
5187
5188 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5189
5190         * anonymous.cs: If the anon method is pulled into a helper class,
5191         it needs to be `internal' not `private'. Fixes runtime behavior on
5192         msft. bug #75704
5193
5194 2005-08-20  Martin Baulig  <martin@ximian.com>
5195
5196         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5197         scope if we don't already have it.
5198
5199         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5200         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5201         fixes #75867.
5202
5203 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5204
5205         Fix #75803
5206         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5207         is a partial class.
5208
5209 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5210
5211         The big constants rewrite
5212         Fix #75746, #75685 and more
5213         As a side effect saved 1MB for MWF ;-)
5214         
5215         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5216         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5217         enum based for corlib compilation.
5218         
5219         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5220         subtractions.
5221         
5222         * class.cs (FixedField.Define): Use ResolveAsConstant.
5223         
5224         * const.cs (IConstant): Interface constants and enums.
5225         (Const.ResolveValue): New method for constant resolvning.
5226         (ExternalConstant): Constants from imported assemblies.
5227         
5228         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5229         conversion; like enums.
5230         (Constant.ToType): Converts this constant to different type.
5231         (Constant.Increment): Adds 1.
5232         
5233         * convert.cs (ImplicitConversionRequired): Simplified.
5234         
5235         * cs-parser.jay: Create EnumMember directly.
5236         
5237         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5238         
5239         * doc.cs (GenerateEnumDocComment): Removed.
5240         
5241         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5242         (ConvertIntLiteral): Removed.
5243         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5244         
5245         * enum.cs (EnumMember): Implement IConstant.
5246         (Enum.IsValidEnumConstant): Removed.
5247         (Enum.GetNextDefaultValue): Removed.
5248         (Enum.FindMembers): Updated.
5249         (Enum.GenerateDocComment): Iterate enum members.
5250         
5251         * expression.cs (Cast.TryReduce): Handle enums correctly.
5252         (New.Constantify): Made public.
5253         (MemberAccess.DoResolve): Removed contant specific if(s).
5254         
5255         * literal.cs (NullLiteral): Implement new abstract methods.
5256         
5257         * statement.cs (GotoCase.Resolve): Use new constant methods.
5258         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5259         
5260         * typemanager.cs (LookupEnum): Removed.
5261         (IsEnumType): Fixed to work with corlib.
5262         (RegisterConstant): Removed.
5263         (LookupConstant): Removed.
5264         (GetConstant): Changed to work with IConstant.
5265
5266 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5267
5268         * location.cs : Fixed overflown (>255) column number.
5269
5270 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5271
5272         First cut of the qualified-alias-member feature.
5273         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5274         token.
5275         * cs-parser.jay (DOUBLE_COLON): New token.
5276         (namespace_or_type_name): Add rule for recognizing
5277         qualified-alias-members.
5278         (primary_expression): Likewise.
5279         (element_access): Allow QualifiedAliasMember as a possible
5280         type-bearing expression.
5281         (local_variable_type, local_variable_pointer_type): Likewise.
5282         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5283         aliases in the current and enclosing namespace declarations.
5284         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5285         * decl.cs (MemberName.is_double_colon): New.
5286         (MemberName.MemberName): Add new constructor for alias-member.
5287         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5288         * expression.cs (QualifiedAliasMember): New expression type.
5289
5290 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5291
5292         * location.cs : it borked when no argument was specified.
5293
5294 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5295
5296         * location.cs : tiny ToString() format fix.
5297
5298 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5299
5300         * statement.cs : oops, it was missing.
5301
5302 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5303
5304         A set of fixes for precise line/column location.
5305
5306         * location.cs :
5307           "token" field now holds a file/line "delta", a line number offset 
5308           from the segment, and a column number. See also:
5309           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5310           December/009508.html
5311           Removed static IsNull. Use instance IsNull property instead.
5312         * cs-tokenizer.cs :
5313           For some tokens it stores Location. For Identifier it stores
5314           LocatedToken which is a pair of string name and location.
5315           Column numbers are adjusted only at getChar().
5316         * report.cs :
5317           Use Location.ToString() for reporting (it now contains column).
5318         * cs-parser.jay :
5319           Largely modified to use LocatedToken instead of
5320           string (IDENTIFIER), and to acquire Location from some tokens.
5321         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5322           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5323           codegen.cs :
5324           Now MemberName holds Location. DeclSpace.ctor() receives Location
5325           as a parameter. Removed extra parameters to all derived classes.
5326           Replaced Location.IsNull() with instance property.
5327         * assign.cs, expression.cs :
5328           Added .ctor() overload that omits Location.
5329         * attribute.cs :
5330           Added "nameEscaped" flag that indicates the identifier was escaped
5331           in the source file. This fixes bug #57047.
5332
5333 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5334
5335         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5336         New method, looking for lo-case imported cls type.
5337
5338         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5339         here.
5340
5341         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5342
5343         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5344
5345         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5346         all_imported_types.
5347         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5348
5349         Optimized to save 3.5 MB for SWF compilation.
5350
5351 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5352
5353         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5354         (PartialContainer.Create): Moved logic AddToContainer.
5355         (PartialContainer.MarkForDuplicationCheck): Shares name.
5356         
5357         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5358         place.
5359         
5360         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5361         initialization.
5362         (Namespace.GetSignatureForError): New method.
5363         
5364         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5365         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5366
5367 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5368
5369         Fix #75669.
5370         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5371         member lookup rather than qualifier_type, since qualifier_type can
5372         be null.
5373
5374 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5375
5376         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5377         enum member.
5378
5379 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5380
5381         * statement.cs: Copy the local exception into the exception
5382         captured local.  Fixes 75674
5383
5384 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5385
5386         Fix #75658.
5387         * expression.cs (Invocation.OverloadResolve): Don't report error
5388         CS1501 if error CS1502 has been reported.
5389         (New.DoResolve): Delegate CS1501 reporting to
5390         Invocation.OverloadResolve.
5391
5392         Fix #75656.
5393         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5394         invariant-meaning-in-block property in an enclosing block if
5395         necessary.
5396
5397 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
5398
5399         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5400         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5401         (Switch.CheckSwitch): Just save 50kb for SWF.
5402
5403 2005-07-27  Martin Baulig  <martin@ximian.com>
5404
5405         * anonymous.cs (CaptureContext.AddField): Added
5406         `AnonymousContainer am' argument; compute its toplevel scope if
5407         it's not already computed.  Fixes #75649.
5408
5409 2005-07-26  Raja R Harinath  <rharinath@novell.com>
5410
5411         Fix #75628.
5412         * class.cs (Constructor.Emit): Reset block to null if the block
5413         resolve fails.
5414
5415 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5416
5417         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5418
5419 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5420
5421         * class.cs (MethodData.Define): Check whether accessor implementing
5422         interface is public.
5423
5424         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5425
5426 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
5427
5428         Fix #57245
5429         * namespace.cs (LookupType): Moved same type check to...
5430         
5431         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5432         with the same name.
5433
5434 2005-07-21  Raja R Harinath  <rharinath@novell.com>
5435
5436         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5437         already found a typebuilder.
5438         * class.cs (MethodCore.IsDuplicateImplementation): Compare
5439         MemberNames, not strings.
5440
5441         * const.cs (Error_ExpressionMustBeConst): 
5442         Rename from Error_EpressionMustBeConst.
5443         * const.cs, class.cs, statement.cd: Update.
5444
5445 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
5446
5447         Fix #65573
5448
5449         * const.cs (Const.LookupConstantValue): Report missing contant expression
5450         everytime.
5451         (Error_EpressionMustBeConstant): Only one error method.
5452
5453         * class.cs, statement.c: Updated.
5454
5455 2005-07-20  Raja R Harinath  <rharinath@novell.com>
5456
5457         * statement.cs (Block.Flags): Add back HasVarargs.
5458         (Block.flags): Make protected.
5459         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5460
5461         * typemanager.cs (types, typecontainers, user_types): Remove.
5462         (UserTypes, TypeContainers): Likewise.
5463         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5464         (CleanUp, Reset): Update.
5465         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
5466         (GetNestedType): Use Type.GetNestedType.
5467         (CoreLookupType): Take two arguments, the namespace and the
5468         basename of the type.  Update to use the Namespace.Lookup
5469         mechanism.
5470         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5471         (RealMemberLookup): Use IsNestedChildOf instead of playing with
5472         string concatenation and substring matches.
5473         * class.cs, enum.cs, delegate.cs: Update to changes.
5474
5475 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
5476
5477         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5478         Expression and made virtual.
5479
5480         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5481         (ImplicitStandardConversionExists): Fixed `byte' typo ?
5482
5483         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5484
5485         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5486         error message.
5487
5488         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5489         change.
5490
5491 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
5492
5493         Fix #57707
5494         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5495         AssemblyCultureAttribute is not used on executable.
5496
5497         * rootcontext.cs,
5498         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5499
5500 2005-07-16  Raja R Harinath  <rharinath@novell.com>
5501
5502         Fix #60638.
5503         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5504         New.  Reports CS0252/CS0253.
5505         Mostly taken from preliminary patch by Duncak Mak.
5506         (Binary.DoResolveOperator): Store results of operator lookup.
5507         Use them to detect if we need to warn about unintended reference
5508         comparisons.
5509
5510 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5511
5512         Fix #72969.
5513         * namespace.cs (Namespace.Lookup): Add back location parameter.
5514         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
5515         * delegate.cs, ecore.cs, expression.cs: Update to changes.
5516
5517         * codegen.cs (EmitContext.DeclSpace): Make readonly.
5518         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5519         (Namespace.LookupType): ... this.
5520         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5521         of namespaces.
5522         * typemanager.cs (LookupTypeReflection): Remove buggy code that
5523         purported to handle pointers.
5524         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5525         CoreLookupType.
5526
5527 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
5528
5529         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5530         type as namespace.
5531
5532 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5533
5534         * namespace.cs (Namespace.Lookup): Drop location parameter.
5535         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
5536         (NamespaceEntry.Lookup): ... this.
5537         (NamespaceEntry.Error_AmbiguousTypeReference):
5538         Move here from DeclSpace.
5539         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5540         names ...
5541         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5542         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5543         Move to NamespaceEntry.
5544         * delegate.cs, expression.cs: Update to changes.
5545
5546 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
5547
5548         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5549         CheckAttributeType and refactored.
5550         (Attribute.ResolvePossibleAttributeType): Changed to reuse
5551         ResolveAsTypeTerminal error handling.
5552         (ResolveAsTypeTerminal): Introduced because of global attributes extra
5553         handling.
5554         (GetSignatureForError): Print errors in same way.
5555
5556         * class.cs,
5557         * codegen.cs: Reflect attribute GetSignatureForError change.
5558
5559         * ecore.cs,
5560         * expression.cs: Add silent parameter to ResolveAsTypeStep.
5561
5562         * namespace.cs (UsingEntry): Refactored to make fields private.
5563
5564         * assign.cs,
5565         statement.cs: Error_UnexpectedKind has extra parameter.
5566
5567 2005-07-14  Raja R Harinath  <rharinath@novell.com>
5568
5569         * ecore.cs (IAlias): Remove.
5570         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
5571         that implement the interface.
5572         * namespace.cs (Namespace): Likewise.
5573         (Namespace.declspaces): Renamed from 'defined_names'.
5574         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
5575         DeclSpace instead of an IAlias.
5576         * tree.cs (Tree.AddDecl): Update.
5577
5578 2005-07-12  Raja R Harinath  <rharinath@novell.com>
5579
5580         * statement.cs (Block.Flags); Remove HasVarargs.
5581         (Block.HasVarargs): Move to ToplevelBlock.
5582         (Block.ThisVariable, Block.AddThisVariable): Likewise.
5583         (Block.Variables): Make protected.  Initialize variable hashtable
5584         if necessary.
5585         (Block.AddVariable): Update.
5586         (Block.Resolve): Update to changes.
5587         (ToplevelBlock.HasVarargs): New boolean.
5588         (ToplevelBlock.ThisVariable): Move here from Block.
5589         (ToplevelBlock.AddThisVariable): Likewise.
5590         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
5591         * expression.cs (This.ResolveBase): Update to changes.
5592         (ArglistAccess.DoResolve): Likewise.
5593
5594 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5595
5596         Fix #75321
5597         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5598
5599         * class.cs (TypeContainer.VerifyMembers): Distinguish between
5600         not used and not used & assigned.
5601         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5602
5603 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5604
5605         Fix #75053
5606         * expression.cs (Is.DoResolve): null is never provided type.
5607
5608 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5609
5610         Fix #52496
5611         * cs-parser.jay: Less strict event error rule to catch more errors.
5612
5613 2005-07-08  Martin Baulig  <martin@ximian.com>
5614
5615         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5616         gettter (allowed) or setter (not allowed).
5617
5618         * class.cs (Accessor): Implement IIteratorContainer.
5619         (Accessor.Yields): New public field.
5620         (PropertyBase.PropertyMethod.Define): Handle iterators on a
5621         per-accessor basis.
5622
5623         * cs-parser.jay
5624         (get_accessor_declaration, set_accessor_declaration): Set the
5625         `yields' flag on the accessor, not the property.
5626         (property_declaration): Do the iterators check on a per-accessor
5627         basis and not for the whole property.
5628
5629 2005-07-08  Martin Baulig  <martin@ximian.com>
5630
5631         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5632         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5633
5634 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
5635
5636         Fix #74975
5637         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5638         (ExtractSecurityPermissionSet): Cope with self referencing security
5639         attributes properly.
5640
5641         * driver.cs (SetOutputFile): Made public property OutputFile.
5642
5643 2005-07-07  Raja R Harinath  <rharinath@novell.com>
5644
5645         Fix #75486.
5646         * class.cs (TypeContainer.first_nonstatic_field): Rename from
5647         has_nonstatic_fields.  Make into a FieldBase pointer.
5648         (TypeContainer.AddField): Add CS0282 check.
5649         (TypeContainer.EmitType): Update.
5650
5651 2005-07-06  Miguel de Icaza  <miguel@novell.com>
5652
5653         * cs-tokenizer.cs (consume_identifier): Do not create strings to
5654         compare if they start with __.
5655
5656 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5657
5658         * statement.cs (Switch.SwitchGoverningType): Only look at
5659         UserCasts that don't need implicit standard conversions to one of
5660         the allowed switch types (Fixes test-322.cs).
5661         (LocalInfo.Resolve): Re-enable sanity-test.
5662
5663 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
5664
5665         * cs-tokenizer.cs (consume_identifier): Detect double undescores
5666         
5667         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5668         
5669         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5670
5671 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5672
5673         Fix #75472.
5674         * ecore.cs (SimpleName.GetSignatureForError): Add.
5675         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5676         (MemberAccess.GetSignatureForError): Add.
5677
5678 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5679  
5680         The big error and warning messages review.
5681         
5682         * anonymous.cs,
5683         * assign.cs,
5684         * attribute.cs,
5685         * class.cs,
5686         * codegen.cs,
5687         * convert.cs,
5688         * cs-parser.jay,
5689         * cs-tokenizer.cs,
5690         * decl.cs,
5691         * delegate.cs,
5692         * doc.cs,
5693         * driver.cs,
5694         * ecore.cs,
5695         * enum.cs,
5696         * expression.cs,
5697         * flowanalysis.cs,
5698         * iterators.cs,
5699         * literal.cs,
5700         * location.cs,
5701         * modifiers.cs,
5702         * namespace.cs,
5703         * parameter.cs,
5704         * pending.cs,
5705         * report.cs,
5706         * rootcontext.cs,
5707         * statement.cs,
5708         * support.cs,
5709         * tree.cs,
5710         * typemanager.cs: Updated.
5711         
5712         * class.cs: (MethodCore.SetYields): Moved here to share.
5713         (PropertyMethod.Define): Moved iterator setup here.
5714         
5715         * iterators.cs: Add orig_method to have full access to parent
5716         container.
5717
5718 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5719
5720         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5721         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5722         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5723         variable of struct type.
5724         * expression.cs (Unary.ResolveOperator): Update to change.
5725         (Indirection.VerifyFixed): Likewise.
5726         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5727         (ParameterReference.VerifyFixed): Value parameters are fixed.
5728         (This.VerifyFixed): Treat 'this' as a value parameter.
5729         * statement.cs (LocalInfo.IsFixed): Remove.
5730
5731 2005-07-01  Martin Baulig  <martin@ximian.com>
5732
5733         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5734         `ec.EmitThis ()' to get the correct scope.
5735
5736 2005-07-01  Martin Baulig  <martin@ximian.com>
5737
5738         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5739         instance is a ParameterReference; fixes #75299.
5740
5741 2005-07-01  Martin Baulig  <martin@ximian.com>
5742
5743         Reverted Marek's latest patch (r46725):
5744         - it contains structural changes which are neither mentioned in
5745           the ChangeLog nor explained anywhere; for example the additional
5746           argument of EmitContext's and Iterator's .ctor's and the
5747           TypeContainer.DefineMembers() change.
5748         - structural changes like this should go in in seperate patches
5749           and not be hidden in a huge patch which just seems to affect
5750           warnings and errors.
5751           a big and hard to understand patch.
5752         - it breaks iterators and causes regressions, for instance in
5753           test-iter-03.cs.      
5754
5755 2005-06-30  Raja R Harinath  <rharinath@novell.com>
5756
5757         Fix #75412.
5758         * expression.cs (Indexers.map): Remove.
5759         (Indexers.Append): Filter out inaccessible setters and getters.
5760         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5761
5762         Fix #75283.
5763         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
5764         Refactored from ...
5765         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5766         (FieldExpr.Emit, PropertyExpr.Emit): Update.
5767         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5768         * expression.cs (Invocation.EmitCall): Add CS0120 check.
5769
5770 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
5771
5772         Fix #75322
5773         * class.cs (FieldBase.GetInitializerExpression): One more field
5774         for backup.
5775
5776 2005-06-28  Miguel de Icaza  <miguel@novell.com>
5777
5778         * pending.cs: Do not define a proxy if the base method is virtual,
5779         it will be picked up by the runtime (bug 75270).
5780
5781 2005-06-08  Martin Baulig  <martin@ximian.com>
5782
5783         The big Iterators rewrite :-)
5784
5785         * iterators.cs: Rewrite this to use the anonymous methods framework.
5786
5787         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5788         before the TypeContainers; see 2test-21.cs.
5789
5790         * class.cs
5791         (TypeContainer.DefineType): Don't create a new EmitContext if we
5792         already have one (this only happens if we're an Iterator).
5793         (TypeContainer.Define): Also call Define() on all our iterators.
5794         (Method.CreateEmitContext): Added support for iterators.
5795
5796         * anonymous.cs
5797         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5798         (AnonymousContainer.CreateMethodHost): Moved here from
5799         AnonymousMethod and made abstract.
5800         (AnonymousContainer.CreateScopeType): New abstract method.
5801         (AnonymousContainer.IsIterator): New public property.
5802         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5803         get the ScopeTypeBuilder rather than manually defining it here. 
5804         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5805         iterators here.
5806
5807         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5808         before RootContext.DefineTypes().
5809
5810         * codegen.cs (EmitContext.RemapToProxy): Removed.
5811         (EmitContext.CurrentAnonymousMethod): Changed type from
5812         AnonymousMethod -> AnonymousContainer.
5813         (EmitContext.ResolveTopBlock): Protect from being called twice.
5814         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5815         (EmitContext.EmitThis): Removed the iterators hacks; use the
5816         anonymous methods framework for that.
5817
5818         * statement.cs
5819         (ToplevelBlock.Container): Make this a property, not a field.
5820         (ToplevelBlock.ReParent): New public method; move the
5821         ToplevelBlock into a new container.
5822         (Foreach.TemporaryVariable): Simplify.
5823
5824 2005-06-05  Martin Baulig  <martin@ximian.com>
5825
5826         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5827         (Block.AddTemporaryVariable): New public method; creates a new
5828         `LocalInfo' for a temporary variable.
5829         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5830         variables here.
5831         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5832         non-iterator variables.
5833
5834 2005-06-05  Martin Baulig  <martin@ximian.com>
5835
5836         * statement.cs (Foreach.TemporaryVariable): Create the
5837         LocalBuilder in the Emit phase and not in Resolve since in some
5838         situations, we don't have an ILGenerator during Resolve; see
5839         2test-19.cs for an example.
5840
5841 2005-06-04  Martin Baulig  <martin@ximian.com>
5842
5843         **** Merged r45395 from GCS ****
5844
5845         The big Foreach rewrite - Part II.
5846
5847         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5848         with `PropertyInfo ienumerator_getcurrent'.
5849
5850         * codegen.cs (VariableStorage): Removed.
5851
5852         * statement.cs
5853         (Foreach): Derive from Statement, not ExceptionStatement.
5854         (Foreach.CollectionForeach): New nested class.  Moved all the code
5855         dealing with collection foreach here.
5856         (Foreach.ForeachHelperMethods): Removed.
5857         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5858
5859 2005-05-23  Martin Baulig  <martin@ximian.com>
5860
5861         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5862         don't need to.  Fix #75014.
5863
5864 2005-05-20  Martin Baulig  <martin@ximian.com>
5865
5866         Merged r44808 from GMCS.
5867
5868         * class.cs (TypeContainer.CircularDepException): Removed.
5869         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5870         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5871         (CS0146) and interface (CS0529) dependencies here.
5872
5873 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5874
5875         * expression.cs (Invocation.EmitCall): Fix initialization
5876         'this_call' to reflect current behaviour.  Fix indentation.
5877
5878         * convert.cs (FindMostEncompassedType): Add two trivial special
5879         cases (number_of_types == 0 || number_of_types == 1).
5880         (FindMostEncompasingType): Likewise.
5881
5882 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5883
5884         Some cleanups preparing for the fix of #75283.
5885         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5886         error testing.
5887         (EventExpr.InstanceResolve): Likewise.
5888         (EventExpr.DoResolve): Remove redundant checks.
5889
5890 2005-06-10  Duncan Mak  <duncan@novell.com>
5891
5892         * cs-tokenizer.cs (process_directives): New flag for controlling
5893         the processing of preprocessor directives.
5894         (x_token): After seeing a '#', return Token.NONE instead of going
5895         to handle_preprocessing_directive() when not processing
5896         directives. This avoids unnecessary processing during the token peek in
5897         is_punct().
5898
5899         This fixes #74939.
5900
5901         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5902         the existing error reporting methods instead of Report.Error.
5903
5904         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5905         after Raja's rewrite.
5906
5907 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5908
5909         * class.cs: Small fix.
5910
5911 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5912
5913         Fix #75160.
5914         * class.cs (GetPartialBases): Fix return value check of
5915         part.GetClassBases.
5916
5917 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5918
5919         Ensure that partial classes are registered in their enclosing
5920         namespace.  Initial part of fix of #75160.
5921         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5922         Register declspace with namespace here, not in
5923         DeclSpace.RecordDecl.
5924         * cs-parser.jay: Pass namespace to RecordDecl.
5925         * class.cs (PartialContainer.Create): Likewise.
5926         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5927         called.
5928         * decl.cs (Declspace.RecordDecl): Remove.
5929         * namespace.cs (NamespaceEntry.DefineName): Remove.
5930
5931 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5932
5933         * rootcontext.cs: Reset TargetExt as well.
5934
5935 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5936
5937         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5938         -langversion:ISO-1.
5939
5940 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5941
5942         Fix #75080, cs0119.cs.
5943         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5944         of ...
5945         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5946         allowing ExprClass.Type and ExprClass.Namespace for
5947         ResolveFlags.VariableOrValue.
5948         (Expression.Resolve) [1-argument variant]: Change default resolve
5949         flags based on language version.
5950         (Expression.Error_UnexpectedKind): Use a simple string array
5951         rather than an ArrayList.
5952         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5953         not ExprClass.Type.
5954         (TypeOfVoid.DoResolve): Likewise.
5955         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5956         flags argument -- it always has the same value.
5957
5958 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5959
5960         Fix #75081.
5961         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5962         Use it in the error message.
5963         * assign.cs, expression.cs, statement.cs: Update.
5964
5965 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5966
5967         Fix #75088.
5968         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5969         the "almostMatchedMember" case too.
5970         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5971         that failed the accessibility checks to 'almost_match'.
5972
5973 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5974
5975         * attribute.cs: Use internal MethodBuilder methods to set
5976         ExactSpelling and SetLastError on PInvoke methods, instead
5977         of passing them via charset.  Fixes #75060.
5978
5979 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5980
5981         * parameter.cs (Parameter): Remove TODO comment.
5982         (Parameter.DefineParameter): Remove Location parameter.
5983         (Parameters.LabelParameters): Likewise.
5984         * class.cs (Constructor.Emit): Update to change.
5985         (MethodData.Emit): Likewise.
5986         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5987         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5988
5989 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5990
5991         * parameter.cs,
5992           Removed Parameters.Location and added Parameter.Location instead.
5993           Removed Location parameter from Emit() and GetSignature().
5994         * anonymous.cs,
5995           class.cs,
5996           cs-parser.jay,
5997           delegate.cs,
5998           iterators.cs,
5999           statement.cs :
6000           Modified all related calls.
6001
6002 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6003
6004         Improve user-defined conversion handling.
6005         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6006         applicable operators.
6007         (AddConversionOperators): New.  Helper for GetConversionOperators.
6008         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6009         there is only one most encompassed/encompassing type.
6010         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6011         "applicable operator" handling.
6012         (UserConversion): Move cache here from GetConversionOperators.
6013         Directly cache the chosen operator, rather than the whole
6014         MethodGroup.
6015         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6016         case.  Allow conversion of decimal to sbyte and byte too.
6017         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6018         New static methods.  Used to avoid allocating EmptyExpressions in
6019         convert.cs.
6020
6021 2005-05-24  Duncan Mak  <duncan@novell.com>
6022
6023         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6024         another class, used in Convert.ExplicitNumericConversion.
6025         (CastToDecimal): New class, similar to above, but casts to
6026         System.Decimal, used in Convert.ImplicitNumericConversion and also
6027         in explicit convesion from double/float to decimal.
6028
6029         * convert.cs (ImplicitNumericConversion): Handle implicit
6030         conversions to System.Decimal.
6031         (ExplicitNumericConversion): handle explicit conversions to
6032         System.Decimal.
6033
6034         This fixes #68711.
6035         
6036 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6037
6038         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6039         know the type at this stage, just break through.   Fixes #75008 
6040
6041 2005-05-19  Martin Baulig  <martin@ximian.com>
6042
6043         * delegate.cs
6044         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6045         to disable error reporting.
6046
6047         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6048         here since we don't want to report an error; see the new test-336.cs.
6049
6050 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6051
6052         * statement.cs (ToplevelBlock.GetParameterReference)
6053         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6054         Move here from class Block.
6055         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6056         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6057
6058 2005-05-18  Martin Baulig  <martin@ximian.com>
6059
6060         Fix #74978.
6061
6062         * flowanalysis.cs
6063         (FlowBranching.Reachability): Add non-static public And() and Or()
6064         methods.
6065         (FlowBranchingSwitch): New class; do the `break_origins' thing
6066         like in FlowBranchingLoop.
6067         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6068         reachability, not just locals and parameters.
6069         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6070         switch; MergeBreakOrigins() now takes care of that.
6071
6072 2005-05-18  Martin Baulig  <martin@ximian.com>
6073
6074         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6075         a loop and may leave it, reset the barrier; fixes #74974.
6076
6077 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6078         
6079         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6080         is back.
6081         
6082         * cs-parser.jay: Catch more lexical errors.
6083         
6084         * report.cs: Add one more Error method.
6085         
6086         * rootcontext.cs,
6087         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6088
6089 2005-05-17  Martin Baulig  <martin@ximian.com>
6090
6091         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6092         #70970. 
6093
6094 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6095
6096         Fix test-382.cs.  Emit values of decimal constants.
6097         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6098         Carved out of ...
6099         (TypeContainer.AddField): ... this.
6100         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6101         with initializers to include 'Const's.
6102         (ClassPart.RegisterFieldForInitialization): Forward to
6103         PartialContainer.
6104         * const.cs (Const.Const): Pass initializer to base class.
6105         (Const.Define): In case of decimal constants, register them for
6106         initialization in a static constructor.
6107
6108 2005-05-14  Martin Baulig  <martin@ximian.com>
6109
6110         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6111         do not call ResolveUnreachable() on unreachable statements in
6112         here, see the comment in the source code.
6113
6114 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6115
6116         Fix #74934.
6117         * expression.cs (BinaryResolveOperator): If one of the operands of
6118         an equality comparison is 'null' and the other is a pointer type,
6119         convert the null to a NullPointer.
6120         * convert.cs (ImplicitReferenceConversion): If the expression is a
6121         NullLiteral and the target type is a pointer type, return a
6122         NullPointer instead.
6123         (ImplicitConversionStandard): Likewise.
6124
6125 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6126         
6127         * cs-parser.jay: Set readonly context based on special constructs.
6128         
6129         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6130         readonly variable error handling.
6131         
6132         * rootcontext.cs (EmitCode): Don't verify members when error
6133         occurred.
6134         
6135         * statement.cs (LocalInfo): Add reaodnly context information.
6136         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6137
6138 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6139
6140         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6141         for #74041 to initialize 'resolved' to false only for explicit
6142         blocks.  Fixes #74873.
6143
6144 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6145
6146         Fix #74920.
6147         * typemanager.cs (unmanaged_enclosing_types): New.
6148         (IsUnmanagedType): Avoid infloops by using
6149         'unmanaged_enclosing_types' to talk with recursive invocations.
6150
6151 2005-05-13  Martin Baulig  <martin@ximian.com>
6152
6153         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6154         instance variable, not a local.  Fix #74873.
6155         (Block.ResolveUnreachable): Set it to true here.
6156
6157 2005-05-11  Duncan Mak  <duncan@novell.com>
6158
6159         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6160         continuing to process for 'arg'.
6161         (handle_preprocessing_directive): Check the argument of the #endif
6162         directive and report error CS1025 if there are any trailing
6163         characters.
6164
6165         According to the C# spec, having even whitespace after the #endif
6166         directive is illegal; however, because we call arg.TrimEnd ()
6167         beforehand, we have the same behavior as csc, allowing whitespace
6168         after the directive.
6169
6170         Fixes #74892.
6171
6172 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6173
6174         Fix #74863.
6175         
6176         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6177         (Constructor.GetObsoleteAttribute): Implemented correctly.
6178
6179 2005-05-10  Martin Baulig  <martin@ximian.com>
6180
6181         * support.cs (ReflectionParameters.ParameterModifier): Use
6182         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6183         and `ParameterAttributes.In'.  Fixes #74884.
6184
6185 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6186
6187         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6188         
6189         * expression.cs (Argument.GetParameterModifier): Turned to property.
6190         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6191         
6192         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6193         its C# equivalent.
6194         
6195 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6196
6197         Fix #74852.
6198         * decl.cs (MemberCache.AddMethods): Register override methods,
6199         rather than non-override methods.
6200         * typemanager.cs (RegisterOverride): New.
6201         (IsOverride): Update.
6202
6203 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6204
6205         Fix #73105.
6206         
6207         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6208         recursive declaration.
6209         
6210         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6211         
6212 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6213
6214         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6215         
6216         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6217
6218 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6219
6220         Fix #74797.
6221         * decl.cs (DeclSpace.FamilyAccessible): 
6222         Use TypeManager.IsNestedFamilyAccessible.
6223
6224         Fix reopened #64812.
6225         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6226         internal'.
6227
6228 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6229             Abin Thomas  <projectmonokochi@rediffmail.com>
6230             Anoob V E  <projectmonokochi@rediffmail.com>
6231             Harilal P R  <projectmonokochi@rediffmail.com>
6232
6233         Fix #64812.
6234         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6235         allow access to all static members.
6236
6237 2005-05-04  Martin Baulig  <martin@ximian.com>
6238
6239         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6240
6241 2005-05-04  Martin Baulig  <martin@ximian.com>
6242
6243         Fix #74655.
6244
6245         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6246         section at the end; make things work if `default' is not the last
6247         section.        
6248
6249 2005-05-04  Martin Baulig  <martin@ximian.com>
6250
6251         Fix #70400.
6252
6253         * statement.cs (Switch): Replaced the `got_default' field with a
6254         `default_section' one.
6255         (Switch.CheckSwitch): Set `default_section' here.
6256         (Switch.Resolve): If we're a constant switch and the constant is
6257         not found, use the default section.
6258
6259 2005-05-03  Martin Baulig  <martin@ximian.com>
6260
6261         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6262
6263         * statement.cs (Foreach.ArrayForeach): New nested class.
6264         (Foreach.TemporaryVariable): New nested class.
6265         (Foreach.EmitArrayForeach): Removed; this is now in the new
6266         ArrayForeach class.
6267
6268 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6269
6270         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6271         more conservative.
6272         (VerifyPendingMethods): Revert change below.
6273
6274         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6275         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6276         that used to trigger warning -28.  Remove warning -28.
6277         * expression.cs (Invocation.OverloadResolve): Use
6278         TypeManager.IsOverride to distinguish override methods.
6279
6280         Fix #74773.
6281         * pending.cs (VerifyPendingMethods): If a base type implements the
6282         requested interface, don't bother checking individual methods of
6283         the base type.  As a side-effect, this prevents the creation of
6284         unnecessary proxies.
6285
6286 2005-05-02  Martin Baulig  <martin@ximian.com>
6287
6288         Fix #70182.
6289
6290         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6291         Also `And' the locals if the old vector is null.
6292         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6293         null; in this case we basically reset all the variables.        
6294
6295 2005-05-02  Martin Baulig  <martin@ximian.com>
6296
6297         Fix #74529.
6298
6299         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6300         Added `FlowBranching branching' argument; always `and' the
6301         variables instead of `or'ing them unless we're an infinite loop.
6302
6303         * statement.cs (While.Resolve): Create a new sibling unless we're
6304         infinite.       
6305
6306 2005-05-02  Martin Baulig  <martin@ximian.com>
6307
6308         Fix #70140.
6309
6310         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6311         arguments; use it instead of creating a new TopLevelBlock.
6312         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6313         our ConstructorInitializer.
6314
6315         * statement.cs
6316         (TopLevelBlock.TopLevelBranching): New public property.
6317         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6318         and create our `TopLevelBranching'.
6319
6320         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6321         anonymous method host, use `block.TopLevelBranching' rather than
6322         creating a new branching.
6323
6324 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6325
6326         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6327         a ScopeInfo, if any of the current children is a child of the new
6328         entry, move those children there.
6329
6330 2005-04-30  Martin Baulig  <martin@ximian.com>
6331
6332         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6333         at the beginning of a SwitchSection.  Fix #73335.
6334
6335 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6336
6337         Fix #74378
6338         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6339         
6340         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6341         (FieldExpr.DoResolve): Obsolete members are ignored for field
6342         initializers.
6343         
6344 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6345
6346         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6347         of arrays detection.
6348
6349         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6350         verification.
6351         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6352
6353         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6354         arrays report.
6355
6356 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6357
6358         * cs-parser.jay: Use the prefered version of -unsafe in error
6359         message.
6360
6361 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6362
6363         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6364         circumstances.
6365
6366 2005-04-20  John Luke  <john.luke@gmail.com>
6367
6368         * driver.cs: fix typo in error message, --outout to --output
6369
6370 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6371
6372         * codegen.cs (InRefOutArgumentResolving): New field.
6373         
6374         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6375         fields outside contructor.
6376         
6377         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6378         
6379 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6380
6381         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6382         parameter code was not completed ever, so it was not as up-to-date
6383         as local variables.  Must finish it.
6384
6385         The bug fix was to compare the Toplevel of the block, not the
6386         current block.  Thanks for Ben for pointing this out. 
6387
6388 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6389
6390         * decl.cs (AddMethods): Use the declaring type of the problem
6391         method to determine if we want to squash a warning.
6392
6393 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * attribute.cs: Removed debug output.
6396
6397         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6398         
6399         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6400         Report.Stderr.
6401         
6402 2005-04-18  Raja R Harinath  <rharinath@novell.com>
6403
6404         Fix #74481.
6405         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6406         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6407         all null comparisons against reference types.
6408
6409 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
6410
6411         Fix# 74565
6412         * class.cs (TypeContainer.CircularDepException) New nested
6413         exception class.
6414         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6415         (TypeContainer.DefineType): Removed error, reset InTransit before
6416         exit.
6417         (Class.DefineType): Throw exception when is in Transit.
6418         Catch exception and report error.
6419         (Struct.DefineType): Throw exception when is in Transit.
6420         Catch exception and report error.
6421         (Interface.DefineType): Throw exception when is in Transit.
6422         Catch exception and report error.
6423
6424         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6425         handle nested exception handlers.
6426
6427         * flowanalysis.cs (InTryWithCatch): New method, search for try with
6428         a catch.
6429
6430         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6431         InFinally and InCatch storage.
6432
6433         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6434         (Catch.Resolve): Set and Restore ec.InCatch.
6435         (Try.Resolve): Set and Restore ec.InFinally.
6436         (Try.HasCatch): True when try has catch.
6437
6438 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
6439
6440         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6441           for the same event member, so exclude such cases from warning 419.
6442           Fixed bug #74633.
6443
6444 2005-04-16  Miguel de Icaza  <miguel@novell.com>
6445
6446         * expression.cs (Binary.ResolveOperator): Apply patch from John
6447         Luke to fix bug 59864: operators &, | and ^ on enumerations
6448         require that the same enum type on both sides.
6449
6450         * driver.cs: Add warnings to old flag usage, this is to assist
6451         people who produce Makefiles and hope that the Makefiles will be
6452         used on Windows.
6453
6454         * class.cs (TypeContainer.EmitType): Moved the definition of the
6455         special $PRIVATE$ field from the resolve phase to the Emit phase.
6456         During resolve we do not know if we are a struct with
6457         HasExplicitLayout, we know this only after the attributes for the
6458         type are emitted.
6459
6460         Set the FieldOffset to zero on the dummy field that we create for
6461         the class.   Fixes 74590.
6462
6463 2005-04-16  Raja R Harinath  <rharinath@novell.com>
6464
6465         Fix #73834.
6466         * ecore.cs (PropertyExpr.resolved): New.
6467         (DoResolve): Use it to handle a case of double resolution here.
6468         Handle a case of identical-name-and-type-name.
6469         * expression.cs (ArrayCreation.CheckIndices): Avoid double
6470         resolution by storing the results of expression resolution back
6471         into the "probes" array.
6472
6473 2005-04-15  Raja R Harinath  <rharinath@novell.com>
6474
6475         Fix cs0208-7.cs and cs0208-8.cs.
6476         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6477         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
6478         error reporting to point out the reason a struct is not unmanaged.
6479
6480 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6481
6482         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
6483           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6484
6485 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6486
6487         Fix #74528.
6488         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6489         IdenticalNameAndTypeName here.
6490         (EventExpr.InstanceResolve): Likewise.
6491
6492 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
6493
6494         C# 2.0 DefaultCharSetAttribute implementation
6495         
6496         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6497         which allows us to set GlobalNamespace for every resolve.
6498         (Attribute.ResolveArguments): Cut from Resolve.
6499         (Attribute.GetCharSetValue): Returns CharSet named argument.
6500         (Attribute.DefinePInvokeMethod): Gets default charset from
6501         module settings.
6502         (GlobalAttribute.ResolveAsTypeStep): Override.
6503         (GlobalAttribute.ResolveArguments): Override.
6504         
6505         * class.cs (TypeAttr): Is protected.
6506         
6507         * codegen.cs (ModuleClass.DefaultCharSet): New member.
6508         (ModuleClass.DefaultCharSetType): New memeber.
6509         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6510         
6511         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6512         charset from module.
6513         
6514         * delegate.cs (TypeAttr): Override.
6515         (Delegate.DefineType): Use this TypeAttr.
6516         
6517         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6518         at very early stage (before types are defined) to resolve model
6519         module attributes. It will probably not work with corlib but it
6520         should be ok.
6521         
6522         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6523         charset from module.
6524         
6525         * typemanager.cs (default_charset_type): New type.
6526
6527 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6528
6529         * decl.cs (MemberCache.AddMethods): Don't warn if
6530         System.Object.Finalize has buggy MethodAttributes.
6531
6532         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6533         removed below.
6534
6535 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6536
6537         * doc.cs : detect ambiguous reference to overloaded members.
6538           Fixed bug #71603. MS 1.1 csc does not detect it.
6539
6540 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6541
6542         * doc.cs : delegates must not be referenced with parameters.
6543           Fixed bug #71605.
6544
6545 2005-04-12  Miguel de Icaza  <miguel@novell.com>
6546
6547         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6548
6549 2005-04-10  Miguel de Icaza  <miguel@novell.com>
6550
6551         * driver.cs (MainDriver): Stop processing if the CLS stage found
6552         errors. 
6553
6554         (CompilerCallableEntryPoint.InvokeCompiler): Always
6555         reset after execution;   Take a TextWriter argument for the
6556         output.
6557
6558         * report.cs: Use the error stream instead of hardcoding stderr. 
6559
6560 2005-04-09  Miguel de Icaza  <miguel@novell.com>
6561
6562         * class.cs: Reduce code paths to test, too small of an
6563         optimization to make it worth the extra testing.  Always perform
6564         it. 
6565
6566 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6567
6568         Fix #74510.
6569         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6570         operators that had errors reported on them.
6571
6572 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
6573
6574         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6575         argument types.
6576         (Attribute.Resolve): Add named argument type checking.
6577         
6578         * class.cs (FixedField.Define): Use IsPrimitiveType
6579         
6580         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6581         
6582         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6583         unsafe parameter types.
6584         
6585         * statement.cs (Using.ResolveExpression): Add better error description.
6586         
6587         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6588         
6589 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6590
6591         Fix #74484.
6592         * attribute.cs (Attribute.GetAttributeUsage): Resolve
6593         AttributeUsageAttribute in the emitcontext of the attribute class,
6594         not in the emitcontext of the attributable entity it was attached to.
6595         * cs-parser.jay: Use 'current_class', not 'current_container',
6596         when creating a GlobalAttribute.
6597
6598 2005-04-08  Alp Toker  <alp@atoker.com>
6599
6600         * pending.cs: The fix to #58413 failed to compile methods implementing
6601         interfaces with/without params modifiers and vice versa, even though
6602         params modifiers aren't part of the signature. Make the modifier check
6603         less strict as in csc.
6604
6605 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
6606             Anoob V E  <projectmonokochi@rediffmail.com>
6607             Harilal P R  <projectmonokochi@rediffmail.com>
6608
6609         Fix #58413.
6610         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6611         modifiers of pending methods.
6612         (PendingImplementation.PendingImplementation): Initialize it.
6613         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6614         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6615         with ParameterData.  Add check for modifiers.
6616         * class.cs (MethodData.Define): Update to changes.
6617
6618 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6619
6620         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6621
6622 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
6623
6624         * class.cs (PropertyMethod.Define): Check private accessor in abstract
6625         property.
6626         
6627         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6628         
6629         * rootcontext.cs,
6630         * typemanager.cs: Registered RequiredAttributeAttribute.
6631         
6632 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6635         Warning CS0169 is back at level 3.
6636         (IMethodData.SetMemberIsUsed): New method.
6637         
6638         * decl.cs (IsUsed): New value; moved from FieldBase.Status
6639         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6640         
6641         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6642
6643         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6644         contants.
6645         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6646         is used.
6647         
6648         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6649         is used.
6650         
6651         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6652         to avoid the problems with nested types.
6653
6654 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
6655             Anoob V.E  <projectmonokochi@rediffmail.com>
6656             Harilal P.R  <projectmonokochi@rediffmail.com>
6657             Raja R Harinath  <rharinath@novell.com>
6658
6659         Fix #73820.
6660         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6661         attribute.
6662         * typemanager (GetConstructor): Make public.
6663
6664 2005-04-05  John Luke  <john.luke@gmail.com>
6665             Raja R Harinath  <rharinath@novell.com>
6666
6667         Fix #62232.
6668         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6669         struct too.  Return false quicker in a few cases.
6670         (VerifyUnManaged): Use it.
6671
6672 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6673
6674         Fix #74041.
6675         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6676         not 'unreachable_seen'.
6677
6678 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6679
6680         * attribute.cs (Attribute.GetValue): Removed unused.
6681         
6682         * codegen.cs (CodeGen.TrimExt): Removed unused.
6683         
6684         * cs-parser.jay (output): Removed unused.
6685         
6686         * cs-tokenizer.cs (hex_digits): Removed unused.
6687         
6688         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6689         
6690         * expression.cs (Indirection.LoadExprValue): Removed unused.
6691         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6692         
6693         * iterators.cs (Iterator.param_types): Removed unused.
6694         
6695         * statement.cs (Goto.block): Removed unused.
6696         (ToplevelBlock.did): Removed unused.
6697         (Switch.ResolveConstantSwitch): Removed unused.
6698
6699 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6700
6701         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6702         resetting thingy.
6703
6704 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6705
6706         Fix #74232 and cs0208-3.cs.
6707         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6708         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6709         unmanaged type.  Don't use FieldBuilders when 't' is a
6710         TypeBuilder.  Use ModFlags and MemberType fields.
6711         * class.cs (MemberBase.member_type): Rename from MemberType.
6712         (MemberBase.MemberType): New property.  Determines member_type on
6713         demand.
6714         (MemberBase.DoDefine): Don't initialize MemberType here.
6715         (FieldMember.Define): Likewise.
6716
6717 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6718
6719         Fix #74241
6720         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6721         Attributes are emitted there.
6722         
6723 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6724
6725         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6726         keyword in 'partial enum' too.
6727         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6728         is not allowed).
6729         Report from Kamil Skalski <nazgul@omega.pl>.
6730
6731         Fix #74309.
6732         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6733         have partial containers too.
6734
6735         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6736         in block' checks to Block.CheckInvariantMeaningInBlock.
6737         * statement.cs (Block.GetKnownVariableInfo): Make private.
6738         (Block.IsVariableUsedInChildBlock): Remove.
6739         (Block.IsVariableUsedInBlock): Likewise.
6740         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6741         conflicting declaration.
6742         (Block.AddVariable): Make error messages less long-winded and more
6743         specific.  Show location of conflicting declaration.
6744         * parameter.cs (Parameters.Location): New readonly property.
6745
6746 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6747
6748         Clean up semantics of invoking ResolveMemberAccess.
6749         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6750         can have an instance, ensure that we pass in a non-TypeExpression
6751         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6752         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6753         argument.  Update to changes and simplify.
6754         (FieldExpr.Emitinstance): Remove CS0120 check.
6755         (PropertyExpr.EmitInstance): Likewise.
6756         * expression.cs (Argument.Resolve): Likewise.
6757         (Invocation.DoResolve): Update to changes in semantics of
6758         InstanceExpression.
6759
6760 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6761
6762         Fix #74241
6763         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6764         customization.
6765         
6766         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6767
6768 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6769
6770         Fix difference in behaviour with commandline invocation.
6771         * driver.cs (Driver.Reset): New.
6772         (CompilerCallableEntryPoint): Call it.
6773
6774         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6775         variable" warnings if the boolean expression failed to resolve.
6776
6777 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6778
6779         * attribute.cs: Fix the union of several permissions when some of them
6780         are unrestricted (so the result isn't an unrestricted permission set).
6781         Fix #74036.
6782
6783 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6784
6785         * ecore.cs (MemberExpr): New class.  Convert from interface
6786         IMemberExpr.
6787         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6788         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6789         error checks.
6790         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6791         (MethodGroupExpr.IsExplicitImpl): Remove.
6792         (Expression.GetFieldFromEvent): Remove.
6793         (SimpleName.MemberStaticCheck): Remove.
6794         (SimpleName.DoSimpleNameResolve): Update to changes.
6795         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6796         (MemberAccess.IdenticalNameAndTypeName): Remove.
6797         (MemberAccess.error176): Move to MemberExpr.
6798         (MemberAccess.DoResolve): Update to changes.
6799         (BaseAccess.DoResolve): Likewise.
6800
6801 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6802
6803         C# 2.0 Conditional attribute class implementation
6804         
6805         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6806         Analyzes class whether it has attribute which has ConditionalAttribute
6807         and its condition is not defined.
6808         
6809         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6810         (Class.IsExcluded): New method. Search for at least one defined
6811         condition in ConditionalAttribute of attribute class.
6812
6813 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6814
6815         * ecore.cs (PropertyExpr): Derive from Expression, not
6816         ExpressionStatement.
6817         (PropertyExpr.EmitStatement): Remove.
6818
6819 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6820
6821         Fix #74060.
6822         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6823         internal field "value__" of an enum be private.  The examples for
6824         "value__" that I found on MSDN all used FieldAttributes.Private.
6825
6826         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6827         Don't mention IL method attribute names.
6828
6829         Fix #47991.  Remove a TODO.
6830         * statement.cs (Block.Toplevel): Make into a field.
6831         (Block.Parameters): Move into ToplevelBlock.
6832         (Block.known_variables): Rename from child_variable_names.
6833         (Block.Block): Remove variants that take Parameters.  Initialize
6834         'Toplevel' with the immediately surrounding toplevel block.
6835         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6836         LocalInfo parameter.
6837         (Block.GetKnownVariableInfo): New.
6838         (Block.IsVariableNameUsedInChildBlock): Update.
6839         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6840         the block, even though it may not be in scope.
6841         (Block.AddVariable): Remove Parameters parameter.  Use
6842         Toplevel.Parameters instead.
6843         (Block.AddConstant): Remove Parameters parameter.
6844         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6845         (Block.IsParamaterReference): Likewise.
6846         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6847         (ToplevelBlock.Parameters): New.  Moved from Block.
6848         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6849         initialize Parameters to a non-null value.
6850         * cs-parser.jay: Update to changes.
6851         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6852         simple names that mean different things in the same block.  Use
6853         Block.IsVariableNameUsedInBlock.
6854
6855 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6856
6857         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6858         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6859         GetTypeHandle.  It is possible for a reflected type to derive from
6860         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6861         System.Array during mscorlib compilation).
6862         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6863         contain a method_hash, don't create one either.  Don't create a
6864         deep copy of the base cache's method_hash.
6865         (MemberCache.SetupCache): Rename back from DeepCopy.
6866         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6867         already initialized.  If we see an override function, add its
6868         underlying base virtual function to the member_hash too.
6869
6870         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6871
6872 2005-03-26  Raja R Harinath  <harinath@acm.org>
6873
6874         Fix #73038.
6875         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6876         fails to resolve, ensure that the LHS is still resolved as an
6877         lvalue.
6878
6879 2005-03-25  Raja R Harinath  <harinath@acm.org>
6880
6881         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6882         ec.ContainerType.
6883         (Enum.current_ec): Remove.
6884         (Enum.LookupEnumValue): Remove EmitContext argument.
6885         Just uses the one created during DefineType.
6886         (Enum.FindMembers): Update.
6887         * expression.cs (MemberAccess.DoResolve): Update.
6888
6889 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6890
6891         * assign.cs (Assign.DoResolve): Check for CS1717 when
6892         source and target are same (uses Equals).
6893
6894         * expression.cs (LocalVariableReference, ParameterReference,
6895         This): Implemented Equals, GetHashCode.
6896
6897         * statement.cs (Block.GetParameterReference): Removed useless
6898         local variable.
6899
6900 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6901
6902         Fix cs0128.cs
6903         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6904         blocks before deciding whether the error is cs0136 or cs0128.
6905
6906         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6907         (using_alias_directive, using_namespace_directive): Pass
6908         MemberName, not an expression to Namespace.UsingAlias and
6909         Namespace.Using.
6910         (MakeName): Use the MemberName of the namespace.
6911         * namespace.cs (Namespace.MemberName): New.
6912         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6913         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6914         Likewise.
6915         * decl.cs (MemberName.Name): Make readonly.
6916         (MemberName.FromDotted): New "constructor".
6917         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6918         (MemberCore.Name): Compute from MemberName on demand.
6919         (MemberCore.SetMemberName): Provide a way to change the
6920         MemberName.
6921         (MemberCore.AddToContainer): Don't take a fullname parameter.
6922         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6923         fully qualified name of the container to the member name.
6924         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6925         only if the type is a member of the root container.
6926         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6927         MemberName.Left rather than searching for an embedded ".".
6928         (PartialContainer.CreatePart): Update to changes in RootContext.
6929         (MemberBase.ShortName): Turn into a property.  Use
6930         MemberCore.SetMemberName.
6931         (MemberBase.ExplicitInterfaceName): Remove.
6932         (MemberBase.UpdateMemberName): Remove.
6933         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6934         (PropertyBase.SetMemberName): New override.
6935         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6936         (Tree.GetDecl): New.
6937         (Tree.AllDecls): Rename from Decls.
6938         * attribute.cs, enum.cs, report.cs: Update to changes.
6939         * driver.cs (MainDriver): Use MemberName.FromDotted on
6940         RootContext.MainClass.
6941
6942 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6943
6944         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6945         checks.
6946
6947         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6948
6949 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6950
6951         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6952         property accessor modifiers.
6953
6954         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6955         fixed buffer attribute (CS1716).
6956         (PropertyMethod.HasCustomAccessModifier): When property accessor
6957         has custom modifier.
6958
6959         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6960         modifiers.
6961         (PropertyExpr.DoResolveLValue): Add CS0272.
6962
6963 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6964
6965         * convert.cs: When converting to a pointer, use the proper Conv.U
6966         or Conv.I depending on the source data type.
6967
6968         * cs-tokenizer.cs: Make the size for large decimal constants,
6969         fixes #72957.
6970
6971 2005-03-17  Martin Baulig  <martin@ximian.com>
6972
6973         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6974         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6975
6976 2005-03-17  Martin Baulig  <martin@ximian.com>
6977
6978         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6979         to bool so we can return an error condition.
6980         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6981         returned an error.
6982
6983 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6984
6985         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6986         attributes.
6987
6988 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6989
6990         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6991         Refactor to avoid traversing the list of assemblies, and to avoid
6992         string concatenation.
6993         * typemanager.cs (guid_attr_type): Remove.
6994         (negative_hits, pointers, references): Remove hashes.
6995         (type_hash): New.
6996         (GetConstructedType): New.  Uses type_hash to handle constructed
6997         types (arrays, references, pointers).
6998         (GetReferenceType, GetPointerType): Use it.
6999         (GetNestedType): New.  Uses type_hash to handle nested types of
7000         reflected types.
7001         (LookupType, LookupTypeDirect): Remove.
7002         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7003         'types' hash and LookupTypeReflection directly.
7004         (params_string, params_object): Use GetConstructedType.
7005         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7006         top-level types.
7007         (Namespace.Lookup): Use cached_types.
7008         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7009         provided by old TypeManager.LookupType.
7010         * rootcontext.cs (MakeFQN): Remove.
7011         * decl.cs (DeclSpace.MakeFQN): Likewise.
7012         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7013         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7014         TypeManager.GetConstructedType.
7015         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7016
7017 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7018
7019         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7020         indexers.
7021
7022         * cs-parser.jay: Reports CS1527 for any namespace element.
7023
7024         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7025         Added CS0407.
7026
7027         * expression.cs (ParameterReference.IsAssigned): Changed error to
7028         CS0269.
7029         (Error_WrongNumArguments): Moved CS0245 detection here.
7030
7031         * statement.cs (Return.Resolve): Add CS1622 report.
7032
7033 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7034
7035         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7036
7037 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7038
7039         * attribute.cs expression.cs: Get rid of some allocations.
7040
7041 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7042
7043         * doc.cs : just eliminate the latest change.
7044
7045 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7046
7047         * doc.cs : commented out the latest change. It breaks xml-030.cs
7048
7049 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7050
7051         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7052           fail. So invoke CreateType() in FindDocumentedType().
7053
7054 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7055
7056         * cs-tokenizer.cs : added IsKeyword().
7057         * doc.cs : Detect keyword incorrectly used as identifier.
7058           Allow identifiers prefixed by @.
7059
7060 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7061
7062         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7063         It caused exception in namespace resolving (again!).
7064         
7065         * class.cs (Class.ctor): Removed exit.
7066         (PropertyMethod.ctor): ditto.
7067         
7068         * codegen.cs (Codegen.Reset): Reset static data.
7069         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7070         
7071         * cs-tokenizer.cs (Cleanup): Removed.
7072         
7073         * driver.cs (GetSystemDir): Rewrote to one line command.
7074         It caused problem with unloaded dynamic modules.
7075         (UnixParseOption): Removed Exit.
7076         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7077         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7078         Now can be mcs used as library.
7079         
7080         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7081         empty location.
7082         
7083         * location.cs (Reset): Reset static data.
7084         
7085         * namespace.cs (Reset): Reset static data.
7086         
7087         * report.cs (Report.Reset): Reset static data.
7088         
7089         * rootcontext.cs (RootContext.Reset): Reset static data.
7090         
7091         * tree.cs (RootTypes.ctor): Use Location.Null
7092         
7093         * typemanager.cs (TypeManager.Reset): Reset static data.
7094         (CoreLookupType): Removed Exit.
7095         (TypeHandle.Reset): Reset static data.
7096         
7097 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7098
7099         Fix #73516.
7100         * typemanager.cs (ComputeNamespaces): Import namespaces from
7101         referenced modules too.
7102
7103 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7104
7105         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7106         than '.'.
7107
7108 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7109
7110         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7111         enclosing DeclSpace.  This ensures that a name-lookup populates
7112         more caches and there are fewer 'TypeExpression's.  Carve out
7113         nested type lookup into ...
7114         (LookupNestedTypeInHierarchy): ... this.
7115
7116 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7117
7118         Clean up a few partial-class semantics.  
7119         Fixes test-357.cs and cs1618-2.cs.
7120         * cs-parser.jay (struct_declaration): Use 'current_class' as
7121         parent of newly-created struct.  Remove call to Register ().
7122         Use 'pop_current_class' to complete handing the current struct.
7123         (interface_declaration): Likewise.
7124         (class_declaration): Likewise.
7125         (enum_declaration): Use 'current_class' as parent of newly created
7126         enum.
7127         (delegate_declaration): Likewise.
7128         (pop_current_class): New function.  This is used to handle closing
7129         up the 'current_class' and 'current_container', and pointing them
7130         to the enclosing class/container.
7131         (CSharpParser): Initialize 'current_class' too.
7132         * decl.cs (MemberCore): Add check for invariant: a partial
7133         container is not a parsed entity, and thus does not enclose any
7134         parsed members.
7135         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7136         (DeclSpace.BaseTypeExpr): Use it.
7137         (DeclSpace.LookupType): Add check for invariant.
7138         * class.cs (TypeContainer): Add check for invariant: a nested
7139         class should have the same NamespaceEntry as its enclosing class.
7140         (TypeContainer.EmitFieldInitializers): Make virtual.
7141         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7142         MemberCore.
7143         (TypeContainer.Register): Remove.
7144         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7145         null.  Use TypeResolveEmitContext for resolving base types and
7146         interfaces.  Move initialization of Parts.TypeBuilder here from
7147         ...
7148         (TypeContainer.DefineNestedTypes): ... here.
7149         (PartialContainer): Take a Namespace not a NamespaceEntry.
7150         (PartialContainer.Create): Don't use Register.  Call the
7151         appropriate Add... function directly.
7152         (ClassPart): Take both the PartialContainer and the enclosing
7153         class as constructor arguments.
7154         (ClassPart.EmitFieldInitializers): Override.
7155         (ClassPart.PartFindNestedTypes): Remove.
7156         (FieldBase.GetInitializerExpression): Resolve the initializer
7157         expression in the emit context of the enclosing class.
7158         * tree.cs (RootTypes): Remove Register ().
7159         
7160 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7161
7162         * cs-parser.jay: Removed CS0134.
7163         
7164         * driver.cs: Removed CS1901.
7165         
7166         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7167         for predefined types.
7168
7169 2005-03-07  Duncan Mak  <duncan@novell.com>
7170
7171         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7172         well. Fixes bug #73454.
7173
7174 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7175
7176         * cs-tokenizer.cs (xtoken): Add CS1035.
7177         
7178         * class.cs (MethodData.Define): Add CS0683.
7179         (FieldMember.ctor): Add CS0681.
7180
7181 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7182
7183         * ecore.cs (SimpleName.DoResolve): Rename from
7184         SimpleName.DoResolveAllowStatic.
7185         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7186         Pass 'intermediate' flag to MemberStaticCheck.
7187         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7188         of "intermediate" lookups via MemberAccess.
7189         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7190         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7191
7192 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7193
7194         Fix #73394.
7195         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7196         slipped in because of variable names that are identical to a
7197         builtin type's BCL equivalent ('string String;', 'int Int32;').
7198         (PropertyExpr.EmitInstance): Likewise.
7199
7200 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7203         
7204         * report.cs (warning_ignore_table): Made public.
7205
7206 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7207
7208         Fix #73282.
7209         * class.cs (MethodData.Emit): Pass 'container' to
7210         container.GetObsoleteAttribute instead of 'container.Parent'.
7211
7212 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7213
7214         * cs-parser.jay: Add 1534 error test.
7215
7216         * iterators.cs (Yield.CheckContext): Add error 1629.
7217         (Iterator.ctor): Save unsafe modifier.
7218         (MoveNextMethod.DoEmit): Restore unsafe context.
7219
7220         * namespace.cs (UsingAlias): Better error message.
7221
7222 2005-03-03  Dan Winship  <danw@novell.com>
7223
7224         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7225         the warning message [#73219]
7226
7227 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7228
7229         Fix compile with MCS 1.0.0.0.
7230         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7231         w_restore to not depend on string constant folding.
7232
7233 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7234
7235         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7236         CS0246 check to users who passed 'silent = false'.
7237         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7238         check.
7239         (SimpleName.SimpleNameResolve): Update.
7240         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7241         (MemberAccess.IdenticalNameAndTypeName): Update.
7242         * doc.cs (FindDocumentedTypeNonArray): Update.
7243
7244 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7245
7246         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7247         * parameters.cs (ComputeAndDefineParameters): Remove.
7248         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7249         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7250         Use GetParameterInfo.
7251
7252 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7253
7254         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7255
7256 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7257
7258         Unify DeclSpace.LookupType and DeclSpace.FindType.
7259         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7260         is in charge of defining nested types on demand.
7261         (DeclSpace.LookupType): Use it when the current_type is a
7262         TypeBuilder.  Use LookupTypeDirect for reflected types.
7263         (DeclSpace.FindType): Remove.
7264         (DeclSpace.LookupInterfaceOrClass): Likewise.
7265         (DeclSpace.DefineTypeAndParents): Likewise.
7266         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7267         DeclSpace.LookupType.
7268         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7269         * typemanager.cs (LookupType): Simplify.
7270         (AddUserType): Remove type from negative_hits.
7271         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7272         * class.cs (TypeContainer.FindMembers): Move handling of nested
7273         types ...
7274         (TypeContainer.FindMembers_NestedTypes): ... here.
7275         (TypeContainer.FindNestedType): Implement override.
7276         (ClassPart.FindNestedType): Delegate to PartialContainer.
7277         (ClassPart.PartFindNestedType): Looks up the nested types of the
7278         part alone.
7279
7280 2005-03-02  Martin Baulig  <martin@ximian.com>
7281
7282         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7283         static constructor in static classes.
7284
7285 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7286
7287         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7288         sizeParamIndex is not specified.
7289
7290 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7291
7292         Fix #73117
7293         * report.cs (WarningMessage.IsEnabled): Missing null check.
7294
7295 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7296
7297         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7298         in the fields and not in the properties.
7299
7300 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7301
7302         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7303         fields as well.
7304
7305 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7306
7307         * attribute.cs: Small refactoring (improved robustness).
7308         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7309         (ValidateGuid): Removed.
7310         (Resolve): Removed referenced to above mentioned.
7311         (GetAttributeUsage): Made private and changed to work without
7312         class assistance.
7313         (GetIndexerAttributeValue): Don't crash.
7314         (GetConditionalAttributeValue): Ditto.
7315         (GetClsCompliantAttributeValue): Ditto.
7316         (ExtractSecurityPermissionSet): All attributes exceptions are
7317         error 648.
7318         (GetPropertyValue): New helper.
7319         (GetMethodImplOptions): New method.
7320         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7321         some missing properties.
7322         
7323         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7324         (Method.ApplyAttributeBuilder): Updated.
7325         
7326         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7327         exception.
7328
7329 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7330
7331         Fix #73052.
7332         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7333         non-simple types (array, pointer, reference).
7334
7335 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7336
7337         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7338
7339         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7340         for operators.
7341         (Method.CheckBase): Catch wrong destructor here.
7342         (MethodData.Define): Add errors 550, 668.
7343
7344         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7345
7346         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7347
7348         * pending.cs (VerifyPendingMethods): Add error 551.
7349
7350         * typemanager.cs (CSharpName): Next error report helper.
7351
7352 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7353
7354         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7355         attributes. Removed useless attribute double check.
7356         It saves almost 2MBs for corlib.
7357
7358 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7359
7360         Fix #72924.
7361         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7362         called twice in case of error.
7363
7364 2005-02-23  Chris Toshok  <toshok@ximian.com>
7365
7366         Fix compiler portions of #72827.
7367         * statement.cs (Block.Emit): call Begin/EndScope on the
7368         EmitContext instead of the ILGenerator.
7369
7370         * codegen.cs (EmitContext.BeginScope): new method, call
7371         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7372         we have one.)
7373         (EmitContext.BeginScope): same, but EndScope and CloseScope
7374
7375         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7376         offset and call the superclass's OpenScope(int) with it.
7377         (SymbolWriter.CloseScope): get the current il
7378         offset and call superclass's CloseScope(int) with it.
7379
7380 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7381
7382         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7383         CS1677 for out and ref as well.
7384
7385         * class.cs (Method.Define): Add error CS1599 detection.
7386         
7387         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7388         
7389         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7390         
7391         * delegate.cs (Delegate.Define): Add error CS1599 detection.
7392         
7393         * support.cs.cs (ModifierDesc): New helper method.
7394
7395 2005-02-23  Raja R Harinath  <rharinath@novell.com>
7396             Abin Thomas  <projectmonokochi@rediffmail.com>
7397             Anoob V E  <projectmonokochi@rediffmail.com>
7398             Harilal P R  <projectmonokochi@rediffmail.com>
7399
7400         Fix #57851, #72718.
7401         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7402         MemberLookup (used for error reporting) actually returns a result.
7403         Fix error report number (122, not 112).
7404
7405 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
7406             Anoob V E  <projectmonokochi@rediffmail.com>
7407             Harilal P R  <projectmonokochi@rediffmail.com>
7408
7409         Fix #71134.
7410         * pending.cs (PendingImplementation.GetAbstractMethods):
7411         Find NonPublic members too.
7412
7413 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
7414
7415         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7416         Fixed error 217.
7417         
7418         * class.cs (MethodCore.CheckMethodAgainstBase):
7419         Add error 239 report.
7420
7421 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7422
7423         Fix #68955.
7424         * expression.cs (Invocation.IsApplicable): Make public.
7425         (Invocation.IsParamsMethodApplicable): Likewise.
7426         * delegate.cs (Delegate.VerifyApplicability): Don't use
7427         Invocation.VerifyArgumentCompat for parameter applicability
7428         testing.  Use Invocation.IsApplicable and
7429         Invocation.IsParamsMethodApplicable.
7430
7431 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7432
7433         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7434         
7435         * class.cs (Operator.Define): Add error 217 report.
7436         
7437 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7438
7439         * namespace.cs (UsingEntry.Resolve): Undo change below.
7440
7441 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7442
7443         Fix #72756.
7444         * ecore.cs (Expression.MemberLookupFailed): Add argument to
7445         disable the error message when the extended MemberLookup also
7446         fails.
7447         (Expression.MemberLookupFinal): Update.
7448         (SimpleName.DoSimpleNameResolve): Update.
7449         * expression.cs (MemberAccess.ResolveNamespaceOrType):
7450         Don't use MemberLookupFinal.
7451         (New.DoResolve): Update.
7452         (BaseAccess.CommonResolve): Update.
7453
7454 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7455
7456         Fix #72732.
7457         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7458         occured previously, don't resolve again.
7459
7460 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7461
7462         Fix #69949
7463         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7464         argument. Call ResolveAttributeUsage for unresolved.
7465         when types doesn't match ctor arguments.
7466         
7467         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7468         for nested attribute classes.
7469         (Class.attribute_usage): Removed.
7470         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7471         for attribute class.
7472         
7473         * ecore.cs (IsAttribute): Removed.
7474         
7475         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7476         
7477         * rootcontext.cs (RegisterAttribute): Removed, attributes are
7478         now normal types.
7479         (attribute_types): Removed.
7480         (EmitCode): Global attributes are emited as the latest.
7481
7482 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
7483
7484         * class.cs (EmitFieldInitializers): Don't emit field initializer
7485         for default values when optimilization is on.
7486         
7487         * constant.cs (Constant.IsDefaultValue): New property.
7488         
7489         * driver.cs: Add /optimize handling.
7490         
7491         * constant.cs,
7492         * ecore.cs,
7493         * literal.cs: Implement new IsDefaultValue property.
7494         
7495         * rootcontext.cs (Optimize): New field, holds /optimize option.
7496
7497 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7498
7499         Fix crasher in re-opened #72347.
7500         * namespace.cs (Namespace.Lookup): Return null if
7501         DeclSpace.DefineType returns null.
7502
7503         Fix #72678.
7504         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7505
7506 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7507
7508         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
7509         now returns null if it cannot resolve to an lvalue.
7510         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7511         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7512         returned null.  Remove check for SimpleName.
7513         (EventExpr.DoResolveLValue): New.
7514         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7515         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
7516         error from ...
7517         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
7518         avoid CS0131 error.
7519         (Unary.ResolveOperator): Move CS0211 check ...
7520         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
7521         CS0131 error.
7522         (Unary.DoResolveLValue): Simplify.
7523         (AddressOf.DoResolveLValue): New.
7524         (ArrayAccess.DoResolveLValue): New.
7525
7526 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
7527
7528         * attribute.cs (Attribute.Resolve): Add arguments casting for
7529         when types doesn't match ctor arguments.
7530
7531 2005-02-16  Raja R Harinath  <rharinath@novell.com>
7532
7533         Fix parts of #63202.
7534         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7535         lookup of operator in base type.  Ensure that all checks happen
7536         when the operator resolves to an "op_..." method.
7537
7538 2005-02-15  Raja R Harinath  <rharinath@novell.com>
7539
7540         Fix #71992.
7541         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7542         'ignore_cs0104' parameter.  Pass it to ...
7543         (NamespaceEntry.Lookup): ... this.
7544         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7545         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7546         (TypeLookupExpression.DoResolveAsTypeStep): Update.
7547         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7548         Update.  Request that cs0104 errors be ignored.
7549         (ComposedCast.ResolveAsTypeStep): Update.
7550
7551 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7552
7553         Fix #59209.
7554         * expression.cs (Invocation.BetterFunction): Remove support for
7555         comparing virtual functions and their overrides.
7556         (Invocation.IsOverride): New.
7557         (Invocation.OverloadResolve): Don't consider 'override' functions
7558         during candidate selection.  Store them in a lookaside list.
7559         If the selected method is a 'virtual' function, use the list to
7560         find any overrides that are closer to the LHS type.
7561
7562 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
7563
7564         * expression.cs (New.DoResolve): Add complex core type reduction.
7565         (New.Constantify): Converts complex core type syntax like 'new int ()'
7566         to simple constant.
7567         
7568 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7569
7570         * decl.cs (EntryType.EntryType): New constructor to create an
7571         updated copy of a cache entry.
7572         (MemberCache.AddMethods): Use it.
7573         (MemberCache.ClearDeclaredOnly): Remove.
7574         (MemberCache.MemberCache): Update.
7575
7576 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7577
7578         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7579         variable.  This one is represents the actual low-level declaration
7580         of the method, as opposed to the semantic level `IsStatic'.   
7581
7582         An anonymous method which is hosted into a static method might be
7583         actually an instance method.  IsStatic would reflect the
7584         container, while MethodIsStatic represents the actual code
7585         generated.
7586
7587         * expression.cs (ParameterReference): Use the new MethodIsStatic
7588         instead of IsStatic.
7589
7590         * anonymous.cs (AnonymousMethod.Compatible): Pass the
7591         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7592         set on the current EmitContext. 
7593
7594         * expression.cs (Cast): Overload DoResolveLValue so we can pass
7595         resolve our casted expression as an LValue.  This triggers the
7596         proper LValue processing that is later required by Assign.
7597
7598         This fixes 72347.
7599
7600         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7601
7602 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
7603
7604         C# 2.0 Fixed buffer implementation
7605
7606         * anonymous.cs: Update after RegisterHelperClass renaming.
7607
7608         * attribute.cs (AttributeTester.fixed_buffer_cache):
7609         Cache of external fixed buffers.
7610         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7611         implementation if field is fixed buffer else null.
7612
7613         * class.cs
7614         (TypeContainer.AddField): Accept FieldMember instead of Field.
7615         (FieldBase.IsFieldClsCompliant): Extracted code from
7616         VerifyClsCompliance descendant customization.
7617         (FixedField): New class handles fixed buffer fields.
7618         (FixedFieldExternal): Keeps information about imported fixed
7619         buffer.
7620         (IFixedField): Make access to internal or external fixed buffer
7621         same.
7622
7623         * cs-parser.jay: Add fixed buffer parsing.
7624
7625         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7626         buffer.
7627
7628         * expression.cs (Indirection): Extended implementation to accept
7629         fixed buffer field.
7630         (PointerArithmetic.Emit): Get element from fixed buffer as well.
7631         (ElementAccess.MakePointerAccess): Get type as parameter.
7632         (DoResolve): Add fixed buffer field expression conversion.
7633         (DoResolveLValue): Ditto.
7634         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7635         (ArrayPtr): Derives from FixedBufferPtr.
7636         (ArrayPtr.Emit): Add extra emit for array elements.
7637
7638         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7639
7640         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7641         for compiler generated types.
7642         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7643
7644         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7645         and consume less memory.
7646         (Fixed.Resolve): Add fixed buffer case.
7647
7648         * typemanager.cs (compiler_generated_attr_ctor,
7649         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7650         (HasElementType): Add our own implementation to work on every
7651         runtime.
7652
7653 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7654
7655         * anonymous.cs (CaptureContext): Track whether `this' has been
7656         referenced.   
7657
7658         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7659         only captured `this' if it was implicitly done (instance
7660         methods/variables were used). 
7661
7662         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7663         `this' must be captured.
7664
7665 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7666  
7667         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7668         is null it means that there has been no need to capture anything,
7669         so we just create a sibling.
7670
7671         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7672
7673         Just a partial fix.  The other half is fairly elusive.
7674         
7675 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7676
7677         Fix #52586, cs0121-4.cs.
7678         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7679         and return a hashtable.
7680         (MemberCache.ClearDeclaredOnly): New.
7681         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7682         the method_hash of a base type too.
7683         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7684         type methods.  Overwrite entries with the same MethodHandle so
7685         that the ReflectedType is correct.  The process leaves in base
7686         virtual functions and their overrides as distinct entries.
7687         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7688         matters since it was boxed in a ArrayList before.
7689         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7690         modifier.
7691         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7692         case of a virtual function and its override (choose the overload
7693         as better).
7694         (Invocation.OverloadResolve): Avoid 'override' members during
7695         'applicable_type' calculation.
7696
7697 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7698
7699         Combine two near-redundant caches.
7700         * typemanager.cs (method_params): Rename from method_internal_params.
7701         (TypeManager.GetParameterData): New.  Replace
7702         Invocation.GetParameterData.
7703         (TypeManager.LookupParametersByBuilder): Remove.
7704         * expression.cs (Invocation.method_parameter_cache): Remove.
7705         (Invocation.GetParameterData): Remove.
7706         Update to changes.
7707         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7708         Update to changes.
7709
7710 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7711
7712         Fix #72015.
7713         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7714         TypeManager.multicast_delegate_type is null, resolve it by looking
7715         up "System.MulticastDelegate".
7716         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7717
7718 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7719             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7720             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7721
7722         Fix cs0164.cs.
7723         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7724         (LabeledStatement.AddReference): New.  Set 'referenced'.
7725         (Goto.Resolve): Use it.
7726
7727 2005-02-05  John Luke  <john.luke@gmail.com>
7728
7729         * driver.cs: remove duplicate -doc line in Usage ()
7730
7731 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7732
7733         * location.cs (Location.AddFile): Fix CS2002 error report.
7734
7735 2005-02-02  Martin Baulig  <martin@ximian.com>
7736
7737         * delegate.cs (Delegate.DefineType): Report an internal error if
7738         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7739         details.        
7740
7741 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7742
7743         Fix a crasher in a variant of #31984.
7744         * const.cs (Constant.CheckBase): New override that defers the
7745         new-or-override check in case the base type hasn't been populated
7746         yet.
7747         (Constant.Define): Ensure the new-or-override check is performed.
7748
7749 2005-02-01  Duncan Mak  <duncan@ximian.com>
7750
7751         * const.cs (LookupConstantValue): Check that `ce' is not null
7752         before calling GetValue ().
7753
7754 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7755
7756         Fix test-334.cs (#69519).
7757         * cs-parser.jay (using_alias_directive): Pass in an expression to
7758         NamespaceEntry.UsingAlias.
7759         (using_namespace_directive): Pass in an expression to
7760         NamespaceEntry.Using.
7761         (namespace_name): Don't flatten to a string.
7762         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7763         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7764         ResolveAsTypeStep.
7765         (NamespaceEntry.UsingEntry): Likewise.
7766         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7767         changes.
7768         (NamespaceEntry.LookupForUsing): Remove.
7769         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7770         names.
7771         (NamespaceEntry.Lookup): Remove support for dotted names.
7772
7773 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7774
7775         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7776         split into two.
7777         (NamespaceEntry.ImplicitParent): Compute on demand.
7778         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7779         parallels the current.
7780         (NamespaceEntry.LookupForUsing): Use it.
7781         (NamespaceEntry.Lookup): If the current namespace-entry is
7782         implicit, don't search aliases and using tables.
7783
7784 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7785
7786         Fix #31984.
7787         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7788         BaseCache here.
7789         (TypeContainer.BaseCache): Compute on demand.
7790         (TypeContainer.FindMembers): Define constants and types if they're
7791         not already created.
7792         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7793         check.
7794         * const.cs (Constant.Define): Make idempotent.
7795
7796 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7797
7798         * pending.cs: Produce better code (no nops produced by using Ldarg
7799         + value).
7800         
7801         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7802         i - 1' it should be arg + 1.
7803
7804         Fixes bug #71819.
7805
7806 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7807
7808         * attribute.cs (Attribute.CheckAttributeType): Make private
7809         non-virtual.
7810         (Attribute.ResolveType): Make virtual.
7811         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7812         handling of RootContext.Tree.Types.
7813
7814 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7815
7816         Update attribute-handling to use the SimpleName/MemberAccess
7817         mechanisms.
7818         * cs-parser.jay (attribute): Pass in an expression to the
7819         constructors of Attribute and GlobalAttribute.
7820         * attribute.cs (Attribute): Take an expression for the name.
7821         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7822         passed in attribute name expression.
7823         (Attribute.CheckAttributeType): Use it.
7824         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7825         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7826         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7827         argument to prevent error messages if the lookup fails.
7828
7829 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7830
7831         * expression.cs (Indirection): Implemented IVariable interface
7832         to support indirection in AddressOf operator.
7833         (PointerArithmetic.Emit): Add optimalization for case where
7834         result can be precomputed.
7835
7836 2005-01-26  Martin Baulig  <martin@ximian.com>
7837
7838         * class.cs (TypeContainer.AttributeTargets): Return the correct
7839         AttributeTargets depending on our `Kind' instead of throwing an
7840         exception; fixes #71632.
7841
7842 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7843
7844         Fix #71257
7845         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7846         constant members.
7847
7848 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7849
7850         Fix #71602.
7851         * expression.cs (MemberAccess.DoResolve): Don't complain with
7852         cs0572 when the LHS of a member access has identical name and type
7853         name.
7854
7855 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7856
7857         Fix #71651, #71675
7858         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7859         CreatePermission.
7860         Create custom PermissionSet only for PermissionSetAttribute.
7861
7862 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7863
7864         Fix #71649
7865         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7866         delegates in static class.
7867
7868 2005-01-24  Martin Baulig  <martin@ximian.com>
7869
7870         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7871         merging an implicit block, just use its reachability.
7872
7873         * statement.cs (Block.Resolve): Make the unreachable code check
7874         work wrt. implicit blocks; see test-337 from #63842.
7875
7876 2005-01-21  Alp Toker  <alp@atoker.com>
7877  
7878         * cs-parser.jay: destructor_declaration's container is PartialContainer
7879         not Class when partial types are used, so use Kind prop instead of
7880         'is'.
7881         
7882 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7883
7884         * cs-parser.jay: Improve error reporting when an interface
7885         declares new types.
7886
7887 2005-01-20  Dick Porter  <dick@ximian.com>
7888
7889         * support.cs: SeekableStreamReader fix from Sandor Dobos
7890         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7891         chars are read.  Fixes bug 70369.
7892
7893 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7894
7895         * cs-parser.jay (catch_clause): Simplify current_block handling
7896         somewhat.
7897
7898 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7899
7900         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7901         code with ImplicitStandardConversion to handle the implicit
7902         conversion of method groups into valid delegate invocations. 
7903
7904         The problem is that in parameter handling we were using this code
7905         path.  Fixes bug #64698
7906
7907 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7908
7909         * cs-parser.jay: Fix several infelicities.
7910         - Avoid assigning to the parser value stack.  Code like 
7911           '$3 = null' is unclean.  Synthesize a value for the code block
7912           instead. 
7913         - Avoid using oob_stack for storing location information.  Use ...
7914         (_mark_): ... this.  New (empty) rule.  Saves the current location
7915         in $$.
7916         (foreach_statement): Avoid using oob_stack for current_block
7917         handling.  Use technique used in for_statement and
7918         using_statement.  Synthesize a value for the code block to store
7919         additional intermediate information.
7920
7921 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7922
7923         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7924         of a different type is only allowed to private fields of a
7925         containing type, not on fields of a base class.
7926
7927         See test-174.cs and error cs0122-9.cs
7928
7929 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7930
7931         Fix test-335.cs (bug #58126).
7932         * cs-parser.jay (argument): Split out non-expression parts of the
7933         rule into 'non_simple_argument'.
7934         (invocation_expression): Support parenthesized invocations with
7935         multiple arguments, and with single non-simple arguments.
7936
7937 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7938
7939         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7940         places.
7941
7942 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7943
7944         Fix cs0038-1.cs, cs1640-6.cs.
7945         * ecore.cs (Expression.Resolve): Remove special-case for
7946         SimpleName in error-handling.
7947         (Expression.almostMatchedMembers): Relax access permission to
7948         protected.
7949         (Expression.MemberLookupFailed): Handle duplicates in
7950         almostMatchedMembers list.
7951         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7952         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7953         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7954         overload if the passed in MemberInfo is a MethodBase.
7955
7956 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7957
7958         Fix #70749
7959         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7960         for non-CAS & merge permission sets properly.
7961
7962 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7963
7964         Improve standard-compliance of simple name and member access 
7965         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7966         * ecore.cs (FullNamedExpression): New abstract base class 
7967         for Namespaces and TypeExpressions.
7968         (ResolveFlags.SimpleName): Remove.
7969         (SimpleName): Remove support for dotted names.
7970         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7971         DeclSpace.FindType and DeclSpace.LookupType.
7972         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7973         (Expression.ExprClassName): Make member function.
7974         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7975         a namespace.  Remove creation of dotted "SimpleName"s.
7976         (MemberAccess.DoResolve): Likewise.
7977         * decl.cs (DeclSpace.Cache): Make private.
7978         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7979         (DeclSpace.FindType): Update.
7980         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7981         FullNamedExpression.
7982         * namespace.cs (Namespace): Derive from FullNamedExpression
7983         so that it can be part of expression resolution.
7984         (Namespace.Lookup): Return an FullNamedExpression.
7985         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7986         namespace.
7987         * rootcontext.cs (NamespaceLookup): Remove.
7988         (LookupType): Move to DeclSpace.
7989         * attribute.cs (CheckAttributeType): Update.
7990         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7991         (FindDocumentedTypeNonArray): Likewise.
7992
7993 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7994
7995         Fix cs0509.cs, cs1632.cs.
7996         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7997         is the same as IsInterface.
7998         (TypeContainer.GetClassBases): Likewise.
7999         * statement.cs (LabeledStatement.ig): New field.
8000         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8001         label.
8002         (LabeledStatement.DoEmit): Check that the label was created with
8003         the same ILGenerator.
8004
8005 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8006
8007         Fix #71058
8008         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8009         accessors to its properties.
8010
8011         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8012         from accessors to property.
8013         
8014 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8015
8016         Fix #70722
8017         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8018         only for overrides.
8019         
8020 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8021
8022         * attribute.cs: Check for null and empty strings.  
8023
8024         I have lost another battle to Paolo.
8025
8026 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8027
8028         Fix #70942
8029         * class.cs (PropertyMethod): Set Parent field in ctors.
8030         (SetMethod.InternalParameters): Add unsafe switch hack.
8031         Override MarkForDuplicationCheck where it is appropriate.
8032
8033         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8034         It says whether container allows members with the same name.
8035         Base default is no.
8036         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8037         Removed is_method parameter.
8038
8039 2005-01-06  Duncan Mak  <duncan@ximian.com>
8040
8041         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8042         because the previous change led to incorrect reporting of CS1032
8043         ("Cannot define/undefine preprocessor symbols after first token in
8044         file"). Instead of using `tokens_seen' as the only flag that
8045         triggers CS1040, introduce `comments_seen'. This new flag is used
8046         to signify having seen comments on the current line, so it is
8047         unset after a newline.
8048
8049 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8050
8051         * doc.cs : When searching for a type, find nested type too.
8052           This fixes bug #71040.
8053
8054 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8055
8056         * doc.cs :
8057           - Warn missing member comment on those classes which also does not
8058             have doc comments. Fixed bug #71041.
8059           - Don't warn missing doc comment on default constructor.
8060             Fixed bug #71042.
8061
8062 2005-01-06  Duncan Mak  <duncan@ximian.com>
8063
8064         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8065         comments, set `tokens_seen' to true. This allows us to detect
8066         misplaced preprocessor directives (i.e. not at the beginning of
8067         the a line, nor after whitespaces). In that case, report error
8068         CS1040. This fixes bug #56460.
8069
8070         * cs-parser.jay (interface_member_declaration): Add checks for
8071         IsExplicitImpl, and report CS0541 error if an interface member is
8072         defined as an explicit interface declaration.
8073
8074 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8075
8076         Fix #70817
8077         * class.cs (PropertyMethod): Set Parent field in ctors.
8078         (SetMethod.InternalParameters): Add unsafe switch hack.
8079         
8080         * decl.cs (MemberCore.Parent): Cannot be readonly.
8081
8082 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8083
8084         * decl.cs (DeclSpace.ResolveType): Remove.
8085         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8086         Merge in code from ...
8087         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8088         * class.cs, enum.cs: Update to changes.
8089
8090 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8091
8092         * anonymous.cs: Ensure that we init the scope of our parent if it
8093         has not been initialized yet.
8094
8095 2004-12-30  Duncan Mak  <duncan@ximian.com>
8096
8097         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8098         if field.FieldBuilder is null. Fixes #70758.
8099
8100         * convert.cs: Fixed some typos and updated some of the comments.
8101         (ImplicitStandardConversionExists):
8102         (TryImplicitIntConversion): If `target_type' is an interface and
8103         the type of `ic' implements this interface, return true or a new
8104         BoxedCast instead of null. This fixes #70468.
8105
8106 2004-12-29  Duncan Mak  <duncan@ximian.com>
8107
8108         * expression.cs (Argument.Emit): Check that Expr is
8109         IMemoryLocation before casting to it, and report CS1510 otherwise.
8110
8111         This fixes #70402.
8112
8113 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8114
8115         * statement.cs (Block.ThisVariable): remove the recursion here, to
8116         make the --profile more sane.
8117
8118 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8119
8120         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8121         assembly, by JB Evain.
8122
8123 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8124
8125         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8126           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8127         "parent" refers to enclosing type/class.  "base" refers to superclass.
8128
8129 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8130
8131         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8132         Ensure that we only have GlobalAttributes.
8133         * attribute.cs (Attribute.Emit): Make non-virtual.
8134         (GlobalAttribute.Emit): Remove.
8135         (Attribute.Resolve): Make virtual.
8136         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8137         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8138         the argument. Don't create one.
8139         (Attribute.GetObsoleteAttribute): Likewise.
8140         (Attribute.GetClsCompliantAttributeValue): Likewise.
8141         * class.cs, decl.cs: Update to changes.
8142
8143 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8144
8145         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8146         
8147         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8148         
8149         * statement.cs (Foreach.Resolve): Add error 186 report.
8150
8151 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8152
8153         * expression.cs (Conditional.DoResolve): Add warning 429.
8154         
8155         * statement.cs (If.Resolve): Add warning 665.
8156
8157 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8158
8159         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8160         except when in the parser, and in GlobalAttribute.
8161         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8162         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8163         RootContext.Tree.Types.NamespaceEntry once work is done.
8164         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8165         and resets RootContext.Tree.Types.NamespaceEntry.
8166
8167 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8168
8169         * cs-parser.jay: Don't create a block for every variable.
8170
8171 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8172
8173         * location.cs: Provide extra information.
8174
8175         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8176         variables from the captured environment, it is the ldarg_0.
8177
8178 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8179
8180         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8181         find a conclusion.
8182         
8183         * class.cs: Changed warning level for 169 to avoid developer
8184         displeasure from warning flooding. It will be changed back when they
8185         fix most of current BCL warnings.
8186         
8187         * RootContext.cs: Pushed default WarningLevel to 3.
8188         
8189         * statement.cs: Removed unused variable.
8190
8191 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8192
8193         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8194         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8195         Add error 502 report.
8196         (StaticClass.DefineType): Add error 441 report.
8197         (Class.AllowedModifiersProp): New virtual property as temporary
8198         extension to AllowedModifiers.
8199         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8200         to share implementation with StaticClass and don't call virtual
8201         methods from ctor.
8202         
8203         * driver.cs (MainDriver): Add error 1558 test.
8204
8205         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8206         report. Moved error 36 test here.
8207
8208         * statement.cs (Throw.Resolve): Add error 724 report.
8209
8210         * typemanager.cs: Add out_attribute_type core type.
8211         
8212 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8213
8214         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8215         3018 report.
8216         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8217
8218         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8219         3017 report.
8220         
8221         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8222
8223         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8224         Add error 3023 report.
8225         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8226
8227         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8228         implementation.
8229
8230 2004-12-12  John Luke  <john.luke@gmail.com>
8231
8232         * driver.cs (AddArgs): take -- into account when
8233         adding arguments, fixes bug 65710 
8234
8235 2004-12-12  Martin Baulig  <martin@ximian.com>
8236
8237         * expression.cs (Unary.TryReduceNegative): Added support for
8238         SByteConstant and ByteConstant.
8239         (Unary.Reduce): Check error values from TryReduceNegative().
8240
8241 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8242
8243         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8244         and report exception as error 182.
8245
8246 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8247
8248         * driver.cs (Main): Fix message when there are warnings.
8249
8250 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8251
8252         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8253
8254 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8255
8256         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8257         Reduced number of warnings.
8258         
8259         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8260
8261 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8262
8263         * driver.cs: Removed message.
8264
8265         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8266
8267 2004-12-08    <vargaz@freemail.hu>
8268
8269         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8270
8271 2004-12-08  Martin Baulig  <martin@ximian.com>
8272
8273         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8274         instead of a CS3002 for properties and indexer.
8275
8276 2004-12-08  Martin Baulig  <martin@ximian.com>
8277
8278         * decl.cs (MemberName.ToString): Make this work again.
8279
8280 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8281
8282         * attribute.cs (Resolve): Add error 591 detection.
8283
8284         * class.cs (FieldMember.Define): Add error 1547 detection.
8285         (Indexer.Define): Add error 620 detection.
8286         (Operator.Define): Add error 590 detection.
8287
8288         * ecore.cs: Missing argument for error 79.
8289
8290         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8291         detection.
8292
8293 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8294
8295         Fix #70106
8296         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8297         only.
8298
8299 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8300
8301         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8302           Some operator comments were suppressed.
8303         * doc.cs : Implicit/explicit operator name in doc comments are like
8304           "op_Explicit(type)~returnType", so added suffix handling.
8305
8306 2004-12-07  Martin Baulig  <martin@ximian.com>
8307
8308         * decl.cs
8309         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8310         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8311         (DeclSpace.ec): New protected field; store the EmitContext here.
8312         (DeclSpace.EmitContext): New public property; moved here from
8313         `TypeContainer'.
8314         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8315         EmitContext.
8316
8317         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8318         (Enum.Emit): Don't create a new EmitContext.
8319
8320         * delegate.cs (Delegate.DefineType): Always create the
8321         EmitContext.
8322
8323         * iterators.cs (Iterators.DefineIterator): Create a new
8324         EmitContext and store it in `ec'.
8325
8326 2004-08-24  Martin Baulig  <martin@ximian.com>
8327
8328         * typemanager.cs
8329         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8330         this for accessibility checks.
8331         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8332         IsNestedFamilyAccessible.
8333         (TypeManager.IsSubclassOf): New method, do what the name actually
8334         says.   
8335
8336 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8337
8338         Fix crash on cs0657-17.cs.
8339         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8340         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8341         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8342         the case where the NamespaceEntry gets overwritten.
8343
8344 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8345
8346         Fixed #69195, #56821
8347         * ecore.cs (ResolveBoolean): Tiny refactoring.
8348
8349         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8350         of right expression resolving when left is false constant and
8351         operator is LogicalAnd OR true constant and operator is LogicalOr.
8352
8353         * statement.cs (ResolveUnreachable): Always reports warning.
8354
8355 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * class.cs: Distinguish between 1721 and 1722 (just a little help
8358         for the programmer).
8359
8360 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8361
8362         * delegate.cs: Only allow this on new versions of the language. 
8363
8364 2004-12-02  Duncan Mak  <duncan@ximian.com>
8365
8366         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8367         Expression class.
8368         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8369         here as a static method. Take an additional bool out parameter
8370         `must_do_cs1540_check' for signaling to InstanceResolve.
8371         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8372         member field from PropertyExpr class and made it an argument of
8373         the method instead.
8374         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8375         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8376         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8377         and `remove_accessor' as well as InstanceResolve: report CS0122
8378         where applicable.
8379
8380         Fixes #70129.
8381
8382 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8383
8384         Fix test-327.cs, test-328.cs, and put in early infrastructure
8385         for eventually fixing #52697.
8386         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8387         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8388         from other methods.
8389         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8390         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8391         (VerifyUsing, error246): Update.
8392         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8393         'NamespaceEntry.LookupNamespaceOrType'.
8394
8395 2004-12-03  Martin Baulig  <martin@ximian.com>
8396
8397         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8398         method as our child, call AnonymousMethod.Compatible() on it.
8399
8400 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8401
8402         Disable XML documentation support in 'basic' profile.
8403         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8404         Redirect XmlElement to System.Object.
8405         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8406         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8407         * mcs.exe.sources: Add doc-bootstrap.cs.
8408         * doc-bootstrap.cs: New file.  Contains empty stub implementation
8409         of doc.cs.
8410
8411 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8412
8413         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8414           comments are allowed.
8415
8416 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8417
8418         * delegate.cs: Add checks for subtypes in paramaters and return values
8419         in VerifyMethod () to add support for Covariance/Contravariance
8420         in delegates.
8421         
8422 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8423
8424         * report.cs: Remove extra closing parenthesis.
8425
8426         * convert.cs (Error_CannotImplicitConversion): If the name of the
8427         types are the same, provide some extra information.
8428
8429         * class.cs (FieldBase): Use an unused bit field from the field to
8430         encode the `has_offset' property from the FieldMember.  This saves
8431         a couple of Ks on bootstrap compilation.
8432
8433         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8434         method as our child, return the AnonymousMethod resolved
8435         expression.
8436
8437         * expression.cs (New.DoResolve): Allow return values from
8438         NewDelegate to also include AnonymousMethods.
8439
8440         Fixes #70150.
8441
8442 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8443
8444         Fix bug #70102
8445         * attribute.cs (Resolve): Improved implementation of params
8446         attribute arguments.
8447
8448         * support.cs (ParameterData): Add HasParams to be faster.
8449
8450 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8451
8452         all things are for /doc support:
8453
8454         * doc.cs: new file that supports XML documentation generation.
8455         * mcs.exe.sources: added doc.cs.
8456         * driver.cs:
8457           Handle /doc command line option.
8458           Report error 2006 instead of 5 for missing file name for /doc.
8459           Generate XML documentation when required, after type resolution.
8460         * cs-tokenizer.cs:
8461           Added support for picking up documentation (/// and /** ... */),
8462           including a new XmlCommentState enumeration.
8463         * cs-parser.jay:
8464           Added lines to fill Documentation element for field, constant,
8465           property, indexer, method, constructor, destructor, operator, event
8466           and class, struct, interface, delegate, enum.
8467           Added lines to warn incorrect comment.
8468         * rootcontext.cs :
8469           Added Documentation field (passed only when /doc was specified).
8470         * decl.cs:
8471           Added DocComment, DocCommentHeader, GenerateDocComment() and
8472           OnGenerateDocComment() and some supporting private members for
8473           /doc feature to MemberCore.
8474         * class.cs:
8475           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8476         * delegate.cs:
8477           Added overriden DocCommentHeader.
8478         * enum.cs:
8479           Added overriden DocCommentHeader and GenerateDocComment().
8480
8481 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8482
8483         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8484         unwrapping the enumeration values, chain to
8485         DoConstantNumericPromotions again, so we can promote things to the
8486         fundamental types (takes care of enums that are bytes, sbytes).
8487
8488         Fixes bug #62054.
8489
8490 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8491
8492         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8493         Fix long-standing bug in type-lookup.  Use FindType instead of
8494         LookupType when ec.ResolvingTypeTree.
8495         (Attribute.ResolveType, Attribute.Resolve)
8496         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8497         Update to changes.
8498         (Attributes.Search): Remove internal version.  Update.
8499         (Attributes.SearchMulti): Update.
8500         (Attributes.GetClsCompliantAttribute): Remove.
8501         (Attributes.GetIndexerNameAttribute): Remove.
8502         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8503         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8504         * class.cs (Indexer.Define): Likewise.
8505
8506 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8507
8508         Fix bug #68790
8509         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8510         MarshallByReference members access.
8511
8512         * expression.cs: Use CheckMarshallByRefAccess;
8513         Better error CS0197 message.
8514
8515         * report.cs: Print whole related error message.
8516
8517 2004-11-30  Raja R Harinath  <rharinath@novell.com>
8518
8519         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8520         the current directory to help debugging.
8521
8522 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8523
8524         * class (GetClassBases): Better error 60 report.
8525         (EventProperty): Disabled warning 67 detection.
8526
8527 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8528
8529         Fix bug #60324
8530         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8531
8532         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8533         precise values.
8534
8535 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8536
8537         Fix bug #49488
8538         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8539
8540         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8541
8542 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * attribute.cs (Attribute.Resolve): Refine error reporting and
8545         report a cs0117 if the identifier does not exist, to distinguish
8546         from 0617 which is a miss-use of the actual identifier.
8547
8548         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8549         between cs0070 and cs0079.
8550
8551         * class.cs (MemberBase.DoDefine): When reporting a wrong
8552         accessibility level, we use MethodCore to compare instead of
8553         Method (this was a regression in some refactoring effort).
8554
8555         So now we correctly report cs0056 again.
8556
8557         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8558         testing the target_type (which was known to be object_type) and
8559         not the source type (which is anonymous_method).
8560
8561         Fixed reporting of error cs1660.
8562
8563         * expression.cs (UserCast.Source): Expose the underlying cast.
8564
8565         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8566         allowed types to find a match to int32 first (most common).
8567
8568         In addition, it ignores any ImplicitUserConversions that did an
8569         internal implicit conversion (as the switch statement allows only
8570         one integral conversion to exist).
8571
8572         * class.cs (PartialContainer.Create): rename `name' to
8573         `member_name' for clarity.  Then replace the string calls with a
8574         call to MemberName.GetPartialName, as now using
8575         MemberName.ToString is an error (this is due to the side effects
8576         it had, that were fixed in the past).
8577
8578         This will restore the error reporting on a number of partial class
8579         errors that were missusing this (and getting an exception as a
8580         results, which is now just a plain textual warning, because
8581         yyparse debug output would crash otherwise).
8582
8583 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8584
8585         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8586
8587 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8588
8589         * rootcontext.cs (LookupType): Make sure to cache lookups that
8590         don't give us a negative result. This saves about 5% of corlib
8591         compilation time.
8592
8593 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8594
8595         * report.cs (AbstractMessage.Print): messages are sent to stderr
8596
8597         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8598         non-interface in the list of interfaces (at this point, either
8599         parent was properly set, or a base class is being listed in the
8600         interfaces section).
8601
8602         This flags error 1722, and resolves the crash from bug 69259.
8603
8604 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8605
8606         * statement.cs (Using.EmitExpressionFinally): make this work right
8607         for valuetypes. Fixes 69926.
8608
8609 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8610
8611         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8612         converted to an enum" here, before we try to change the underlying
8613         type.  This code exists, but it is a different code path than the
8614         one used while encoding constants.
8615
8616         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8617         old bug: when converting from the null literal to a pointer,
8618         return an EmptyCast, not the NullLiteral.
8619
8620         This fixes #69921, the recent null_type changes probably made this
8621         bug more prominent.
8622
8623         (ImplicitReferenceConversionExists): In addition, resynchronized
8624         the code here, so it matches the same code in
8625         ImplicitReferenceConversionExists for the `from any class-type S
8626         to any interface-type T'.
8627         
8628
8629 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8630
8631         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8632
8633 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8634
8635         * cs-parser.jay: Use verbosity accordingly. 
8636
8637 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8638
8639         * expression.cs (Unary.ResolveOperator): Do not report warning;
8640         AddressOf reads from variable.
8641         
8642         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8643
8644 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8645
8646         Fix bug #69462
8647
8648         * attribute.cs (Attributable): Removed CheckTargets.
8649         (Attributes.Emit): Explicit attribute targets are tested here.
8650
8651         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8652         not enabled for interfaces.
8653
8654         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8655         (GetAssemblyName): Ouch next bug there.
8656
8657 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8658
8659         * expression.cs: Error 275 added.
8660         
8661 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8662
8663         Fix bug #69177 (Implemented decimal constant support)
8664
8665         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8666         (BinaryFold): Add DecimalConstant.
8667
8668         * const.cs (Define): Decimal constant 
8669         (is not constant.
8670         (ChangeType): Add decimal type handling.
8671         (LookupConstantValue): Don't set value for decimal type but
8672         emit DecimalConstantAttribute. Needed for constant optimization.
8673
8674         * constant.cs (ToDecimal): New method.
8675         (ConvertToDecimal): New method.
8676         (IntConstant): Implemented ConvertToDecimal.
8677         (DecimalConstant.Emit): Emit optimized version for decimals in
8678         int range.
8679
8680         * expression.cs (ResolveOperator): Changed order of constant
8681         reduction to work correctly with native types which have
8682         overloaded operators.
8683         (ResolveMemberAccess): Extract constant value from attribute
8684         for decimal type.
8685
8686         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8687
8688         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8689         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8690         (ChangeType): Decimal is special.
8691         (TypeToCoreType): Add decimal type.
8692
8693 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8694
8695         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8696         decimal types.
8697
8698 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8699
8700         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8701         test cs1667-5.cs.
8702
8703 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8704
8705         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8706
8707         * pending.cs (PendingImplementation): Grab only interfaces.
8708
8709 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8710
8711         * statement.cs (ForeachHelperMethods): Add location member and
8712         error 202 detection.
8713
8714 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8715
8716         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8717         automatically handled by executable.make.
8718         (PROGRAM): Make profile-specific.
8719
8720 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8721
8722         * expression.cs (DoResolveBase): Fixed wrong warning for out
8723         variables.
8724
8725 2004-11-18  Martin Baulig  <martin@ximian.com>
8726
8727         Merged latest changes into gmcs.  Please keep this comment in
8728         here, it makes it easier for me to see what changed in MCS since
8729         the last time I merged.
8730
8731 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8732
8733         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8734         (TypeHandle.GetMemberCache): New.
8735         (TypeHandle.TypeHandle): Update.
8736         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8737         (TypeManager.LookupParentInterfacesCache):
8738         Rename from LookupInterfaceCache.  Optimize slightly.
8739         (TypeManager.MemberLookup_FindMembers): Update.
8740         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8741         multi-type variant.
8742         (AddCacheContents): Rename from AddHashtable.
8743         * class.cs (TypeContainer.parent_container): Remove.
8744         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8745         (TypeContainer.DoDefineMembers): Don't initialize it.
8746         Update to name changes.
8747         
8748 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8749
8750         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8751         that factors the code to check access modifiers on override.  
8752
8753         (PropertyBase): Use the code here.
8754
8755         Patch from Lluis S'anchez, fixes bug #69361.
8756
8757 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8758
8759         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8760         routine that is used to report the use of a captured variable
8761         whose address has been taken.
8762
8763         There are two checks: one when variables are being captured and
8764         the other check is when the address of a variable is taken. 
8765         
8766         (because an anonymous methods might be resolved before *or* after
8767         the address has been taken) and 
8768
8769         * expression.cs (Conditional.DoResolve): Remove the special
8770         casing that Martin added to trueExpr and falseExpr being both
8771         NullLiteral.  We get the right behavior now just by introducing
8772         the null_type into the compiler. 
8773
8774         * convert.cs (ExplicitConversion): Change the code to use
8775         null_type instead of testing `expr is NullLiteral'.
8776         (ImplicitConversionStandard): use null_type too.
8777         (ImplicitReferenceConversionExists): use null_type too.
8778         (ImplicitReferenceConversion): use null_type too.
8779
8780         * literal.cs: The type of `NullLiteral' is now null_type instead
8781         of object_type. 
8782         (Resolve): Set the type here.
8783
8784         * typemanager.cs: Introduce null_type.
8785
8786 2004-11-17  Martin Baulig  <martin@ximian.com>
8787
8788         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8789         direction, like FindMembers() does.  Fixes #69546, testcase is in
8790         test-315.cs.    
8791
8792 2004-11-16  Martin Baulig  <martin@ximian.com>
8793
8794         This is based on a patch from Marek Safar, see bug #69082.
8795         Fixes bugs #63705 and #67130.
8796
8797         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8798         method; create a MemberCache for an interface type and cache the
8799         result.
8800
8801         * decl.cs (IMemberContainer.ParentContainer): Removed.
8802         (IMemberContainer.ParentCache): New property.
8803         (MemberCache.SetupCacheForInterface): Removed.
8804         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8805         to create a cache for an interface's "parent".
8806
8807         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8808         interfaces too.
8809
8810 2004-11-16  Martin Baulig  <martin@ximian.com>
8811
8812         Merged back from gmcs; these changes already went into gmcs a
8813         couple of weeks ago.
8814
8815         * typemanager.cs
8816         (TypeManager.AddUserType): Removed the `ifaces' argument.
8817         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8818         `TypeExpr []'.
8819         (TypeManager.AddUserInterface): Removed.
8820         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8821         `TypeExpr []'.
8822         (TypeManager.GetInterfaces): Likewise.
8823         (TypeManager.GetExplicitInterfaces): Likewise.
8824
8825         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8826
8827         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8828         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8829
8830 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8831
8832         * statement.cs: Avoid adding bools to a hashtable.
8833
8834 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8835
8836         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8837         calling an unsafe method from a safe location.
8838
8839 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8840
8841         Fix #69167
8842         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8843
8844 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * namespace.cs (VerifyUsing): use GetPartialName instead of
8847         ToString. 
8848
8849 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * statement.cs (Return.Resolve): Fix regression in typo: if
8852         `in_exc', we have to request a NeedReturnLabel, this was a typo
8853         introduced in the anonymous method check-in.  Fixes #69131.
8854
8855         * Indexers were using the ShortName when defining themselves,
8856         causing a regression in the compiler bootstrap when applying the
8857         patch from 2004-11-02 (first part), now they use their full name
8858         and the bug is gone.
8859
8860 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8861
8862         * driver.cs: Strip the path from the names of embedded resources. Fixes
8863         #68519.
8864
8865 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8866
8867         Fix error message regression: cs0104-2.cs.
8868         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8869         (AliasEntry.Resolve): Update.
8870         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8871         'silent' flag.
8872         (RootContext.LookupType): Update.
8873
8874 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8875
8876         * cs-parser.jay: Add support for handling accessor modifiers
8877         * class: Add support port accessor modifiers and error checking,
8878         define PropertyMethod.Define as virtual (not abstract anymore)
8879         * ecore.cs: Add checking for proeprties access with access modifiers
8880         * iterators.cs: Modify Accessor constructor call based in the modified
8881         constructor
8882 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8883
8884         * expression.cs (StringConcat): Handle being called twice,
8885         as when we have a concat in a field init with more than two
8886         ctors in the class
8887
8888 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8891         special case explicit implementations, we should always produce
8892         the .property or .event declaration.
8893         
8894         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8895         since it will not return correct data if people use this
8896         unresolved in the presence of using statements (see test-313).
8897
8898         * class.cs (MethodData.Define): If we are an explicit interface
8899         implementation, set the method name to the full name of the
8900         interface plus the name of the method.  
8901
8902         Notice that using the method.MethodName.GetFullName() does not
8903         work, as it will only contain the name as declared on the source
8904         file (it can be a shorthand in the presence of using statements)
8905         and not the fully qualifed type name, for example:
8906
8907         using System;
8908
8909         class D : ICloneable {
8910                 object ICloneable.Clone ()  {
8911                 }
8912         }
8913
8914         Would produce a method called `ICloneable.Clone' instead of
8915         `System.ICloneable.Clone'.
8916
8917         * namespace.cs (Alias.Resolve): Use GetPartialName.
8918         
8919 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8920
8921         * cs-parser.jay: Add error 1055 report.
8922
8923 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8924
8925         * assign.cs (Assign.DoResolve): Only do the transform of
8926         assignment into a New if the types are compatible, if not, fall
8927         through and let the implicit code deal with the errors and with
8928         the necessary conversions. 
8929
8930 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8931
8932         * cs-parser.jay: Add error 1031 report.
8933
8934         * cs-tokenizer.cs: Add location for error 1038.
8935
8936 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8937
8938         * cs-parser.jay: Add error 1016 report.
8939
8940 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8941
8942         * cs-parser.jay: Add errors 1575,1611 report.
8943
8944 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8945
8946         * cs-parser.jay: Add error 1001 report.
8947
8948 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8949
8950         Fix #68850
8951         * attribute.cs (GetMarshal): Add method argument for
8952         caller identification.
8953
8954         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8955         agument for GetMarshal and RuntimeMissingSupport.
8956
8957 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8958
8959         * attribute.cs (ExtractSecurityPermissionSet): Removed
8960         TypeManager.code_access_permission_type.
8961
8962         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8963
8964 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8965
8966         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8967         for obsolete use of a variable here.   Fixes regression on errors
8968         cs0619-25 and cs0619-26.
8969
8970 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8971
8972         Fix #62358, implemented security attribute encoding.
8973
8974         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8975         Tests permitted SecurityAction for assembly or other types.
8976         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8977         data from SecurityPermissionAttribute to PermisionSet class.
8978
8979         * class.cs (ApplyAttributeBuilder): Added special handling
8980         for System.Security.Permissions.SecurityAttribute based types.
8981
8982         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8983         special handling for System.Security.Permissions.SecurityAttribute
8984         based types.
8985
8986         * enum.cs (ApplyAttributeBuilder): Added special handling
8987         for System.Security.Permissions.SecurityAttribute based types.
8988
8989         * parameter.cs (ApplyAttributeBuilder): Added special handling
8990         for System.Security.Permissions.SecurityAttribute based types.
8991
8992         * rootcontext.cs: Next 2 core types.
8993
8994         * typemanager.cs (TypeManager.security_permission_attr_type):
8995         Built in type for the SecurityPermission Attribute.
8996         (code_access_permission_type): Build in type.
8997
8998 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8999
9000         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9001         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9002         all of this information into
9003         EmitContext.EmitCapturedVariableInstance.
9004         
9005         * codegen.cs (EmitCapturedVariableInstance): move here the
9006         funcionality of emitting an ldarg.0 in the presence of a
9007         remapping.   This centralizes the instance emit code.
9008
9009         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9010         then emit a load of this: it means that we have reached the
9011         topmost ScopeInfo: the one that contains the pointer to the
9012         instance of the class hosting the anonymous method.
9013
9014         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9015         captures to the topmost CaptureContext.
9016
9017 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9018
9019         * expression.cs (LocalVariableReference): Move the knowledge about
9020         the iterators into codegen's EmitCapturedVariableInstance.
9021
9022 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9023
9024         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9025         all code paths return a value from an anonymous method (it is the
9026         same as the 161 error, but for anonymous methods).
9027
9028 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9029
9030         The introduction of anonymous methods in the compiler changed
9031         various ways of doing things in the compiler.  The most
9032         significant one is the hard split between the resolution phase
9033         and the emission phases of the compiler.
9034
9035         For instance, routines that referenced local variables no
9036         longer can safely create temporary variables during the
9037         resolution phase: they must do so from the emission phase,
9038         since the variable might have been "captured", hence access to
9039         it can not be done with the local-variable operations from the runtime.
9040         
9041         * statement.cs 
9042
9043         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9044         is a toplevel block.
9045
9046         (ToplevelBlock): A new kind of Block, these are the blocks that
9047         are created by the parser for all toplevel method bodies.  These
9048         include methods, accessors and anonymous methods.
9049
9050         These contain some extra information not found in regular blocks:
9051         A pointer to an optional CaptureContext (for tracking captured
9052         local variables and parameters).  A pointer to the parent
9053         ToplevelBlock.
9054         
9055         (Return.Resolve): Catch missmatches when returning a value from an
9056         anonymous method (error 1662).
9057         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9058         phase.
9059
9060         (Break.Resolve): ditto.
9061
9062         (SwitchLabel): instead of defining the labels during the
9063         resolution phase, we now turned the public ILLabel and ILLabelCode
9064         labels into methods called GetILLabelCode() and GetILLabel() that
9065         only define the label during the Emit phase.
9066
9067         (GotoCase): Track the SwitchLabel instead of the computed label
9068         (its contained therein).  Emit the code by using
9069         SwitchLabel.GetILLabelCode ().
9070
9071         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9072         whether the Local has been captured or not.
9073
9074         (LocalInfo.IsCaptured): New property, used to tell whether the
9075         local has been captured.
9076         
9077         * anonymous.cs: Vastly updated to contain the anonymous method
9078         support.
9079
9080         The main classes here are: CaptureContext which tracks any
9081         captured information for a toplevel block and ScopeInfo used to
9082         track the activation frames for various local variables.   
9083
9084         Each toplevel block has an optional capture context associated
9085         with it.  When a method contains an anonymous method both the
9086         toplevel method and the anonymous method will create a capture
9087         context.   When variables or parameters are captured, they are
9088         recorded on the CaptureContext that owns them, for example:
9089
9090         void Demo () {
9091              int a;
9092              MyDelegate d = delegate {
9093                  a = 1;
9094              }
9095         }
9096
9097         Here `a' will be recorded as captured on the toplevel
9098         CapturedContext, the inner captured context will not have anything
9099         (it will only have data if local variables or parameters from it
9100         are captured in a nested anonymous method.
9101
9102         The ScopeInfo is used to track the activation frames for local
9103         variables, for example:
9104
9105         for (int i = 0; i < 10; i++)
9106                 for (int j = 0; j < 10; j++){
9107                    MyDelegate d = delegate {
9108                         call (i, j);
9109                    }
9110                 }
9111
9112         At runtime this captures a single captured variable `i', but it
9113         captures 10 different versions of the variable `j'.  The variable
9114         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9115         recorded on a child.  
9116
9117         The toplevel ScopeInfo will also track information like the `this'
9118         pointer if instance variables were referenced (this is necessary
9119         as the anonymous method lives inside a nested class in the host
9120         type of the method). 
9121
9122         (AnonymousMethod): Expanded to track the Toplevel, implement
9123         `AnonymousMethod.Compatible' to tell whether an anonymous method
9124         can be converted to a target delegate type. 
9125
9126         The routine now also produces the anonymous method content
9127
9128         (AnonymousDelegate): A helper class that derives from
9129         DelegateCreation, this is used to generate the code necessary to
9130         produce the delegate for the anonymous method that was created. 
9131
9132         * assign.cs: API adjustments for new changes in
9133         Convert.ImplicitStandardConversionExists.
9134
9135         * class.cs: Adjustments to cope with the fact that now toplevel
9136         blocks are of type `ToplevelBlock'. 
9137
9138         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9139         insteda of standard blocks.
9140
9141         Flag errors if params arguments are passed to anonymous methods.
9142
9143         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9144         `CurrentAnonymousMethod' which points to the current Anonymous
9145         Method.  The variable points to the AnonymousMethod class that
9146         holds the code being compiled.  It is set in the new EmitContext
9147         created for the anonymous method.
9148
9149         (EmitContext.Phase): Introduce a variable and an enumeration to
9150         assist in enforcing some rules about when and where we are allowed
9151         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9152         only one that enfonces this right now).
9153
9154         (EmitContext.HaveCaptureInfo): new helper method that returns
9155         whether we have a CapturedContext initialized.
9156
9157         (EmitContext.CaptureVariable): New method used to register that a
9158         LocalInfo must be flagged for capturing. 
9159
9160         (EmitContext.CapturedParameter): New method used to register that a
9161         parameters must be flagged for capturing. 
9162         
9163         (EmitContext.CapturedField): New method used to register that a
9164         field must be flagged for capturing. 
9165
9166         (EmitContext.HaveCapturedVariables,
9167         EmitContext.HaveCapturedFields): Return whether there are captured
9168         variables or fields. 
9169
9170         (EmitContext.EmitMethodHostInstance): This is used to emit the
9171         instance for the anonymous method.  The instance might be null
9172         (static methods), this (for anonymous methods that capture nothing
9173         and happen to live side-by-side with the current method body) or a
9174         more complicated expression if the method has a CaptureContext.
9175
9176         (EmitContext.EmitTopBlock): Routine that drives the emission of
9177         code: it will first resolve the top block, then emit any metadata
9178         and then emit the code.  The split is done so that we can extract
9179         any anonymous methods and flag any captured variables/parameters.
9180         
9181         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9182         during this phase, the ILGenerator should not be used as labels
9183         and local variables declared here might not be accessible to any
9184         code that is part of an anonymous method.  
9185
9186         Exceptions to this include the temporary variables that are
9187         created by some statements internally for holding temporary
9188         variables. 
9189         
9190         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9191         metadata for a cb
9192
9193         (EmitContext.TemporaryReturn): This method is typically called
9194         from the Emit phase, and its the only place where we allow the
9195         ReturnLabel to be defined other than the EmitMeta.  The reason is
9196         that otherwise we would have to duplicate a lot of logic in the
9197         Resolve phases of various methods that today is on the Emit
9198         phase. 
9199
9200         (EmitContext.NeedReturnLabel): This no longer creates the label,
9201         as the ILGenerator is not valid during the resolve phase.
9202
9203         (EmitContext.EmitThis): Extended the knowledge in this class to
9204         work in anonymous methods in addition to iterators. 
9205
9206         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9207         code is necessary on the stack to access the instance to a local
9208         variable (the variable will be accessed as a field).
9209
9210         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9211         EmitContext.EmitAddressOfParameter): Routines to support
9212         parameters (not completed at this point). 
9213         
9214         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9215         will also remove the parameters.
9216
9217         * convert.cs (Convert): Define a `ConstantEC' which points to a
9218         null.  This is just to prefity some code that uses
9219         ImplicitStandardConversion code and do not have an EmitContext
9220         handy.
9221
9222         The idea is to flag explicitly that at that point in time, it is
9223         known that the conversion will not trigger the delegate checking
9224         code in implicit conversions (which requires a valid
9225         EmitContext). 
9226
9227         Everywhere: pass new EmitContext parameter since
9228         ImplicitStandardConversionExists now requires it to check for
9229         anonymous method conversions. 
9230
9231         (Convert.ImplicitStandardConversionExists): If the type of an
9232         expression is the anonymous_method_type, and the type is a
9233         delegate, we invoke the AnonymousMethod.Compatible method to check
9234         whether an implicit conversion is possible. 
9235
9236         (Convert.ImplicitConversionStandard): Only do implicit method
9237         group conversions if the language level is not ISO_1.
9238
9239         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9240         MethodInfo for the Invoke method.  used by Delegate and
9241         AnonymousDelegate.
9242
9243         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9244         method conversions if the target type is a delegate.
9245
9246         Removed extra debugging nops.
9247
9248         (LocalVariableReference): Turn the `local_info' into a public
9249         field. 
9250
9251         Add `prepared' field, the same hack used for FieldExprs to cope
9252         with composed assignments, as Local variables do not necessarily
9253         operate purely on the stack as they used to: they can be captured
9254         fields. 
9255
9256         Add `temp' for a temporary result, like fields.
9257
9258         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9259
9260         It now copes with Local variables that are captured and emits the
9261         proper instance variable to load it from a field in the captured
9262         case. 
9263
9264         (ParameterReference.DoResolveBase): During the resolve phase,
9265         capture parameters if we are in an anonymous method.
9266
9267         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9268         anonymous method, use the EmitContext helper routines to emit the
9269         parameter reference.
9270
9271         * iterators.cs: Set RemapToProxy to true/false during the
9272         EmitDispose class.
9273
9274         * parameters.cs (GetParameterByName): New helper method. 
9275
9276         * typemanager.cs (anonymous_method_type) a new type that
9277         represents an anonyous method.  This is always an internal type,
9278         used as a fencepost to test against the anonymous-methodness of an
9279         expression. 
9280         
9281 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9282
9283         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9284         561 report.
9285         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9286
9287 2004-10-18  Martin Baulig  <martin@ximian.com>
9288
9289         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9290         `Type' directly, but call ResolveType() on it.
9291         (Catch.Resolve): Likewise.
9292         (Foreach.Resolve): Likewise.
9293
9294 2004-10-18  Martin Baulig  <martin@ximian.com>
9295
9296         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9297         `Type' directly, but call ResolveType() on it.
9298         (Probe.DoResolve): Likewise.
9299         (ArrayCreation.LookupType): Likewise.
9300         (TypeOf.DoResolve): Likewise.
9301         (SizeOf.DoResolve): Likewise.
9302
9303 2004-10-18  Martin Baulig  <martin@ximian.com>
9304
9305         * expression.cs (Invocation.BetterFunction): Put back
9306         TypeManager.TypeToCoreType().
9307
9308 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9309
9310         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9311         the ResolveType.
9312
9313 2004-10-18  Martin Baulig  <martin@ximian.com>
9314
9315         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9316         `Type' directly, but call ResolveType() on it.
9317
9318 2004-10-18  Martin Baulig  <martin@ximian.com>
9319
9320         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9321         `Type' directly, but call ResolveType() on it.
9322         (MemberBase.DoDefine): Likewise.
9323
9324         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9325         `Type' directly, but call ResolveType() on it.
9326         (ComposedCast.DoResolveAsTypeStep): Likewise.
9327
9328         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9329         `Type' directly, but call ResolveType() on it.
9330
9331 2004-10-17  John Luke  <john.luke@gmail.com>
9332
9333         * class.cs (Operator.GetSignatureForError): use CSharpName
9334
9335         * parameter.cs (Parameter.GetSignatureForError): Returns
9336         correct name even if was not defined.
9337
9338 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9339
9340         Fix #65816.
9341         * class.cs (TypeContainer.EmitContext): New property.
9342         (DefineNestedTypes): Create an emitcontext for each part.
9343         (MethodCore.DoDefineParameters): Use container's emitcontext.
9344         Pass type array to InternalParameters.
9345         (MemberBase.DoDefine): Use container's emitcontext.
9346         (FieldMember.Define): Likewise.
9347         (Event.Define): Likewise.
9348         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9349         Pass type array to InternalParameters.
9350         (SetIndexerMethod.GetParameterInfo): Likewise.
9351         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9352         * delegate.cs (Define): Pass emitcontext to
9353         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9354         array to InternalParameters.
9355         * expression.cs (ParameterReference.DoResolveBase): Pass
9356         emitcontext to GetParameterInfo.
9357         (ComposedCast.DoResolveAsTypeStep): Remove check on
9358         ec.ResolvingTypeTree.
9359         * parameter.cs (Parameter.Resolve): Change argument to
9360         EmitContext.  Use ResolveAsTypeTerminal.
9361         (Parameter.GetSignature): Change argument to EmitContext.
9362         (Parameters.ComputeSignature): Likewise.
9363         (Parameters.ComputeParameterTypes): Likewise.
9364         (Parameters.GetParameterInfo): Likewise.
9365         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9366         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9367         * support.cs (InternalParameters..ctor): Remove variant that takes
9368         a DeclSpace.
9369         * typemanager.cs (system_intptr_expr): New.
9370         (InitExpressionTypes): Initialize it.
9371
9372 2004-10-12  Chris Toshok  <toshok@ximian.com>
9373
9374         * cs-parser.jay: fix location for try_statement and catch_clause.
9375
9376 2004-10-11  Martin Baulig  <martin@ximian.com>
9377
9378         * report.cs: Don't make --fatal abort on warnings, we have
9379         -warnaserror for that.
9380
9381 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9382
9383         More DeclSpace.ResolveType avoidance.
9384         * decl.cs (MemberCore.InUnsafe): New property.
9385         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9386         with newly created EmitContext.
9387         (FieldMember.Define): Likewise.
9388         * delegate.cs (Delegate.Define): Likewise.
9389         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9390         only if normal name-lookup fails.
9391         (TypeExpr.DoResolve): Enable error-checking.
9392         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9393         (SizeOf.DoResolve): Likewise.
9394         (ComposedCast.DoResolveAsTypeStep): Likewise.
9395         (StackAlloc.DoResolve): Likewise.
9396         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9397         (Block.Unsafe): New property.
9398         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9399         (Unsafe): Set 'unsafe' flag of contained block.
9400         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9401         (Fixed.Resolve): Likewise.
9402         (Catch.Resolve): Likewise.
9403         (Using.ResolveLocalVariableDecls): Likewise.
9404         (Foreach.Resolve): Likewise.
9405
9406 2004-10-05  John Luke <john.luke@gmail.com>
9407
9408         * cs-parser.jay: add location to error CS0175
9409
9410 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9411
9412         * ecore.cs (Expression.Constantity): Add support for turning null
9413         into a constant.
9414
9415         * const.cs (Const.Define): Allow constants to be reference types
9416         as long as the value is Null.
9417
9418 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9419
9420         * namespace.cs (NamespaceEntry.Using): No matter which warning
9421         level is set, check if this namespace name has already been added.
9422
9423 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9424
9425         * expression.cs: reftype [!=]= null should always use br[true,false].
9426         # 67410
9427
9428 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9429
9430         Fix #67108
9431         * attribute.cs: Enum conversion moved to 
9432         GetAttributeArgumentExpression to be applied to the all
9433         expressions.
9434
9435 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9436
9437         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9438         * class.c (TypeContainer.DefineType): Flag error if
9439         base types aren't accessible due to access permissions.
9440         * decl.cs (DeclSpace.ResolveType): Move logic to
9441         Expression.ResolveAsTypeTerminal.
9442         (DeclSpace.ResolveTypeExpr): Thin layer over
9443         Expression.ResolveAsTypeTerminal.
9444         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9445         Refactor code into NestedAccess.  Use it.
9446         (DeclSpace.NestedAccess): New.
9447         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9448         argument to silence errors.  Check access permissions.
9449         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9450         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9451         (Cast.DoResolve): Likewise.
9452         (New.DoResolve): Likewise.
9453         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9454         (TypeOf.DoResolve): Likewise.
9455
9456         * expression.cs (Invocation.BetterConversion): Return the Type of
9457         the better conversion.  Implement section 14.4.2.3 more faithfully.
9458         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9459         section 14.4.2.2 explicit.
9460         (Invocation.OverloadResolve): Update.
9461         (Invocation): Remove is_base field.
9462         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9463         (Invocation.Emit): Likewise.
9464
9465 2004-09-27  Raja R Harinath  <rharinath@novell.com>
9466
9467         * README: Update to changes.
9468
9469 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9470
9471         * cs-parser.jay: Reverted 642 warning fix.
9472
9473 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9474
9475         Fix bug #66615
9476         * decl.cs (FindMemberWithSameName): Indexer can have more than
9477         1 argument.
9478
9479 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9480
9481         * expression.cs (LocalVariableReference.DoResolveLValue):
9482         Do not report warning 219 for out values.
9483         (EmptyExpression.Null): New member to avoid extra allocations.
9484
9485 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9486
9487         * cs-parser.jay: Fix wrong warning 642 report.
9488
9489         * cs-tokenizer.cs (CheckNextToken): New helper;
9490         Inspect next character if is same as expected.
9491
9492 2004-09-23  Martin Baulig  <martin@ximian.com>
9493
9494         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9495         (Convert.ImplicitReferenceConversionExists): Likewise.
9496
9497 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9498
9499         * class.cs (Operator.Define): Add error 448 and 559 report.
9500
9501 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9502
9503         * class.cs (MemberBase.IsTypePermitted): New protected
9504         method for checking error CS0610.
9505
9506 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9507
9508         * class.cs (TypeContainer.HasExplicitLayout): New property
9509         Returns whether container has StructLayout attribute set Explicit.
9510         (FieldMember): New abstract class for consts and fields.
9511         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9512         (Field): Reuse FieldMember.
9513
9514         * const.cs (Const): Reuse FieldMember.
9515
9516         * rootcontext.cs: EmitConstants call moved to class.
9517
9518 2004-09-22  Martin Baulig  <martin@ximian.com>
9519
9520         Thanks to Peter Sestoft for this bug report.
9521
9522         * expression.cs (Conditional): If both the `trueExpr' and the
9523         `falseExpr' is a NullLiteral, return a NullLiteral.
9524
9525 2004-09-22  Martin Baulig  <martin@ximian.com>
9526
9527         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9528         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9529         for the "get_Current" call.
9530
9531 2004-09-22  Martin Baulig  <martin@ximian.com>
9532
9533         Marek and me just fixed one of our oldest bugs: #28562 :-)
9534
9535         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9536
9537         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9538         we're an EnumConstant, just return that.
9539         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9540         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9541         to get the value which'll actually be written into the attribute.
9542         However, we have to use GetValue() to access the attribute's value
9543         in the compiler.        
9544
9545 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9546
9547         * constant.cs (Constant.IsNegative): New abstract property
9548         IsNegative.
9549
9550         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9551         (StackAlloc.DoResolve): Reused IsNegative.
9552
9553 2004-09-21  Martin Baulig  <martin@ximian.com>
9554
9555         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9556         if we're used in an iterator, we may be called from different
9557         methods.
9558
9559         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9560         we actually have an exception block.
9561
9562 2004-09-20  John Luke <jluke@cfl.rr.com>
9563
9564         * class.cs, cs-parser.jay: Improve the error report for 1520:
9565         report the actual line where the error happens, not where the
9566         class was declared.
9567
9568         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9569         Pass location information that was available elsewhere.
9570
9571 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
9572
9573         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9574         runtime to delay sign assemblies.
9575
9576 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * cs-parser.jay: Do not report the stack trace, this is barely
9579         used nowadays.
9580
9581 2004-08-22  John Luke  <john.luke@gmail.com>
9582  
9583         * driver.cs : check that a resource id is not already used
9584         before adding it, report CS1508 if it is, bug #63637
9585
9586 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9587
9588         * ecore.cs: Removed dead code.
9589
9590 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
9591
9592         * class.cs: Do not report warning CS0067 on the interfaces.
9593
9594 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9595
9596         * cs-parser.jay: Add error 504 report.
9597
9598 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9599
9600         * rootcontext.cs: WarningLevel is 4 by default now.
9601
9602         * statement.cs (Fixed.Resolve): Do not null
9603         VariableInfo.
9604
9605 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9606
9607         Fixed bug #55780
9608         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9609         deep search when property is not virtual.
9610         (PropertyExpr.ResolveAccessors): Make one call for both
9611         accessors.
9612
9613 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9614
9615         Fixed bug #65766
9616         * statement.cs: Error 152 report constains also location.
9617
9618 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9619
9620         Fixed bug #65766
9621         * const.cs: Explicitly set constant as static.
9622
9623 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9624
9625         Fixed bug #64226
9626         * cs-parser.jay: Add error 1017 report.
9627
9628 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9629
9630         Fixed bug #59980, #64224
9631         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9632
9633         * typemanager.cs (IsSpecialMethod): Simplified
9634
9635 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9636
9637         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9638         condition with better params.
9639
9640 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9641
9642         Fixed bug #65238
9643         * attribute.cs (Resolve): Property has to have both
9644         accessors.
9645
9646 2004-09-14  Martin Baulig  <martin@ximian.com>
9647
9648         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9649
9650 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9651
9652         Fixed bug #61902
9653         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9654         called and is obsolete then this member suppress message
9655         when call is inside next [Obsolete] method or type.
9656
9657         * expression.cs: Use TestObsoleteMethodUsage member.
9658
9659 2004-09-14  Martin Baulig  <martin@ximian.com>
9660
9661         * cs-parser.jay: Sync a bit with the GMCS version.
9662
9663 2004-09-14  Martin Baulig  <martin@ximian.com>
9664
9665         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9666         (CSharpParser.yacc_verbose_flag): New public field.
9667
9668         * genericparser.cs: Removed.
9669
9670 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9671
9672         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9673
9674 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9675
9676         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9677
9678 2004-09-10  Martin Baulig  <martin@ximian.com>
9679
9680         Backported my MemberName changes from GMCS into MCS.
9681
9682         - we are now using a special `MemberName' class instead of using
9683         strings; in GMCS, the `MemberName' also contains the type
9684         arguments.
9685
9686         - changed the grammar rules a bit:
9687           * the old `member_name' is now a `namespace_or_type_name':
9688             The rule is that we use `namespace_or_type_name' everywhere
9689             where we expect either a "member name" (GetEnumerator) or a
9690             "member name" with an explicit interface name
9691             (IEnumerable.GetEnumerator).
9692             In GMCS, the explicit interface name may include type arguments
9693             (IEnumerable<T>.GetEnumerator).
9694           * we use `member_name' instead of just `IDENTIFIER' for
9695             "member names":
9696             The rule is that we use `member_name' wherever a member may
9697             have type parameters in GMCS.       
9698
9699         * decl.cs (MemberName): New public class.
9700         (MemberCore.MemberName): New public readonly field.
9701         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9702         (DeclSpace): Likewise.
9703
9704         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9705         * enum.cs (Enum.ctor): Likewise.
9706
9707         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9708         MemberName.     
9709         (AliasEntry.ctor): Take a MemberName, not an Expression.
9710         (AliasEntry.UsingAlias): Likewise.
9711
9712         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9713         (IMethodData.MemberName): Changed type from string to MemberName.
9714         (MemberBase.ExplicitInterfaceName): Likewise.
9715         (AbstractPropertyEventMethod.SetupName): Make this private.
9716         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9717         argument; compute the member name here.
9718         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9719         on the `member.MemberName' and the `prefix'.
9720
9721         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9722         not `type_name'.
9723         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9724         thus, we get a `MemberName' instead of a `string'.  These
9725         declarations may have type parameters in GMCS.
9726         (interface_method_declaration, delegate_declaration): Likewise.
9727         (class_declaration, interface_declaration): Likewise.
9728         (method_header): Use `namespace_or_type_name' instead of
9729         `member_name'.  We may be an explicit interface implementation.
9730         (property_declaration, event_declaration): Likewise.
9731         (member_name): This is now just an `IDENTIFIER', not a
9732         `namespace_or_type_name'.
9733         (type_name, interface_type): Removed.
9734         (namespace_or_type_name): Return a MemberName, not an Expression.
9735         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9736         call GetTypeExpression() on the MemberName to get an expression.
9737         (IndexerDeclaration.interface_type): Changed type from string to
9738         MemberName.
9739         (MakeName): Operate on MemberName's instead of string's.
9740
9741 2004-09-13  Raja R Harinath  <rharinath@novell.com>
9742
9743         Fix bug #55770.
9744         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9745         (NamespaceEntry.Lookup): Add new argument to flag if we want the
9746         lookup to avoid symbols introduced by 'using'.
9747         * rootcontext.cs (NamespaceLookup): Update.
9748
9749 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9750
9751         * class.cs (TypeContainer.DoDefineMembers): Do not call
9752         DefineDefaultConstructor for static classes.
9753
9754 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9755
9756         * attribute.cs (Attribute.Resolve): Add error 653 report.
9757
9758         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9759         report.
9760         (Method.ApplyAttributeBuilder): Add error 685 report.
9761         (Operator.Define): Add error 564 report.
9762
9763         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9764
9765         * expression.cs (Invocation.DoResolve): Add error
9766         245 and 250 report.
9767
9768         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9769         error 674 report.
9770
9771 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9772
9773         * class.cs (ConstructorInitializer.Resolve):
9774         Wrong error number (515->516).
9775
9776 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9777
9778         * class.cs (Indexer.Define): Add error 631 report.
9779
9780 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9781
9782         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9783
9784 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9785
9786         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9787
9788 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9789
9790         * cs-parser.jay: Added error CS0241 report.
9791
9792 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9793
9794         * cs-parser.jay (fixed_statement): Introduce a scope for the
9795         declaration in the 'fixed' statement.
9796
9797 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9798
9799         * cs-parser.jay: Added CS0230 error report.
9800
9801 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9802
9803         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9804
9805 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9806
9807         * expression.cs (Argument.Resolve): Added error CS0192 and
9808         CS0199 report.
9809
9810 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9811
9812         C# 2.0 #pragma warning feature
9813
9814         * cs-tokenizer.cs (PreProcessPragma): New method; 
9815         Handles #pragma directive.
9816
9817         * report.cs (WarningRegions): New class; Support
9818         class for #pragma warning directive. It tests whether
9819         warning is enabled for a given line.
9820
9821 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9822
9823         * const.cs: Add more descriptive error report, tahnks to
9824         Sebastien. 
9825
9826 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9827
9828         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9829
9830 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9831
9832         * expression.cs: Apply patch from Ben: Remove dead code from
9833         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9834         as that code just threw an exception anwyays.
9835
9836         * const.cs: Remove the call to the turnintoconstant, for details
9837         see bug: #63144
9838         
9839         * literal.cs: The type of the null-literal is the null type;  So
9840         we use a placeholder type (literal.cs:System.Null, defined here)
9841         for it.
9842
9843         * expression.cs (Conditional.DoResolve): Remove some old code that
9844         is no longer needed, conversions have been fixed.
9845
9846         (ArrayCreationExpression.DoResolve): Return false if we fail to
9847         resolve the inner expression.
9848
9849 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9850
9851         Fix test-290.cs.
9852         * cs-parser.jay (delegate_declaration): Record a delegate
9853         declaration as a type declaration.
9854         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9855
9856 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9857
9858         * parameter.cs: Do not crash if the type can not be resolved. 
9859
9860         * expression.cs: Report errors with unsafe pointers, fixes #64896
9861
9862 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9863
9864         * expression.cs: Pointer arith always needs to do a conv.i
9865         if the operand is a long. fix 65320
9866
9867 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9868
9869         Fixed cs0619-37.cs, cs0619-38.cs
9870
9871         * enum.cs (GetObsoleteAttribute): Removed.
9872
9873         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9874         on Enum member is double staged. The first is tested member
9875         and then enum.
9876
9877 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9878
9879         Fixed #56986, #63631, #65231
9880
9881         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9882         adds member to name container.
9883         (TypeContainer.AddToTypeContainer): New method, adds type to
9884         name container.
9885         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9886         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9887         AddOperator): Simplified by reusing AddToMemberContainer.
9888         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9889         instead of field.
9890         (Method.CheckForDuplications): Fixed implementation to test all
9891         possibilities.
9892         (MemberBase): Detection whether member is explicit interface
9893         implementation is now in constructor.
9894         (MemberBase.UpdateMemberName): Handles IndexerName.
9895         (Accessor): Changed to keep also location information.
9896         (AbstractPropertyEventMethod): Is derived from MemberCore.
9897         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9898         will be emited or not.
9899         (PropertyBase.AreAccessorsDuplicateImplementation):
9900         Tests whether accessors are not in collision with some method.
9901         (Operator): Is derived from MethodCore to simplify common
9902         operations.
9903
9904         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9905         must be performed.
9906         (DeclSpace.AddToContainer): Adds the member to defined_names
9907         table. It tests for duplications and enclosing name conflicts.
9908
9909         * enum.cs (EnumMember): Clean up to reuse the base structures
9910
9911 2004-09-03  Martin Baulig  <martin@ximian.com>
9912
9913         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9914         into TypeContainer, to make partial classes work again.
9915
9916 2004-09-03  Martin Baulig  <martin@ximian.com>
9917
9918         * rootcontext.cs (RootContext.V2): Removed.
9919
9920 2004-03-23  Martin Baulig  <martin@ximian.com>
9921
9922         * expression.cs (Invocation.OverloadResolve): Added `bool
9923         may_fail' argument and use it instead of the Location.IsNull() hack.
9924
9925 2004-09-03  Martin Baulig  <martin@ximian.com>
9926
9927         Merged latest changes into gmcs.  Please keep this comment in
9928         here, it makes it easier for me to see what changed in MCS since
9929         the last time I merged.
9930
9931 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9932
9933         Fix #61128.
9934         * expression.cs (BetterConversion): Don't allow either conversion 
9935         to be null.  Remove redundant implicit conversion test when 'q ==
9936         null' -- when this function is invoked, we already know that the
9937         implicit conversion exists.
9938         (BetterFunction): Assume that 'best' is non-null.  Remove
9939         redundant reimplementation of IsApplicable when 'best' is null.
9940         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9941         number of arguments.
9942         (IsAncestralType): Extract from OverloadResolve.
9943         (OverloadResolve): Make robust to the MethodGroupExpr being
9944         unsorted.  Implement all the logic of Section 14.5.5.1, and
9945         support overloading of methods from multiple applicable types.
9946         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9947
9948         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9949         (RealError, Warning): Append type of report to related symbol.
9950
9951 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9952
9953         * enum.cs: Fixed CLS-Compliance checks for enum members.
9954         Error tests cs3008-8.cs, cs3014-8.cs
9955
9956 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9957
9958         Fixed bug #62342, #63102
9959         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9960         like ImplementMethod.
9961
9962 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9963
9964         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9965         Fixed bug #65170.
9966
9967 2004-09-02  Martin Baulig  <martin@ximian.com>
9968
9969         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9970         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9971         on the MethodBase.
9972
9973 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9974
9975         C# 2.0 Static classes implemented
9976
9977         * class.cs (TypeContainer): instance_constructors,
9978         initialized_fields, initialized_static_fields,
9979         default_constructor, base_inteface_types are protected to be
9980         accessible from StaticClass.
9981         (TypeContainer.DefineDefaultConstructor): New virtual method
9982         for custom default constructor generating
9983         (StaticClass): New class to handle "Static classes" feature.
9984
9985         * cs-parser.jay: Handle static keyword on class like instance
9986         of StaticClass.
9987
9988         * driver.cs: Added "/langversion" command line switch with two
9989         options (iso-1, default).
9990
9991 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9992
9993         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9994
9995 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * delegate.cs: Style.
9998
9999 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10000
10001         * delegate.cs: Add seperate instance expr field for miguel.
10002
10003 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10004
10005         * PointerArithmetic (Resolve): make sure we are not doing
10006         pointer arith on void*. Also, make sure we are resolved
10007         by not setting eclass until resolve.
10008
10009         All callers: Make sure that PointerArithmetic gets resolved.
10010
10011 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10012
10013         * ArrayCreation (LookupType): If the type does not resolve 
10014         to an array, give an error.
10015
10016 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10017
10018         * statement.cs (Try.Resolve): Fixed bug #64222
10019
10020 2004-08-27  Martin Baulig  <martin@ximian.com>
10021
10022         * class.cs
10023         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10024         crash here.     
10025
10026 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10027
10028         * ecore.cs (Constantify): Get underlying type via
10029         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10030         Windows in special cases.
10031
10032 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10033
10034         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10035         for obtaining also private methods.
10036         (GetRemoveMethod): Used GetRemoveMethod (true)
10037         for obtaining also private methods.
10038
10039 2004-08-24  Martin Baulig  <martin@ximian.com>
10040
10041         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10042         MethodAttributes.HideBySig for operators.
10043
10044 2004-08-23  Martin Baulig  <martin@ximian.com>
10045
10046         Back to the old error reporting system :-)
10047
10048         * report.cs (Message): Removed.
10049         (Report.MessageData, ErrorData, WarningData): Removed.
10050         (Report.Error, Warning): Back to the old system.
10051
10052 2004-08-23  Martin Baulig  <martin@ximian.com>
10053
10054         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10055
10056         * class.cs (TypeContainer.ParentContainer): New public virtual
10057         method; replaces the explicit interface implementation.
10058         (ClassPart.ParentContainer): Override.
10059
10060 2004-08-23  Martin Baulig  <martin@ximian.com>
10061
10062         * statement.cs (Switch): Added support for constant switches; see
10063         #59428 or test-285.cs.
10064
10065 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10066
10067         Fixed bug #62740.
10068         * statement.cs (GetEnumeratorFilter): Removed useless
10069         logic because C# specs is strict. GetEnumerator must be
10070         public.
10071
10072 2004-08-22  Martin Baulig  <martin@ximian.com>
10073
10074         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10075         a switch and may break, reset the barrier.  Fixes #59867.
10076
10077 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10078
10079         CLS-Compliance speed up (~5% for corlib)
10080
10081         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10082         New method. Tests container for CLS-Compliant names
10083
10084         * class.cs (TypeContainer.VerifyClsName): New method.
10085         Checks whether container name is CLS Compliant.
10086         (Constructor): Implements IMethodData.
10087
10088         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10089         low-case table for CLS Compliance test.
10090         (MemberCache.VerifyClsParameterConflict): New method.
10091         Checks method parameters for CS3006 error.
10092
10093         * enum.cs (EnumMember): Is derived from MemberCore.
10094         (Enum.VerifyClsName): Optimized for better performance.
10095
10096 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10097
10098         * report.cs: Renamed Error_T to Error and changed all
10099         references.
10100
10101 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10102
10103         * class.cs (TypeContainer.IndexerArrayList): New inner class
10104         container for indexers.
10105         (TypeContainer.DefaultIndexerName): New constant for default
10106         indexer name. Replaced all "Item" with this constant.
10107         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10108
10109         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10110         DefaultMemberAttribute constructor.
10111
10112 2004-08-05  Martin Baulig  <martin@ximian.com>
10113
10114         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10115         Fix bug #59429.
10116
10117 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10118
10119         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10120         multi platforms problem.
10121
10122         * compiler.csproj: Included shared files.
10123
10124 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10125
10126         Fix bug 60333, 55971 in the more general way
10127         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10128         Added arg_type argument for constant conversion.
10129         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10130
10131 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10132
10133         Fix bug #59760
10134         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10135         OperatorArrayList, MethodCoreArrayList for typecontainer
10136         containers. Changed class member types to these new types.
10137         (MethodArrayList.DefineMembers): Added test for CS0659.
10138
10139 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10140
10141         * cfold.cs: Synchronize the folding with the code in expression.cs
10142         Binary.DoNumericPromotions for uint operands.
10143
10144         * attribute.cs: Revert patch from Raja, it introduced a regression
10145         while building Blam-1.2.1 (hard to isolate a test case).
10146
10147 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10148
10149         Fix for #55382
10150         * class.cs:
10151         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10152         name collision.
10153         (MethodCore.parent_method): New member. The method we're overriding
10154         if this is an override method.
10155         (MethodCore.CheckBase): Moved from Method class and made common.
10156         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10157         private.
10158         (MethodCore.CheckForDuplications): New abstract method. For custom
10159         member duplication search in a container
10160         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10161         method and its return type.
10162         (Event.conflict_symbol): New member. Symbol with same name in the
10163         parent class.
10164
10165         * decl.cs:
10166         (MemberCache.FindMemberWithSameName): New method. The method
10167         is looking for conflict with inherited symbols.
10168
10169 2004-08-04  Martin Baulig  <martin@ximian.com>
10170
10171         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10172
10173         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10174
10175 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10176
10177         * report.cs (Message): New enum for better error, warning reference in
10178         the code.
10179         (MessageData): New inner abstract class. It generally handles printing of
10180         error and warning messages.
10181         Removed unused Error, Warning, Message methods.
10182
10183 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10184
10185         Fix for cs0592-8.cs test
10186         * attribute.cs
10187         (Attributable.ValidAttributeTargets): Made public.
10188         (Attribute.ExplicitTarget): New member for explicit target value.
10189         (Attribute.CheckTargets): Now we translate explicit attribute
10190         target to Target here.
10191
10192 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10193
10194         * ecore.cs (MethodGroupExpr): new IsBase property.
10195
10196         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10197
10198         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10199         rather than an instance expr.
10200
10201         (DelegateCreation.Emit): Use the method group rather than
10202         the instance expression. Also, if you have base.Foo as the
10203         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10204
10205         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10206
10207         (NewDelegate.DoResolve): Only check for the existance of Invoke
10208         if the method is going to be needed. Use MethodGroupExpr.
10209
10210         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10211
10212         * expression.cs: For pointer arith., make sure to use
10213         the size of the type, not the size of the pointer to
10214         the type.
10215
10216 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10217
10218         Fix for #60722
10219         * class.cs (Class): Added error CS0502 test.
10220
10221 2004-08-03  John Luke  <jluke@cfl.rr.com>
10222             Raja R Harinath  <rharinath@novell.com>
10223
10224         Fix for #60997.
10225         * attribute.cs (Attribute.complained_before): New flag.
10226         (Attribute.ResolveType, Attribute.Resolve),
10227         (Attribute.DefinePInvokeMethod): Set it.
10228         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10229         
10230 2004-08-03  Martin Baulig  <martin@ximian.com>
10231
10232         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10233         use a user-defined operator; we still need to do numeric
10234         promotions in case one argument is a builtin type and the other
10235         one has an implicit conversion to that type.  Fixes #62322.
10236
10237 2004-08-02  Martin Baulig  <martin@ximian.com>
10238
10239         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10240         (LocalInfo.IsThis): New public property.
10241         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10242
10243 2004-08-01  Martin Baulig  <martin@ximian.com>
10244
10245         * class.cs (TypeContainer.GetClassBases): Don't set the default
10246         here since we may get called from GetPartialBases().
10247         (TypeContainer.DefineType): If GetClassBases() didn't return a
10248         parent, use the default one.
10249
10250 2004-07-30  Duncan Mak  <duncan@ximian.com>
10251
10252         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10253
10254 2004-07-30  Martin Baulig  <martin@ximian.com>
10255
10256         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10257
10258         * class.cs (SourceMethod): New public class, derive from the
10259         symbol writer's ISourceMethod.
10260         (Method): Use the new symbol writer API.
10261
10262         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10263         as argument and use the new symbol writer.
10264
10265         * location.cs
10266         (SourceFile): Implement the symbol writer's ISourceFile.
10267         (Location.SymbolDocument): Removed.
10268         (Location.SourceFile): New public property.
10269
10270         * symbolwriter.cs: Use the new symbol writer API.
10271
10272 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10273
10274         * Makefile (install-local): Remove.  Functionality moved to
10275         executable.make.
10276
10277 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10278
10279         * Makefile: Install mcs.exe.config file together with mcs.exe.
10280         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10281         correct runtime version.
10282         
10283 2004-07-25  Martin Baulig  <martin@ximian.com>
10284
10285         * class.cs
10286         (TypeContainer.RegisterOrder): Removed, this was unused.
10287         (TypeContainer, interface_order): Removed.
10288         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10289         TypeContainer as argument since we can also be called with a
10290         `PartialContainer' for a partial class/struct/interface.
10291         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10292         of checking whether we're an `Interface' - we could be a
10293         `PartialContainer'.
10294         (PartialContainer.Register): Override; call
10295         AddClass()/AddStruct()/AddInterface() on our parent.
10296
10297         * cs-parser.jay (interface_member_declaration): Add things to the
10298         `current_container', not the `current_class'.
10299
10300         * rootcontext.cs (RegisterOrder): The overloaded version which
10301         takes an `Interface' was unused, removed.
10302
10303         * typemanager.cs (TypeManager.LookupInterface): Return a
10304         `TypeContainer', not an `Interface'.
10305         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10306         contain a `PartialContainer' for an interface, so check it's
10307         `Kind' to figure out what it is.
10308
10309 2004-07-25  Martin Baulig  <martin@ximian.com>
10310
10311         * class.cs (Class.DefaultTypeAttributes): New public constant.
10312         (Struct.DefaultTypeAttributes): Likewise.
10313         (Interface.DefaultTypeAttributes): Likewise.
10314         (PartialContainer.TypeAttr): Override this and add the
10315         DefaultTypeAttributes.
10316
10317 2004-07-25  Martin Baulig  <martin@ximian.com>
10318
10319         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10320         we can just use the `Parent' field instead.
10321
10322 2004-07-25  Martin Baulig  <martin@ximian.com>
10323
10324         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10325
10326 2004-07-25  Martin Baulig  <martin@ximian.com>
10327
10328         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10329         our parts before defining any methods.
10330         (TypeContainer.VerifyImplements): Make this virtual.
10331         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10332         on our PartialContainer.
10333
10334 2004-07-25  Martin Baulig  <martin@ximian.com>
10335
10336         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10337
10338         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10339         argument, we can just use the `Parent' field instead.
10340
10341         * class.cs
10342         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10343         (MemberBase.DoDefine): Likewise.
10344
10345 2004-07-24  Martin Baulig  <martin@ximian.com>
10346
10347         * decl.cs (MemberCore.Parent): New public field.
10348         (DeclSpace.Parent): Moved to MemberCore.
10349
10350         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10351         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10352         parent's .ctor.
10353         (FieldBase, Field, Operator): Likewise.
10354         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10355         (EventField, Event): Likewise.
10356
10357 2004-07-23  Martin Baulig  <martin@ximian.com>
10358
10359         * class.cs (PartialContainer): New public class.
10360         (ClassPart): New public class.
10361         (TypeContainer): Added support for partial classes.
10362         (TypeContainer.GetClassBases): Splitted some of the functionality
10363         out into GetNormalBases() and GetPartialBases().
10364
10365         * cs-tokenizer.cs (Token.PARTIAL): New token.
10366         (Tokenizer.consume_identifier): Added some hacks to recognize
10367         `partial', but only if it's immediately followed by `class',
10368         `struct' or `interface'.
10369
10370         * cs-parser.jay: Added support for partial clases.
10371
10372 2004-07-23  Martin Baulig  <martin@ximian.com>
10373
10374         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10375         a `DeclSpace' and also made it readonly.
10376         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10377         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10378         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10379
10380         * cs-parser.jay: Pass the `current_class', not the
10381         `current_container' (at the moment, this is still the same thing)
10382         to a new Method, Property, Event, Indexer or Constructor.
10383
10384 2004-07-23  Martin Baulig  <martin@ximian.com>
10385
10386         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10387         and removed the `current_interface' one.
10388         (struct_declaration, class_declaration, interface_declaration):
10389         Set `current_class' to the newly created class/struct/interface;
10390         set their `Bases' and call Register() before parsing their body.
10391
10392 2004-07-23  Martin Baulig  <martin@ximian.com>
10393
10394         * class.cs (Kind): New public enum.
10395         (TypeContainer): Made this class abstract.
10396         (TypeContainer.Kind): New public readonly field.
10397         (TypeContainer.CheckDef): New public method; moved here from
10398         cs-parser.jay.
10399         (TypeContainer.Register): New public abstract method.
10400         (TypeContainer.GetPendingImplementations): New public abstract
10401         method.
10402         (TypeContainer.GetClassBases): Removed the `is_class' and
10403         `is_iface' parameters.
10404         (TypeContainer.DefineNestedTypes): Formerly known as
10405         DoDefineType().
10406         (ClassOrStruct): Made this class abstract.
10407
10408         * tree.cs (RootTypes): New public type. 
10409
10410 2004-07-20  Martin Baulig  <martin@ximian.com>
10411
10412         * tree.cs (Tree.RecordNamespace): Removed.
10413         (Tree.Namespaces): Removed.
10414
10415         * rootcontext.cs (RootContext.IsNamespace): Removed.
10416
10417         * cs-parser.jay (namespace_declaration): Just create a new
10418         NamespaceEntry here.
10419
10420 2004-07-20  Martin Baulig  <martin@ximian.com>
10421
10422         * statement.cs (ExceptionStatement): New abstract class.  This is
10423         now used as a base class for everyone who's using `finally'.
10424         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10425         our local variables before using them.
10426
10427         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10428         virtual method.  This is used by Yield.Resolve() to "steal" an
10429         outer block's `finally' clauses.
10430         (FlowBranchingException): The .ctor now takes an ExceptionStatement
10431         argument.
10432
10433         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10434         version which takes an ExceptionStatement.  This version must be
10435         used to create exception branchings.
10436
10437         * iterator.cs
10438         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10439         (Iterator.EmitMoveNext): Added exception support; protect the
10440         block with a `fault' clause, properly handle 'finally' clauses.
10441         (Iterator.EmitDispose): Run all the `finally' clauses here.
10442
10443 2004-07-20  Martin Baulig  <martin@ximian.com>
10444
10445         * iterator.cs: This is the first of a set of changes in the
10446         iterator code.  Match the spec more closely: if we're an
10447         IEnumerable, then GetEnumerator() must be called.  The first time
10448         GetEnumerator() is called, it returns the current instance; all
10449         subsequent invocations (if any) must create a copy.
10450
10451 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * expression.cs: Resolve the constant expression before returning
10454         it. 
10455
10456 2004-07-19  Martin Baulig  <martin@ximian.com>
10457
10458         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10459         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10460         the return type of the new EmitContext.
10461
10462 2004-07-18  Martin Baulig  <martin@ximian.com>
10463
10464         * class.cs (Property.Define): Fix iterators.
10465
10466         * iterators.cs (Iterator.Define): Moved the
10467         `container.AddInterator (this)' call here from the .ctor; only do
10468         it if we resolved successfully.
10469
10470 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
10471
10472         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10473         `true' for preprocessing directives that we parse.  The return
10474         value indicates whether we should return to regular tokenizing or
10475         not, not whether it was parsed successfully.
10476
10477         In the past if we were in: #if false ... #line #endif, we would
10478         resume parsing after `#line'.  See bug 61604.
10479
10480         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10481         building: IsEnumType should return true only for enums, not for
10482         enums or System.Enum itself.  This fixes #61593.
10483
10484         Likely what happened is that corlib was wrong: mcs depended on
10485         this bug in some places.  The bug got fixed, we had to add the
10486         hack, which caused bug 61593.
10487
10488         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10489         that was a workaround for the older conditions.
10490
10491 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
10492
10493         * assign.cs: IAssignMethod has a new interface, as documented
10494         inline. All assignment code now uses this new api.
10495
10496         * ecore.cs, expression.cs: All classes which implement
10497         IAssignMethod now use the new interface.
10498
10499         * expression.cs (Invocation): add a hack to EmitCall so that
10500         IndexerAccess can be the target of a compound assignment without
10501         evaluating its arguments twice.
10502
10503         * statement.cs: Handle changes in Invocation api.
10504
10505 2004-07-16  Martin Baulig  <martin@ximian.com>
10506
10507         * iterators.cs: Rewrote this.  We're now using one single Proxy
10508         class for both the IEnumerable and the IEnumerator interface and
10509         `Iterator' derives from Class so we can use the high-level API.
10510
10511         * class.cs (TypeContainer.AddIterator): New method.
10512         (TypeContainer.DoDefineType): New protected virtual method, which
10513         is called from DefineType().
10514         (TypeContainer.DoDefineMembers): Call DefineType() and
10515         DefineMembers() on all our iterators.
10516         (TypeContainer.Emit): Call Emit() on all our iterators.
10517         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10518
10519         * codegen.cs (EmitContext.CurrentIterator): New public field.
10520
10521 2004-07-15  Martin Baulig  <martin@ximian.com>
10522
10523         * typemanager.cs
10524         (TypeManager.not_supported_exception_type): New type.   
10525
10526 2004-07-14  Martin Baulig  <martin@ximian.com>
10527
10528         * iterators.cs: Use real error numbers.
10529
10530 2004-07-14  Martin Baulig  <martin@ximian.com>
10531
10532         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10533         requires this to be a System.Collection.IEnumerable and not a
10534         class implementing that interface.
10535         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10536
10537 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10538
10539         * class.cs: Fixed previous fix, it broke some error tests.
10540
10541 2004-07-12  Martin Baulig  <martin@ximian.com>
10542
10543         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10544         Fixes #61293.
10545
10546 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * assign.cs (LocalTemporary): Add new argument: is_address,If
10549         `is_address' is true, then the value that we store is the address
10550         to the real value, and not the value itself.
10551         
10552         * ecore.cs (PropertyExpr): use the new local temporary
10553         stuff to allow us to handle X.Y += z (where X is a struct)
10554
10555 2004-07-08  Martin Baulig  <martin@ximian.com>
10556
10557         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10558         not always return, just like we're doing in Using.Resolve().
10559
10560 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * cs-parser.jay (fixed_statement): flag this as Pinned.
10563
10564 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10565
10566         * typemanager.cs (TypeManager): Removed MakePinned method, this
10567         mechanism is replaced with the .NET 2.x compatible mechanism of
10568         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10569
10570         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10571         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10572         `IsFixed' property which has a different meaning.
10573
10574 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10575
10576         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10577         visible from inside a nested class, not just the names of the
10578         immediately enclosing class.
10579         Fix for bug #60730.
10580
10581 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10582
10583         * expression.cs (BetterConversion): Remove buggy special-case
10584         handling of "implicit constant expression conversions".  At this
10585         point, we already know that the conversion is possible -- we're
10586         only checking to see which is better.
10587
10588 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10589
10590         * cs-parser.jay: Added error CS0210 test.
10591
10592 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10593
10594         * cs-parser.jay: Added error CS0134 test.
10595
10596 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10597
10598         Fix bug #52507
10599         * cs-parser.jay: Added error CS0145 test.
10600
10601 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10602
10603         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10604
10605 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10606         
10607         * expression.cs (StackAlloc.Resolve): The argument may not
10608         be a constant; deal with this case.
10609         
10610 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10611
10612         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10613         GetIndexerAttributeValue.
10614         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10615
10616         * class.cs (Indexer.Define): Added error tests for CS0415,
10617         CS0609.
10618
10619 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10622         property code.
10623
10624 2004-06-23  Martin Baulig  <martin@ximian.com>
10625
10626         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10627         neither return nor throw, reset the barrier as well.  Fixes #60457.
10628
10629 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10630
10631         * class.cs : EventAttributes is now set to None by default.
10632           This fixes bug #60459.
10633
10634 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10635
10636         Fix bug #60219
10637         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10638         Don't throw exception but return null (it's sufficient now).
10639
10640 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10641
10642         * typemanager.cs (GetArgumentTypes): Faster implementation.
10643
10644 2004-06-18  Martin Baulig  <martin@ximian.com>
10645
10646         * attribute.cs (Attribute.Resolve): Check whether we're an
10647         EmptyCast which a Constant child.  Fixes #60333.
10648
10649 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10650
10651         * statement.cs (EmitCollectionForeach): Account for the fact that
10652         not all valuetypes are in areas which we can take the address of.
10653         For these variables, we store to a temporary variable. Also, make
10654         sure that we dont emit a `callvirt' on a valuetype method.
10655
10656 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10657
10658         * expression.cs (StackAlloc.DoReSolve): Added test for
10659         negative parameter (CS0247).
10660
10661 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10662
10663         Fix bug #59792
10664         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10665
10666 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10667
10668         Fix bug #59781
10669         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10670         ulong.
10671
10672 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10673
10674         Fix bug #58254 & cs1555.cs, cs1556.cs
10675         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10676
10677 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10678
10679         * cs-parser.jay: Added error CS1669 test for indexers.
10680
10681 2004-06-11  Martin Baulig  <martin@ximian.com>
10682
10683         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10684         call this twice: for params and varargs methods.
10685
10686 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10687
10688         * class.cs:
10689         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10690
10691 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10692
10693         * attribute.cs (Attribute.GetValidTargets): Made public.
10694
10695         * class.cs: 
10696         (AbstractPropertyEventMethod): New class for better code sharing.
10697         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10698         CS1667 report.
10699         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10700
10701 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10702
10703         Fix bug #59477.
10704         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10705         that the call to Resolve is part of a MemberAccess.
10706         (Expression.Resolve): Use it for SimpleName resolution.
10707         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10708         Add 'intermediate' boolean argument.
10709         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10710         error message when the SimpleName can be resolved ambiguously
10711         between an expression and a type.
10712         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10713         public.
10714         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10715         call on the left-side.
10716
10717 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10718
10719         * class.cs:
10720         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10721
10722 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10723
10724         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10725
10726 2004-06-11  Martin Baulig  <martin@ximian.com>
10727
10728         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10729         varargs methods if applicable.
10730
10731 2004-06-11  Martin Baulig  <martin@ximian.com>
10732
10733         * expression.cs (Invocation.EmitCall): Don't use
10734         `method.CallingConvention == CallingConventions.VarArgs' since the
10735         method could also have `CallingConventions.HasThis'.
10736
10737 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10738
10739         * class.cs (Event.GetSignatureForError): Implemented.
10740         Fixed crash in error test cs3010.cs
10741
10742 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
10743
10744         * cs-tokenizer.cs: Change the way we track __arglist to be
10745         consistent with the other keywords.
10746
10747 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
10748
10749         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10750         tomorrow.
10751
10752 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
10753
10754         * codegen.cs: Check that all referenced assemblies have a strongname
10755         before strongnaming the compiled assembly. If not report error CS1577.
10756         Fix bug #56563. Patch by Jackson Harper.
10757         * typemanager.cs: Added a method to return all referenced assemblies.
10758         Fix bug #56563. Patch by Jackson Harper.
10759
10760 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10761
10762         * class.cs:
10763         (Method.ApplyAttributeBuilder): Moved and added conditional
10764         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10765
10766         * delegate.cs:
10767         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10768
10769 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10770
10771         Fixed #59640
10772         * class.cs: (EventField.attribute_targets): Changed default target.
10773
10774 2004-06-08  Martin Baulig  <martin@ximian.com>
10775
10776         * expression.cs (Invocation.EmitCall): Enable varargs methods.
10777
10778 2004-06-08  Martin Baulig  <martin@ximian.com>
10779
10780         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10781
10782 2004-06-07  Martin Baulig  <martin@ximian.com>
10783
10784         Added support for varargs methods.
10785
10786         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10787         keyword.
10788
10789         * cs-parser.jay: Added support for `__arglist'.
10790
10791         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10792
10793         * expression.cs (Argument.AType): Added `ArgList'.
10794         (Invocation): Added support for varargs methods.
10795         (ArglistAccess): New public class.
10796         (Arglist): New public class.
10797
10798         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10799
10800         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
10801         a method's top-level block if the method has varargs.
10802
10803         * support.cs (ReflectionParameters, InternalParameters): Added
10804         support for varargs methods.    
10805
10806 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
10807
10808         * class.cs: Provide location in indexer error report.
10809
10810         * driver.cs: Use standard names.
10811
10812         * namespace.cs: Catch the use of using after a namespace has been
10813         declared also on using aliases.
10814
10815 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10816
10817         Bug #50820.
10818         * typemanager.cs (closure_private_ok, closure_invocation_type)
10819         (closure_qualifier_type, closure_invocation_assembly)
10820         (FilterWithClosure): Move to ...
10821         (Closure): New internal nested class.
10822         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10823         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10824         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10825         (MemberLookup, MemberLookupFailed): Use it.
10826         * expression.cs (New.DoResolve): Treat the lookup for the
10827         constructor as being qualified by the 'new'ed type.
10828         (Indexers.GetIndexersForTypeOrInterface): Update.
10829
10830 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10831
10832         * attribute.cs
10833         (GetConditionalAttributeValue): New method. Returns
10834         condition of ConditionalAttribute.
10835         (SearchMulti): New method.  Returns all attributes of type 't'.
10836         Use it when attribute is AllowMultiple = true.
10837         (IsConditionalMethodExcluded): New method.
10838
10839         * class.cs
10840         (Method.IsExcluded): Implemented. Returns true if method has conditional
10841         attribute and the conditions is not defined (method is excluded).
10842         (IMethodData): Extended interface for ConditionalAttribute support.
10843         (PropertyMethod.IsExcluded): Implemented.
10844
10845         * decl.cs
10846         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10847
10848         * expression.cs
10849         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10850         on the method.
10851
10852 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10853
10854         * expression.cs (ArrayCreationExpression): Make this just an
10855         `expression'. It can't be a statement, so the code here was
10856         dead.
10857
10858 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10859
10860         Fixed #59072
10861         * typemanager.cs (GetFullNameSignature): New method for
10862         MethodBase types.
10863
10864 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10865
10866         Fixed #56452
10867         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10868         Use this method when MethodBuilder is null.
10869         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10870         Added test for error CS0626 (MONO reports error for this situation).
10871         (IMethodData.GetSignatureForError): Extended interface.
10872
10873 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10874
10875         * attribute.cs
10876         (AttributeTester.GetObsoleteAttribute): Returns instance of
10877         ObsoleteAttribute when type is obsolete.
10878
10879         * class.cs
10880         (TypeContainer.VerifyObsoleteAttribute): Override.
10881         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10882         (MethodCode.VerifyObsoleteAttribute): Override.
10883         (MemberBase.VerifyObsoleteAttribute): Override.
10884
10885         * decl.cs
10886         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10887         and report proper error.
10888
10889         *delegate.cs
10890         Delegate.VerifyObsoleteAttribute): Override.
10891
10892         * ecore.cs
10893         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10894         and report proper error.
10895         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10896
10897         * enum.cs
10898         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10899         and enum member.
10900
10901         * expression.cs
10902         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10903         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10904         Added test for ObsoleteAttribute.
10905
10906         * statement.cs
10907         (Catch): Derived from Statement.
10908
10909 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10910  
10911         Fixed bug #59071 & cs0160.cs
10912  
10913         * statement.cs (Try.Resolve): Check here whether order of catch
10914         clauses matches their dependencies.
10915
10916 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10919         caused a regression: #59343.  Referencing nested classes from an
10920         assembly stopped working.
10921
10922 2004-05-31  Martin Baulig  <martin@ximian.com>
10923
10924         MCS is now frozen for beta 2.
10925
10926 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10927
10928         * convert.cs: add a trivial cache for overload operator resolution.
10929
10930 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10931
10932         * decl.cs: If possible, use lookuptypedirect here. We can only do
10933         this if there is no `.' after the namespace. Avoids using
10934         LookupType, which does lots of slow processing.
10935         (FindNestedType) New method, does what it says :-).
10936         * namespace.cs: use LookupTypeDirect.
10937         * rootcontext.cs: use membercache, if possible.
10938         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10939
10940 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10941
10942         * expression.cs:
10943         According to the spec, 
10944
10945         In a member access of the form E.I, if E is a single identifier,
10946         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10947         field, property, localvariable, or parameter with the same type as
10948         the meaning of E as a type-name (§3.8), then both possible
10949         meanings of E are permitted.
10950
10951         We did not check that E as a simple-name had the same type as E as
10952         a type name.
10953
10954         This trivial check gives us 5-7% on bootstrap time.
10955
10956 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10957
10958         * expression.cs (Invocation.OverloadResolve): Avoid the
10959         use of hashtables and boxing here by allocating on demand.
10960
10961 2004-05-30  Martin Baulig  <martin@ximian.com>
10962
10963         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10964         we're doing a silent lookup.  Don't try to lookup nested types in
10965         TypeManager.object_type (thanks to Ben Maurer).
10966
10967 2004-05-30  Martin Baulig  <martin@ximian.com>
10968
10969         Committing a patch from Ben Maurer.
10970
10971         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10972
10973 2004-05-29  Martin Baulig  <martin@ximian.com>
10974
10975         * class.cs (IMethodData.ShouldIgnore): New method.
10976
10977         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10978         `Location' argument, we don't need it anywhere.  Use
10979         `IMethodData.ShouldIgnore ()' instead of
10980         `MethodData.GetMethodFlags ()'.
10981         (TypeManager.AddMethod): Removed.
10982         (TypeManager.AddMethod2): Renamed to AddMethod.
10983
10984 2004-05-29  Martin Baulig  <martin@ximian.com>
10985
10986         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10987
10988         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10989         converting from a class type S to an interface type and we already
10990         have an object on the stack, don't box it again.  Fixes #52578.
10991
10992 2004-05-29  Martin Baulig  <martin@ximian.com>
10993
10994         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10995         Added support for `params' parameters.  Fixes #59267.
10996
10997 2004-05-29  Martin Baulig  <martin@ximian.com>
10998
10999         * literal.cs (NullPointer): Provide a private .ctor which sets
11000         `type' to TypeManager.object_type.  Fixes #59048.
11001
11002 2004-05-29  Martin Baulig  <martin@ximian.com>
11003
11004         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11005         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11006
11007         * ecore.cs (EventExpr.instance_expr): Make the field private.
11008
11009 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11010
11011         Fixed bug #50080 & cs0214-2.cs
11012         * expression.cs (Cast.DoResolve): Check unsafe context here.
11013         
11014         * statement.cs (Resolve.DoResolve): Likewise.
11015
11016 2004-05-26  Martin Baulig  <martin@ximian.com>
11017
11018         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11019
11020         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11021         (RootContext.LookupType): Pass down the `silent' flag.
11022
11023 2004-05-25  Martin Baulig  <martin@ximian.com>
11024
11025         * expression.cs
11026         (MethodGroupExpr.IdenticalTypeName): New public property.
11027         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11028         expression actually refers to a type.
11029
11030 2004-05-25  Martin Baulig  <martin@ximian.com>
11031
11032         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11033         for #56176 and made it actually work.
11034
11035 2004-05-25  Martin Baulig  <martin@ximian.com>
11036
11037         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11038         (FieldExpr, PropertyExpr): Override and implement
11039         CacheTemporaries.  Fixes #52279.
11040
11041 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11042
11043         * location.cs: In the new compiler listing a file twice is a
11044         warning, not an error.
11045
11046 2004-05-24  Martin Baulig  <martin@ximian.com>
11047
11048         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11049         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11050
11051 2004-05-24  Martin Baulig  <martin@ximian.com>
11052
11053         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11054         walking the `using' list.  Fixes #53921.
11055
11056 2004-05-24  Martin Baulig  <martin@ximian.com>
11057
11058         * const.cs (Const.LookupConstantValue): Added support for
11059         EmptyCast's; fixes #55251.
11060
11061 2004-05-24  Martin Baulig  <martin@ximian.com>
11062
11063         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11064         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11065         which does the CS0135 check.  The reason is that we first need to
11066         check whether the variable actually exists.
11067
11068 2004-05-24  Martin Baulig  <martin@ximian.com>
11069
11070         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11071         than RootContext.LookupType() to find the explicit interface
11072         type.  Fixes #58584.
11073
11074 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11075
11076         * Makefile: Simplify.  Use executable.make.
11077         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11078
11079 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11080
11081         * decl.cs:
11082         * enum.cs:
11083         Use the invariant culture when doing String.Compare for CLS case
11084         sensitivity.
11085         
11086 2004-05-23  Martin Baulig  <martin@ximian.com>
11087
11088         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11089         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11090
11091         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11092         
11093 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11094
11095         * class.cs (MemberBase.Define): Reuse MemberType member for 
11096         resolved type. Other methods can use it too.
11097
11098 2004-05-23  Martin Baulig  <martin@ximian.com>
11099
11100         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11101         the variable also exists in the current block (otherwise, we need
11102         to report a CS0103).  Fixes #58670.
11103
11104 2004-05-23  Martin Baulig  <martin@ximian.com>
11105
11106         * flowanalysis.cs (Reachability.Reachable): Compute this
11107         on-the-fly rather than storing it as a field.
11108
11109 2004-05-23  Martin Baulig  <martin@ximian.com>
11110
11111         * flowanalysis.cs (Reachability.And): Manually compute the
11112         resulting `barrier' from the reachability.      
11113        
11114 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11115
11116         Fix bug #57835
11117         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11118         instance of ObsoleteAttribute when symbol is obsolete.
11119
11120         * class.cs
11121         (IMethodData): Extended interface for ObsoleteAttribute support.
11122
11123 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11124
11125         * attribute.cs: Fix bug #55970
11126
11127 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11128
11129         Fix bug #52705
11130         * attribute.cs
11131         (GetObsoleteAttribute): New method. Creates the instance of
11132         ObsoleteAttribute.
11133         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11134         ObsoleteAttribute when member is obsolete.
11135         (AttributeTester.Report_ObsoleteMessage): Common method for
11136         Obsolete error/warning reporting.
11137
11138         * class.cs
11139         (TypeContainer.base_classs_type): New member for storing parent type.
11140
11141         * decl.cs
11142         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11143         for this MemberCore.
11144
11145 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11146
11147         * attribute.cs, const.cs: Fix bug #58590
11148
11149 2004-05-21  Martin Baulig  <martin@ximian.com>
11150
11151         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11152         out parameters if the end of the method is unreachable.  Fixes
11153         #58098. 
11154
11155 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11156
11157         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11158         Hari was right, why extra method.
11159
11160 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11161
11162         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11163
11164 2004-05-20  Martin Baulig  <martin@ximian.com>
11165
11166         Merged this back from gmcs to keep the differences to a minumum.
11167
11168         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11169         instead of a Declspace.
11170         (Attribute.ResolveType): Likewise.
11171         (Attributes.Search): Likewise.
11172         (Attributes.Contains): Likewise.
11173         (Attributes.GetClsCompliantAttribute): Likewise.
11174
11175         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11176         argument.
11177         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11178         DeclSpace.
11179
11180 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11181
11182         Fix bug #58688 (MCS does not report error when the same attribute
11183         is assigned twice)
11184
11185         * attribute.cs (Attribute.Emit): Distinction between null and default.
11186
11187 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11188
11189         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11190         of a top-level attribute without an attribute target.
11191         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11192         Make non-static.
11193         (Attribute.Conditional_GetConditionName), 
11194         (Attribute.Obsolete_GetObsoleteMessage): Update.
11195         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11196         part of ScanForIndexerName.
11197         (Attribute.CanIgnoreInvalidAttribute): New function.
11198         (Attribute.ScanForIndexerName): Move to ...
11199         (Attributes.ScanForIndexerName): ... here.
11200         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11201         (Attributes.Search): New internal variant that can choose not to
11202         complain if types aren't resolved.  The original signature now
11203         complains.
11204         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11205         complaints suppressed.
11206         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11207         only if it not useful.
11208         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11209         top-level for attributes that are shared between the assembly
11210         and a top-level class.
11211         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11212         * class.cs: Update to reflect changes.
11213         (DefineIndexers): Fuse loops.
11214         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11215         a couple more variants of attribute names.
11216
11217 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11218
11219         Fix bug #52585 (Implemented explicit attribute declaration)
11220
11221         * attribute.cs:
11222         (Attributable.ValidAttributeTargets): New abstract method. It gets
11223         list of valid attribute targets for explicit target declaration.
11224         (Attribute.Target): It holds target itself.
11225         (AttributeSection): Removed.
11226         (Attribute.CheckTargets): New method. It checks whether attribute
11227         target is valid for the current element.
11228
11229         * class.cs:
11230         (EventProperty): New class. For events that are declared like
11231         property (with add and remove accessors).
11232         (EventField): New class. For events that are declared like field.
11233         class.cs
11234
11235         * cs-parser.jay: Implemented explicit attribute target declaration.
11236
11237         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11238         Override ValidAttributeTargets.
11239
11240         * parameter.cs:
11241         (ReturnParameter): Class for applying custom attributes on 
11242         the return type.
11243         (ParameterAtribute): New class. Class for applying custom
11244         attributes on the parameter type.
11245
11246 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11247
11248         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11249         definitions. 
11250
11251         (Method): Allow UNSAFE here.
11252
11253         * modifiers.cs: Support unsafe reporting.
11254
11255 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11256
11257         * decl.cs: Fix bug #58478.
11258
11259 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11260
11261         * statement.cs: When checking for unreachable code on an EmptyStatement,
11262         set the location. Fixes bug #58488.
11263
11264 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * driver.cs: Add -pkg handling.
11267
11268         From Gonzalo: UseShelLExecute=false
11269
11270 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11271
11272         * attribute.cs:
11273         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11274         for attribute.
11275         (Attribute.IsClsCompliaceRequired): Moved to base for better
11276         accesibility.
11277         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11278         when attribute is AttributeUsageAttribute.
11279         (Attribute.GetValidTargets): Simplified.
11280         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11281         attribute for this type.
11282         (Attribute.ApplyAttributes): Method renamed to Emit and make
11283         non-static.
11284         (GlobalAttributeSection): New class for special handling of global
11285         attributes (assembly, module).
11286         (AttributeSection.Emit): New method.
11287
11288         * class.cs: Implemented Attributable abstract methods.
11289         (MethodCore.LabelParameters): Moved to Parameter class.
11290         (Accessor): Is back simple class.
11291         (PropertyMethod): Implemented Attributable abstract class.
11292         (DelegateMethod): Implemented Attributable abstract class.
11293         (Event): New constructor for disctintion between normal Event
11294         and Event with accessors.
11295
11296         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11297
11298         * codegen.cs, const.cs, decl.cs, delegate.cs:
11299         (CommonAssemblyModulClass): Implemented Attributable abstract class
11300         and simplified.
11301
11302         * enum.cs: Implement IAttributeSupport interface.
11303         (EnumMember): New class for emum members. Implemented Attributable
11304         abstract class
11305
11306         * parameter.cs:
11307         (ParameterBase): Is abstract.
11308         (ReturnParameter): New class for easier [return:] attribute handling.
11309
11310         * typemanager.cs: Removed builder_to_attr.
11311
11312 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11313
11314         Fix bug #57151.
11315         * attribute.cs (Attribute.GetPositionalValue): New function.
11316         * class.cs (TypeContainer.VerifyMembers): New function.
11317         (TypeContainer.Emit): Use it.
11318         (ClassOrStruct): New base class for Class and Struct.
11319         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11320         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11321         class.
11322         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11323         then each non-static field should have a FieldOffset attribute.
11324         Otherwise, none of the fields should have a FieldOffset attribute.
11325         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11326         and FieldOffset attributes.
11327         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11328         (TypeManager.field_offset_attribute_type): New core types.
11329         (TypeManager.InitCoreTypes): Initialize them.
11330
11331 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11332
11333         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11334         Return correct type.
11335         From bug #58270.
11336
11337 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11338
11339         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11340         be implicitly converted to ulong.
11341         
11342         * expression.cs: The logic for allowing operator &, | and ^ worked
11343         was wrong, it worked before because we did not report an error in
11344         an else branch.  Fixes 57895.
11345
11346         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11347         allow volatile fields to be reference types.
11348
11349 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11350
11351         * driver.cs: Add support for /debug-
11352
11353 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11354
11355         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11356         Add a 'complain' parameter to silence errors.
11357         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11358         silently overlooked type-resolutions.
11359         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11360         to reflect changes.
11361         (Attributes.Search): New function.
11362         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11363         (Attributes.GetAttributeFullName): Remove hack.
11364         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11365         Update to reflect changes.
11366         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11367         Use Attributes.Search instead of nested loops.
11368
11369 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11370
11371         * decl.cs:
11372         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11373         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11374         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11375
11376         * report.cs: (Report.Warning): Renamed to Warning_T because of
11377         parameter collision.
11378
11379 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11380
11381         * expression.cs (MemberAccess.ResolveMemberAccess):
11382         Exit with non-zero status after Report.Error.
11383         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11384         Likewise.
11385         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11386
11387 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11388
11389         * support.cs: Don't hang when the file is empty.
11390
11391 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11392
11393         * support.cs: In SeekableStreamReader, compute the preamble size of the
11394           underlying stream. Position changes should take into account that initial
11395           count of bytes.
11396
11397 2004-05-03  Todd Berman  <tberman@sevenl.net>
11398
11399         * driver.cs: remove unused GetSysVersion function.
11400
11401 2004-05-03  Todd Berman  <tberman@sevenl.net>
11402
11403         * driver.cs: Remove the hack from saturday, as well as the hack
11404         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11405         link_paths to get that bit proper.
11406
11407 2004-05-01  Todd Berman  <tberman@sevenl.net>
11408
11409         * driver.cs: Try a LoadFrom before a Load, this checks the current
11410         path. This is currently a bug in mono that is be fixed, however, this
11411         provides a workaround for now. This will be removed when the bug
11412         is fixed.
11413
11414 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11415
11416         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11417         incomplete key pairs (#57941).
11418
11419 2004-05-01  Todd Berman  <tberman@sevenl.net>
11420
11421         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11422         from the GAC
11423
11424 2004-04-30  Jackson Harper  <jackson@ximian.com>
11425
11426         * codegen.cs: Open keys readonly.
11427         
11428 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11429
11430         * typemanager.cs: don't report cyclic struct layout when a struct
11431         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11432         which has 2 Pango.Rectangle fields.
11433
11434 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11435
11436         * expression.cs: Handle IntPtr comparisons with IL code
11437         rather than a method call.
11438
11439 2004-04-29  Martin Baulig  <martin@ximian.com>
11440
11441         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11442         the list of PropertyInfo's in class hierarchy and find the
11443         accessor.  Fixes #56013.
11444
11445 2004-04-29  Martin Baulig  <martin@ximian.com>
11446
11447         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11448
11449 2004-04-29  Martin Baulig  <martin@ximian.com>
11450
11451         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11452
11453         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11454
11455 2004-04-29  Martin Baulig  <martin@ximian.com>
11456
11457         * class.cs (ConstructorInitializer.Resolve): Check whether the
11458         parent .ctor is accessible.  Fixes #52146.
11459
11460 2004-04-29  Martin Baulig  <martin@ximian.com>
11461
11462         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11463
11464         * statement.cs (Using.EmitLocalVariableDecls): Use
11465         TypeManager.idisposable_type, not typeof (IDisposable).
11466         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11467
11468 2004-04-29  Martin Baulig  <martin@ximian.com>
11469
11470         * class.cs (Event.Define): Don't emit the field and don't set
11471         RTSpecialName and SpecialName for events on interfaces.  Fixes
11472         #57703. 
11473
11474 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11475
11476         Refactor Attribute.ApplyAttributes.
11477         * attribute.cs (Attributable): New base class for objects that can
11478         have Attributes applied on them.
11479         (Attribute): Make AttributeUsage fields public.
11480         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11481         (Attribute.IsInternalCall): New property.
11482         (Attribute.UsageAttr): Convert to a public read-only property.
11483         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11484         (Attribute.ResolveType, Attribute.Resolve)
11485         (Attribute.ScanForIndexerName): Update to reflect changes.
11486         (Attribute.CheckAttributeTarget): Re-format.
11487         (Attribute.ApplyAttributes): Refactor, to various
11488         Attributable.ApplyAttributeBuilder methods.
11489         * decl.cs (MemberCore): Make Attributable.
11490         * class.cs (Accessor): Make Attributable.
11491         (MethodData.ApplyAttributes): Use proper attribute types, not
11492         attribute names.
11493         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11494         (TypeContainer.ApplyAttributeBuilder)
11495         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11496         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11497         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11498         (Operator.ApplyAttributeBuilder): New factored-out methods.
11499         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11500         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11501         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11502         * parameter.cs (ParameterBase): New Attributable base class
11503         that can also represent Return types.
11504         (Parameter): Update to the changes.
11505
11506 2004-04-29  Jackson Harper  <jackson@ximian.com>
11507
11508         * driver.cs: Prefer the corlib system version when looking for
11509         assemblies in the GAC. This is still a hack, but its a better hack
11510         now.
11511         
11512 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11513
11514         * decl.cs, enum.cs: Improved error 3005 reporting.
11515   
11516         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11517         (related_symbols): New private member for list of symbols
11518         related to reported error/warning.
11519         
11520         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11521
11522 2004-04-29  Martin Baulig  <martin@ximian.com>
11523
11524         * ecore.cs (Expression.Constantify): If we're an enum and
11525         TypeManager.TypeToCoreType() doesn't give us another type, use
11526         t.UnderlyingSystemType.  Fixes #56178.  
11527
11528 2004-04-29  Martin Baulig  <martin@ximian.com>
11529
11530         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11531         interfaces and for each interface, only add members directly
11532         declared in that interface.  Fixes #53255.
11533
11534 2004-04-28  Martin Baulig  <martin@ximian.com>
11535
11536         * expression.cs (ConditionalLogicalOperator): Use a temporary
11537         variable for `left' to avoid that we evaluate it more than once;
11538         bug #52588.
11539
11540 2004-04-28  Martin Baulig  <martin@ximian.com>
11541
11542         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11543         `void[]' (CS1547).
11544
11545 2004-04-28  Martin Baulig  <martin@ximian.com>
11546
11547         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11548         void (CS1547).
11549
11550         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11551         whether the type is not void (CS1547).
11552
11553 2004-04-28  Martin Baulig  <martin@ximian.com>
11554
11555         * expression.cs (Unary.DoResolveLValue): Override this and report
11556         CS0131 for anything but Operator.Indirection.
11557
11558 2004-04-28  Martin Baulig  <martin@ximian.com>
11559
11560         Committing a patch from Ben Maurer; see bug #50820.
11561
11562         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11563         check for classes.
11564
11565         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11566         classes.        
11567
11568 2004-04-28  Martin Baulig  <martin@ximian.com>
11569
11570         Committing a patch from Ben Maurer; see bug #50820.
11571
11572         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11573         check for classes.
11574
11575         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11576         classes.        
11577
11578 2004-04-28  Martin Baulig  <martin@ximian.com>
11579
11580         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11581         (Block.AddLabel): Call DoLookupLabel() to only search in the
11582         current block.
11583
11584 2004-04-28  Martin Baulig  <martin@ximian.com>
11585
11586         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11587         comparing StringConstants and NullLiterals in Equality and Inequality.
11588
11589 2004-04-28  Jackson Harper  <jackson@ximian.com>
11590
11591         * driver.cs: Attempt to load referenced assemblies from the
11592         GAC. This is the quick and dirty version of this method that
11593         doesnt take into account versions and just takes the first
11594         canidate found. Will be good enough for now as we will not have more
11595         then one version installed into the GAC until I update this method.
11596
11597 2004-04-28  Martin Baulig  <martin@ximian.com>
11598
11599         * typemanager.cs (TypeManager.CheckStructCycles): New public
11600         static method to check for cycles in the struct layout.
11601
11602         * rootcontext.cs (RootContext.PopulateTypes): Call
11603         TypeManager.CheckStructCycles() for each TypeContainer.
11604         [Note: We only need to visit each type once.]
11605
11606 2004-04-28  Martin Baulig  <martin@ximian.com>
11607
11608         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11609
11610         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11611         success and added `out object value'.  Use a `bool resolved' field
11612         to check whether we've already been called rather than
11613         `ConstantValue != null' since this breaks for NullLiterals.
11614
11615 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11616
11617         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11618         setting of this flag, since the 'set' method may be non-public.
11619
11620 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11621
11622         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11623         check on current_vector.Block.
11624
11625 2004-04-27  Martin Baulig  <martin@ximian.com>
11626
11627         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11628         a field initializer.  Fixes #56459.
11629
11630 2004-04-27  Martin Baulig  <martin@ximian.com>
11631
11632         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11633         we're not attempting to use an indexer.  Fixes #52154.
11634
11635 2004-04-27  Martin Baulig  <martin@ximian.com>
11636
11637         * statement.cs (Return): Don't create a return label if we don't
11638         need it; reverts my change from January 20th.  Thanks to Ben
11639         Maurer for this.
11640
11641 2004-04-27  Martin Baulig  <martin@ximian.com>
11642
11643         According to the spec, `goto' can only leave a nested scope, but
11644         never enter it.
11645
11646         * statement.cs (Block.LookupLabel): Only lookup in the current
11647         block, don't recurse into parent or child blocks.
11648         (Block.AddLabel): Check in parent and child blocks, report
11649         CS0140/CS0158 if we find a duplicate.
11650         (Block): Removed this indexer for label lookups.
11651         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11652         this already does the error reporting for us.
11653
11654         * flowanalysis.cs
11655         (FlowBranching.UsageVector.Block): New public variable; may be null.
11656         (FlowBranching.CreateSibling): Added `Block' argument.
11657         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11658         label for the target of a `goto' and check whether we're not
11659         leaving a `finally'.
11660
11661 2004-04-27  Martin Baulig  <martin@ximian.com>
11662
11663         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11664         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11665         just for returns).
11666
11667 2004-04-27  Martin Baulig  <martin@ximian.com>
11668
11669         * statement.cs (Block.AddLabel): Also check for implicit blocks
11670         and added a CS0158 check.
11671
11672 2004-04-27  Martin Baulig  <martin@ximian.com>
11673
11674         * flowanalysis.cs (FlowBranchingLoop): New class.
11675         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11676         UsageVector's instead of an ArrayList.
11677         (FlowBranching.Label): Likewise.
11678         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11679         (FlowBranching.AddBreakVector): New method.
11680
11681 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * attribute.cs: Small regression fix: only convert the type if we
11684         the type is different, fixes System.Drawing build.
11685
11686 2004-04-27  Martin Baulig  <martin@ximian.com>
11687
11688         * attribute.cs (Attribute.Resolve): If we have a constant value
11689         for a named field or property, implicity convert it to the correct
11690         type.
11691
11692 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11693
11694         * statement.cs (Block.Block): Implicit blocks share
11695         'child_variable_names' fields with parent blocks.
11696         (Block.AddChildVariableNames): Remove.
11697         (Block.AddVariable): Mark variable as "used by a child block" in
11698         every surrounding block.
11699         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11700         been used in a child block, complain about violation of "Invariant
11701         meaning in blocks" rule.
11702         * cs-parser.jay (declare_local_variables): Don't use
11703         AddChildVariableNames.
11704         (foreach_statement): Don't create an implicit block: 'foreach'
11705         introduces a scope.
11706
11707 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11710         converting from 0L to ulong.  Fixes 57522.
11711
11712 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11713
11714         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11715         derived class hides via 'new' keyword field from base class (test-242.cs).
11716         TODO: Handle this in the more general way.
11717         
11718         * class.cs (CheckBase): Ditto.
11719
11720 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11721
11722         * decl.cs (caching_flags): New member for storing cached values
11723         as bit flags.
11724         (MemberCore.Flags): New enum where bit flags for caching_flags
11725         are defined.
11726         (MemberCore.cls_compliance): Moved to caching_flags.
11727         (DeclSpace.Created): Moved to caching_flags.
11728
11729         * class.cs: Use caching_flags instead of DeclSpace.Created
11730         
11731 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11732
11733         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11734         if we are only a derived class, not a nested class.
11735
11736         * typemanager.cs: Same as above, but do this at the MemberLookup
11737         level (used by field and methods, properties are handled in
11738         PropertyExpr).   Allow for the qualified access if we are a nested
11739         method. 
11740
11741 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11742
11743         * class.cs: Refactoring.
11744         (IMethodData): New inteface; Holds links to parent members
11745         to avoid member duplication (reduced memory allocation).
11746         (Method): Implemented IMethodData interface.
11747         (PropertyBase): New inner classes for get/set methods.
11748         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11749         (Event): New inner classes for add/remove methods.
11750         (Event.DelegateMethod): Implemented IMethodData interface.
11751
11752         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11753         EmitContext (related to class.cs refactoring).
11754
11755 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11756
11757         * delegate.cs (Delegate.VerifyApplicability): If the number of
11758         arguments are the same as the number of parameters, first try to
11759         verify applicability ignoring  any 'params' modifier on the last
11760         parameter.
11761         Fixes #56442.
11762
11763 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11764
11765         * class.cs (TypeContainer.AddIndexer): Use
11766         'ExplicitInterfaceName' to determine if interface name was
11767         explicitly specified.  'InterfaceType' is not initialized at this time.
11768         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11769         Indexers array is already in the required order.  Initialize
11770         'IndexerName' only if there are normal indexers.
11771         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11772         (TypeContainer.Emit): Emit DefaultMember attribute only if
11773         IndexerName is initialized.
11774         Fixes #56300.
11775
11776 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11777
11778         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11779         Fixes #57007
11780
11781 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11782
11783         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11784         attributes.
11785         Fix for #56456.
11786
11787         * attribute.cs (Attribute.Resolve): Check for duplicate named
11788         attributes.
11789         Fix for #56463.
11790
11791 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * iterators.cs (MarkYield): track whether we are in an exception,
11794         and generate code accordingly.  Use a temporary value to store the
11795         result for our state.
11796
11797         I had ignored a bit the interaction of try/catch with iterators
11798         since their behavior was not entirely obvious, but now it is
11799         possible to verify that our behavior is the same as MS .NET 2.0
11800
11801         Fixes 54814
11802
11803 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11804
11805         * iterators.cs: Avoid creating temporaries if there is no work to
11806         do. 
11807
11808         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11809         Enumerations, use TypeManager.EnumToUnderlying and call
11810         recursively. 
11811
11812         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11813         bug #57013
11814
11815         (This.Emit): Use EmitContext.EmitThis to emit our
11816         instance variable.
11817
11818         (This.EmitAssign): Ditto.
11819
11820         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11821         codepaths, we will move all the functionality into
11822         Mono.CSharp.This 
11823
11824         (FieldExpr.EmitAssign): Ditto.
11825
11826         This fixes several hidden bugs that I uncovered while doing a code
11827         review of this today.
11828
11829         * codegen.cs (EmitThis): reworked so the semantics are more clear
11830         and also support value types "this" instances.
11831
11832         * iterators.cs: Changed so that for iterators in value types, we
11833         do not pass the value type as a parameter.  
11834
11835         Initialization of the enumerator helpers is now done in the caller
11836         instead of passing the parameters to the constructors and having
11837         the constructor set the fields.
11838
11839         The fields have now `assembly' visibility instead of private.
11840
11841 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11842
11843         * expression.cs (Argument.Resolve): Check if fields passed as ref
11844         or out are contained in a MarshalByRefObject.
11845
11846         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11847         another compiler type.
11848
11849 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11850
11851         * class.cs (Indexer.Define): use the new name checking method.
11852         Also, return false on an error.
11853         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11854         (is_identifier_[start/part]_character): make static.
11855
11856 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11857
11858         * expression.cs (Binary.ResolveOperator): Do no append strings
11859         twice: since we can be invoked more than once (array evaluation)
11860         on the same concatenation, take care of this here.  Based on a fix
11861         from Ben (bug #56454)
11862
11863 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11864
11865         * codegen.cs: Fix another case where CS1548 must be reported (when 
11866         delay-sign isn't specified and no private is available #56564). Fix
11867         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11868         error when MCS is used on the MS runtime and we need to delay-sign 
11869         (which seems unsupported by AssemblyBuilder - see #56621).
11870
11871 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11872
11873         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11874         (TypeManager.ComputeNamespaces): Faster implementation for
11875         Microsoft runtime.
11876
11877         * compiler.csproj: Updated AssemblyName to mcs.
11878
11879 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * rootcontext.cs: Add new types to the boot resolution.
11882
11883         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11884         MulticastDelegate is not allowed.
11885
11886         * typemanager.cs: Add new types to lookup: System.TypedReference
11887         and ArgIterator.
11888
11889         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11890         check for TypedReference or ArgIterator, they are not allowed. 
11891
11892         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11893         makes us properly catch 1510 in some conditions (see bug 56016 for
11894         details). 
11895
11896 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11897
11898         * CryptoConvert.cs: update from corlib version
11899         with endian fixes.
11900
11901 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11902
11903         * class.cs (Indexer.Define): Check indexername declaration
11904
11905 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11906
11907         * attribute.cs (IsClsCompliant): Fixed problem with handling
11908         all three states (compliant, not-compliant, undetected).
11909
11910 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11911
11912         * attribute.cs (Attribute): Location is now public.
11913         (Resolve): Store resolved arguments (pos_values) in attribute class.
11914         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11915         (GetClsCompliantAttributeValue): New method that gets
11916         CLSCompliantAttribute value.
11917         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11918         if exists else null.
11919         (AttributeTester): New class for CLS-Compliant verification routines.
11920
11921         * class.cs (Emit): Add CLS-Compliant verification.
11922         (Method.GetSignatureForError): Implemented.
11923         (Constructor.GetSignatureForError): Implemented
11924         (Constructor.HasCompliantArgs): Returns if constructor has
11925         CLS-Compliant arguments.
11926         (Constructor.Emit): Override.
11927         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11928         is needed to test only parameters.
11929         (FieldBase.GetSignatureForError): Implemented.
11930         (TypeContainer): New member for storing base interfaces.
11931         (TypeContainer.FindMembers): Search in base interfaces too.
11932
11933         * codegen.cs (GetClsComplianceAttribute): New method that gets
11934         assembly or module CLSCompliantAttribute value.
11935         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11936         for assembly.
11937         (ModuleClass.Emit): Add error 3012 test.
11938
11939         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11940
11941         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11942         state for all decl types.
11943         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11944         if CLS-Compliant tests are required.
11945         (IsClsCompliaceRequired): New method. Analyze whether code
11946         must be CLS-Compliant.
11947         (IsExposedFromAssembly): New method. Returns true when MemberCore
11948         is exposed from assembly.
11949         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11950         value or gets cached value.
11951         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11952         is explicitly marked with CLSCompliantAttribute.
11953         (IsIdentifierClsCompliant): New abstract method. This method is
11954         used to testing error 3005.
11955         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11956         for identifier and parameters CLS-Compliant testing.
11957         (VerifyClsCompliance): New method. The main virtual method for
11958         CLS-Compliant verifications.
11959         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11960         null. I don't know why is null (too many public members !).
11961         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11962         and get value of first CLSCompliantAttribute that found.
11963
11964         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11965         (VerifyClsCompliance): Override and add extra tests.
11966
11967         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11968         clscheck- disable CLS-Compliant verification event if assembly is has
11969         CLSCompliantAttribute(true).
11970
11971         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11972         ApllyAttribute is now called in emit section as in the other cases.
11973         Possible future Emit integration.
11974         (IsIdentifierClsCompliant): New override.
11975         (VerifyClsCompliance): New override.
11976         (GetEnumeratorName): Returns full enum name.
11977
11978         * parameter.cs (GetSignatureForError): Implemented.
11979
11980         * report.cs (WarningData): New struct for Warning message information.
11981         (LocationOfPreviousError): New method.
11982         (Warning): New method. Reports warning based on the warning table.
11983         (Error_T): New method. Reports error based on the error table.
11984
11985         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11986         verifications are done here.
11987
11988         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11989
11990         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11991         CLSCompliantAttribute.
11992         (all_imported_types): New member holds all imported types from other
11993         assemblies.
11994         (LoadAllImportedTypes): New method fills static table with exported types
11995         from all referenced assemblies.
11996         (Modules): New property returns all assembly modules.
11997
11998 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12001         throwing a parser error.
12002
12003         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12004         which removes the hardcoded get_/set_ prefixes for properties, as
12005         IL allows for the properties to be named something else.  
12006
12007         Bug #56013
12008
12009         * expression.cs: Do not override operand before we know if it is
12010         non-null.  Fix 56207
12011
12012 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12013
12014         * typemanager.cs: support for pinned variables.
12015
12016 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12017
12018         * decl.cs, typemanager.cs: Avoid using an arraylist
12019         as a buffer if there is only one result set.
12020
12021 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12022
12023         * expression.cs: Make sure you cant call a static method
12024         with an instance expression, bug #56174.
12025
12026 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12027
12028         * class.cs (IsDuplicateImplementation): Improve error reporting to
12029         flag 663 (method only differs in parameter modifier).
12030
12031         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12032         in preprocessor directives.
12033
12034         * location.cs (LookupFile): Allow for the empty path.
12035
12036         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12037         better approach for some of that patch, but its failing with the
12038         CharSet enumeration.  For now try/catch will do.
12039
12040         * typemanager.cs: Do not crash if a struct does not have fields.
12041         Fixes 56150.
12042
12043 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12044
12045         * expression.cs: cs0213, cant fix a fixed expression.
12046         fixes 50231.
12047
12048 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12049
12050         * cs-parser.jay: detect invalid embeded statements gracefully.
12051         bug #51113.
12052
12053 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12054
12055         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12056         As a regex:
12057         s/
12058         the invocation type may not be a subclass of the tye of the item/
12059         The type of the item must be a subclass of the invocation item.
12060         /g
12061
12062         Fixes bug #50820.
12063
12064 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12065
12066         * attribute.cs: Added methods to get a string and a bool from an
12067         attribute. Required to information from AssemblyKeyFileAttribute,
12068         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12069         * codegen.cs: Modified AssemblyName creation to include support for
12070         strongnames. Catch additional exceptions to report them as CS1548.
12071         * compiler.csproj: Updated include CryptoConvert.cs.
12072         * compiler.csproj.user: Removed file - user specific configuration.
12073         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12074         Mono.Security assembly. The original class is maintained and tested in
12075         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12076         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12077         like CSC 8.0 (C# v2) supports.
12078         * Makefile: Added CryptoConvert.cs to mcs sources.
12079         * rootcontext.cs: Added new options for strongnames.
12080
12081 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12082
12083         * driver.cs: For --expect-error, report error code `2'
12084         if the program compiled with no errors, error code `1' if
12085         it compiled with an error other than the one expected.
12086
12087 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12088
12089         * compiler.csproj: Updated for Visual Studio .NET 2003.
12090         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12091         * compiler.sln: Updated for Visual Studio .NET 2003.
12092
12093 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12094
12095         * expression.cs: Fix bug #47234. We basically need to apply the
12096         rule that we prefer the conversion of null to a reference type
12097         when faced with a conversion to 'object' (csc behaviour).
12098
12099 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12100
12101         * statement.cs: Shorter form for foreach, eliminates
12102         a local variable. r=Martin.
12103
12104 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12105
12106         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12107         checks if we can use brtrue/brfalse to test for 0.
12108         * expression.cs: use the above in the test for using brtrue/brfalse.
12109         cleanup code a bit.
12110
12111 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12112
12113         * expression.cs: Rewrite string concat stuff. Benefits:
12114
12115         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12116         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12117         rather than a concat chain.
12118
12119         * typemanager.cs: Add lookups for more concat overloads.
12120
12121 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12122
12123         * expression.cs: Emit shorter il code for array init.
12124
12125         newarr
12126         dup
12127         // set 1
12128
12129         // set 2
12130
12131         newarr
12132         stloc.x
12133
12134         ldloc.x
12135         // set 1
12136
12137         ldloc.x
12138         // set 2
12139
12140 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12141
12142         * statement.cs: Before, two switch blocks would be merged if the
12143         total size of the blocks (end_item - begin_item + 1) was less than
12144         two times the combined sizes of the blocks.
12145
12146         Now, it will only merge if after the merge at least half of the
12147         slots are filled.
12148
12149         fixes 55885.
12150
12151 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12152
12153         * class.cs : csc build fix for GetMethods(). See bug #52503.
12154
12155 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12156
12157         * expression.cs: Make sure fp comparisons work with NaN.
12158         This fixes bug #54303. Mig approved this patch a long
12159         time ago, but we were not able to test b/c the runtime
12160         had a related bug.
12161
12162 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12165
12166 2004-03-19  Martin Baulig  <martin@ximian.com>
12167
12168         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12169         error here and not in our caller.
12170
12171 2004-03-19  Martin Baulig  <martin@ximian.com>
12172
12173         * interface.cs: Completely killed this file.
12174         (Interface): We're now a TypeContainer and live in class.cs.
12175
12176         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12177         argument; we're now also called for interfaces.
12178         (TypeContainer.DefineMembers): Allow this method being called
12179         multiple times.
12180         (TypeContainer.GetMethods): New public method; formerly known as
12181         Interface.GetMethod().  This is used by PendingImplementation.
12182         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12183         it's now private and non-static.
12184         (Interface): Moved this here; it's now implemented similar to
12185         Class and Struct.
12186         (Method, Property, Event, Indexer): Added `bool is_interface'
12187         argument to their .ctor's.
12188         (MemberBase.IsInterface): New public field.
12189
12190         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12191         instances instead of InterfaceMethod, InterfaceProperty, etc.
12192         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12193         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12194
12195 2004-03-19  Martin Baulig  <martin@ximian.com>
12196
12197         * class.cs (MethodCore.IsDuplicateImplementation): New private
12198         method which does the CS0111 checking.
12199         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12200         Use IsDuplicateImplementation().
12201
12202 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12203
12204         * decl.cs (FindMemberToOverride): New method to find the correct
12205         method or property to override in the base class.
12206         * class.cs
12207             - Make Method/Property use the above method to find the
12208               version in the base class.
12209             - Remove the InheritableMemberSignatureCompare as it is now
12210               dead code.
12211
12212         This patch makes large code bases much faster to compile, as it is
12213         O(n) rather than O(n^2) to do this validation.
12214
12215         Also, it fixes bug 52458 which is that nested classes are not
12216         taken into account when finding the base class member.
12217
12218         Reviewed/Approved by Martin.
12219
12220 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12221
12222         * interface.cs: In all interface classes removed redundant
12223         member initialization.
12224
12225 2004-03-16  Martin Baulig  <martin@ximian.com>
12226
12227         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12228
12229 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * decl.cs (DefineTypeAndParents): New helper method to define a
12232         type's containers before the type itself is defined;  This is a
12233         bug exposed by the recent changes to Windows.Forms when an
12234         implemented interface was defined inside a class that had not been
12235         built yet.   
12236
12237         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12238
12239         (Check): Loop correctly to report errors modifiers
12240         (UNSAFE was not in the loop, since it was the same as TOP).
12241
12242         * interface.cs: Every interface member now takes a ModFlags,
12243         instead of a "is_new" bool, which we set on the base MemberCore. 
12244
12245         Every place where we called "UnsafeOk" in the interface, now we
12246         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12247         the unsafe settings from the member declaration instead of the
12248         container interface. 
12249
12250         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12251
12252         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12253         `set_indexer_name' to the pending bits (one per type).
12254
12255         We fixed a bug today that was picking the wrong method to
12256         override, since for properties the existing InterfaceMethod code
12257         basically ignored the method name.  Now we make sure that the
12258         method name is one of the valid indexer names.
12259
12260 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12261  
12262         * support.cs (SeekableStreamReader): Keep track of stream byte
12263         positions and don't mix them with character offsets to the buffer.
12264
12265         Patch from Gustavo Giráldez
12266
12267 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12268
12269         * interface.cs (InterfaceSetGetBase): Removed double member
12270         initialization, base class does it as well.
12271
12272 2004-03-13  Martin Baulig  <martin@ximian.com>
12273
12274         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12275         when compiling corlib.
12276
12277 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * convert.cs (ExplicitConversion): We were reporting an error on
12280         certain conversions (object_type source to a value type, when the
12281         expression was `null') before we had a chance to pass it through
12282         the user defined conversions.
12283
12284         * driver.cs: Replace / and \ in resource specifications to dots.
12285         Fixes 50752
12286
12287         * class.cs: Add check for duplicate operators.  Fixes 52477
12288
12289 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12290
12291         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12292         that are in the middle of the statements, not only at the end.
12293         Fixes #54987
12294
12295         * class.cs (TypeContainer.AddField): No longer set the
12296         `HaveStaticConstructor' flag, now we call it
12297         `UserDefineStaticConstructor' to diferentiate the slightly
12298         semantic difference.
12299
12300         The situation is that we were not adding BeforeFieldInit (from
12301         Modifiers.TypeAttr) to classes that could have it.
12302         BeforeFieldInit should be set to classes that have no static
12303         constructor. 
12304
12305         See:
12306
12307         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12308
12309         And most importantly Zoltan's comment:
12310
12311         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12312
12313         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12314          before its static fields are used', i.e. initialization does not need
12315          to be triggered by the first access to the type. Setting this flag
12316          helps the JIT to compile better code, since it can run the static
12317          constructor at JIT time, and does not need to generate code to call it
12318          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12319          this flag for lots of classes like String. 
12320          
12321          csc sets this flag if the type does not have an explicit static 
12322          constructor. The reasoning seems to be that if there are only static
12323          initalizers for a type, and no static constructor, then the programmer
12324          does not care when this initialization happens, so beforefieldinit
12325          can be used.
12326          
12327          This bug prevents the AOT compiler from being usable, since it 
12328          generates so many calls to mono_runtime_class_init that the AOT code
12329          is much slower than the JITted code. The JITted code is faster, 
12330          because it does not generate these calls if the vtable is type is
12331          already initialized, which is true in the majority of cases. But the
12332          AOT compiler can't do this."
12333
12334 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * class.cs (MethodData.Emit): Refactor the code so symbolic
12337         information is generated for destructors;  For some reasons we
12338         were taking a code path that did not generate symbolic information
12339         before. 
12340
12341 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12342
12343         * class.cs: Create a Constructor.CheckBase method that
12344         takes care of all validation type code. The method
12345         contains some code that was moved from Define.
12346
12347         It also includes new code that checks for duplicate ctors.
12348         This fixes bug #55148.
12349
12350 2004-03-09  Joshua Tauberer <tauberer@for.net>
12351
12352         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12353         a { ... }-style array creation invokes EmitStaticInitializers
12354         which is not good for reference-type arrays.  String, decimal
12355         and now null constants (NullCast) are not counted toward
12356         static initializers.
12357
12358 2004-03-05  Martin Baulig  <martin@ximian.com>
12359
12360         * location.cs (SourceFile.HasLineDirective): New public field;
12361         specifies whether the file contains or is referenced by a "#line"
12362         directive.
12363         (Location.DefineSymbolDocuments): Ignore source files which
12364         either contain or are referenced by a "#line" directive.        
12365
12366 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12367
12368         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12369         direct access to our parent, so check the method inline there.
12370
12371 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12372
12373         * expression.cs (Invocation.EmitCall): Miguel's last commit
12374         caused a regression. If you had:
12375
12376             T t = null;
12377             t.Foo ();
12378
12379         In Foo the implict this would be null.
12380
12381 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12382
12383         * expression.cs (Invocation.EmitCall): If the method is not
12384         virtual, do not emit a CallVirt to it, use Call.
12385
12386         * typemanager.cs (GetFullNameSignature): Improve the method to
12387         cope with ".ctor" and replace it with the type name.
12388
12389         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12390         as an argument the ConstructorBuilder where it is being defined,
12391         to catch the recursive constructor invocations.
12392
12393 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12396         routines to check if a type is an enumerable/enumerator allow
12397         classes that implement the IEnumerable or IEnumerator interfaces.
12398
12399         * class.cs (Property, Operator): Implement IIteratorContainer, and
12400         implement SetYields.
12401
12402         (Property.Define): Do the block swapping for get_methods in the
12403         context of iterators.   We need to check if Properties also
12404         include indexers or not.
12405
12406         (Operator): Assign the Block before invoking the
12407         OperatorMethod.Define, so we can trigger the Iterator code
12408         replacement. 
12409
12410         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12411         Property and Operator classes are not created when we parse the
12412         declarator but until we have the block completed, so we use a
12413         singleton SimpleIteratorContainer.Simple to flag whether the
12414         SetYields has been invoked.
12415
12416         We propagate this setting then to the Property or the Operator to
12417         allow the `yield' to function.
12418
12419 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12420
12421         * codegen.cs: Implemented attribute support for modules.
12422         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12423         Assembly/Module functionality.
12424
12425         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12426         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12427         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12428
12429 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12430
12431         * interface.cs (FindMembers): The operation is performed on all base
12432         interfaces and not only on the first. It is required for future CLS Compliance patch.
12433
12434 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12435
12436         * statement.cs, codegen.cs:
12437         This patch deals with patterns such as:
12438
12439         public class List : IEnumerable {
12440
12441                 public MyEnumerator GetEnumerator () {
12442                         return new MyEnumerator(this);
12443                 }
12444
12445                 IEnumerator IEnumerable.GetEnumerator () {
12446                         ...
12447                 }
12448                 
12449                 public struct MyEnumerator : IEnumerator {
12450                         ...
12451                 }
12452         }
12453
12454         Before, there were a few things we did wrong:
12455         1) we would emit callvirt on a struct, which is illegal
12456         2) we emited ldarg when we needed to emit ldarga
12457         3) we would mistakenly call the interface methods on an enumerator
12458         type that derived from IEnumerator and was in another assembly. For example:
12459
12460         public class MyEnumerator : IEnumerator
12461
12462         Would have the interface methods called, even if there were public impls of the
12463         method. In a struct, this lead to invalid IL code.
12464
12465 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12466
12467         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12468           renamed to Emit.
12469
12470         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12471
12472 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12473
12474         * cs-parser.jay: Fix small regression: we were not testing V2
12475         compiler features correctly.
12476
12477         * interface.cs: If the emit context is null, then create one
12478
12479 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12480
12481         * decl.cs (GetSignatureForError): New virtual method to get full name
12482           for error messages.
12483
12484         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12485           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12486
12487         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12488           Duplicated members and code in these classes has been removed.
12489           Better encapsulation in these classes.
12490
12491 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12492
12493         * assign.cs (Assign.DoResolve): When dealing with compound
12494         assignments, there is a new rule in ECMA C# 2.4 (might have been
12495         there before, but it is documented here) that states that in:
12496
12497         a op= b;
12498
12499         If b is of type int, and the `op' is a shift-operator, then the
12500         above is evaluated as:
12501
12502         a = (int) a op b 
12503
12504         * expression.cs (Binary.ResolveOperator): Instead of testing for
12505         int/uint/long/ulong, try to implicitly convert to any of those
12506         types and use that in pointer arithmetic.
12507
12508         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12509         method to print information for from the type, not from the
12510         null-method we were given.
12511
12512 2004-02-01  Duncan Mak  <duncan@ximian.com>
12513
12514         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12515         parsing for cmd, fixes bug #53694.
12516
12517 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12518
12519         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12520         in the member name duplication tests. Property and operator name duplication
12521         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12522
12523 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12524
12525         * interface.cs (PopulateMethod): Fixed crash when interface method
12526         returns not existing type (error test cs0246-3.cs).
12527
12528 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12529
12530         * cs-parser.jay (interface_accessors): Re-write actions to also
12531         store attributes attached to get and set methods. Fix spelling
12532         while at it.
12533
12534         (inteface_property_declaration): Modify accordingly.
12535
12536         (InterfaceAccessorInfo): New helper class to store information to pass
12537         around between rules that use interface_accessors.
12538
12539         * interface.cs (Emit): Apply attributes on the get and set
12540         accessors of properties and indexers too.
12541
12542         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12543         right MethodBuilder when applying attributes to the get and set accessors.
12544
12545 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12546
12547         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12548
12549 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12550
12551         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12552
12553 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12554
12555         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12556         changes that treat `yield' specially when present before `break'
12557         or `return' tokens.
12558
12559         * cs-tokenizer.cs: yield is no longer a keyword.
12560
12561 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12562
12563         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12564         setting for default constructors.
12565         For default constructors are almost every time set wrong Modifier. The
12566         generated IL code has been alright. But inside mcs this values was
12567         wrong and this was reason why several of my CLS Compliance tests
12568         failed.
12569
12570 2004-01-22  Martin Baulig  <martin@ximian.com>
12571
12572         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12573         not a QualifiedIdentifier.  This is what `type_name_expression'
12574         was previously doing.
12575         (type_name_expression): Removed; the code is now in
12576         `namespace_or_type_name'.
12577         (qualified_identifier): Removed, use `namespace_or_type_name'
12578         instead.
12579         (QualifiedIdentifier): Removed this class.      
12580
12581 2004-01-22  Martin Baulig  <martin@ximian.com>
12582
12583         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12584         not a string as alias name.
12585
12586 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12587
12588         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12589         #52730 bug, and instead compute correctly the need to use a
12590         temporary variable when requesting an address based on the
12591         static/instace modified of the field and the constructor.
12592  
12593 2004-01-21  Martin Baulig  <martin@ximian.com>
12594
12595         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12596         class and namespace before looking up aliases.  Fixes #52517.
12597
12598 2004-01-21  Martin Baulig  <martin@ximian.com>
12599
12600         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12601         assinged in a 'try'; fixes exception4.cs.
12602
12603 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12604         * class.cs : Implemented parameter-less constructor for TypeContainer
12605
12606         * decl.cs: Attributes are now stored here. New property OptAttributes
12607
12608         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12609
12610         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12611
12612 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12613
12614         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12615           (CSharpSignature): New method for indexer and property signature.
12616
12617 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12618
12619         * pending.cs (IsVirtualFilter): Faster implementation.
12620
12621 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12622
12623         * typemanager.cs: Avoid inclusion of same assembly more than once.
12624
12625 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12626
12627         * cs-parser.jay: Fixed problem where the last assembly attribute
12628           has been applied also to following declaration (class, struct, etc.)
12629           
12630 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12631
12632         * class.cs: Added error CS0538, CS0539 reporting.
12633         Fixed crash on Microsoft runtime when field type is void.
12634
12635         * cs-parser.jay: Added error CS0537 reporting.
12636
12637         * pending.cs: Added error CS0535 reporting.
12638         Improved error report for errors CS0536, CS0534.
12639
12640 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12641
12642         Merge a few bits from the Anonymous Method MCS tree.
12643
12644         * statement.cs (ToplevelBlock): New class for toplevel methods,
12645         will hold anonymous methods, lifted variables.
12646
12647         * cs-parser.jay: Create toplevel blocks for delegates and for
12648         regular blocks of code. 
12649
12650 2004-01-20  Martin Baulig  <martin@ximian.com>
12651
12652         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12653         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12654         and `NeedExplicitReturn'; added `IsLastStatement'.
12655         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12656         have a `ReturnLabel' or we're not unreachable.
12657
12658         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12659         child's reachability; don't just override ours with it.  Fixes
12660         #58058 (lluis's example).
12661         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12662         InFinally(), InLoop(), InSwitch() and
12663         BreakCrossesTryCatchBoundary() methods.
12664
12665         * statement.cs (Return): Do all error checking in Resolve().
12666         Unless we are the last statement in a top-level block, always
12667         create a return label and jump to it.
12668         (Break, Continue): Do all error checking in Resolve(); also make
12669         sure we aren't leaving a `finally'.
12670         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12671         statement in a top-level block.
12672         (Block.Flags): Added `IsDestructor'.
12673         (Block.IsDestructor): New public property.
12674
12675 2004-01-20  Martin Baulig  <martin@ximian.com>
12676
12677         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12678
12679 2004-01-20  Martin Baulig  <martin@ximian.com>
12680
12681         * statement.cs (Statement.ResolveUnreachable): New public method.
12682         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12683         (Block.Resolve): Resolve unreachable statements.
12684
12685 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12686
12687         * expression.cs: We need to fix the case where we do
12688         not have a temp variable here.
12689
12690         * assign.cs: Only expression compound assignments need
12691         temporary variables.
12692
12693 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12694
12695         * flowanalysis.cs: Reduce memory allocation in a few ways:
12696           - A block with no variables should not allocate a bit
12697             vector for itself.
12698           - A method with no out parameters does not need any tracking
12699             for assignment of the parameters, so we need not allocate
12700             any data for it.
12701           - The arrays:
12702                 public readonly Type[] VariableTypes;
12703                 public readonly string[] VariableNames;
12704             Are redundant. The data is already stored in the variable
12705             map, so we need not allocate another array for it.
12706           - We need to add alot of checks for if (params | locals) == null
12707             due to the first two changes.
12708
12709 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12712         implement IMemoryLocation, we store a copy on a local variable and
12713         take the address of it.  Patch from Benjamin Jemlich
12714
12715         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12716         to use a special "type_name_expression" rule which reduces the
12717         number of "QualifiedIdentifier" classes created, and instead
12718         directly creates MemberAccess expressions.
12719
12720 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12723         that fixes #52853.  Null literal assignment to ValueType
12724
12725         * class.cs (MethodData.Emit): Instead of checking the name of the
12726         method to determine if its a destructor, create a new derived
12727         class from Method called Destructor, and test for that.  
12728
12729         * cs-parser.jay: Create a Destructor object instead of a Method.  
12730
12731         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12732
12733         Fixes: 52933
12734
12735 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * expression.cs (Binary.ResolveOperator): Perform an implicit
12738         conversion from MethodGroups to their delegate types on the
12739         Addition operation.
12740
12741         * delegate.cs: Introduce a new class DelegateCreation that is the
12742         base class for `NewDelegate' and `ImplicitDelegateCreation',
12743         factor some code in here.
12744
12745         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12746         conversion from MethodGroups to compatible delegate types. 
12747
12748         * ecore.cs (Expression.Resolve): Do not flag error 654
12749         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12750         we allow conversions from MethodGroups to delegate types now.
12751
12752         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12753         assignments in v2 either.
12754
12755 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12756
12757         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12758         static read-only fields in ctors.
12759
12760         Applied patch from Benjamin Jemlich 
12761
12762         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12763
12764 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12765
12766         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12767         here to return true, as they can be used like this:
12768
12769                 (XXX) int.MEMBER ()
12770
12771         Fixed 49836 and all the other dups
12772
12773 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12774
12775         * driver.cs: Implement /win32res and /win32icon.
12776
12777 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12778
12779         * cs-parser.jay: Add a rule to improve error handling for the
12780         common mistake of placing modifiers after the type.
12781
12782 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12783
12784         * cs-parser.jay (interface_event_declaration): Catch
12785         initialization of events on interfaces, and report cs0068
12786
12787         * cs-parser.jay (interface_event_declaration): Catch
12788         initialization of events. 
12789
12790         * ecore.cs: Better report missing constructors.
12791
12792         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12793         the error reporting done in the wrong place.  Fix.
12794
12795         * expression.cs (Binary.ResolveOperator): Catch the 
12796         operator + (E x, E y) error earlier, and later allow for implicit
12797         conversions in operator +/- (E e, U x) from U to the underlying
12798         type of E.
12799
12800         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12801         52596, if the container class is abstract, the default constructor
12802         is protected otherwise its public (before, we were always public).
12803
12804         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12805         fixed statement.
12806
12807         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12808         Jemlich that fixes bug #52597, MCS was generating invalid code for
12809         idisposable structs.   Thanks to Ben for following up with this
12810         bug as well.
12811
12812 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12813
12814         * driver.cs: Allow assemblies without code to be generated, fixes
12815         52230.
12816
12817 2004-01-07  Nick Drochak <ndrochak@gol.com>
12818
12819         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12820
12821 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12822
12823         * cs-parser.jay: Add rules to improve error reporting if fields or
12824         methods are declared at the namespace level (error 116)
12825
12826         * Add rules to catch event add/remove
12827
12828 2004-01-04  David Sheldon <dave-mono@earth.li>
12829
12830   * expression.cs: Added matching ")" to error message for 
12831   CS0077
12832
12833 2004-01-03 Todd Berman <tberman@gentoo.org>
12834
12835         * ecore.cs, attribute.cs:
12836         Applying fix from #52429.
12837
12838 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12839
12840         * ecore.cs, expression.cs, statement.cs:
12841         Total rewrite of how we handle branching. We
12842         now handle complex boolean expressions with fewer
12843         jumps. As well if (x == 0) no longer emits a ceq.
12844
12845         if (x is Foo) is much faster now, because we generate
12846         better code.
12847
12848         Overall, we get a pretty big improvement on our benchmark
12849         tests. The code we generate is smaller and more readable.
12850
12851         I did a full two-stage bootstrap. The patch was reviewed
12852         by Martin and Miguel.
12853
12854 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12855
12856         * cs-parser.jay: Make primary_expression not take a QI.
12857         we dont need this because the member_access rule covers
12858         us here. So we replace the rule with just IDENTIFIER.
12859
12860         This has two good effects. First, we remove a s/r conflict.
12861         Second, we allocate many fewer QualifiedIdentifier objects.
12862
12863 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12864
12865         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12866         set the correct information via SRE. This prevents
12867         hanging on the MS runtime. Fixes #29374.
12868
12869 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12870
12871         * convert.cs: correctly handle conversions to value types
12872         from Enum and ValueType as unboxing conversions.
12873
12874         Fixes bug #52569. Patch by Benjamin Jemlich.
12875
12876 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12877
12878         * expression.cs (BetterConversion): Prefer int -> uint
12879         over int -> ulong (csc's behaviour). This fixed bug #52046.
12880
12881 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12882
12883         * decl.cs (MemberCache.FindMembers): now returns a
12884         MemberInfo [].
12885
12886         * typemanager.cs: In general, go with with ^^.
12887         (CopyNewMethods): take an IList.
12888         (RealMemberLookup): Only allocate an arraylist
12889         if we copy from two sets of methods.
12890
12891         This change basically does two things:
12892         1) Fewer array lists allocated due to CopyNewMethods.
12893         2) the explicit cast in MemberList costed ALOT.
12894
12895 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12896
12897         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12898         a hashtable to avoid needless string allocations when an identifier is
12899         used more than once (the common case).
12900
12901 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12902
12903         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12904         is broken, it will not return anything. So, we
12905         have to use the information we have in mcs to
12906         do the task.
12907
12908         * typemanager.cs: Add a cache for GetInterfaces,
12909         since this will now be used more often (due to ^^)
12910
12911         (GetExplicitInterfaces) New method that gets the
12912         declared, not effective, interfaces on a type
12913         builder (eg, if you have interface IFoo, interface
12914         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12915         { IBar }.
12916
12917         This patch makes MCS able to bootstrap itself on
12918         Windows again.
12919
12920 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12921
12922         * expression.cs: Remove the Nop's that Miguel put
12923         in by mistake.
12924
12925 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12926
12927         * report.cs, codegen.cs: Give the real stack trace to
12928         the error when an exception is thrown.
12929
12930 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12931
12932         * decl.cs: only allocate hashtables for ifaces if 
12933         it is an iface!
12934
12935 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12936
12937         * expression.cs: fix the error from cs0121-2.cs
12938         (a parent interface has two child interfaces that
12939         have a function with the same name and 0 params
12940         and the function is called through the parent).
12941
12942 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12943
12944         * class.cs, rootcontext.cs, typmanager.cs: do not
12945         leak pointers.
12946
12947 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12948
12949         * codegen.cs: remove stack for the ec flow branching.
12950         It is already a linked list, so no need.
12951
12952 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12953
12954         * Makefile: Allow custom profiler here.
12955
12956 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12957
12958         * typemanager.cs (LookupType):
12959           - Use a static char [], because split takes
12960             a param array for args, so it was allocating
12961             every time.
12962           - Do not store true in a hashtable, it boxes.
12963
12964 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12965
12966         * flowanalysis.cs: bytify common enums.
12967
12968 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12969
12970         * modifiers.cs: Add a new set of flags for the
12971         flags allowed on explicit interface impls.
12972         * cs-parser.jay: catch the use of modifiers in
12973         interfaces correctly.
12974         * class.cs: catch private void IFoo.Blah ().
12975
12976         All related to bug #50572.
12977
12978 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12979
12980         * decl.cs: Rewrite the consistant accessability checking.
12981         Accessability is not linear, it must be implemented in
12982         a tableish way. Fixes #49704.
12983
12984 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12985
12986         * expression.cs: Handle negation in a checked context.
12987         We must use subtraction from zero. Fixes #38674.
12988
12989 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12990
12991         * class.cs: Ignore static void main in DLLs.
12992         * rootcontext.cs: Handle the target type here,
12993         since we are have to access it from class.cs
12994         * driver.cs: account for the above.
12995
12996 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12997
12998         * report.cs: Give line numbers and files if available.
12999
13000 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13001
13002         * driver.cs: Implement /addmodule.
13003
13004         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13005         ModuleBuilders.
13006
13007 2003-12-20  Martin Baulig  <martin@ximian.com>
13008
13009         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13010         (FieldBase.IsAssigned): Removed this field.
13011         (FieldBase.SetAssigned): New public method.
13012         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13013
13014 2003-12-20  Martin Baulig  <martin@ximian.com>
13015
13016         * expression.cs (LocalVariableReference.DoResolve): Don't set
13017         `vi.Used' if we're called from DoResolveLValue().
13018
13019         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13020         returns the usage vector it just merged into the current one -
13021         pass this one to UsageWarning().
13022         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13023         of the `EmitContext', don't call this recursively on our children.
13024
13025 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13026
13027         * driver.cs: Implement /target:module.
13028
13029 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13030
13031         * support.cs (CharArrayHashtable): New helper class.
13032
13033         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13034         char arrays, not strings, so we can avoid creating a string in
13035         consume_identifier if the identifier is a keyword.
13036
13037 2003-12-16  Martin Baulig  <martin@ximian.com>
13038
13039         * statement.cs (LocalInfo.Assigned): Removed this property.
13040         (LocalInfo.Flags): Removed `Assigned'.
13041         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13042         and uses flow analysis.
13043         (Block.UsageWarning): Made this method private.
13044         (Block.Resolve): Call UsageWarning() if appropriate.
13045
13046         * expression.cs (LocalVariableReference.DoResolve): Always set
13047         LocalInfo.Used here.
13048
13049 2003-12-13  Martin Baulig  <martin@ximian.com>
13050
13051         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13052         any value here; we're now using flow analysis to figure out
13053         whether a statement/block returns a value.
13054
13055 2003-12-13  Martin Baulig  <martin@ximian.com>
13056
13057         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13058         working again.
13059         (FlowBranching.MergeFinally): Don't call
13060         `branching.CheckOutParameters()' here, this is called in
13061         MergeTopBlock().
13062         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13063         when adding the `finally' vector.       
13064
13065 2003-12-13  Martin Baulig  <martin@ximian.com>
13066
13067         * flowanalysis.cs
13068         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13069         actually work and also fix #48962.
13070
13071 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13072
13073         * decl.cs: Do not check System.Object for nested types,
13074         since we know it does not have any. Big bang for buck:
13075
13076         BEFORE:
13077            Run 1:   8.35 seconds
13078            Run 2:   8.32 seconds
13079            corlib:  17.99 seconds
13080         AFTER:
13081            Run 1:   8.17 seconds
13082            Run 2:   8.17 seconds
13083            corlib:  17.39 seconds
13084
13085 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13086
13087         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13088         time we are returning 0 members, so we save alot here.
13089
13090 2003-12-11  Martin Baulig  <martin@ximian.com>
13091
13092         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13093         `MergeChild()', also just take the `FlowBranching' as argument;
13094         call Merge() on it and return the result.
13095         (FlowBranching.Merge): We don't need to do anything if we just
13096         have one sibling.
13097
13098 2003-12-11  Martin Baulig  <martin@ximian.com>
13099
13100         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13101         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13102         Maurer for this idea.
13103
13104 2003-12-11  Martin Baulig  <martin@ximian.com>
13105
13106         * flowanalysis.cs (MergeResult): This class is now gone; we now
13107         use the `UsageVector' for this.  The reason for this is that if a
13108         branching just has one sibling, we don't need to "merge" them at
13109         all - that's the next step to do.
13110         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13111         `MergeResult'.
13112
13113 2003-12-11  Martin Baulig  <martin@ximian.com>
13114
13115         Reworked flow analyis and made it more precise and bug-free.  The
13116         most important change is that we're now using a special `Reachability'
13117         class instead of having "magic" meanings of `FlowReturns'.  I'll
13118         do some more cleanups and optimizations and also add some more
13119         documentation this week.
13120
13121         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13122         largely reworked this class.
13123         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13124         the new `Reachability' class instead of having "magic" values here.
13125         (FlowBranching): We're now using an instance of `Reachability'
13126         instead of having separate `Returns', `Breaks' etc. fields.
13127
13128         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13129         based on flow analysis; ignore the return value of block.Emit ().
13130
13131 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13132
13133         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13134         if they are private.
13135
13136 2003-12-09  Martin Baulig  <martin@ximian.com>
13137
13138         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13139         call them directly on the UsageVector.
13140
13141 2003-12-09  Martin Baulig  <martin@ximian.com>
13142
13143         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13144         Changed return type from `FlowReturns' to `Reachability'.
13145
13146 2003-12-09  Martin Baulig  <martin@ximian.com>
13147
13148         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13149         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13150         `Reachable' fields with a single `Reachability' one.
13151
13152 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13153
13154         * class.cs (FindMembers): Remove foreach's.
13155
13156         Bootstrap times:
13157
13158         BEFORE
13159                 Run 1:   8.74 seconds
13160                 Run 2:   8.71 seconds
13161
13162         AFTER
13163                 Run 1:   8.64 seconds
13164                 Run 2:   8.58 seconds
13165
13166
13167 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13168
13169         * cs-parser.jay:
13170         * gen-treedump.cs:
13171         * statement.cs:
13172         This patch does a few things:
13173                 1. EmptyStatement is now a singleton, so it is never reallocated.
13174                 2. All blah is EmptyStatement constructs have been changed to
13175                    blah == EmptyStatement.Value, which is much faster and valid
13176                    now that EmptyStatement is a singleton.
13177                 3. When resolving a block, rather than allocating a new array for
13178                    the non-empty statements, empty statements are replaced with
13179                    EmptyStatement.Value
13180                 4. Some recursive functions have been made non-recursive.
13181         Mainly the performance impact is from (3), however (1) and (2) are needed for
13182         this to work. (4) does not make a big difference in normal situations, however
13183         it makes the profile look saner.
13184
13185         Bootstrap times:
13186
13187         BEFORE
13188         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13189         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13190         Total memory allocated: 56397 KB
13191
13192         AFTER
13193         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13194         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13195         Total memory allocated: 55666 KB
13196
13197 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13198
13199         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13200         than the hashtable in a hashtable version
13201
13202         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13203         we always end up concating a string. This results in a huge perf
13204         loss, because many strings have to be tracked by the GC. In this
13205         patch, we first use a hashtable that works with two keys, so that
13206         the strings do not need to be concat'ed.
13207
13208         Bootstrap times:
13209         BEFORE
13210                 Run 1:   8.74 seconds
13211                 Run 2:   8.71 seconds
13212
13213         AFTER
13214                 Run 1:   8.65 seconds
13215                 Run 2:   8.56 seconds
13216
13217 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13218
13219         * Makefile: Add a new target `do-time' that does a quick and simple
13220         profile, leaving easy to parse output.
13221
13222 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13223
13224         * codegen.cs (Init): Create the dynamic assembly with 
13225         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13226
13227 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13228
13229         * support.cs: Make the PtrHashtable use only one
13230         instance of its comparer.
13231
13232 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13233
13234         * typemanager.cs: Fix lookup of GetNamespaces.
13235
13236 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13237
13238         * expression.cs: Removed redundant line.
13239
13240         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13241         ArrayLists, use for loops with bounds.  
13242
13243         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13244         arraylist.
13245
13246         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13247         arraylists, use for loop with bounds.
13248
13249         The above three changes give us a 0.071 second performance
13250         improvement out of 3.294 seconds down to 3.223.  On my machine
13251         the above changes reduced the memory usage by 1,387 KB during
13252         compiler bootstrap.
13253
13254         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13255         QualifiedIdentifiers.  Before we created a new string through
13256         concatenation, and mostly later on, the result would be
13257         manipulated by DecomposeQI through string manipulation.
13258
13259         This reduced the compiler memory usage for bootstrapping from
13260         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13261         compile times in 0.05 seconds.
13262
13263 2003-11-28  Dick Porter  <dick@ximian.com>
13264
13265         * support.cs: Do string compares with the Invariant culture.
13266
13267         * rootcontext.cs: 
13268         * gen-treedump.cs: 
13269         * expression.cs: 
13270         * driver.cs: 
13271         * decl.cs: 
13272         * codegen.cs: 
13273         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13274         the comparison is done with the Invariant culture.
13275
13276 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13277
13278         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13279         GetEnumerator method.
13280
13281         (ProbeCollectionType): Iterate starting at the most specific type
13282         upwards looking for a GetEnumerator
13283
13284         * expression.cs: Shift count can be up to 31 for int/uint and 63
13285         for long/ulong.
13286
13287 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * statement.cs (Block.LookupLabel): Also look for the label on the
13290         children blocks.  Use a hash table to keep track of visited
13291         nodes. 
13292
13293         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13294         we actually did transform the other operand, otherwise fall back
13295         to the common codepath that casts to long.
13296
13297         * cs-tokenizer.cs: Use the same code pattern as the int case.
13298         Maybe I should do the parsing myself, and avoid depending on the
13299         Parse routines to get this done.
13300
13301 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13302
13303         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13304         which fixes bug 51347.  This time test it.
13305
13306         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13307         attributes for example can not tell the difference between these.
13308         The difference was only a syntax feature of the language. 
13309
13310         * attribute.cs: Apply attributes to delegates.
13311
13312         * delegate.cs: Call the apply attributes method.
13313
13314 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13317         comparing 0 vs Byte.MinValue, not the value
13318
13319         (ImplicitConversionRequired): When reporting a conversion error,
13320         use error 31 to print out the constant error instead of the
13321         simpler 29.
13322
13323         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13324         which fixes bug 51347.
13325
13326 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13329         which fixes the -warnaserror command line option.
13330
13331 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13332
13333         * cfold.cs (DoNumericPromotions): During constant folding of
13334         additions on UIntConstant, special case intconstants with
13335         IntConstants like we do on the expression binary operator. 
13336
13337 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * convert.cs (ImplicitReferenceConversion): We were missing a case
13340         (System.Enum are not value types or class types, so we need to
13341         classify them separatedly).
13342
13343         * driver.cs: We do not support error 2007.
13344
13345 2003-11-12 Jackson Harper <jackson@ximian.com>
13346
13347         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13348         system directory. Also use the full file name so users can
13349         libraries names mscorlib-o-tron.dll in a non system dir.
13350
13351 2003-11-10  Martin Baulig  <martin@ximian.com>
13352
13353         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13354         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13355         calling `ResolveType()' on them, directly assign their `Type'.
13356
13357 2003-11-08  Martin Baulig  <martin@ximian.com>
13358
13359         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13360         return value and the `out parent' parameter.
13361         (TypeContainer.DefineType): Moved the CS0644 check into
13362         GetClassBases().  Don't pass the interface types to the
13363         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13364         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13365
13366         * ecore.cs (TypeExpr.IsAttribute): New property.
13367         (TypeExpr.GetInterfaces): New method.
13368
13369         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13370         TypeExpr instead of a Type.
13371         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13372         (Interface.DefineType): Don't pass the interface types to the
13373         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13374         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13375
13376         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13377         instead of a `Type[]'.
13378         (TypeManager.RegisterBuilder): Likewise.
13379         (TypeManager.AddUserInterface): Likewise.
13380         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13381         `Type[]' and also return a `TypeExpr[]'.
13382         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13383
13384 2003-11-08  Martin Baulig  <martin@ximian.com>
13385
13386         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13387         Expression.     
13388
13389 2003-11-08  Martin Baulig  <martin@ximian.com>
13390
13391         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13392         TypeManager.ResolveExpressionTypes().
13393
13394         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13395         instead of an Expression.
13396         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13397         (TypeExpression): New public class; formerly known as `TypeExpr'.
13398
13399         * expression.cs (ComposedCast): Derive from TypeExpr.
13400
13401         * typemanager.cs (TypeManager.system_*_expr): These are now
13402         TypExpr's instead of Expression's.
13403         (TypeManager.ResolveExpressionTypes): New public static function;
13404         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13405         of them.        
13406
13407 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * expression.cs (New.DoResolve): Do not dereference value that
13410         might be a null return.
13411
13412         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13413         sure that the constant value has the right type.  Fixes an
13414         unreported bug, similar to 50425.
13415
13416         * const.cs (Const.LookupConstantValue): Call
13417         ImplicitStandardConversionExists before doing a conversion to
13418         avoid havng the TypeManager.ChangeType do conversions.
13419
13420         Reduced the number of casts used
13421
13422         (Const.ChangeType): New routine to enable reuse of the constant
13423         type changing code from statement.
13424
13425         * typemanager.cs (ChangeType): Move common initialization to
13426         static global variables.
13427
13428         Fixes #50425.
13429
13430         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13431         every value type to go through, even if it was void.  Fix that. 
13432
13433         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13434         character of the define, and the is_identifier_part_character for
13435         the rest of the string.
13436
13437 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13438
13439         * expression.cs (UnaryMutator.EmitCode): When I updated
13440         LocalVariableReference.DoResolve, I overdid it, and dropped an
13441         optimization done on local variable references.
13442
13443 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13444
13445         * ecore.cs: Convert the return from Ldlen into an int.
13446
13447 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13448
13449         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13450         the accessibility, this is a special case for toplevel non-public
13451         classes (internal for instance).
13452
13453 2003-10-20  Nick Drochak <ndrochak@gol.com>
13454
13455         * ecore.cs: Fix typo and build.  Needed another right paren.
13456
13457 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13458
13459         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13460         `internal' case regular and protected, but not allowing protected
13461         to be evaluated later.  Bug 49840
13462
13463 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13464
13465         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13466         to kb.Nlast, and not the kb.nFirst to isolate the switch
13467         statement.
13468
13469         Extract the underlying type, so enumerations of long/ulong are
13470         treated like long/ulong.
13471
13472 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13473
13474         * expression.cs (New): Overload the meaning of RequestedType to
13475         track the possible creation of the NewDelegate type, since
13476         DoResolve is invoked more than once for new constructors on field
13477         initialization.
13478
13479         See bugs: #48800 and #37014
13480
13481         * cs-parser.jay (declare_local_constants): Take an arraylist
13482         instead of a single constant.
13483
13484         (local_constant_declaration): It should take a
13485         constant_declarators, not a constant_declarator.  Fixes 49487
13486
13487         * convert.cs: Fix error report.
13488
13489 2003-10-13 Jackson Harper <jackson@ximian.com>
13490
13491         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13492         bug #49611
13493
13494 2003-10-09  Martin Baulig  <martin@ximian.com>
13495
13496         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13497         to the .ctor.
13498         (MethodCore.DoDefineParameters): Removed the TypeContainer
13499         argument; use the DeclSpace which was passed to the .ctor instead.
13500         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13501         TypeContainer; we only need a DeclSpace here.
13502
13503 2003-10-09  Martin Baulig  <martin@ximian.com>
13504
13505         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13506         to the .ctor.
13507         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13508         EmitContext's .ctor.    
13509
13510 2003-10-09  Martin Baulig  <martin@ximian.com>
13511
13512         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13513         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13514         AsAccessible(), moved them as well.
13515
13516         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13517
13518 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13519
13520         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13521
13522 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13523
13524         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13525         generation for >=, as spotted by Paolo, bug 48679.  
13526         Patch from David Waite.
13527
13528         * cs-tokenizer.cs: Add handling for #pragma.
13529
13530         * cs-parser.jay: Allow for both yield and yield return in the
13531         syntax.  The anti-cobolization of C# fight will go on!
13532
13533         * class.cs (TypeBuilder.DefineType): Catch error condition here
13534         (Parent.DefineType erroring out and returning null).
13535
13536         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13537         coping with enumerations variables, we were mistakenly processing
13538         them as a regular value type instead of built-in types.  Fixes the
13539         bug #48063
13540
13541         * typemanager.cs (IsBuiltinOrEnum): New method.
13542
13543 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * cs-parser.jay: Upgrade: yield now needs the return clause.
13546
13547 2003-09-19  Martin Baulig  <martin@ximian.com>
13548
13549         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13550         `MemberCache parent' argument.  Normally, an interface doesn't
13551         have a parent type except System.Object, but we use this in gmcs
13552         for generic type parameters.
13553
13554 2003-09-18  Martin Baulig  <martin@ximian.com>
13555
13556         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13557         on `type.IsInterface'; don't check whether the type has a parent
13558         to determine whether it's an interface.
13559
13560 2003-09-15  Martin Baulig  <martin@ximian.com>
13561
13562         * class.cs (TypeContainer.DefineType): Added an error flag to
13563         avoid reporting duplicate CS0146's ("class definition is
13564         circular.").
13565
13566         * driver.cs (Driver.MainDriver): Abort if
13567         RootContext.ResolveTree() reported any errors.
13568
13569 2003-09-07  Martin Baulig  <martin@ximian.com>
13570
13571         * report.cs (Error, Warning): Added overloaded versions which take
13572         a `params object[] args' and call String.Format().
13573
13574 2003-09-07  Martin Baulig  <martin@ximian.com>
13575
13576         * decl.cs (DeclSpace..ctor): Don't call
13577         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13578         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13579         (DeclSpace.RecordDecl): New method.
13580
13581         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13582
13583 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13584
13585         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13586         value attributes to be applied to ParameterBuilders.
13587
13588         * class.cs (MethodCore.LabelParameters): Make static and more
13589         generic so that it can be used from other places - like interface
13590         methods, for instance.
13591
13592         * interface.cs (Interface.Emit): Call LabelParameters before
13593         emitting attributes on the InterfaceMethod.
13594
13595 2003-08-26  Martin Baulig  <martin@ximian.com>
13596
13597         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13598         resolving aliases; fixes #47927.
13599
13600 2003-08-26  Martin Baulig  <martin@ximian.com>
13601
13602         * statement.cs (Using.DoResolve): This is internally emitting a
13603         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13604         do not always return.  Fixes #47681.
13605
13606 2003-08-26  Martin Baulig  <martin@ximian.com>
13607
13608         * decl.cs (MemberCore): Moved WarningNotHiding(),
13609         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13610         into MemberBase.
13611         (AdditionResult): Make this nested in DeclSpace.
13612         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13613         argument; call NamespaceEntry.Define() unless we're nested in a
13614         class or struct.
13615
13616         * namespace.cs (Namespace.DefineName): New public function.  This
13617         is called from DeclSpace's .ctor to add 
13618         (Namespace.Lookup): Include DeclSpaces in the lookup.
13619
13620         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13621
13622         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13623
13624 2003-08-25  Martin Baulig  <martin@ximian.com>
13625
13626         * convert.cs (Convert.ExplicitReferenceConversion): When
13627         converting from an interface type to a class, unbox if the target
13628         type is a struct type.  Fixes #47822.
13629
13630 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13631
13632         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13633         #47854.
13634
13635 2003-08-22  Martin Baulig  <martin@ximian.com>
13636
13637         * class.cs (TypeManager.DefineType): When defining a nested type,
13638         call DefineType() on our parent; fixes #47801.
13639
13640 2003-08-22  Martin Baulig  <martin@ximian.com>
13641
13642         * class.cs (MethodData.Define): While checking if a method is an
13643         interface implementation, improve the test a bit more to fix #47654.
13644
13645 2003-08-22  Martin Baulig  <martin@ximian.com>
13646
13647         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13648         correctly; fixes #47722.
13649
13650 2003-08-22  Martin Baulig  <martin@ximian.com>
13651
13652         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13653         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13654
13655         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13656
13657 2003-08-22  Martin Baulig  <martin@ximian.com>
13658
13659         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13660         can only be assigned in static constructors.  Fixes #47161.
13661
13662 2003-08-22  Martin Baulig  <martin@ximian.com>
13663
13664         Rewrote and improved the flow analysis code.
13665
13666         * flowbranching.cs (FlowBranching): Make this class abstract.
13667         (FlowBranching.CreateBranching): New static function to create a
13668         new flow branching.
13669         (FlowBranchingBlock, FlowBranchingException): New classes.
13670         (FlowBranching.UsageVector.Type): New public readonly field.
13671         (FlowBranching.UsageVector.Breaks): Removed the setter.
13672         (FlowBranching.UsageVector.Returns): Removed the setter.
13673         (FlowBranching.UsageVector): Added Break(), Return(),
13674         NeverReachable() and Throw() methods to modify the reachability.
13675         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13676         done by FlowBranching.Merge().
13677         (FlowBranching.UsageVector.MergeChild): New method; merges the
13678         merge result into the current vector.
13679         (FlowBranching.Merge): New abstract method to merge a branching.
13680
13681 2003-08-12  Martin Baulig  <martin@ximian.com>
13682
13683         * expression.cs (Indirection.CacheTemporaries): Create the
13684         LocalTemporary with the pointer type, not its element type.
13685
13686 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13689         token was a keyword or not.
13690
13691         Add `error' options where an IDENTIFIER was expected;  Provide
13692         CheckToken and CheckIdentifierToken convenience error reporting
13693         functions. 
13694
13695         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13696
13697         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13698         NameSpaceEntry NameSpaceEntry.
13699
13700         (LookupInterfaceOrClass): Avoid creating a full qualified name
13701         from namespace and name: avoid doing lookups when we know the
13702         namespace is non-existant.   Use new Tree.LookupByNamespace which
13703         looks up DeclSpaces based on their namespace, name pair.
13704
13705         * driver.cs: Provide a new `parser verbose' to display the
13706         exception thrown during parsing.  This is turned off by default
13707         now, so the output of a failure from mcs is more graceful.
13708
13709         * namespace.cs: Track all the namespaces defined in a hashtable
13710         for quick lookup.
13711
13712         (IsNamespace): New method
13713
13714 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13715
13716         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13717         we know that we need to concatenate (full typename can never be
13718         null). 
13719
13720         * class.cs: ditto.
13721
13722         * statement.cs: Use a bitfield;  Do not initialize to null things
13723         which are done by the constructor by default.
13724
13725         * cs-parser.jay: bug fix, parameter was 4, not 3.
13726
13727         * expression.cs: Just use the property;
13728
13729         * statement.cs: No need for GetVariableInfo method.
13730
13731 2003-08-08  Martin Baulig  <martin@ximian.com>
13732
13733         * flowanalysis.cs (FlowReturns): This is now nested in the
13734         `FlowBranching' class.
13735         (MyBitVector): Moved this here from statement.cs.
13736         (FlowBranching.SiblingType): New enum type.
13737         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13738
13739 2003-08-07  Martin Baulig  <martin@ximian.com>
13740
13741         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13742         `FlowBranching' class and called `BranchingType'.
13743
13744 2003-08-07  Martin Baulig  <martin@ximian.com>
13745
13746         * flowanalysis.cs: Moved all the control flow analysis code into
13747         its own file.
13748
13749 2003-08-07  Martin Baulig  <martin@ximian.com>
13750
13751         * assign.cs (Assign.DoResolve): `target' must either be an
13752         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13753         #37319.
13754
13755 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * expression.cs (BinaryMethod): This kind of expression is created by the
13758         Binary class if it determines that the operator has to be handled
13759         by a method.
13760
13761         (BinaryDelegate): This kind of expression is created if we are
13762         dealing with a + or - operator on delegates.
13763
13764         (Binary): remove method, argumetns, and DelegateOperator: when
13765         dealing with methods, 
13766
13767         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13768
13769         * statement.cs (Block): use bitfields for the three extra booleans
13770         we had in use.   Remove unused topblock parameter.
13771
13772         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13773
13774         * assign.cs: Drop extra unneeded tests.
13775
13776 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13779
13780         * statement.cs (Foreach): Use VariableStorage instead of
13781         LocalBuilders.   
13782
13783         * codegen.cs (VariableStorage): New class used by clients that
13784         require a variable stored: locals or fields for variables that
13785         need to live across yield.
13786
13787         Maybe provide a convenience api for EmitThis+EmitLoad?
13788
13789         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13790         these bad boys.
13791
13792 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13793
13794         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13795         RemapParameterLValue): New methods that are used to turn a
13796         precomputed FieldInfo into an expression like this:
13797
13798                 instance.FieldInfo
13799
13800         The idea is to use this instead of making LocalVariableReference
13801         have more than one meaning.
13802
13803         * cs-parser.jay: Add error production to BASE.
13804
13805         * ecore.cs: Deal with TypeManager.GetField returning null, which
13806         is now a valid return value.
13807
13808         (FieldExprNoAddress): New expression for Fields whose address can
13809         not be taken.
13810
13811         * expression.cs (LocalVariableReference): During the resolve
13812         phases, create new expressions if we are in a remapping context.
13813         Remove code that dealt with remapping here.
13814
13815         (ParameterReference): same.
13816
13817         (ProxyInstance): New expression, like the `This' expression, but
13818         it is born fully resolved.  We know what we are doing, so remove
13819         the errors that are targeted to user-provided uses of `this'.
13820
13821         * statement.cs (Foreach): our variable is now stored as an
13822         Expression;  During resolution, follow the protocol, dont just
13823         assume it will return this.
13824
13825 2003-08-06  Martin Baulig  <martin@ximian.com>
13826
13827         * support.cs (SeekableStreamReader.cs): New public class.
13828
13829         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13830         SeekableStreamReader instead of the normal StreamReader.
13831
13832 2003-08-04  Martin Baulig  <martin@ximian.com>
13833
13834         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13835         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13836         deambiguate casts and delegate invocations.
13837         (parenthesized_expression): Use the new tokens to ensure this is
13838         not a cast of method invocation.
13839
13840         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13841         when reading a `)' and Deambiguate_CloseParens () was previously
13842         called.
13843
13844         * expression.cs (ParenthesizedExpression): New class.  This is
13845         just used for the CS0075 test.
13846         (Binary.DoResolve): Check for CS0075.   
13847
13848 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13849
13850         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13851         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13852         reference comparison.
13853
13854         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13855         examine the ReturnType for equality - this is necessary in the
13856         cases of implicit and explicit operators whose signature also
13857         includes the return type.
13858
13859 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * namespace.cs: Cache the result of the namespace computation,
13862         instead of computing it every time.
13863
13864 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13865
13866         * decl.cs: Use a global arraylist that we reuse over invocations
13867         to avoid excesive memory consumption.  Reduces memory usage on an
13868         mcs compile by one meg (45 average).
13869
13870         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13871         private, work around that.
13872
13873 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * literal.cs (IntLiteral): Define Zero and One static literals. 
13876
13877         * cs-parser.jay (integer_literal): use static literals to reduce
13878         memory usage for the most used literals (0, 1 and -1).  211kb
13879         reduced in memory usage.
13880
13881         Replace all calls to `new ArrayList' with `new
13882         ArrayList(4)' which is a good average number for most allocations,
13883         and also requires only 16 bytes of memory for its buffer by
13884         default. 
13885
13886         This reduced MCS memory usage in seven megabytes for the RSS after
13887         bootstrapping.
13888
13889 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13890
13891         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13892         handle params methods the correct way by forming only one
13893         applicable set with params and normal methods in them. Earlier we
13894         were looking at params methods only if we found no normal methods
13895         which was not the correct thing to do.
13896
13897         (Invocation.BetterFunction): Take separate arguments indicating
13898         when candidate and the best method are params methods in their
13899         expanded form.
13900
13901         This fixes bugs #43367 and #46199.
13902
13903         * attribute.cs: Documentation updates.
13904
13905         (CheckAttribute): Rename to CheckAttributeTarget.
13906         (GetValidPlaces): Rename to GetValidTargets.
13907
13908         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13909         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13910
13911         Fixes bug #44468.
13912
13913 2003-07-28  Martin Baulig  <martin@ximian.com>
13914
13915         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13916         name when looking up the base class of a nested class.  Fixes #46977.
13917
13918 2003-07-26  Martin Baulig  <martin@ximian.com>
13919
13920         * expression.cs (Indexers.Indexer): New nested struct; contains
13921         getter, setter and the indexer's type.
13922         (Indexers.Properties): This is now an ArrayList of
13923         Indexers.Indexer's.
13924         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13925         indexer doesn't have any getters.
13926
13927         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13928         for embedded property and indexer assignments.
13929
13930 2003-07-26  Martin Baulig  <martin@ximian.com>
13931
13932         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13933         preprocessor directive is not the first non-whitespace character
13934         on a line.
13935
13936 2003-07-26  Martin Baulig  <martin@ximian.com>
13937
13938         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13939         namespace parsing, follow the spec more closely.
13940
13941         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13942         NamespaceEntry.Lookup().
13943
13944 2003-07-25  Martin Baulig  <martin@ximian.com>
13945
13946         * MethodCore.cs (OverridesSomething): New public field; it's set
13947         from TypeContainer.DefineMembers if this method overrides
13948         something (which doesn't need to be a method).  Fix #39462.
13949
13950 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13951
13952         * typemanager.cs (GetMembers): Ensure that the list of members is
13953         reversed. This keeps things in sync.
13954
13955         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13956         find an AttributeUsage attribute.
13957
13958         * expression.cs (Invocation.OverloadResolve): Perform the check
13959         which disallows Invoke to be directly called on a Delegate.
13960
13961         (Error_InvokeOnDelegate): Report error cs1533.
13962
13963 2003-07-25  Martin Baulig  <martin@ximian.com>
13964
13965         * expression.cs (Indexers.GetIndexersForType): Only look in the
13966         interface hierarchy if the requested type is already an
13967         interface.  Fixes #46788 while keeping #46502 fixed.
13968
13969 2003-07-25  Martin Baulig  <martin@ximian.com>
13970
13971         * class.cs (TypeContainer.DefineMembers): Check whether all
13972         readonly fields have been assigned and report warning CS0649 if
13973         not.
13974
13975         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13976         a valuetype.
13977
13978 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13979
13980         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13981         returned from GetMethods to make things consistent with the
13982         assumptions MCS makes about ordering of methods.
13983
13984         This should comprehensively fix bug #45127 and it does :-)
13985
13986         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13987         ordering is actually reverse.
13988
13989         * Clean up some debug messages I left lying around.
13990
13991         * interface.cs (Populate*): Get rid of code which emits attributes
13992         since the stage in which we emit attributes is the 'Emit' stage,
13993         not the define stage.
13994
13995         (Emit): Move attribute emission for interface members here.
13996
13997 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13998
13999         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14000         closely: we eliminate methods in base types when we have an
14001         applicable method in a top-level type.
14002
14003         Please see section 14.5.5.1 for an exact description of what goes
14004         on. 
14005
14006         This fixes bug #45127 and a host of other related to corlib compilation.
14007
14008         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14009         array is the method corresponding to the top-level type (this is
14010         because of the changes made to icall.c) so we change this
14011         accordingly.
14012
14013         (MethodGroupExpr.Name): This too.
14014
14015         * typemanager.cs (GetElementType): New method which does the right
14016         thing when compiling corlib. 
14017
14018         * everywhere: Make use of the above in the relevant places.
14019
14020 2003-07-22  Martin Baulig  <martin@ximian.com>
14021
14022         * cs-parser.jay (invocation_expression): Moved
14023         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14024         `cast_expression', but create a InvocationOrCast which later
14025         resolves to either an Invocation or a Cast.
14026
14027         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14028         method; call this before EmitStatement() to make sure that this
14029         expression can be used as a statement.
14030
14031         * expression.cs (InvocationOrCast): New class; resolves to either
14032         an Invocation or a Cast.
14033
14034         * statement.cs (StatementExpression): Call ResolveStatement() on
14035         the ExpressionStatement before emitting it.
14036
14037 2003-07-21  Martin Baulig  <martin@ximian.com>
14038
14039         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14040         `ref' and `out' attributes match; fixes #46220.
14041         (MemberAccess.ResolveMemberAccess): You can't reference a type
14042         through an expression; fixes #33180.
14043         (Indexers.GetIndexersForType): Don't return the indexers from
14044         interfaces the class implements; fixes #46502.
14045
14046 2003-07-21  Martin Baulig  <martin@ximian.com>
14047
14048         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14049         CS0661 checks; fixes bug #30442.
14050
14051 2003-07-21  Martin Baulig  <martin@ximian.com>
14052
14053         * decl.cs (AdditionResult): Added `Error'.
14054
14055         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14056
14057         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14058         makes cs0031.cs actually work.
14059
14060 2003-07-20  Martin Baulig  <martin@ximian.com>
14061
14062         * namespace.cs: Fixed that bug which caused a crash when compiling
14063         the debugger's GUI.
14064
14065 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14066
14067         * typemanager.cs (LookupTypeReflection): Never expose types which
14068         are NotPublic, NestedPrivate, NestedAssembly, or
14069         NestedFamANDAssem.  We used to return these, and later do a check
14070         that would report a meaningful error, but the problem is that we
14071         would not get the real match, if there was a name override.
14072
14073 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * namespace.cs (Namespace, Name): Do not compute the namespace
14076         name dynamically, compute it in the constructor.  This reduced
14077         memory usage by 1697 KB.
14078
14079         * driver.cs: Use --pause to pause at the end.
14080
14081 2003-07-17  Peter Williams  <peter@newton.cx>
14082
14083         * Makefile: Change the name of the test target so that it doesn't
14084         conflict with the recursive test target.
14085
14086 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14089         AddressOf): Do not use EmitThis, that was wrong, use the actual
14090         this pointer.
14091
14092 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * class.cs (MethodData.Define): While checking if a method is an
14095         interface implementation, improve the test: If we are not public
14096         (use new test here: use the computed MethodAttributes directly,
14097         instead of the parsed modifier flags) check if the `implementing'
14098         method comes from an interface or not.
14099
14100         * pending.cs (VerifyPendingMethods): Slightly better error
14101         message.
14102
14103         * makefile: add test target that does the mcs bootstrap.
14104
14105 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14106
14107         * interface.cs (Define): Do nothing here since there are no
14108         members to populate etc. Move the attribute emission out of here
14109         since this was just totally the wrong place to put it. Attribute
14110         application happens during the 'Emit' phase, not in the 'Define'
14111         phase.
14112
14113         (Emit): Add this method and move the attribute emission here
14114
14115         * rootcontext.cs (EmitCode): Call the Emit method on interface
14116         types too.
14117
14118 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14119
14120         * expression.cs (OverloadResolve): Report error only if Location
14121         is not 'Null' which means that there was a probe going on.
14122
14123 2003-07-14  Martin Baulig  <martin@ximian.com>
14124
14125         * expression.cs (ConditionalLogicalOperator): New public class to
14126         implement user defined conditional logical operators.
14127         This is section 14.11.2 in the spec and bug #40505.
14128
14129 2003-07-14  Martin Baulig  <martin@ximian.com>
14130
14131         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14132
14133 2003-07-14  Martin Baulig  <martin@ximian.com>
14134
14135         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14136
14137         * ecore.cs (IVariable.VerifyFixed): New interface method.
14138
14139         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14140         operator, check whether the variable is actually fixed.  Fixes bug
14141         #36055.  Set a variable definitely assigned when taking its
14142         address as required by the spec.
14143
14144         * statement.cs (LocalInfo.IsFixed): New field.
14145         (LocalInfo.MakePinned): Set `IsFixed' to true.
14146
14147 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14148
14149         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14150         for .ctors, ensure that we only ask for members declared in the
14151         attribute type (BindingFlags.DeclaredOnly).
14152
14153         Fixes bug #43632.
14154
14155         * expression.cs (Error_WrongNumArguments): Report error 1501
14156         correctly the way CSC does.
14157
14158 2003-07-13  Martin Baulig  <martin@ximian.com>
14159
14160         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14161         lookup on the fully qualified name, to make things like "X.X" work
14162         where "X.X" is a fully qualified type name, but we also have a
14163         namespace "X" in the using list.  Fixes #41975.
14164
14165 2003-07-13  Martin Baulig  <martin@ximian.com>
14166
14167         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14168         function. If we're a CompoundAssign, we need to create an embedded
14169         CompoundAssign, not an embedded Assign.
14170         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14171         Fixes #45854.
14172
14173 2003-07-13  Martin Baulig  <martin@ximian.com>
14174
14175         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14176         work to fix bug #46088.
14177
14178 2003-07-13  Ravi Pratap <ravi@ximian.com>
14179
14180         * class.cs (Operator.Emit): Do not emit attributes here - it is
14181         taken care of by the Method class that we delegate too. This takes
14182         care of bug #45876.
14183
14184 2003-07-10  Martin Baulig  <martin@ximian.com>
14185
14186         * expression.cs (TypeOfVoid): New class.
14187         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14188
14189 2003-07-10  Martin Baulig  <martin@ximian.com>
14190
14191         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14192         bug #35957.
14193
14194 2003-07-10  Martin Baulig  <martin@ximian.com>
14195
14196         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14197         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14198
14199         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14200
14201         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14202
14203 2003-07-10  Martin Baulig  <martin@ximian.com>
14204
14205         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14206         of decimal.  Fixes #42850.
14207
14208         NOTE: I also fixed the created byte blob, but this doesn't work on
14209         the MS runtime and csc never produces any byte blobs for decimal
14210         arrays.
14211
14212 2003-07-10  Martin Baulig  <martin@ximian.com>
14213
14214         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14215         structs; fixes #32068.
14216         (Block.AddChildVariableNames): Fixed #44302.
14217
14218 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14219
14220         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14221
14222 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14223
14224         * attribute.cs: And this test is onger needed.
14225
14226 2003-07-08  Martin Baulig  <martin@ximian.com>
14227
14228         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14229         inaccessible types.  Fixes #36313.
14230
14231         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14232
14233         * namespace.cs (NamespaceEntry): Create implicit entries for all
14234         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14235         implicit entries for N1.N2 and N1.
14236
14237 2003-07-08  Martin Baulig  <martin@ximian.com>
14238
14239         Rewrote the handling of namespaces to fix a lot of the issues
14240         wrt. `using' aliases etc.
14241
14242         * namespace.cs (Namespace): Splitted this class into a
14243         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14244
14245         * typemanager.cs (TypeManager.IsNamespace): Removed.
14246         (TypeManager.ComputeNamespaces): Only compute namespaces from
14247         loaded assemblies here, not the namespaces from the assembly we're
14248         currently compiling.
14249
14250 2003-07-08  Martin Baulig  <martin@ximian.com>
14251
14252         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14253
14254 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14255
14256         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14257         already fixed it.  
14258
14259         I thought about the memory savings here, but LookupTypeReflection
14260         is used under already very constrained scenarios.  Compiling
14261         corlib or mcs only exposes one hit, so it would not really reduce
14262         any memory consumption.
14263
14264 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14265
14266         * typemanager.cs: fixes bug #45889 by only adding public types from
14267         other assemblies to the list of known types.
14268
14269 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14270
14271         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14272         on the type we resolved.
14273
14274 2003-07-05  Martin Baulig  <martin@ximian.com>
14275
14276         * pending.cs (PendingImplementation.ParentImplements): Don't
14277         create the proxy if the parent is abstract.
14278
14279         * class.cs (TypeContainer.DefineIndexers): Process explicit
14280         interface implementations first.  Fixes #37714.
14281
14282 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14283
14284         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14285         defined recursively;  but since we modify the input parameters
14286         (left is set to `this' temporarily), we reset this value if the
14287         left_is_explicit is false, which gives the original semantics to
14288         the code.  
14289
14290         * literal.cs (NullPointer): new class used to represent a null
14291         literal in a pointer context.
14292
14293         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14294         type is a pointer, use a NullPointer object instead of a
14295         NullLiteral.   Closes 43687
14296
14297         (ExplicitConversion): Convert pointer values using
14298         the conv opcode to the proper type.
14299
14300         * ecore.cs (New): change ValueTypeVariable property into a method,
14301         that returns whether the valuetype is suitable for being used.
14302
14303         * expression.cs (Binary.DoNumericPromotions): Only return if we
14304         the int constant was a valid uint, and we can return both left and
14305         right as uints.  If not, we continue processing, to trigger the
14306         type conversion.  This fixes 39018.
14307
14308         * statement.cs (Block.EmitMeta): During constant resolution, set
14309         the CurrentBlock property on the emitcontext, so that we resolve
14310         constants propertly.
14311
14312 2003-07-02  Martin Baulig  <martin@ximian.com>
14313
14314         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14315         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14316
14317         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14318         than emitting it here.
14319
14320         * statement.cs: Fixed some more flow analysis bugs.
14321
14322 2003-07-02  Martin Baulig  <martin@ximian.com>
14323
14324         * class.cs (MethodData.Define): When implementing interface
14325         methods, set Final unless we're Virtual.
14326
14327         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14328         check work for interface methods.
14329
14330 2003-07-01  Martin Baulig  <martin@ximian.com>
14331
14332         * ecore.cs (EmitContext.This): Replaced this property with a
14333         GetThis() method which takes a Location argument.  This ensures
14334         that we get the correct error location for a CS0188.
14335
14336 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14337
14338         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14339         ImplicitStandardConversion.
14340
14341         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14342
14343 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14344
14345         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14346         optimization.
14347
14348 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14349
14350         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14351         constructors.
14352
14353         (MethodData.Define): Turn off initlocals for unsafe methods.
14354
14355 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14356
14357         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14358         complete;  Fixes #37521.
14359
14360         * delegate.cs: Use Modifiers.TypeAttr to compute the
14361         TypeAttributes, instead of rolling our own.  This makes the flags
14362         correct for the delegates.
14363
14364 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * class.cs (Constructor.Define): Set the private flag for static
14367         constructors as well.
14368
14369         * cs-parser.jay (statement_expression): Set the return value to
14370         null, to avoid a crash when we catch an error.
14371
14372 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14373
14374         * cs-parser.jay: Applied patch from Jackson that adds support for
14375         extern and unsafe modifiers to destructor declarations.
14376
14377         * expression.cs: Report error 21 if the user is trying to index a
14378         System.Array.
14379
14380         * driver.cs: Add an error message, suggested by the bug report.
14381
14382         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14383         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14384
14385 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * namespace.cs: Add some information to reduce FAQs.
14388
14389 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14390
14391         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14392         underlying enumeration types.  Fixes #43915.
14393
14394         * expression.cs: Treat ushort/short as legal values to be used in
14395         bitwise operations.
14396
14397 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14398
14399         * delegate.cs: transfer custom attributes for paramenters from
14400         the delegate declaration to Invoke and BeginInvoke.
14401
14402 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14403
14404         * attribute.cs: handle custom marshalers and emit marshal info
14405         for fields, too.
14406
14407 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14408
14409         * makefile.gnu: Added anonymous.cs to the compiler sources.
14410
14411 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14412
14413         * iterators.cs: Change the name of the proxy class to include two
14414         underscores.
14415
14416         * cs-parser.jay: Update grammar to include anonymous methods.
14417
14418         * anonymous.cs: new file.
14419
14420 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14421
14422         * class.cs (Field.Define): Add missing test for pointers and
14423         safety. 
14424
14425 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14426
14427         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14428         we use the stobj opcode.
14429
14430         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14431         since it wasn't the correct fix. 
14432
14433         It still is puzzling that we are required to use stobj for IntPtr
14434         which seems to be a ValueType.
14435
14436 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14437
14438         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14439         during regular simple name resolution.   Now, the trick is that
14440         instead of returning for processing the simplename, we do a
14441         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14442         contextual lookup type).   If a match is found, return that, if
14443         not, return for further composition.
14444
14445         This fixes long-standing 30485.
14446
14447         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14448         using the address to initialize an object, do an Stobj instead of
14449         using the regular Stelem.
14450
14451         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14452         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14453         Because if we are a BaseIndexerAccess that value will be true.
14454         Fixes 43643.
14455
14456         * statement.cs (GotoCase.Resolve): Return after reporting an
14457         error, do not attempt to continue. 
14458
14459         * expression.cs (PointerArithmetic.Emit): If our operand is a
14460         long, convert our constants to match the operand before
14461         multiplying.  Convert to I type before adding.   Fixes 43670.
14462
14463 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14464
14465         * enum.cs (ImplicitConversionExists) : Rename to
14466         ImplicitEnumConversionExists to remove ambiguity. 
14467
14468         * ecore.cs (NullCast): New type of cast expression class which
14469         basically is very similar to EmptyCast with the difference being
14470         it still is a constant since it is used only to cast a null to
14471         something else
14472         (eg. (string) null)
14473
14474         * convert.cs (ImplicitReferenceConversion): When casting a null
14475         literal, we return a NullCast.
14476
14477         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14478         should be around anymore.
14479
14480         The renaming (reported was slightly wrong). Corrections:
14481
14482         ConvertImplicitStandard -> ImplicitConversionStandard
14483         ConvertExplicitStandard -> ExplicitConversionStandard
14484
14485         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14486         before passing them in !
14487
14488         * convert.cs (ImplicitConversionStandard): When comparing for
14489         equal expr and target types, ensure that expr is not a
14490         NullLiteral.
14491
14492         In general, we must not be checking (expr_type ==
14493         target_type) in the top level conversion methods
14494         (ImplicitConversion, ExplicitConversion etc). This checking is
14495         done in the methods that they delegate to.
14496
14497 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14498
14499         * convert.cs: Move Error_CannotConvertType,
14500         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14501         ImplicitNumericConversion, ImplicitConversionExists,
14502         ImplicitUserConversionExists, StandardConversionExists,
14503         FindMostEncompassedType, FindMostSpecificSource,
14504         FindMostSpecificTarget, ImplicitUserConversion,
14505         ExplicitUserConversion, GetConversionOperators,
14506         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14507         TryImplicitIntConversion, Error_CannotConvertImplicit,
14508         ConvertImplicitRequired, ConvertNumericExplicit,
14509         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14510         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14511         its own file.
14512
14513         Perform the following renames:
14514
14515         StandardConversionExists -> ImplicitStandardConversionExists
14516         ConvertImplicit -> ImplicitConversion
14517         ConvertImplicitStandard -> ImplicitStandardConversion
14518         TryImplicitIntConversion -> ImplicitIntConversion
14519         ConvertImplicitRequired -> ImplicitConversionRequired
14520         ConvertNumericExplicit -> ExplicitNumericConversion
14521         ConvertReferenceExplicit -> ExplicitReferenceConversion
14522         ConvertExplicit -> ExplicitConversion
14523         ConvertExplicitStandard -> ExplicitStandardConversion
14524
14525 2003-05-19  Martin Baulig  <martin@ximian.com>
14526
14527         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14528         (TypeInfo): Added support for structs having structs as fields.
14529
14530         * ecore.cs (FieldExpr): Implement IVariable.
14531         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14532         VariableInfo for the field.
14533
14534 2003-05-18  Martin Baulig  <martin@ximian.com>
14535
14536         * expression.cs (This.DoResolve): Report a CS0027 if we're
14537         emitting a field initializer.
14538
14539 2003-05-18  Martin Baulig  <martin@ximian.com>
14540
14541         * expression.cs (This.ResolveBase): New public function.
14542         (This.DoResolve): Check for CS0188.
14543
14544         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14545         This.Resolve().
14546
14547         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14548         `instance_expression' to null if we don't have any non-static
14549         methods.
14550
14551 2003-05-18  Martin Baulig  <martin@ximian.com>
14552
14553         Reworked the way how local variables and parameters are handled by
14554         the flow analysis code.
14555
14556         * statement.cs (TypeInfo, VariableMap): New public classes.
14557         (VariableInfo): New public class.  This is now responsible for
14558         checking whether a variable has been assigned.  It is used for
14559         parameters and local variables.
14560         (Block.EmitMeta): Take the InternalParameters as argument; compute
14561         the layout of the flow vectors here.
14562         (Block.LocalMap, Block.ParameterMap): New public properties.
14563         (FlowBranching): The .ctor doesn't get the InternalParameters
14564         anymore since Block.EmitMeta() now computes the layout of the flow
14565         vector.
14566         (MyStructInfo): This class is now known as `StructInfo' and nested
14567         in `TypeInfo'; we don't access this directly anymore.
14568
14569         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14570         property and removed IsAssigned(), IsFieldAssigned(),
14571         SetAssigned() and SetFieldAssigned(); we now call them on the
14572         VariableInfo so we don't need to duplicate this code everywhere.
14573
14574         * expression.cs (ParameterReference): Added `Block block' argument
14575         to the .ctor.
14576         (LocalVariableReference, ParameterReference, This): The new
14577         VariableInfo class is now responsible for all the definite
14578         assignment stuff.
14579
14580         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14581         IsParameterAssigned, SetParameterAssigned): Removed.
14582
14583 2003-05-18  Martin Baulig  <martin@ximian.com>
14584
14585         * typemanager.cs (InitCoreTypes): Try calling
14586         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14587         the 3-args-version.  Corlib now also needs our `void_type'.
14588         (GetMethod): Added overloaded version which takes an optional
14589         `bool report_errors' to allow lookups of optional methods.
14590
14591 2003-05-12  Martin Baulig  <martin@ximian.com>
14592
14593         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14594         only used for locals and not for parameters.
14595
14596 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * support.cs (InternalParameters.ParameterType): Return the
14599         ExternalType of the parameter.
14600
14601         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14602         they were unused.
14603
14604 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * class.cs (MethodData.Define): Do not set the `newslot' on
14607         interface members, if they are also flagged as "override".
14608
14609         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14610         better code for ++i and i++.  This only works for static fields
14611         and local variables.
14612
14613         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14614         want to pull the DeclSpace out of the builder_to_declspace instead
14615         of the TypeBuilder (like in TypeContainer.FindMembers).
14616
14617         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14618         instead of LookupTypeContainer.  Fixes the crash on .NET for
14619         looking up interface members.
14620
14621         * const.cs: Create our own emit context during the Definition
14622         stage, so that constants are evaluated in the proper context, when
14623         a recursive definition happens.
14624
14625 2003-05-11  Martin Baulig  <martin@ximian.com>
14626
14627         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14628         new block for a switch section.
14629         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14630         the adding/lookup in the switch block.  Fixes #39828.
14631
14632 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14635         functionality: I needed to convert the data after I had performed
14636         the add/sub operation into the operands type size.
14637
14638         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14639         pass the type for the box operation, otherwise the resulting
14640         object would have been of type object.
14641
14642         (BoxedCast): Add constructor to specify the type to box as.
14643
14644 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * iterators.cs: I was reusing the `count' variable inadvertently,
14647         take steps to not allow this to happen.
14648
14649 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14652         by creating an array at the point where the params starts and
14653         putting all those arguments there, then adjusting the size of the
14654         array.
14655
14656 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14657
14658         * expression.cs (New.AddressOf): Implement interface
14659         IMemoryLocation.  This is used when the `new' operator is used in
14660         the context of an invocation to a method on a value type.
14661
14662         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14663         example. 
14664
14665         * namespace.cs: Also check the using aliases here.
14666
14667         * driver.cs: Move the test for using validity after the types have
14668         been entered, so we do a single pass that also includes the using
14669         aliases. 
14670
14671         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14672         in the regular case.   CreateSiblingForFinally is doing extra
14673         error checking.
14674
14675         * attribute.cs (GetAttributeArgumentExpression): Store the result
14676         on an out value, and use the return value to indicate failure
14677         instead of using null (which is a valid return for Constant.GetValue).
14678
14679         * statement.cs: Perform the analysis flow for the increment
14680         portion after the statement, because this will be the real flow of
14681         execution.  Fixes #42385
14682
14683         * codegen.cs (EmitContext.EmitArgument,
14684         EmitContext.EmitStoreArgument): New helper functions when the
14685         RemapToProxy flag is set.
14686
14687         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14688         function.
14689
14690         Add support for remapping parameters. 
14691
14692         * iterators.cs: Propagate parameter values;  Store parameter
14693         values in the proxy classes.
14694
14695 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14698         need a proxy reference;  I do not know what I was thinking
14699
14700         * cs-parser.jay (constructor_initializer): catch another error,
14701         and display nice message.
14702
14703         (field_declaration): catch void field declaration
14704         to flag a better error. 
14705
14706         * class.cs (MemberBase.CheckBase): Report an error instead of a
14707         warning if a new protected member is declared in a struct. 
14708         (Field.Define): catch the error of readonly/volatile.
14709
14710         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14711
14712         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14713         volatile variable is taken
14714
14715 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * statement.cs (Fixed.Resolve): Report an error if we are not in
14718         an unsafe context.
14719
14720 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14721
14722         * typemanager.cs: reuse the code that handles type clashes for
14723         delegates and enumerations.
14724
14725         * class.cs (Report28): Always report.
14726
14727         * expression.cs (EncodeAsAttribute): Allow nulls here.
14728
14729 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14732         the functionality for testing whether an expression is valid for
14733         an attribute here.  Also handle the case of arrays of elements
14734         being stored. 
14735
14736         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14737         encoding a linear array into an array of objects that are suitable
14738         to be passed to an CustomAttributeBuilder.
14739
14740         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14741
14742         * ecore.cs: (FieldExpr): Handle field remapping here.
14743
14744         * iteratators.cs: Pass the instance variable (if the method is an
14745         instance method) to the constructors, so we can access the field
14746         variables on the class.
14747
14748         TODO: Test this with structs.  I think the THIS variable on
14749         structs might have to be a pointer, and not a refenrece
14750
14751 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14752
14753         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14754         local variables to fields in a proxy class.
14755
14756         * iterators.cs (PopulateProxy): Rename our internal fields to
14757         <XXX>.  
14758         Create a <THIS> field if we are an instance method, so we can
14759         reference our parent container variables.
14760         (MapVariable): Called back from the EmitContext code to enter a
14761         new variable to field mapping into the proxy class (we just create
14762         a FieldBuilder).
14763
14764         * expression.cs
14765         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14766         for using the remapped locals to fields.
14767
14768         I placed the code here, because that gives the same semantics to
14769         local variables, and only changes the Emit code.
14770
14771         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14772         statements inside iterators.
14773         (VariableInfo): Add a FieldBuilder for the cases when we are
14774         remapping local variables to fields in a proxy class
14775
14776         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14777         current_block != null.
14778
14779         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14780         not cope with strings, as it has been moved to the
14781         TableSwitchEmit.  Fixed bug in switch generation.
14782
14783         * expression.cs (New.DoResolve): Provide more context for the user
14784         when reporting an error.
14785
14786         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14787         pointers. 
14788
14789         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14790         check the permissions for it.  Note than in a type-resolution
14791         context the check was already present in DeclSpace.ResolveType,
14792         but was missing from the MemberAccess.
14793
14794         (ArrayCreation.CheckIndices): warn if the user has
14795         more nested levels of expressions, but there are no more
14796         dimensions specified.  Avoids crash on bug 41906.
14797
14798 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14799
14800         * statement.cs (Block): replace Implicit bool, for a generic
14801         flags.   
14802         New flag: `Unchecked'.  This is used during the EmitMeta phase
14803         (which is out-of-line with the regular Resolve/Emit process for a
14804         statement, as this is done ahead of time, but still gets a chance
14805         to call constant resolve).
14806
14807         (Block.Flags): new enum for adding a new flag.
14808
14809         (Block.EmitMeta): track the state of unchecked.
14810
14811         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14812         to enable constant resolution to work there as well.
14813
14814 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14815
14816         * typemanager.cs (ienumerable_type): Also look up
14817         System.Collections.IEnumerable. 
14818
14819 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14820
14821         TODO: Test more than one conditional per method.
14822
14823         * class.cs (Indexer.Define): Report the location where the user is
14824         referencing the unsupported feature.
14825
14826         (MethodData): Overload the use of `conditionals' to
14827         minimize the creation of needless ArrayLists.   This saves roughly
14828         212kb on my machine.
14829
14830         (Method): Implement the new IIteratorContainer interface.
14831         (Method.SetYields): Implement the method by setting the ModFlags
14832         to contain METHOD_YIELDS.
14833
14834         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14835         which just got set to null.
14836
14837         * iterators.cs: New file.
14838
14839         (Yield, YieldBreak): New statements.
14840
14841         * statement.cs (Return.Resolve): Flag an error if we are used in
14842         an iterator method.
14843
14844         * codegen.cs (InIterator): New flag set if the code is being
14845         compiled in an iterator method.
14846
14847         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14848         internal modifier, and we just use it to avoid adding extra
14849         fields, as this is seldom used.  
14850
14851         * cs-parser.jay: Add yield_statement (yield and yield break).
14852
14853         * driver.cs: New flag -v2 to turn on version 2 features. 
14854
14855         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14856         hashtable when v2 is enabled.
14857
14858 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14859
14860         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14861         there is already a namespace defined with this name.
14862
14863         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14864         people upgraded their corlibs.
14865
14866         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14867         always use fully qualified types, no need to use the compiler
14868         front end.
14869
14870         (TypeManager.IsNamespace): Use binarysearch.
14871
14872         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14873         AddDelegate): I did not quite use the new IsValid API properly: I
14874         have to pass the short-name and the fullname.  I was passing only
14875         the basename instead of the fullname sometimes. 
14876
14877         (TypeContainer.DefineType): call NamespaceClash.
14878
14879         * interface.cs (Interface.DefineType): use NamespaceClash before
14880         defining the type.
14881
14882         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14883         defining the type.
14884
14885         * enum.cs: (Enum.DefineType): use NamespaceClash before
14886         defining the type.
14887
14888         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14889         speed increase.  First, use the negative_hits cache when we get a
14890         negative.  Second, add the type with its full original name
14891         instead of the new . and + encoded name (reflection uses + to
14892         separate type from a nested type).  Use LookupTypeReflection
14893         directly which bypasses the type->name hashtable (that we already
14894         know does not contain the type.
14895
14896         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14897         location/container type. 
14898
14899         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14900
14901 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14902
14903         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14904
14905         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14906         method is being referenced in the method group from a static
14907         context, and report error 120 if so.
14908
14909         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14910         Error118. 
14911
14912         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14913         is created, we create the A namespace).
14914
14915         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14916         Fixes #41591
14917
14918 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14919
14920         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14921         invocation to ModuleBuilder.GetType with the same values will
14922         return a new type instance, so we need to cache its return
14923         values. 
14924
14925         * expression.cs (Binary.ResolveOperator): Only allow the compare
14926         operators on enums if they are of the same type.
14927
14928         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14929         types of ValueType on their own case.  Before we were giving them
14930         the same treatment as objects.
14931
14932         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14933         fullname.  Short name is used to compare against container name.
14934         Fullname is used to check against defined namespace names.
14935
14936         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14937         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14938
14939         (Method.CheckBase): Call parent.
14940         (MemberBase.CheckBase): Check for protected members on sealed
14941         classes.
14942         (PropertyBase.CheckBase): Call parent.
14943         (Field.Define): Call parent.
14944
14945         * report.cs: Negative error codes are now mapped to 8000 - code,
14946         so that the display is render more nicely.
14947
14948         * typemanager.cs: Do not use try/catch, instead report a regular
14949         error. 
14950
14951         (GetPointerType, GetReferenceType): These methods provide
14952         mechanisms to obtain the T* and T& from a T.  We had the code
14953         previously scattered around the code base, and it also used
14954         TypeManager.LookupType that would go through plenty of caches.
14955         This one goes directly to the type source.
14956
14957         In some places we did the Type.GetType followed by
14958         ModuleBuilder.GetType, but not in others, so this unifies the
14959         processing as well.
14960
14961         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14962         statements now that we have namespace information.
14963
14964         * typemanager.cs (IsNamespace): New method, returns whether the
14965         string presented is a namespace or not.
14966
14967         (ComputeNamespaces): New public entry point, computes the list of
14968         available namespaces, using the GetNamespaces API call in Mono, or
14969         the slower version in MS.NET.   
14970
14971         Now before we start the semantic analysis phase, we have a
14972         complete list of namespaces including everything that the user has
14973         provided.
14974
14975         Deleted old code to cache namespaces in .nsc files.
14976
14977 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14980         class/struct location definition Location for the implicit
14981         constructor location.
14982
14983         (Operator.Define): Use the location of the operator for the
14984         implicit Method definition.
14985
14986         (Constructor.Emit): use the constructor location for the implicit
14987         base initializer constructor.
14988
14989         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14990         and the Expression class now contains two new methods:
14991
14992         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14993         isolate type lookup from the rest of the resolution process.
14994
14995         Since we use Expressions to hold type definitions due to the way
14996         we parse the input we have historically overloaded Resolve to
14997         perform the Type lookups if a special flag is passed.  Now this is
14998         eliminated and two methods take their place. 
14999
15000         The differences in the two methods between xStep and xTerminal is
15001         that xStep is involved in our current lookup system that uses
15002         SimpleNames to compose a name, while xTerminal is used just to
15003         catch the case where the simplename lookup failed.
15004
15005 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * expression.cs (ResolveMemberAccess): Remove redundant code.
15008         TypeExpr expressions are always born fully resolved.
15009
15010         * interface.cs (PopulateMethod): Do not lookup the types twice.
15011         We were doing it once during SemanticAnalysis and once during
15012         PopulateMethod.
15013
15014         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15015         in local variable type definitions, were being returned as a
15016         SimpleName (we decomposed everything into a string), that is
15017         because primary_expression was being used instead of a type in the
15018         grammar (reduce/reduce conflicts).
15019
15020         The part that was wrong is that we converted the expression into a
15021         string (an oversimplification in one hand, compounded with primary
15022         expressions doing string concatenation).
15023
15024         So things like:
15025
15026         A.B.C [] x;
15027
15028         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15029         using clauses from working on this particular context.  And a type
15030         was being matched directly against "A.B.C[]".
15031
15032         We now use the correct approach, and allow for ComposedCast to be
15033         part of the unary expression.  So the "A.B.C []" become a composed
15034         cast of "A.B.C" (as a nested group of MemberAccess with a
15035         SimpleName at the end) plus the rank composition "[]". 
15036
15037         Also fixes 35567
15038
15039 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15042         for the access level checking.
15043
15044         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15045         `TypeContainer container', because I kept getting confused when I
15046         was debugging this code.
15047
15048         * expression.cs (Indexers): Instead of tracking getters/setters,
15049         we now track them in parallel.  We create one arraylist less, but
15050         most importantly it is possible now for the LValue code to find a
15051         matching get for a set.
15052
15053         (IndexerAccess.DoResolveLValue): Update the code.
15054         GetIndexersForType has been modified already to extract all the
15055         indexers from a type.  The code assumed it did not.
15056
15057         Also make the code set the correct return type for the indexer.
15058         This was fixed a long time ago for properties, but was missing for
15059         indexers.  It used to be void_type.
15060
15061         (Binary.Emit): Test first for doubles instead of
15062         floats, as they are more common.
15063
15064         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15065         when dealing with floats and the <=, >= operators.  This fixes bug
15066         #39314 
15067
15068         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15069         to load the array value by emitting a load on the foreach variable
15070         type.  This was incorrect.  
15071
15072         We now emit the code to load an element using the the array
15073         variable type, and then we emit the conversion operator.
15074
15075         Fixed #40176
15076
15077 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15078
15079         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15080
15081 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15082
15083         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15084         test for protection before we test for signatures. 
15085
15086         (MethodSignature.ToString): implement.
15087
15088         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15089         to the case where we reduced into a LongConstant.
15090
15091         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15092         depend on whether the information is acurrate, because the
15093         Microsoft runtime will always claim that the array type is public,
15094         regardless of the real state.
15095
15096         If the type is a pointer, another problem happens: the type is
15097         reported as non-public in Microsoft.  
15098
15099         In both cases we have to call CheckAccessLevel recursively with
15100         the underlying type as the argument to be tested.
15101
15102 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * assign.cs (Assign.Emit): If we are dealing with a compound
15105         assignment expression, we should use the code path that stores the
15106         intermediate result in a temporary value.  This fixes #40903.
15107
15108         *expression.cs (Indirection.ToString): Provide ToString method for
15109         debugging. 
15110
15111 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15112
15113         * class.cs: Null out fields holding references to Block objects so
15114         they can be garbage collected.
15115
15116         * expression.cs (OverloadResolve): Remove unused local.
15117
15118 2003-04-07  Martin Baulig  <martin@ximian.com>
15119
15120         * codegen.cs (EmitContext.CurrentFile): New public field.
15121         (EmitContext.Mark): Use the CurrentFile to check whether the
15122         location is in the correct file.
15123         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15124
15125 2003-04-07  Martin Baulig  <martin@ximian.com>
15126
15127         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15128
15129         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15130         location.  [FIXME: The location argument which gets passed to this
15131         method is sometimes wrong!]
15132
15133 2003-04-07  Nick Drochak <ndrochak@gol.com>
15134
15135         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15136
15137 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * expression.cs (Indirection.EmitAssign): We were using the
15140         temporary, but returning immediately instead of continuing the
15141         EmitAssing flow.
15142
15143 2003-04-06  Martin Baulig  <martin@ximian.com>
15144
15145         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15146         if it's a nested child, but also deriving from the outer class.
15147         See test 190.cs.
15148
15149         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15150         nested child, but also deriving from the outer class.  See
15151         test-190.cs.
15152         (FilterWithClosure): We may access private members of the outer
15153         class if we're a nested child and deriving from the outer class.
15154         (RealMemberLookup): Only set `closure_private_ok' if the
15155         `original_bf' contained BindingFlags.NonPublic.
15156
15157 2003-04-05  Martin Baulig  <martin@ximian.com>
15158
15159         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15160
15161 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15162
15163         * class.cs (Event.Define): Do not allow abstract events to have
15164         initializers. 
15165
15166 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15167
15168         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15169         block in event declarations.
15170
15171         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15172         value type, get its address.
15173
15174         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15175         leaving a class on the stack instead of a boolean value (int
15176         0/1).  Change the code so we compare against null, and then the
15177         result against zero.
15178
15179         * class.cs (TypeContainer.GetClassBases): We were checking for the
15180         parent class being sealed too late.
15181
15182         * expression.cs (Binary.Emit): For <= and >= when dealing with
15183         floating point values, use cgt.un and clt.un instead of cgt and
15184         clt alone.
15185
15186 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15187
15188         * statement.cs: Apply the same optimization as MS: skip the 
15189         GetEnumerator returning an IEnumerator, and use the one returning a 
15190         CharEnumerator instead. This allows us to avoid the try-finally block 
15191         and the boxing.
15192
15193 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15194
15195         * cs-parser.jay: Attributes cannot be applied to
15196                          namespaces. Fixes #40473
15197
15198 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15199
15200         * class.cs:
15201         (Add*): check if the name is valid using the full name for constants,
15202         fields, properties and events.
15203
15204 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15207         char constants to be part of the enumeration.
15208
15209         * expression.cs (Conditional.DoResolve): Add support for operator
15210         true. Implements the missing functionality from 14.12
15211
15212         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15213         operator true/false as required by the spec.
15214
15215         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15216         implicit conversion to boolean.
15217
15218         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15219         also one where the type implements `operator true'. 
15220
15221         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15222         get an expression that will invoke operator true based on an
15223         expression.  
15224
15225         (GetConversionOperators): Removed the hack that called op_True
15226         here.  
15227
15228         (Expression.ResolveBoolean): Move this from Statement.
15229
15230 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * ecore.cs (FieldExpr): do not allow initialization of initonly
15233         fields on derived classes
15234
15235 2003-03-13  Martin Baulig  <martin@ximian.com>
15236
15237         * statement.cs (Block.Emit): Call ig.BeginScope() and
15238         ig.EndScope() when compiling with debugging info; call
15239         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15240
15241 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15242
15243         * expression.cs (Indexers): Do not construct immediately, allow
15244         for new members to be appended as we go.  Fixes 38143
15245
15246 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15247
15248         * expression.cs: save/restore context when resolving an unchecked
15249         expression.
15250
15251 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15252
15253         * cfold.cs: Catch division by zero in modulus operator during
15254         constant folding.
15255
15256 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15257
15258         * interface.cs (Interface.DefineMembers): Avoid defining members
15259         twice. 
15260
15261 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * driver.cs: handle the +/- options for -noconfig
15264
15265         * statement.cs (Unckeched.Resolve): Also track the state of
15266         unchecked in the Resolve phase.
15267
15268 2003-02-27  Martin Baulig  <martin@ximian.com>
15269
15270         * ecore.cs (Expression.MemberLookup): Don't create a
15271         MethodGroupExpr for something which is not a method.  Fixes #38291.
15272
15273 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * class.cs (MemberBase.CheckParameters): Also check that the type
15276         is unmanaged if it is a pointer.
15277
15278         * expression.cs (SizeOf.Resolve): Add location information.
15279
15280         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15281         a managed type is declared.
15282
15283         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15284         parameter modifiers as well.  Fixes bug 38606
15285
15286         * class.cs: Very sad.  Am backing out the speed up changes
15287         introduced by the ArrayList -> Array in the TypeContainer, as they
15288         were not actually that much faster, and introduced a bug (no error
15289         reports on duplicated methods).
15290
15291         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15292         source first, this will guarantee that we have a valid expression
15293         before calling in lower levels functions that will require a
15294         resolved object.  Then use this original_source in the
15295         target.ResolveLValue instead of the original source that was
15296         passed to us.
15297
15298         Another change.  Use target.Resolve instead of LValueResolve.
15299         Although we are resolving for LValues, we will let the Assign code
15300         take care of that (it will be called again from Resolve).  This
15301         basically allows code like this:
15302
15303         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15304         class Y { void A (X x) { x [0] += o; }
15305
15306         The problem was that the indexer was trying to resolve for
15307         set_Item (idx, object o) and never finding one.  The real set_Item
15308         was set_Item (idx, X).  By delaying the process we get the right
15309         semantics. 
15310
15311         Fixes bug 36505
15312
15313 2003-02-23  Martin Baulig  <martin@ximian.com>
15314
15315         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15316         while calling DoEmit ().
15317
15318         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15319         source files; if you use the #line directive inside a method, the
15320         compiler stops emitting line numbers for the debugger until it
15321         reaches the end of the method or another #line directive which
15322         restores the original file.
15323
15324 2003-02-23  Martin Baulig  <martin@ximian.com>
15325
15326         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15327
15328 2003-02-23  Martin Baulig  <martin@ximian.com>
15329
15330         * statement.cs (Block.AddChildVariableNames): We need to call this
15331         recursively, not just for our immediate children.
15332
15333 2003-02-23  Martin Baulig  <martin@ximian.com>
15334
15335         * class.cs (Event.Define): Always make the field private, like csc does.
15336
15337         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15338         actually work, fixes bug #37521.
15339
15340 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * delegate.cs: When creating the various temporary "Parameters"
15343         classes, make sure that we call the ComputeAndDefineParameterTypes
15344         on those new parameters (just like we do with the formal ones), to
15345         allow them to be resolved in the context of the DeclSpace.
15346
15347         This fixes the bug that Dick observed in Bugzilla #38530.
15348
15349 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15350
15351         * expression.cs (ResolveMemberAccess): When resolving a constant,
15352         do not attempt to pull a constant if the value was not able to
15353         generate a valid constant.
15354
15355         * const.cs (LookupConstantValue): Do not report more errors than required.
15356
15357 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15358
15359         * expression.cs: fixes bug #38328.
15360
15361 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * class.cs: Changed all the various members that can be part of a
15364         class from being an ArrayList to be an Array of the right type.
15365         During the DefineType type_list, interface_list, delegate_list and
15366         enum_list are turned into types, interfaces, delegates and enums
15367         arrays.  
15368
15369         And during the member population, indexer_list, event_list,
15370         constant_list, field_list, instance_constructor_list, method_list,
15371         operator_list and property_list are turned into their real arrays.
15372
15373         Although we could probably perform this operation earlier, for
15374         good error reporting we need to keep the lists and remove the
15375         lists for longer than required.
15376
15377         This optimization was triggered by Paolo profiling the compiler
15378         speed on the output of `gen-sample-program.pl' perl script. 
15379
15380         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15381         not crash in methods like MemberLookupFailed that use this field.  
15382
15383         This problem arises when the compiler fails to resolve a type
15384         during interface type definition for example.
15385
15386 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15387
15388         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15389         inherit from System.Object, so we have to stop at null, not only
15390         when reaching System.Object.
15391
15392 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15393
15394         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15395         DeclaredOnly because the parent indexer might have had a different
15396         name, but did not loop until the top of the hierarchy was reached.
15397
15398         The problem this one fixes is 35492: when a class implemented an
15399         indexer from an interface, we were getting the interface method
15400         (which was abstract) and we were flagging an error (can not invoke
15401         abstract method).
15402
15403         This also keeps bug 33089 functioning, and test-148 functioning.
15404
15405         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15406         out if a method is special is to see if it is declared in a
15407         property or event, or whether it is one of the predefined operator
15408         names.   This should fix correctly #36804.
15409
15410 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15411
15412         The goal here is to remove the dependency on EmptyCast.Peel ().
15413         Killing it completely.
15414
15415         The problem is that currently in a number of places where
15416         constants are expected, we have to "probe" for an EmptyCast, and
15417         Peel, which is not the correct thing to do, as this will be
15418         repetitive and will likely lead to errors. 
15419
15420         The idea is to remove any EmptyCasts that are used in casts that
15421         can be reduced to constants, so we only have to cope with
15422         constants. 
15423
15424         This bug hunt was triggered by Bug 37363 and the desire to remove
15425         the duplicate pattern where we were "peeling" emptycasts to check
15426         whether they were constants.  Now constants will always be
15427         constants.
15428
15429         * ecore.cs: Use an enumconstant here instead of wrapping with
15430         EmptyCast.  
15431
15432         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15433         throwing me off.  By handling this we can get rid of a few hacks.
15434
15435         * statement.cs (Switch): Removed Peel() code.
15436
15437 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15438
15439         * class.cs: Location information for error 508
15440
15441         * expression.cs (New.DoResolve): Add a guard against double
15442         resolution of an expression.  
15443
15444         The New DoResolve might be called twice when initializing field
15445         expressions (see EmitFieldInitializers, the call to
15446         GetInitializerExpression will perform a resolve on the expression,
15447         and later the assign will trigger another resolution
15448
15449         This leads to bugs (#37014)
15450
15451         * delegate.cs: The signature for EndInvoke should contain any ref
15452         or out parameters as well.  We were not doing this in the past. 
15453
15454         * class.cs (Field.Define): Do not overwrite the type definition
15455         inside the `volatile' group.  Turns out that volatile enumerations
15456         were changing the type here to perform a validity test, which
15457         broke conversions. 
15458
15459 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15460
15461         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15462         and structs, we do not want to load the instance variable
15463
15464         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15465         enum_type has to be handled like an object reference (implicit
15466         conversions exists from this to object), but the regular IsClass
15467         and IsValueType tests will never return true for this one.
15468
15469         Also we use TypeManager.IsValueType instead of type.IsValueType,
15470         just for consistency with the rest of the code (this is only
15471         needed if we ever use the construct exposed by test-180.cs inside
15472         corlib, which we dont today).
15473
15474 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15475
15476         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15477         just InternalCall.
15478
15479 2003-02-09  Martin Baulig  <martin@ximian.com>
15480
15481         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15482         (Namespace.DefineNamespaces): New static public method; this is
15483         called when we're compiling with debugging to add all namespaces
15484         to the symbol file.
15485
15486         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15487         pass it to the Namespace's .ctor.
15488
15489         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15490         and MethodBase arguments; pass the namespace ID to the symwriter;
15491         pass the MethodBase instead of the token to the symwriter.
15492         (SymbolWriter.DefineNamespace): New method to add a namespace to
15493         the symbol file.
15494
15495 2003-02-09  Martin Baulig  <martin@ximian.com>
15496
15497         * symbolwriter.cs: New file.  This is a wrapper around
15498         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15499         methods here in near future.
15500
15501 2003-02-09  Martin Baulig  <martin@ximian.com>
15502
15503         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15504         ILGenerator.MarkSequencePoint() which are actually used by the
15505         symbol writer.
15506
15507 2003-02-09  Martin Baulig  <martin@ximian.com>
15508
15509         * location.cs (SourceFile): New public sealed class.  This
15510         contains the name and an index which is used in the location's token.
15511         (Location): Reserve an appropriate number of bits in the token for
15512         the source file instead of walking over that list, this gives us a
15513         really huge performance improvement when compiling with debugging.
15514
15515         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15516         `SourceFile' argument instead of a string.
15517         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15518         but don't parse/tokenize here, we need to generate the list of all
15519         source files before we do that.
15520         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15521         the files.
15522
15523         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15524         instead of a string.
15525
15526         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15527         of a string.
15528
15529 2003-02-09  Martin Baulig  <martin@ximian.com>
15530
15531         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15532         filename on `#line default'.
15533
15534 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15535
15536         * statement.cs: don't clear the pinned var when the fixed statement
15537         returns from the method (fixes bug#37752).
15538
15539 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15540
15541         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15542         to IsValueType.
15543
15544 2003-02-07  Martin Baulig  <martin@ximian.com>
15545
15546         * driver.cs: Removed the `--debug-args' command line argument.
15547
15548         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15549         automatically by the AsssemblyBuilder.
15550         (CodeGen.InitializeSymbolWriter): We don't need to call any
15551         initialization function on the symbol writer anymore.  This method
15552         doesn't take any arguments.
15553
15554 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15555
15556         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15557         from referenced assemblies as well.
15558
15559 2003-02-02  Martin Baulig  <martin@ximian.com>
15560
15561         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15562
15563 2003-02-02  Martin Baulig  <martin@ximian.com>
15564
15565         * class.cs (Constructor.Emit): Open the symbol writer before
15566         emitting the constructor initializer.
15567         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15568         single-stepping through constructor initializers.
15569
15570 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * class.cs: Handle error 549: do not allow virtual methods in
15573         sealed classes. 
15574
15575 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15576
15577         * decl.cs: Check access levels when resolving types
15578
15579 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15580
15581         * statement.cs: Add parameters and locals set in catch blocks that might 
15582         return to set vector
15583
15584 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * class.cs (Operator): Set the SpecialName flags for operators.
15587
15588         * expression.cs (Invocation.DoResolve): Only block calls to
15589         accessors and operators on SpecialName methods.
15590
15591         (Cast.TryReduce): Handle conversions from char constants.
15592
15593
15594 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15595
15596         * statement.cs: small memory and time optimization in FlowBranching.
15597
15598 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15599
15600         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15601         problem that the last fix but in the other sid (Set).
15602
15603         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15604         access when there is no indexer in the hierarchy.
15605
15606 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15607
15608         * class.cs: Combine some if statements.
15609
15610 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15611
15612         * driver.cs: fixed bug #37187.
15613
15614 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15615
15616         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15617         any indexer, it's needed to build a list with all the indexers in the
15618         hierarchy (AllGetters), else we have problems. Fixes #35653.
15619
15620 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * class.cs (MethodData.Define): It is wrong for an interface
15623         implementation to be static in both cases: explicit and implicit.
15624         We were only handling this in one case.
15625
15626         Improve the if situation there to not have negations.
15627
15628         * class.cs (Field.Define): Turns out that we do not need to check
15629         the unsafe bit on field definition, only on usage.  Remove the test.
15630
15631 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15632
15633         * driver.cs: use assembly.Location instead of Codebase (the latest
15634         patch made mcs fail when using MS assemblies).
15635
15636 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15637
15638         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15639         get the path to *corlib.dll.
15640
15641 2003-01-21  Nick Drochak <ndrochak@gol.com>
15642
15643         * cs-tokenizer.cs:
15644         * pending.cs:
15645         * typemanager.cs: Remove compiler warnings
15646
15647 2003-01-20  Duncan Mak  <duncan@ximian.com>
15648
15649         * AssemblyInfo.cs: Bump the version number to 0.19.
15650
15651 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15652
15653         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15654
15655 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15656
15657         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15658
15659 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15660
15661         * cs-parser.jay: Small fix: we were not comparing the constructor
15662         name correctly.   Thanks to Zoltan for the initial pointer.
15663
15664 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15665
15666         * cs-tokenizer.cs: Set file name when specified with #line
15667
15668 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * cs-parser.jay: Only perform the constructor checks here if we
15671         are named like the class;  This will help provider a better
15672         error.  The constructor path is taken when a type definition is
15673         not found, but most likely the user forgot to add the type, so
15674         report that rather than the constructor error.
15675
15676 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15677
15678         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15679         allocations.
15680
15681 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15682
15683         * cs-parser.jay: Add cleanup call.
15684
15685 2003-01-13  Duncan Mak  <duncan@ximian.com>
15686
15687         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15688         consistent with other methods.
15689
15690 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15691
15692         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15693
15694 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15695
15696         * attribute.cs: only set GuidAttr to true when we have a
15697         GuidAttribute.
15698
15699 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15700
15701         * ecore.cs:
15702         * expression.cs:
15703         * typemanager.cs: fixes to allow mcs compile corlib with the new
15704         Type.IsSubclassOf fix.
15705
15706 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * expression.cs (LocalVariableReference.DoResolve): Classify a
15709         constant as a value, not as a variable.   Also, set the type for
15710         the variable.
15711
15712         * cs-parser.jay (fixed_statement): take a type instead of a
15713         pointer_type, so we can produce a better error message later.
15714
15715         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15716         as an error.  
15717
15718         (For.DoEmit): Make inifinite loops have a
15719         non-conditional branch back.
15720
15721         (Fixed.DoEmit): First populate the pinned variables, then emit the
15722         statement, then clear the variables.  Before I was emitting the
15723         code once for each fixed piece.
15724
15725
15726 2003-01-08  Martin Baulig  <martin@ximian.com>
15727
15728         * statement.cs (FlowBranching.MergeChild): A break in a
15729         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15730
15731 2003-01-08  Martin Baulig  <martin@ximian.com>
15732
15733         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15734         lives in the same number space than `param_map'.  Fixes #36154.
15735
15736 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15737
15738         * cs-parser.jay (constructor_declaration): Set the
15739         Constructor.ModFlags before probing for it.  This makes the
15740         compiler report 514, 515 and 132 (the code was there, but got
15741         broken). 
15742
15743         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15744         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15745         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15746
15747 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15748
15749         * enum.cs: create the enum static fields using the enum type.
15750
15751 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15752
15753         * class.cs: don't try to create the ParamBuilder for the return
15754         type if it's not needed (and handle it breaking for the ms runtime
15755         anyway).
15756
15757 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15758
15759         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15760
15761 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15762
15763         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15764         the command.   This showed up while compiling the JANET source
15765         code, which used \r as its only newline separator.
15766
15767 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15768
15769         * class.cs (Method.Define): If we are an operator (because it
15770         reuses our code), then set the SpecialName and HideBySig.  #36128
15771
15772 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15773
15774         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15775         exception, report error 120 `object reference required'.
15776
15777         * driver.cs: Add --pause option, used during to measure the size
15778         of the process as it goes with --timestamp.
15779
15780         * expression.cs (Invocation.DoResolve): Do not allow methods with
15781         SpecialName to be invoked.
15782
15783 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15786         number before adding it.
15787
15788 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15789
15790         * ecore.cs (StandardImplicitConversion): When in an unsafe
15791         context, we allow conversion between void * to any other pointer
15792         type. This fixes bug #35973.
15793
15794 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15795
15796         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15797         is not thrown when extensionless outputs are used 
15798
15799 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15800
15801         * rootcontext.cs: fixed compilation of corlib.
15802
15803 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * attribute.cs (Attributes.Contains): Add new method.
15806
15807         * class.cs (MethodCore.LabelParameters): if the parameter is an
15808         `out' parameter, check that no attribute `[In]' has been passed.
15809
15810         * enum.cs: Handle the `value__' name in an enumeration.
15811
15812 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15813
15814         * decl.cs: Added special case to allow overrides on "protected
15815         internal" methods
15816
15817 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15818
15819         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15820         since it makes much more sense.
15821
15822         (Attributes.ctor): Don't require a Location parameter.
15823
15824         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15825
15826         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15827         since we already have that information per attribute.
15828
15829         * everywhere : make appropriate changes.
15830
15831         * class.cs (LabelParameters): Write the code which actually
15832         applies attributes to the return type. We can't do this on the MS
15833         .NET runtime so we flag a warning in the case an exception is
15834         thrown.
15835
15836 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15837
15838         * const.cs: Handle implicit null conversions here too.
15839
15840 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15841
15842         * class.cs (MethodCore.LabelParameters): Remove the extra
15843         Type [] parameter since it is completely unnecessary. Instead
15844         pass in the method's attributes so that we can extract
15845         the "return" attribute.
15846
15847 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15850         of ignoring it and letting the compile continue.
15851
15852         * typemanager.cs (ChangeType): use an extra argument to return an
15853         error condition instead of throwing an exception.
15854
15855 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * expression.cs (Unary.TryReduce): mimic the code for the regular
15858         code path.  Perform an implicit cast in the cases where we can
15859         implicitly convert to one of the integral types, and then reduce
15860         based on that constant.   This fixes bug #35483.
15861
15862 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15863
15864         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15865
15866 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15867
15868         * namespace.cs: fixed bug #35489.
15869
15870 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * class.cs: Remove some dead code.
15873
15874         * cs-parser.jay: Estimate the number of methods needed
15875         (RootContext.MethodCount);
15876
15877         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15878         numbers instead of StringBuilders.
15879
15880         * support.cs (PtrHashtable): Add constructor with initial size;
15881         We can now reduce reallocations of the method table.
15882
15883 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15884
15885         * attribute.cs (ApplyAttributes): Keep track of the emitted
15886         attributes on a per-target basis. This fixes bug #35413.
15887
15888 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15891         default to the Windows 1252 encoding.
15892
15893         (UnixParseOption): Support version, thanks to Alp for the missing
15894         pointer. 
15895
15896         * AssemblyInfo.cs: Add nice assembly information.
15897
15898         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15899         (bug 35169).
15900
15901         * cs-parser.jay: Allow a trailing comma before the close bracked
15902         in the attribute_section production.
15903
15904         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15905         address of the instance was being taken, I will take this out,
15906         because we take the address of the object immediately here.
15907
15908 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15909
15910         * typemanager.cs (AreMultipleAllowed): Take care of the most
15911         obvious case where attribute type is not in the current assembly -
15912         stupid me ;-)
15913
15914 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15915
15916         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15917         definitions, instead of doing that afterwards.  
15918
15919         Also we use a nice little hack, depending on the constructor, we
15920         know if we are a "composed" name or a simple name.  Hence, we
15921         avoid the IndexOf test, and we avoid 
15922
15923         * codegen.cs: Add code to assist in a bug reporter to track down
15924         the source of a compiler crash. 
15925
15926 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15927
15928         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15929         types have been emitted for a given element and flag an error
15930         if something which does not have AllowMultiple set is used more
15931         than once.
15932
15933         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15934         attribute types and their corresponding AllowMultiple properties
15935
15936         (AreMultipleAllowed): Check the property for a given type.
15937
15938         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15939         property in the case we have a TypeContainer.
15940
15941         (Attributes.AddAttribute): Detect duplicates and just skip on
15942         adding them. This trivial fix catches a pretty gross error in our
15943         attribute emission - global attributes were being emitted twice!
15944
15945         Bugzilla bug #33187 is now fixed.
15946
15947 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15950         instead of pp_and).
15951
15952         * expression.cs (Binary.ResolveOperator): I can only use the
15953         Concat (string, string, string) and Concat (string, string,
15954         string, string) if the child is actually a concatenation of
15955         strings. 
15956
15957 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15958
15959         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15960         context where we need a 2-character lookahead.
15961
15962         * pending.cs (PendingImplementation): Rework so we can keep track
15963         of interface types all the time, and flag those which were
15964         implemented by parents as optional.
15965
15966 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (Binary.ResolveOperator): Use
15969         String.Concat(string,string,string) or
15970         String.Concat(string,string,string,string) when possible. 
15971
15972         * typemanager: More helper methods.
15973
15974
15975 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15976
15977         * pending.cs: remove the bogus return from GetMissingInterfaces()
15978         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15979
15980 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15981
15982         * namespace.cs: avoid duplicated 'using xxx' being added to
15983         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15984         when we get more than one 'using' statement for the same namespace.
15985         Report a CS0105 warning for it.
15986
15987 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15988
15989         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15990         of calling getChar/putback, uses internal knowledge of it.    
15991
15992         (xtoken): Reorder tokenizer so most common patterns are checked
15993         first.  This reduces the compilation time in another 5% (from 8.11s
15994         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15995
15996         The parsing time is 22% of the compilation in mcs, and from that
15997         64% is spent on the tokenization process.  
15998
15999         I tried using a binary search for keywords, but this is slower
16000         than the hashtable.  Another option would be to do a couple of
16001         things:
16002
16003                 * Not use a StringBuilder, instead use an array of chars,
16004                   with a set value.  Notice that this way we could catch
16005                   the 645 error without having to do it *afterwards*.
16006
16007                 * We could write a hand-parser to avoid the hashtable
16008                   compares altogether.
16009
16010         The identifier consumption process takes 37% of the tokenization
16011         time.  Another 15% is spent on is_number.  56% of the time spent
16012         on is_number is spent on Int64.Parse:
16013
16014                 * We could probably choose based on the string length to
16015                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16016                   computations. 
16017
16018         Another 3% is spend on wrapping `xtoken' in the `token' function.
16019
16020         Handle 0xa0 as whitespace (#34752)
16021
16022 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * typemanager.cs (IsCLRType): New routine to tell whether a type
16025         is one of the builtin types.  
16026
16027         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16028         typecode in more places instead of doing pointer comparissions.
16029         We could leverage some knowledge about the way the typecodes are
16030         laid out.
16031
16032         New code to cache namespaces in assemblies, it is currently not
16033         invoked, to be used soon.
16034
16035         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16036
16037         * expression.cs (Binary.ResolveOperator): specially handle
16038         strings, and do not perform user-defined operator overloading for
16039         built-in types.
16040
16041 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16042
16043         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16044         internalcall as it is a pretty simple operation;  Avoid whenever
16045         possible to call Char.IsLetter.
16046
16047         (consume_identifier): Cut by half the number of
16048         hashtable calls by merging the is_keyword and GetKeyword behavior.
16049
16050         Do not short-circuit, because if we do, we
16051         report errors (ie, #if false && true would produce an invalid
16052         directive error);
16053
16054
16055 2002-11-24  Martin Baulig  <martin@ximian.com>
16056
16057         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16058         check constant ranges and report a CS0221.  Fixes #33186.
16059
16060 2002-11-24  Martin Baulig  <martin@ximian.com>
16061
16062         * cs-parser.jay: Make this work for uninitialized variable
16063         declarations in the `for' initializer.  Fixes #32416.
16064
16065 2002-11-24  Martin Baulig  <martin@ximian.com>
16066
16067         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16068         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16069
16070 2002-11-24  Martin Baulig  <martin@ximian.com>
16071
16072         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16073         argument; if true, we also check for user-defined conversions.
16074         This is only needed if both arguments are of a user-defined type.
16075         Fixes #30443, added test-175.cs.
16076         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16077
16078         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16079
16080 2002-11-24  Martin Baulig  <martin@ximian.com>
16081
16082         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16083         function to get the store opcode.
16084         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16085         only emit the Ldelema if the store opcode is Stobj.  You must run
16086         both test-34 and test-167 to test this.  Fixes #34529.
16087
16088 2002-11-23  Martin Baulig  <martin@ximian.com>
16089
16090         * ecore.cs (Expression.MemberLookup): Added additional
16091         `qualifier_type' argument which is used when we're being called
16092         from MemberAccess.DoResolve() and null if we're called from a
16093         SimpleName lookup.
16094         (Expression.MemberLookupFailed): New method to report errors; this
16095         does the CS1540 check and reports the correct error message.
16096
16097         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16098         argument for the CS1540 check and redone the way how we're dealing
16099         with private members.  See the comment in the source code for details.
16100         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16101         `closure_start_type' to `closure_qualifier_type' and check whether
16102         it's not null.  It was not this filter being broken, it was just
16103         being called with the wrong arguments.
16104
16105         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16106         and pass it the correct `qualifier_type'; this also does the error
16107         handling for us.
16108
16109 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * expression.cs (Invocation.EmitParams): If the we are dealing
16112         with a non-built-in value type, load its address as well.
16113
16114         (ArrayCreation): Use a a pretty constant instead
16115         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16116         static initializers.  
16117
16118         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16119         because they are not really value types, just glorified integers. 
16120
16121         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16122
16123         * ecore.cs: Remove redundant code for enumerations, make them use
16124         the same code path as everything else, fixes the casting issue
16125         with enumerations in Windows.Forms.
16126
16127         * attribute.cs: Do only cast to string if it is a string, the
16128         validation happens later.
16129
16130         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16131         people upgrade their corlibs.
16132
16133         * ecore.cs: Oops, enumerations were not following the entire code path
16134
16135 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * typemanager.cs (FilterWithClosure): Commented out the test for
16138         1540 in typemanager.cs, as it has problems when accessing
16139         protected methods from a parent class (see test-174.cs). 
16140
16141         * attribute.cs (Attribute.ValidateGuid): new method.
16142         (Attribute.Resolve): Use above.
16143
16144 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16147
16148         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16149         handling for enumerations, as we only needed the TypeContainer
16150         functionality to begin with (this is required for the fix below to
16151         work for enums that reference constants in a container class for
16152         example). 
16153
16154         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16155
16156         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16157         a valid TypeBuilder to perform lookups on.o
16158
16159         * class.cs (InheritableMemberSignatureCompare): Use true in the
16160         call to GetGetMethod and GetSetMethod, because we are comparing
16161         the signature, and we need to get the methods *even* if they are
16162         private. 
16163
16164         (PropertyBase.CheckBase): ditto.
16165
16166         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16167         GotoCase.Resolve): Use Peel on EmpytCasts.
16168
16169         * ecore.cs (EmptyCast): drop child, add Peel method.
16170
16171 2002-11-17  Martin Baulig  <martin@ximian.com>
16172
16173         * ecore.cs (EmptyCast.Child): New public property.
16174
16175         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16176         label resolved to an EmptyCast.  Fixes #34162.
16177         (GotoCase.Resolve): Likewise.
16178         (Block.EmitMeta): Likewise.
16179
16180 2002-11-17  Martin Baulig  <martin@ximian.com>
16181
16182         * expression.cs (Invocation.BetterConversion): Prefer int over
16183         uint; short over ushort; long over ulong for integer literals.
16184         Use ImplicitConversionExists instead of StandardConversionExists
16185         since we also need to check for user-defined implicit conversions.
16186         Fixes #34165.  Added test-173.cs.
16187
16188 2002-11-16  Martin Baulig  <martin@ximian.com>
16189
16190         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16191         with the `true' and `false' literals.  Fixes #33151.
16192
16193 2002-11-16  Martin Baulig  <martin@ximian.com>
16194
16195         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16196         October 22nd; don't do the cs1540 check for static members.
16197
16198         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16199         now using our own filter here and doing the cs1540 check again.
16200
16201 2002-11-16  Martin Baulig  <martin@ximian.com>
16202
16203         * support.cs (InternalParameters): Don't crash if we don't have
16204         any fixed parameters.  Fixes #33532.
16205
16206 2002-11-16  Martin Baulig  <martin@ximian.com>
16207
16208         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16209         when looking up static methods to make this work on Windows.
16210         Fixes #33773.
16211
16212 2002-11-16  Martin Baulig  <martin@ximian.com>
16213
16214         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16215         a setter rather than using PropertyInfo.CanWrite.
16216
16217 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16218
16219         * class.cs: Allow acces to block member by subclasses. Fixes build
16220         breaker.
16221
16222 2002-11-14  Martin Baulig  <martin@ximian.com>
16223
16224         * class.cs (Constructor.Emit): Added the extern/block check.
16225         Fixes bug #33678.
16226
16227 2002-11-14  Martin Baulig  <martin@ximian.com>
16228
16229         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16230         iteration while looking for indexers, this is needed because the
16231         indexer may have a different name in our base classes.  Fixed the
16232         error reporting (no indexers at all, not get accessor, no
16233         overloaded match).  Fixes bug #33089.
16234         (IndexerAccess.DoResolveLValue): Likewise.
16235
16236 2002-11-14  Martin Baulig  <martin@ximian.com>
16237
16238         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16239         indexers.  Fixes the first part of bug #33089.
16240         (MethodSignature.InheritableMemberSignatureCompare): Added support
16241         for properties.
16242
16243 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16244
16245         * attribute.cs (Attribute.Resolve): Catch the
16246         NullReferenceException and report it since it isn't supposed to
16247         happen. 
16248
16249 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16252         LogicalOr and LogicalAnd that can benefit from recursively
16253         handling EmitBranchable.  The code now should be nice for Paolo.
16254
16255 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16256
16257         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16258         the Type lookups, as we perform quite a number of lookups on
16259         non-Types.  This can be removed once we can deterministically tell
16260         whether we have a type or a namespace in advance.
16261
16262         But this might require special hacks from our corlib.
16263
16264         * TODO: updated.
16265
16266         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16267         and double which avoids a conversion from an integer to a double.
16268
16269         * expression.cs: tiny optimization, avoid calling IsConstant,
16270         because it effectively performs the lookup twice.
16271
16272 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16273
16274         But a bogus return here to keep the semantics of the old code
16275         until the Mono runtime is fixed.
16276
16277         * pending.cs (GetMissingInterfaces): New method used to remove all
16278         the interfaces that are already implemented by our parent
16279         classes from the list of pending methods. 
16280
16281         * interface.cs: Add checks for calls after ResolveTypeExpr.
16282
16283 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * class.cs (Class.Emit): Report warning 67: event not used if the
16286         warning level is beyond 3.
16287
16288         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16289         being a NullLiteral.
16290
16291         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16292         specifiers. 
16293
16294         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16295         path that might fail if a type can not be resolved.
16296
16297         * expression.cs (Binary.Emit): Emit unsigned versions of the
16298         operators. 
16299
16300         * driver.cs: use error 5.
16301
16302 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16303
16304         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16305
16306 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16307
16308         * cs-parser.jay (switch_section): A beautiful patch from Martin
16309         Baulig that fixed 33094.
16310
16311 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16314         Check whether the base is abstract and report an error if so.
16315
16316         * expression.cs (IndexerAccess.DoResolveLValue,
16317         IndexerAccess.DoResolve): ditto. 
16318
16319         (Invocation.DoResolve): ditto.
16320
16321         (Invocation.FullMethodDesc): Improve the report string.
16322
16323         * statement.cs (Block): Eliminate IsVariableDefined as it is
16324         basically just a wrapper for GetVariableInfo.
16325
16326         * ecore.cs (SimpleName): Use new 
16327
16328         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16329         type, as we return the actual parameter ref/unref state on a
16330         different call.
16331
16332 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16333
16334         * support.cs: Return proper flags REF/OUT fixing the previous
16335         commit.  
16336
16337         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16338         not used to mean `ref' but `ref or out' in ParameterReference
16339
16340         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16341         full type signature instead of calling TypeManger.CSharpName
16342         ourselves. 
16343
16344         * support.cs (InternalParameters.ParameterDesc): Do not compare
16345         directly to the modflags, because REF/OUT will actually be bitsets
16346         if set. 
16347
16348         * delegate.cs (VerifyMethod): Check also the modifiers.
16349
16350         * cs-tokenizer.cs: Fix bug where floating point values with an
16351         exponent where a sign was missing was ignored.
16352
16353         * driver.cs: Allow multiple assemblies to be specified in a single
16354         /r: argument
16355
16356 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16357
16358         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16359         because identifiers after a parenthesis would end up in this kind
16360         of production, and we needed to desamiguate it for having casts
16361         like:
16362
16363                 (UserDefinedType *) xxx
16364
16365 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16366
16367         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16368         we should set on the Bindingflags.NonPublic, but not turn on
16369         private_ok.  private_ok controls whether a Private member is
16370         returned (this is chekced on the filter routine), while the
16371         BindingFlags.NonPublic just controls whether private/protected
16372         will be allowed.   This fixes the problem part of the problem of
16373         private properties being allowed to be used in derived classes.
16374
16375         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16376         so we can call the children DoResolveLValue method (this will
16377         properly signal errors on lvalue assignments to base properties)
16378
16379         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16380         getter are null, and we have a property info, we know that this
16381         happened because the lookup failed, so we report an error 122 for
16382         protection level violation.
16383
16384         We also silently return if setter and getter are null in the
16385         resolve functions, this condition only happens if we have flagged
16386         the error before.  This is the other half of the problem. 
16387
16388         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16389         not have accessibility information, that is why we were returning
16390         true in the filter function in typemanager.cs.
16391
16392         To properly report 122 (property is inaccessible because of its
16393         protection level) correctly, we report this error in ResolveAccess
16394         by failing if both the setter and the getter are lacking (ie, the
16395         lookup failed). 
16396
16397         DoResolve and DoLResolve have been modified to check for both
16398         setter/getter being null and returning silently, the reason being
16399         that I did not want to put the knowledge about this error in upper
16400         layers, like:
16401
16402         int old = Report.Errors;
16403         x = new PropertyExpr (...);
16404         if (old != Report.Errors)
16405                 return null;
16406         else
16407                 return x;
16408
16409         So the property expr is returned, but it is invalid, so the error
16410         will be flagged during the resolve process. 
16411
16412         * class.cs: Remove InheritablePropertySignatureCompare from the
16413         class, as we no longer depend on the property signature to compute
16414         whether it is possible to implement a method or not.
16415
16416         The reason is that calling PropertyInfo.GetGetMethod will return
16417         null (in .NET, in Mono it works, and we should change this), in
16418         cases where the Get Method does not exist in that particular
16419         class.
16420
16421         So this code:
16422
16423         class X { public virtual int A { get { return 1; } } }
16424         class Y : X { }
16425         class Z : Y { public override int A { get { return 2; } } }
16426
16427         Would fail in Z because the parent (Y) would not have the property
16428         defined.  So we avoid this completely now (because the alternative
16429         fix was ugly and slow), and we now depend exclusively on the
16430         method names.
16431
16432         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16433         reference method, instead of using the property.
16434
16435         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16436         routines are gone now.
16437
16438         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16439         names, they were incorrectly named.
16440
16441         * cs-tokenizer.cs: Return are more gentle token on failure. 
16442
16443         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16444         had an out-of-sync index variable, which caused it to remove from
16445         the list of pending methods the wrong method sometimes.
16446
16447 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16450         CanWrite, because those refer to this particular instance of the
16451         property, and do not take into account the fact that we can
16452         override single members of a property.
16453
16454         Constructor requires an EmitContext.  The resolution process does
16455         not happen here, but we need to compute the accessors before,
16456         because the resolution does not always happen for properties.
16457
16458         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16459         subclass, before we did not update this flag, but we did update
16460         bindingflags. 
16461
16462         (GetAccessors): Drop this routine, as it did not work in the
16463         presence of partially overwritten set/get methods. 
16464
16465         Notice that this broke the cs1540 detection, but that will require
16466         more thinking. 
16467
16468 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16469
16470         * class.cs:
16471         * codegen.cs:
16472         * driver.cs: issue a warning instead of an error if we don't support
16473         debugging for the platform. Also ignore a couple of errors that may
16474         arise when trying to write the symbols. Undo my previous patch.
16475
16476 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16477
16478         * driver.cs: ignore /debug switch except for Unix platforms.
16479
16480 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16481
16482         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16483
16484 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16485
16486         * driver.cs: Do not make mcs-debug conditional, so we do not break
16487         builds that use it.
16488
16489         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16490         review this patch.  But basically after all the children variables
16491         have been merged, the value of "Breaks" was not being set to
16492         new_breaks for Switch blocks.  I think that it should be set after
16493         it has executed.  Currently I set this to the value of new_breaks,
16494         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16495         conservative, but I do not understand this code very well.
16496
16497         I did not break anything in the build, so that is good ;-)
16498
16499         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16500
16501 2002-10-20  Mark Crichton  <crichton@gimp.org>
16502
16503         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16504
16505 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16506
16507         * cfold.cs: Fixed compile blocker.
16508
16509 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16510
16511         * driver.cs: I was chekcing the key, not the file.
16512
16513 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16514
16515         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16516         message that we were generating - we just need to silently return
16517         a null.
16518
16519 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * class.cs (Event.Define): Change my previous commit, as this
16522         breaks the debugger.  This is a temporary hack, as it seems like
16523         the compiler is generating events incorrectly to begin with.
16524
16525         * expression.cs (Binary.ResolveOperator): Added support for 
16526         "U operator - (E x, E y)"
16527
16528         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16529         y)".
16530
16531         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16532         init-only variables, but this path did not take into account that
16533         there might be also instance readonly variables.  Correct this
16534         problem. 
16535
16536         This fixes bug 32253
16537
16538         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16539         delegates as well.
16540
16541         * driver.cs: Change the extension for modules to `netmodule'
16542
16543         * cs-parser.jay: Improved slightly the location tracking for
16544         the debugger symbols.
16545
16546         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16547         modifiers that were specified instead of the hardcoded value
16548         (FamAndAssem).  This was basically ignoring the static modifier,
16549         and others.  Fixes 32429.
16550
16551         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16552         fixed a bug in the process (32476)
16553
16554         * expression.cs (ArrayAccess.EmitAssign): Patch from
16555         hwang_rob@yahoo.ca that fixes bug 31834.3
16556
16557 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16558
16559         * driver.cs: Make the module extension .netmodule.
16560
16561 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * driver.cs: Report an error if the resource file is not found
16564         instead of crashing.
16565
16566         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16567         false, like Emit does.
16568
16569 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16570
16571         * typemanager.cs: Remove unused private member.  Also reported mcs
16572         bug to report this as a warning like csc.
16573
16574 2002-10-15  Martin Baulig  <martin@gnome.org>
16575
16576         * statement.cs (Statement.Emit): Made this a virtual method; emits
16577         the line number info and calls DoEmit().
16578         (Statement.DoEmit): New protected abstract method, formerly knows
16579         as Statement.Emit().
16580
16581         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16582
16583 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16586         have fixed a remaining problem: not every AddXXXX was adding a
16587         fully qualified name.  
16588
16589         Now everyone registers a fully qualified name in the DeclSpace as
16590         being defined instead of the partial name.  
16591
16592         Downsides: we are slower than we need to be due to the excess
16593         copies and the names being registered this way.  
16594
16595         The reason for this is that we currently depend (on the corlib
16596         bootstrap for instance) that types are fully qualified, because
16597         we dump all the types in the namespace, and we should really have
16598         types inserted into the proper namespace, so we can only store the
16599         basenames in the defined_names array.
16600
16601 2002-10-10  Martin Baulig  <martin@gnome.org>
16602
16603         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16604         from bug #31834, see the bug report for a testcase which is
16605         miscompiled.
16606
16607 2002-10-10  Martin Baulig  <martin@gnome.org>
16608
16609         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16610         flow analysis code for this.
16611
16612         * statement.cs (Do, While, For): Tell the flow analysis code about
16613         infinite loops.
16614         (FlowBranching.UsageVector): Added support for infinite loops.
16615         (Block.Resolve): Moved the dead code elimination here and use flow
16616         analysis to do it.
16617
16618 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16619
16620         * class.cs (Field.Define): Catch cycles on struct type
16621         definitions. 
16622
16623         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16624         fields if the fields are static.  We only need to check instance
16625         fields. 
16626
16627         * expression.cs (As.DoResolve): Test for reference type.
16628
16629         * statement.cs (Using.ResolveExpression): Use
16630         ConvertImplicitRequired, not ConvertImplicit which reports an
16631         error on failture
16632         (Using.ResolveLocalVariableDecls): ditto.
16633
16634         * expression.cs (Binary.ResolveOperator): Report errors in a few
16635         places where we had to.
16636
16637         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16638
16639 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * expression.cs: Use StoreFromPtr instead of extracting the type
16642         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16643
16644         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16645         an enumeration value to a System.Enum, but System.Enum is not a
16646         value type, but an class type, so we need to box.
16647
16648         (Expression.ConvertExplicit): One codepath could return
16649         errors but not flag them.  Fix this.  Fixes #31853
16650
16651         * parameter.cs (Resolve): Do not allow void as a parameter type.
16652
16653 2002-10-06  Martin Baulig  <martin@gnome.org>
16654
16655         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16656         if it's a class type and not a struct.  Fixes #31815.
16657
16658 2002-10-06  Martin Baulig  <martin@gnome.org>
16659
16660         * statement.cs: Reworked the flow analysis code a bit to make it
16661         usable for dead code elimination.
16662
16663 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16664
16665         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16666
16667 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16670         to fix the test 165, will investigate deeper.
16671
16672 2002-10-04  Martin Baulig  <martin@gnome.org>
16673
16674         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16675         finally blocks actually work.
16676         (Try.Resolve): We don't need to create a sibling for `finally' if
16677         there is no finally block.
16678
16679 2002-10-04  Martin Baulig  <martin@gnome.org>
16680
16681         * class.cs (Constructor.Define): The default accessibility for a
16682         non-default constructor is private, not public.
16683
16684 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * class.cs (Constructor): Make AllowedModifiers public, add
16687         EXTERN.
16688
16689         * cs-parser.jay: Perform the modifiers test here, as the
16690         constructor for the Constructor class usually receives a zero
16691         because of the way we create it (first we create, later we
16692         customize, and we were never checking the modifiers).
16693
16694         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16695         is a version of LookupTypeReflection that includes the type-name
16696         cache.  This can be used as a fast path for functions that know
16697         the fully qualified name and are only calling into *.GetType() to
16698         obtain a composed type.
16699
16700         This is also used by TypeManager.LookupType during its type
16701         composition.
16702
16703         (LookupType): We now also track the real type name, as sometimes
16704         we can get a quey for the real type name from things like
16705         ComposedCast.  This fixes bug 31422.
16706
16707         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16708         complete type fullname, it does not have to go through the type
16709         resolution system to obtain the composed version of the type (for
16710         obtaining arrays or pointers).
16711
16712         (Conditional.Emit): Use the EmitBoolExpression to
16713         generate nicer code, as requested by Paolo.
16714
16715         (ArrayCreation.CheckIndices): Use the patch from
16716         hwang_rob@yahoo.ca to validate the array initializers. 
16717
16718 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * class.cs (ConstructorInitializer.Emit): simplify code by using
16721         Invocation.EmitCall, and at the same time, fix the bugs in calling
16722         parent constructors that took variable arguments. 
16723
16724         * ecore.cs (Expression.ConvertNumericExplicit,
16725         Expression.ImplicitNumericConversion): Remove the code that
16726         manually wrapped decimal (InternalTypeConstructor call is now gone
16727         as well).
16728
16729         * expression.cs (Cast.TryReduce): Also handle decimal types when
16730         trying to perform a constant fold on the type.
16731
16732         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16733
16734         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16735         that only turned off an error report, and did nothing else. 
16736
16737 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16738
16739         * driver.cs: Handle and ignore /fullpaths
16740
16741 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * expression.cs (Binary.ResolveOperator): Catch the case where
16744         DoNumericPromotions returns true, 
16745
16746         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16747
16748 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16749
16750         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16751         report error 70.
16752
16753 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16754
16755         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16756         conversion exists, but it is also required that the conversion be
16757         performed.  This manifested in "(Type64Enum) 2".  
16758
16759         * class.cs (TypeManager.AddMethod): The fix is not to change
16760         AddEnum, because that one was using a fully qualified name (every
16761         DeclSpace derivative does), but to change the AddMethod routine
16762         that was using an un-namespaced name.  This now correctly reports
16763         the duplicated name.
16764
16765         Revert patch until I can properly fix it.  The issue
16766         is that we have a shared Type space across all namespaces
16767         currently, which is wrong.
16768
16769         Options include making the Namespace a DeclSpace, and merge
16770         current_namespace/current_container in the parser.
16771
16772 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * cs-parser.jay: Improve error reporting when we get a different
16775         kind of expression in local_variable_type and
16776         local_variable_pointer_type. 
16777
16778         Propagate this to avoid missleading errors being reported.
16779
16780         * ecore.cs (ImplicitReferenceConversion): treat
16781         TypeManager.value_type as a target just like object_type.   As
16782         code like this:
16783
16784         ValueType v = 1;
16785
16786         Is valid, and needs to result in the int 1 being boxed before it
16787         is assigned to the value type v.
16788
16789         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16790         to validate the enumeration name.
16791
16792         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16793         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16794         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16795
16796         * ecore.cs (TryImplicitIntConversion): When doing an
16797         implicit-enumeration-conversion, check if the type is 64-bits and
16798         perform a conversion before passing to EnumConstant.
16799
16800 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16801
16802         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16803         report ambiguous type references.  Unlike the MS version, we
16804         report what the ambiguity is.   Innovation at work ;-)
16805
16806         (DeclSpace.FindType): Require a location argument to
16807         display when we display an ambiguous error.
16808
16809         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16810
16811         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16812
16813         * expression.cs (EmitDynamicInitializers): Apply patch from
16814         hwang_rob@yahoo.ca that fixes the order in which we emit our
16815         initializers. 
16816
16817 2002-09-21  Martin Baulig  <martin@gnome.org>
16818
16819         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16820         delegate takes no arguments.
16821
16822 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16825         from integers.
16826
16827         * expression.cs: Extract the underlying type.
16828
16829         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16830
16831         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16832
16833 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * class.cs (TypeContainer.DefineType): We can not use the nice
16836         PackingSize with the size set to 1 DefineType method, because it
16837         will not allow us to define the interfaces that the struct
16838         implements.
16839
16840         This completes the fixing of bug 27287
16841
16842         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16843         means also structs.  This fixes part of the problem. 
16844         (Expresion.ImplicitReferenceConversionExists): ditto.
16845
16846         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16847         error if there were no errors reported during the type lookup
16848         process, to avoid duplicates or redundant errors.  Without this
16849         you would get an ambiguous errors plus a type not found.  We have
16850         beaten the user enough with the first error.  
16851
16852         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16853         reference. 
16854
16855         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16856         during the resolution process, stop the lookup, this avoids
16857         repeated error reports (same error twice).
16858
16859         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16860
16861         * typemanager.cs (LookupType): Redo the type lookup code to match
16862         the needs of System.Reflection.  
16863
16864         The issue is that System.Reflection requires references to nested
16865         types to begin with a "+" sign instead of a dot.  So toplevel
16866         types look like: "NameSpace.TopLevelClass", and nested ones look
16867         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16868         levels. 
16869
16870 2002-09-19  Martin Baulig  <martin@gnome.org>
16871
16872         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16873         says that a method always returns or always throws an exception,
16874         don't report the CS0161.
16875
16876         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16877         set `Returns = new_returns'.
16878
16879 2002-09-19  Martin Baulig  <martin@gnome.org>
16880
16881         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16882         to an enum constant, check for a CS0176.
16883
16884 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16885
16886         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16887         for operators that must be in pairs and report errors.
16888
16889         * ecore.cs (SimpleName.DoResolveType): During the initial type
16890         resolution process, when we define types recursively, we must
16891         check first for types in our current scope before we perform
16892         lookups in the enclosing scopes.
16893
16894         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16895
16896         (Invocation.VerifyArgumentsCompat): Call
16897         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16898         I thought we were supposed to always call this, but there are a
16899         few places in the code where we dont do it.
16900
16901 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16902
16903         * driver.cs: Add support in -linkres and -resource to specify the
16904         name of the identifier.
16905
16906 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * ecore.cs (StandardConversionExists): Sync with the conversion
16909         code: allow anything-* to void* conversions.
16910
16911         (FindMostSpecificSource): Use an Expression argument
16912         instead of a Type, because we might be handed over a Literal which
16913         gets a few more implicit conversions that plain types do not.  So
16914         this information was being lost.
16915
16916         Also, we drop the temporary type-holder expression when not
16917         required.
16918
16919 2002-09-17  Martin Baulig  <martin@gnome.org>
16920
16921         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16922         this is an explicit interface implementation.
16923
16924 2002-09-17  Martin Baulig  <martin@gnome.org>
16925
16926         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16927         different `IndexerName' attributes.
16928
16929         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16930         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16931         virtual CommonResolve().
16932
16933 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16934
16935         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16936         and convert that to the UnderlyingType.
16937
16938         * statement.cs (Foreach.Resolve): Indexers are just like variables
16939         or PropertyAccesses.
16940
16941         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16942         inside quoted strings, we were not doing this before.
16943
16944 2002-09-16  Martin Baulig  <martin@gnome.org>
16945
16946         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16947         resolve it.  This is needed for the definite assignment check of the
16948         instance expression, fixes bug #29846.
16949         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16950
16951 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16952
16953         * parameter.cs: Fix compile error.  Cannot reference static member
16954         from an instance object.  Is this an mcs bug?
16955
16956 2002-09-14  Martin Baulig  <martin@gnome.org>
16957
16958         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16959         multiple times.  Fixes bug #30295, added test-166.cs.
16960
16961 2002-09-14  Martin Baulig  <martin@gnome.org>
16962
16963         * statement.cs (Block.Emit): Don't emit unreachable code.
16964         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16965         `break' statements.
16966         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16967
16968 2002-09-14  Martin Baulig  <martin@gnome.org>
16969
16970         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16971         is set.
16972
16973 2002-09-14  Martin Baulig  <martin@gnome.org>
16974
16975         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16976         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16977         be false on the ms runtime.
16978
16979 2002-09-13  Martin Baulig  <martin@gnome.org>
16980
16981         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16982         the CS0038 error message.
16983
16984 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16985
16986         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16987         constant inside, return it.
16988
16989 2002-09-12  Martin Baulig  <martin@gnome.org>
16990
16991         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16992         implicit conversion can be done between enum types.
16993
16994         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16995         check whether an implicit conversion to the current enum's UnderlyingType
16996         exists and report an error if not.
16997
16998         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16999         without debugging support.
17000
17001         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17002         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17003
17004 2002-09-12  Martin Baulig  <martin@gnome.org>
17005
17006         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17007
17008         * ecore.cs (IMemberExpr.DeclaringType): New property.
17009         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17010         nonstatic member of an outer type (CS0038).
17011
17012 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17013
17014         * driver.cs: Activate the using-error detector at warning level
17015         4 (at least for MS-compatible APIs).
17016
17017         * namespace.cs (VerifyUsing): Small buglett fix.
17018
17019         * pending.cs (PendingImplementation): pass the container pointer. 
17020
17021         * interface.cs (GetMethods): Allow for recursive definition.  Long
17022         term, I would like to move every type to support recursive
17023         definitions, not the current ordering mechanism that we have right
17024         now.
17025
17026         The situation is this: Attributes are handled before interfaces,
17027         so we can apply attributes to interfaces.  But some attributes
17028         implement interfaces, we will now handle the simple cases
17029         (recursive definitions will just get an error).  
17030
17031         * parameter.cs: Only invalidate types at the end if we fail to
17032         lookup all types.  
17033
17034 2002-09-09  Martin Baulig  <martin@gnome.org>
17035
17036         * ecore.cs (PropertyExpr.Emit): Also check for
17037         TypeManager.system_int_array_get_length so this'll also work when
17038         compiling corlib.  Fixes #30003.
17039
17040 2002-09-09  Martin Baulig  <martin@gnome.org>
17041
17042         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17043         and throw an exception if we can't get the type's size.  Fixed #30040,
17044         added test-165.cs.
17045
17046 2002-09-09  Martin Baulig  <martin@gnome.org>
17047
17048         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17049
17050         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17051         context.  Fixes bug #30027.
17052
17053         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17054         virtual functions.  Fixes bug #30043, added test-164.cs.
17055
17056 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17057
17058         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17059
17060 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17061
17062         * driver.cs: Use an object to get the windows codepage since it's not a
17063         static property.
17064
17065 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17066
17067         * statement.cs (For.Emit): for infinite loops (test == null)
17068         return whether there is a break inside, not always "true".
17069
17070         * namespace.cs (UsingEntry): New struct to hold the name of the
17071         using definition, the location where it is defined, and whether it
17072         has been used in a successful type lookup.
17073
17074         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17075         strings.
17076
17077         * decl.cs: ditto.
17078
17079 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17080
17081         * attribute.cs : Fix incorrect code which relied on catching
17082         a NullReferenceException to detect a null being passed in
17083         where an object was expected.
17084
17085 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * statement.cs (Try): flag the catch variable as assigned
17088
17089         * expression.cs (Cast): Simplified by using ResolveType instead of
17090         manually resolving.
17091
17092         * statement.cs (Catch): Fix bug by using ResolveType.
17093
17094 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17095
17096         * expression.cs (BetterConversion): Special case for when we have
17097         a NullLiteral as the argument and we have to choose between string
17098         and object types - we choose string the way csc does.
17099
17100         * attribute.cs (Attribute.Resolve): Catch the
17101         NullReferenceException and report error #182 since the Mono
17102         runtime no more has the bug and having this exception raised means
17103         we tried to select a constructor which takes an object and is
17104         passed a null.
17105
17106 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17107
17108         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17109         message (1502, 1503) when we can't locate a method after overload
17110         resolution. This is much more informative and closes the bug
17111         Miguel reported.
17112
17113         * interface.cs (PopulateMethod): Return if there are no argument
17114         types. Fixes a NullReferenceException bug.
17115
17116         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17117         expressions too. Previously we were checking only in one place for
17118         positional arguments leaving out named arguments.
17119
17120         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17121         type to the enum type is not allowed. Remove code corresponding to
17122         that.
17123
17124         (ConvertNumericExplicit): Allow explicit conversions from
17125         the underlying type to enum type. This precisely follows the spec
17126         and closes a bug filed by Gonzalo.
17127
17128 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17129
17130         * compiler.csproj:
17131         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17132
17133 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17136         it was important that we stored the right value after the
17137         reduction in `converted'.
17138
17139 2002-09-04  Martin Baulig  <martin@gnome.org>
17140
17141         * location.cs (Location.SymbolDocument): Use full pathnames for the
17142         source files.
17143
17144 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17147         of the expression resolve mechanism, because that will catch the
17148         SimpleName error failures.
17149
17150         (Conditional): If we can not resolve the
17151         expression, return, do not crash.
17152
17153 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17154
17155         * cs-tokenizer.cs:
17156         (location): display token name instead of its number.
17157
17158 2002-08-28  Martin Baulig  <martin@gnome.org>
17159
17160         * expression.cs (Binary.ResolveOperator): Don't silently return
17161         but return an error if an operator cannot be applied between two
17162         enum types.
17163
17164 2002-08-28  Martin Baulig  <martin@gnome.org>
17165
17166         * class.cs (Constructor.Define): Set the permission attributes
17167         correctly instead of making all constructors public.
17168
17169 2002-08-28  Martin Baulig  <martin@gnome.org>
17170
17171         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17172         for private members before reporting a CS0103; if we find anything,
17173         it's a CS0122.
17174
17175 2002-08-28  Martin Baulig  <martin@gnome.org>
17176
17177         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17178         to check whether `closure_start_type == closure_invocation_type',
17179         we also need to check whether `m.DeclaringType == closure_invocation_type'
17180         before bypassing the permission checks.  We might be accessing
17181         protected/private members from the base class.
17182         (TypeManager.RealMemberLookup): Only set private_ok if private
17183         members were requested via BindingFlags.NonPublic.
17184
17185         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17186
17187         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17188         MethodGroupExpr.IsExplicitImpl if appropriate.
17189         (Invocation.DoResolve): Don't report the CS0120 for explicit
17190         interface implementations.
17191
17192 2002-08-27  Martin Baulig  <martin@gnome.org>
17193
17194         * expression.cs (Invocation.DoResolve): If this is a static
17195         method and we don't have an InstanceExpression, we must report
17196         a CS0120.
17197
17198 2002-08-25  Martin Baulig  <martin@gnome.org>
17199
17200         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17201         `==' between a valuetype and an object.
17202
17203 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17204
17205         * ecore.cs (TypeExpr): Provide a ToString method.
17206
17207 2002-08-24  Martin Baulig  <martin@gnome.org>
17208
17209         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17210         now called proggie.dbg and it's a binary file.
17211
17212 2002-08-23  Martin Baulig  <martin@gnome.org>
17213
17214         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17215
17216 2002-08-23  Martin Baulig  <martin@gnome.org>
17217
17218         * struct.cs (MyStructInfo.ctor): Make this work with empty
17219         structs; it's not allowed to use foreach() on null.
17220
17221 2002-08-23  Martin Baulig  <martin@gnome.org>
17222
17223         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17224         writer the full pathname of the generated assembly.
17225
17226 2002-08-23  Martin Baulig  <martin@gnome.org>
17227
17228         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17229         A `finally' block never returns or breaks; improved handling of
17230         unreachable code.
17231
17232 2002-08-23  Martin Baulig  <martin@gnome.org>
17233
17234         * statement.cs (Throw.Resolve): Allow `throw null'.
17235
17236 2002-08-23  Martin Baulig  <martin@gnome.org>
17237
17238         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17239         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17240         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17241         MemberLookup would return a wrong event if this is an explicit
17242         interface implementation and the class has an event with the same
17243         name.
17244
17245 2002-08-23  Martin Baulig  <martin@gnome.org>
17246
17247         * statement.cs (Block.AddChildVariableNames): New public method.
17248         (Block.AddChildVariableName): Likewise.
17249         (Block.IsVariableNameUsedInChildBlock): Likewise.
17250         (Block.AddVariable): Check whether a variable name has already
17251         been used in a child block.
17252
17253         * cs-parser.jay (declare_local_variables): Mark all variable names
17254         from the current block as being used in a child block in the
17255         implicit block.
17256
17257 2002-08-23  Martin Baulig  <martin@gnome.org>
17258
17259         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17260         find the symbol writer.
17261
17262         * driver.cs: csc also allows the arguments to /define being
17263         separated by commas, not only by semicolons.
17264
17265 2002-08-23  Martin Baulig  <martin@gnome.org>
17266
17267         * interface.cs (Interface.GetMembers): Added static check for events.
17268
17269 2002-08-15  Martin Baulig  <martin@gnome.org>
17270
17271         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17272         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17273
17274         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17275         why the MethodData.EmitDestructor() change was necessary.
17276
17277 2002-08-20  Martin Baulig  <martin@gnome.org>
17278
17279         * class.cs (TypeContainer.FindMembers): Added static check for events.
17280
17281         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17282
17283         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17284         use Type.GetEvents(), not Type.FindMembers().
17285
17286 2002-08-20  Martin Baulig  <martin@gnome.org>
17287
17288         * decl.cs (MemberCache): Added a special method cache which will
17289         be used for method-only searched.  This ensures that a method
17290         search will return a MethodInfo with the correct ReflectedType for
17291         inherited methods.      
17292
17293 2002-08-20  Martin Baulig  <martin@gnome.org>
17294
17295         * decl.cs (DeclSpace.FindMembers): Made this public.
17296
17297 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17298
17299         * delegate.cs: fixed build on windows.
17300         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17301
17302 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17303
17304         * ecore.cs (StandardConversionExists): Return a false
17305         if we are trying to convert the void type to anything else
17306         since that is not allowed.
17307
17308         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17309         we flag error 70 in the event an event is trying to be accessed
17310         directly from outside the declaring type.
17311
17312 2002-08-20  Martin Baulig  <martin@gnome.org>
17313
17314         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17315         MemberCache from typemanager.cs to decl.cs.
17316
17317 2002-08-19  Martin Baulig  <martin@gnome.org>
17318
17319         * class.cs (TypeContainer): Implement IMemberContainer.
17320         (TypeContainer.DefineMembers): Create the MemberCache.
17321         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17322         return public members if BindingFlags.Public was given, check
17323         whether members are static.
17324
17325 2002-08-16  Martin Baulig  <martin@gnome.org>
17326
17327         * decl.cs (DeclSpace.Define): Splitted this in Define and
17328         DefineMembers.  DefineMembers is called first and initializes the
17329         MemberCache.
17330
17331         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17332         DefineMembers() on all our DeclSpaces.
17333
17334         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17335         but call DefineMembers() on all nested interfaces.  We call their
17336         Define() in our new Define() function.
17337
17338         * interface.cs (Interface): Implement IMemberContainer.
17339         (Interface.Define): Moved all code except the attribute stuf to
17340         DefineMembers().
17341         (Interface.DefineMembers): Initialize the member cache.
17342
17343         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17344         need this anymore since we can use MemberCache.FindMembers directly.
17345
17346 2002-08-19  Martin Baulig  <martin@gnome.org>
17347
17348         * typemanager.cs (MemberCache): When creating the cache for an
17349         interface type, add all inherited members.
17350         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17351         to `out bool used_cache' and documented it.
17352         (TypeManager.MemberLookup): If we already used the cache in the first
17353         iteration, we don't need to do the interfaces check.
17354
17355 2002-08-19  Martin Baulig  <martin@gnome.org>
17356
17357         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17358         here from IMemberFinder and don't implement this interface anymore.
17359         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17360
17361         * typemanager.cs (IMemberFinder): This interface is now only used by
17362         classes which actually support the member cache.
17363         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17364         since we only put DeclSpaces into this Hashtable.
17365         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17366         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17367
17368 2002-08-16  Martin Baulig  <martin@gnome.org>
17369
17370         * typemanager.cs (ICachingMemberFinder): Removed.
17371         (IMemberFinder.MemberCache): New property.
17372         (TypeManager.FindMembers): Merged this with RealFindMembers().
17373         This function will never be called from TypeManager.MemberLookup()
17374         so we can't use the cache here, just the IMemberFinder.
17375         (TypeManager.MemberLookup_FindMembers): Check whether the
17376         IMemberFinder has a MemberCache and call the cache's FindMembers
17377         function.
17378         (MemberCache): Rewrote larger parts of this yet another time and
17379         cleaned it up a bit.
17380
17381 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * driver.cs (LoadArgs): Support quoting.
17384
17385         (Usage): Show the CSC-like command line arguments.
17386
17387         Improved a few error messages.
17388
17389 2002-08-15  Martin Baulig  <martin@gnome.org>
17390
17391         * typemanager.cs (IMemberContainer.Type): New property.
17392         (IMemberContainer.IsInterface): New property.
17393
17394         The following changes are conditional to BROKEN_RUNTIME, which is
17395         defined at the top of the file.
17396
17397         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17398         class'es members, but add all members from TypeHandle.ObjectType
17399         if we're an interface.
17400         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17401         is the current type.
17402         (MemberCache.CacheEntry.Container): Removed this field.
17403         (TypeHandle.GetMembers): Include inherited members.
17404
17405 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17406
17407         * typemanager.cs: fixed compilation and added a comment on a field that
17408         is never used.
17409
17410 2002-08-15  Martin Baulig  <martin@gnome.org>
17411
17412         * class.cs (ConstructorInitializer.Resolve): In the
17413         Expression.MemberLookup call, use the queried_type as
17414         invocation_type.
17415
17416         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17417         declared' attribute, it's always true.
17418         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17419         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17420         temporary wrapper for FindMembers which tells MemberLookup whether
17421         members from the base classes are included in the return value.
17422         This will go away soon.
17423         (TypeManager.MemberLookup): Use this temporary hack here; once the
17424         new MemberCache is completed, we don't need to do the DeclaredOnly
17425         looping here anymore since the MemberCache will take care of this.
17426         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17427         (MemberCache): When creating the MemberCache for a class, get
17428         members from the current class and all its base classes.
17429         (MemberCache.CacheEntry.Container): New field.  This is a
17430         temporary hack until the Mono runtime is fixed to distinguish
17431         between ReflectedType and DeclaringType.  It allows us to use MCS
17432         with both the MS runtime and the unfixed Mono runtime without
17433         problems and without accecting performance.
17434         (MemberCache.SearchMembers): The DeclaredOnly looping from
17435         TypeManager.MemberLookup is now done here.      
17436
17437 2002-08-14  Martin Baulig  <martin@gnome.org>
17438
17439         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17440         Type.GetFields on dynamic types but get the fields from the
17441         corresponding TypeContainer.
17442         (MyStructInfo.GetStructInfo): Added check for enum types.
17443
17444         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17445         (MemberList.SyncRoot): Implemented.
17446         (TypeManager.FilterWithClosure): No need to check permissions if
17447         closure_start_type == closure_invocation_type, don't crash if
17448         closure_invocation_type is null.
17449
17450 2002-08-13  Martin Baulig  <martin@gnome.org>
17451
17452         Rewrote TypeContainer.FindMembers to use a member cache.  This
17453         gives us a speed increase of about 35% for the self-hosting MCS
17454         build and of about 15-20% for the class libs (both on GNU/Linux).
17455
17456         * report.cs (Timer): New class to get enhanced profiling.  This
17457         whole class is "TIMER" conditional since it remarkably slows down
17458         compilation speed.
17459
17460         * class.cs (MemberList): New class.  This is an IList wrapper
17461         which we're now using instead of passing MemberInfo[]'s around to
17462         avoid copying this array unnecessarily.
17463         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17464         (ICachingMemberFinder, IMemberContainer): New interface.
17465         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17466         has already been checked, otherwise use it for the name comparision.
17467         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17468         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17469         if possible.  Returns a MemberList, not a MemberInfo [].
17470         (TypeHandle): New class, implements IMemberContainer.  We create
17471         one instance of this class per type, it contains a MemberCache
17472         which is used to do the member lookups.
17473         (MemberCache): New class.  Each instance of this class contains
17474         all members of a type and a name-based hash table.
17475         (MemberCache.FindMembers): This is our new member lookup
17476         function.  First, it looks up all members of the requested name in
17477         the hash table.  Then, it walks this list and sorts out all
17478         applicable members and returns them.
17479
17480 2002-08-13  Martin Baulig  <martin@gnome.org>
17481
17482         In addition to a nice code cleanup, this gives us a performance
17483         increase of about 1.4% on GNU/Linux - not much, but it's already
17484         half a second for the self-hosting MCS compilation.
17485
17486         * typemanager.cs (IMemberFinder): New interface.  It is used by
17487         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17488         Enum, Delegate or Interface.
17489         (TypeManager.finder_to_member_finder): New PtrHashtable.
17490         (TypeManager.finder_to_container): Removed.
17491         (TypeManager.finder_to_delegate): Removed.
17492         (TypeManager.finder_to_interface): Removed.
17493         (TypeManager.finder_to_enum): Removed.
17494
17495         * interface.cs (Interface): Implement IMemberFinder.
17496
17497         * delegate.cs (Delegate): Implement IMemberFinder.
17498
17499         * enum.cs (Enum): Implement IMemberFinder.
17500
17501         * class.cs (TypeContainer): Implement IMemberFinder.
17502
17503 2002-08-12  Martin Baulig  <martin@gnome.org>
17504
17505         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17506
17507 2002-08-12  Martin Baulig  <martin@gnome.org>
17508
17509         * ecore.cs (ITypeExpression): New interface for expressions which
17510         resolve to a type.
17511         (TypeExpression): Renamed to TypeLookupExpression.
17512         (Expression.DoResolve): If we're doing a types-only lookup, the
17513         expression must implement the ITypeExpression interface and we
17514         call DoResolveType() on it.
17515         (SimpleName): Implement the new ITypeExpression interface.
17516         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17517         hack, the situation that we're only looking up types can't happen
17518         anymore when this method is called.  Moved the type lookup code to
17519         DoResolveType() and call it.
17520         (SimpleName.DoResolveType): This ITypeExpression interface method
17521         is now doing the types-only lookup.
17522         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17523         (ResolveFlags): Added MaskExprClass.
17524
17525         * expression.cs (MemberAccess): Implement the ITypeExpression
17526         interface.
17527         (MemberAccess.DoResolve): Added support for a types-only lookup
17528         when we're called via ITypeExpression.DoResolveType().
17529         (ComposedCast): Implement the ITypeExpression interface.
17530
17531         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17532         Expression.Resolve() with ResolveFlags.Type instead.
17533
17534 2002-08-12  Martin Baulig  <martin@gnome.org>
17535
17536         * interface.cs (Interface.Define): Apply attributes.
17537
17538         * attribute.cs (Attribute.ApplyAttributes): Added support for
17539         interface attributes.
17540
17541 2002-08-11  Martin Baulig  <martin@gnome.org>
17542
17543         * statement.cs (Block.Emit): Only check the "this" variable if we
17544         do not always throw an exception.
17545
17546         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17547         whether the property has a set accessor.
17548
17549 2002-08-11  Martin Baulig  <martin@gnome.org>
17550
17551         Added control flow analysis support for structs.
17552
17553         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17554         with control flow analysis turned off.
17555         (IVariable): New interface.
17556         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17557         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17558         (FieldExpr.DoResolve): Resolve the instance expression with flow
17559         analysis turned off and do the definite assignment check after the
17560         resolving when we know what the expression will resolve to.
17561
17562         * expression.cs (LocalVariableReference, ParameterReference):
17563         Implement the new IVariable interface, only call the flow analysis
17564         code if ec.DoFlowAnalysis is true.
17565         (This): Added constructor which takes a Block argument.  Implement
17566         the new IVariable interface.
17567         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17568         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17569         This does the definite assignment checks for struct members.
17570
17571         * class.cs (Constructor.Emit): If this is a non-static `struct'
17572         constructor which doesn't have any initializer, call
17573         Block.AddThisVariable() to tell the flow analysis code that all
17574         struct elements must be initialized before control returns from
17575         the constructor.
17576
17577         * statement.cs (MyStructInfo): New public class.
17578         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17579         argument to this indexer.  If non-zero, check an individual struct
17580         member, not the whole struct.
17581         (FlowBranching.CheckOutParameters): Check struct members.
17582         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17583         overloaded versions of these methods which take an additional
17584         `int field_idx' argument to check struct members.
17585         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17586         overloaded versions of these methods which take an additional
17587         `string field_name' argument to check struct member.s
17588         (VariableInfo): Implement the IVariable interface.
17589         (VariableInfo.StructInfo): New public property.  Returns the
17590         MyStructInfo instance of the variable if it's a struct or null.
17591         (Block.AddThisVariable): New public method.  This is called from
17592         Constructor.Emit() for non-static `struct' constructor which do
17593         not have any initializer.  It creates a special variable for the
17594         "this" instance variable which will be checked by the flow
17595         analysis code to ensure that all of the struct's fields are
17596         initialized before control returns from the constructor.
17597         (UsageVector): Added support for struct members.  If a
17598         variable/parameter is a struct with N members, we reserve a slot
17599         in the usage vector for each member.  A struct is considered fully
17600         initialized if either the struct itself (slot 0) or all its
17601         members are initialized.
17602
17603 2002-08-08  Martin Baulig  <martin@gnome.org>
17604
17605         * driver.cs (Driver.MainDriver): Only report an error CS5001
17606         if there were no compilation errors.
17607
17608         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17609         `UnsafeContext' property to determine whether the parent is in
17610         unsafe context rather than checking the parent's ModFlags:
17611         classes nested in an unsafe class are unsafe as well.
17612
17613 2002-08-08  Martin Baulig  <martin@gnome.org>
17614
17615         * statement.cs (UsageVector.MergeChildren): Distinguish between
17616         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17617         we return.  Added test17() and test18() to test-154.cs.
17618
17619 2002-08-08  Martin Baulig  <martin@gnome.org>
17620
17621         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17622         Family access, make sure the invoking type isn't a subclass of the
17623         queried type (that'd be a CS1540).
17624
17625         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17626         this method which takes an additional `Type invocation_type'.
17627
17628         * expression.cs (BaseAccess.DoResolve): Use the base type as
17629         invocation and query type.
17630         (MemberAccess.DoResolve): If the lookup failed and we're about to
17631         report a CS0122, try a lookup with the ec.ContainerType - if this
17632         succeeds, we must report a CS1540.
17633
17634 2002-08-08  Martin Baulig  <martin@gnome.org>
17635
17636         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17637         (MethodGroupExpr): Implement the IMemberExpr interface.
17638
17639         * expression (MemberAccess.ResolveMemberAccess): No need to have
17640         any special code for MethodGroupExprs anymore, they're now
17641         IMemberExprs.   
17642
17643 2002-08-08  Martin Baulig  <martin@gnome.org>
17644
17645         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17646         Family, FamANDAssem and FamORAssem permissions.
17647         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17648
17649 2002-08-08  Martin Baulig  <martin@gnome.org>
17650
17651         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17652         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17653         or loop block.
17654
17655 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17656
17657         * driver.cs: implemented /resource option to embed managed resources.
17658
17659 2002-08-07  Martin Baulig  <martin@gnome.org>
17660
17661         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17662         (FieldBase.HasFieldInitializer): New public property.
17663         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17664         returns the field initializer and makes sure it is only resolved once.
17665         (TypeContainer.EmitFieldInitializers): Call
17666         FieldBase.GetInitializerExpression to get the initializer, this ensures
17667         that it isn't resolved multiple times.
17668
17669         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17670         the resolving process (SimpleName/MemberLookup) that we're currently
17671         emitting a field initializer (which must not access any instance members,
17672         this is an error CS0236).
17673
17674         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17675         argument, if the `IsFieldInitializer' flag is set, we must report and
17676         error CS0236 and not an error CS0120.   
17677
17678 2002-08-07  Martin Baulig  <martin@gnome.org>
17679
17680         * ecore.cs (IMemberExpr): New public interface.
17681         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17682         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17683         if the expression is an IMemberExpr.
17684
17685         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17686         to be null, implicitly default to `this' if we're non-static in
17687         this case.  Simplified the code a lot by using the new IMemberExpr
17688         interface.  Also fixed bug #28176 here.
17689
17690 2002-08-06  Martin Baulig  <martin@gnome.org>
17691
17692         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17693         ParameterReferences during semantic analysis so that we can do a
17694         type-only search when resolving Cast, TypeOf and SizeOf.
17695         (block): Pass the `current_local_parameters' to the Block's
17696         constructor.
17697
17698         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17699         argument to the constructor.
17700         (ConstructorInitializer.Resolve): Create a temporary implicit
17701         block with the parameters.
17702
17703         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17704         references here if we aren't doing a type-only search.
17705
17706         * statement.cs (Block): Added constructor which takes a
17707         `Parameters parameters' argument.
17708         (Block.Parameters): New public property.
17709
17710         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17711         to `Parameters' and made it public readonly.
17712
17713 2002-08-06  Martin Baulig  <martin@gnome.org>
17714
17715         * ecore.cs (Expression.Warning): Made this public as well.
17716
17717         * report.cs (Report.Debug): Print the contents of collections.
17718
17719 2002-08-06  Martin Baulig  <martin@gnome.org>
17720
17721         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17722         used to tell Resolve() which kinds of expressions it may return.
17723         (Expression.Resolve): Added overloaded version of this method which
17724         takes a `ResolveFlags flags' argument.  This can be used to tell
17725         Resolve() which kinds of expressions it may return.  Reports a
17726         CS0118 on error.
17727         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17728         ResolveFlags.SimpleName.
17729         (Expression.Error118): Added overloaded version of this method which
17730         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17731         which kinds of expressions are allowed.
17732
17733         * expression.cs (Argument.ResolveMethodGroup): New public method.
17734         Resolves an argument, but allows a MethodGroup to be returned.
17735         This is used when invoking a delegate.
17736
17737         * TODO: Updated a bit.
17738
17739 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17740
17741         Fixed compilation with csc.
17742
17743         * ecore.cs: Expression.Error made public. Is this correct? Should
17744         Warning be made public too?
17745
17746         * expression.cs: use ea.Location instead of ea.loc.
17747         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17748
17749 2002-08-06  Martin Baulig  <martin@gnome.org>
17750
17751         * ecore.cs (Expression.loc): Moved the location here instead of
17752         duplicating it in all derived classes.
17753         (Expression.Location): New public property.
17754         (Expression.Error, Expression.Warning): Made them non-static and
17755         removed the location argument.
17756         (Expression.Warning): Added overloaded version which takes an
17757         `int level' argument.
17758         (Expression.Error118): Make this non-static and removed the
17759         expression and location arguments.
17760         (TypeExpr): Added location argument to the constructor.
17761
17762         * expression.cs (StaticCallExpr): Added location argument to
17763         the constructor.
17764         (Indirection, PointerArithmetic): Likewise.
17765         (CheckedExpr, UnCheckedExpr): Likewise.
17766         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17767         (StringPtr): Likewise.
17768
17769
17770 2002-08-05  Martin Baulig  <martin@gnome.org>
17771
17772         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17773
17774         * assign.cs (Assign.DoResolve): Check whether the source
17775         expression is a value or variable.
17776
17777         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17778         while resolving the corresponding blocks.
17779
17780         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17781         an error, don't silently return null.
17782
17783         * statement.cs (Block.AddVariable): Do the error reporting here
17784         and distinguish between CS0128 and CS0136.
17785         (Block.DoResolve): Report all unused labels (warning CS0164).
17786         (LabeledStatement): Pass the location to the constructor.
17787         (LabeledStatement.HasBeenReferenced): New property.
17788         (LabeledStatement.Resolve): Set it to true here.
17789
17790         * statement.cs (Return.Emit): Return success even after reporting
17791         a type mismatch error (CS0126 or CS0127), this is what csc does and
17792         it avoids confusing the users with any consecutive errors.
17793
17794 2002-08-05  Martin Baulig  <martin@gnome.org>
17795
17796         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17797
17798         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17799
17800         * expression.cs (MemberAccess.DoResolve): Silently return if an
17801         error has already been reported.
17802
17803         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17804         error has already been reported.
17805
17806 2002-08-05  Martin Baulig  <martin@gnome.org>
17807
17808         * statement.cs (UsageVector): Only initialize the `parameters'
17809         vector if we actually have any "out" parameters.
17810
17811 2002-08-05  Martin Baulig  <martin@gnome.org>
17812
17813         * expression.cs (Binary.ResolveOperator): When combining delegates,
17814         they must have the same type.
17815
17816 2002-08-05  Martin Baulig  <martin@gnome.org>
17817
17818         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17819         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17820         work with the ms runtime and we also don't need it: if we're a
17821         PropertyBuilder and not in the `indexer_arguments' hash, then we
17822         are a property and not an indexer.
17823
17824         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17825         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17826         since the latter one doesn't work with the ms runtime.
17827
17828 2002-08-03  Martin Baulig  <martin@gnome.org>
17829
17830         Fixed bugs #27998 and #22735.
17831
17832         * class.cs (Method.IsOperator): New public field.
17833         (Method.CheckBase): Report CS0111 if there's already a method
17834         with the same parameters in the current class.  Report CS0508 when
17835         attempting to change the return type of an inherited method.
17836         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17837         and it's not marked abstract or extern.
17838         (PropertyBase): New abstract base class for Property and Indexer.
17839         (PropertyBase.CheckBase): Moved here from Property and made it work
17840         for indexers.
17841         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17842         the same so we can reuse it there.
17843         (Property, Indexer): Derive from PropertyBase.
17844         (MethodSignature.inheritable_property_signature_filter): New delegate
17845         to find properties and indexers.
17846
17847         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17848         argument and improved error reporting.
17849
17850         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17851         EmptyReadOnlyParameters and made it a property.
17852
17853         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17854         version of this method which takes a `PropertyInfo indexer'.
17855         (TypeManager.RegisterIndexer): New method.
17856
17857         * class.cs: Added myself as author of this file :-)
17858
17859 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17860
17861         * class.cs: fixed compilation on windoze.
17862
17863 2002-08-03  Martin Baulig  <martin@gnome.org>
17864
17865         * interface.cs (Interface.GetInterfaceBases): Check whether all
17866         base interfaces are at least as accessible than the current one.
17867
17868         * class.cs (TypeContainer.GetClassBases): Check whether base types
17869         are at least as accessible than the current type.
17870         (TypeContainer.AsAccessible): Implemented and made non-static.
17871         (MemberBase.CheckParameters): Report errors if the accessibility
17872         checks fail.
17873
17874         * delegate.cs (Delegate.Delegate): The default visibility is
17875         internal for top-level types and private for nested types.
17876         (Delegate.Define): Report errors if the accessibility checks fail.
17877
17878         * enum.cs (Enum.Enum): The default visibility is internal for
17879         top-level types and private for nested types.
17880         (Enum.DefineType): Compute the correct visibility.
17881
17882         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17883         function which takes a `bool is_toplevel' instead of a TypeContainer.
17884
17885         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17886         builtin type.
17887
17888 2002-08-02  Martin Baulig  <martin@gnome.org>
17889
17890         * expression.cs (LocalVariableReferenc): Added constructor which
17891         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17892         (LocalVariableReference.IsReadOnly): New property.
17893         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17894         variable is readonly, use our own readonly flag to do this; you can
17895         use the new constructor to get a writable reference to a read-only
17896         variable.
17897
17898         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17899         reference to the local variable.
17900
17901 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * rootcontext.cs (ResolveCore): Also include System.Exception
17904
17905         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17906         we reach an EmptyStatement.
17907
17908         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17909         is also fine.
17910
17911         * expression.cs (Binary.ResolveOperator): Check error result in
17912         two places.
17913
17914         use brtrue/brfalse directly and avoid compares to null.
17915
17916 2002-08-02  Martin Baulig  <martin@gnome.org>
17917
17918         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17919         Fixes bug #28407, added test-155.cs.
17920
17921 2002-08-01  Martin Baulig  <martin@gnome.org>
17922
17923         * class.cs (Event.EmitDefaultMethod): Make this work with static
17924         events.  Fixes #28311, added verify-3.cs.
17925
17926 2002-08-01  Martin Baulig  <martin@gnome.org>
17927
17928         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17929         `is_disposable' fields.
17930         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17931         `hm.is_disposable' if we're using the collection pattern.
17932         (Foreach.EmitCollectionForeach): Use the correct type for the
17933         enumerator's local variable, only emit the try/finally block if
17934         necessary (fixes #27713).
17935
17936 2002-08-01  Martin Baulig  <martin@gnome.org>
17937
17938         * ecore.cs (Expression.report118): Renamed to Error118 and made
17939         it public static.
17940
17941         * statement.cs (Throw.Resolve): Check whether the expression is of
17942         the correct type (CS0118) and whether the type derives from
17943         System.Exception (CS0155).
17944         (Catch.Resolve): New method.  Do the type lookup here and check
17945         whether it derives from System.Exception (CS0155).
17946         (Catch.CatchType, Catch.IsGeneral): New public properties.
17947
17948         * typemanager.cs (TypeManager.exception_type): Added.
17949
17950 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * driver.cs: Updated About function.
17953
17954 2002-07-31  Martin Baulig  <martin@gnome.org>
17955
17956         Implemented Control Flow Analysis.
17957
17958         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17959         (EmitContext.CurrentBranching): Added.
17960         (EmitContext.StartFlowBranching): Added.
17961         (EmitContext.EndFlowBranching): Added.
17962         (EmitContext.KillFlowBranching): Added.
17963         (EmitContext.IsVariableAssigned): Added.
17964         (EmitContext.SetVariableAssigned): Added.
17965         (EmitContext.IsParameterAssigned): Added.
17966         (EmitContext.SetParameterAssigned): Added.
17967         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17968         Added control flow analysis stuff here.
17969
17970         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17971         resolve the expression as lvalue.
17972         (LocalVariableReference.DoResolve): Check whether the variable has
17973         already been assigned.
17974         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17975         the parameter as assigned here.
17976         (ParameterReference.DoResolve): Check whether the parameter has already
17977         been assigned.
17978         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17979         expression as lvalue.
17980
17981         * statement.cs (FlowBranching): New class for the flow analysis code.
17982         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17983         (LabeledStatement.IsDefined): New public property.
17984         (LabeledStatement.AddUsageVector): New public method to tell flow
17985         analyis that the label may be reached via a forward jump.
17986         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17987         flow analysis.
17988         (VariableInfo.Number): New public field.  This is used by flow analysis
17989         to number all locals of a block.
17990         (Block.CountVariables): New public property.  This is the number of
17991         local variables in this block (including the locals from all parent
17992         blocks).
17993         (Block.EmitMeta): Number all the variables.
17994
17995         * statement.cs: Added flow analysis support to all classes.
17996
17997 2002-07-31  Martin Baulig  <martin@gnome.org>
17998
17999         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18000         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18001         then use this argument.
18002
18003         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18004
18005         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18006         use this to specify /define options.
18007
18008 2002-07-29  Martin Baulig  <martin@gnome.org>
18009
18010         * statement.cs (Fixed): Moved all code that does variable lookups
18011         and resolvings from Emit to Resolve.
18012
18013         * statement.cs (For): Moved all code that does variable lookups
18014         and resolvings from Emit to Resolve.
18015
18016         * statement.cs (Using): Moved all code that does variable lookups
18017         and resolvings from Emit to Resolve.
18018
18019 2002-07-29  Martin Baulig  <martin@gnome.org>
18020
18021         * attribute.cs (Attribute.Resolve): Explicitly catch a
18022         System.NullReferenceException when creating the
18023         CustromAttributeBuilder and report a different warning message.
18024
18025 2002-07-29  Martin Baulig  <martin@gnome.org>
18026
18027         * support.cs (ParameterData.ParameterName): Added method to
18028         get the name of a parameter.
18029
18030         * typemanager.cs (TypeManager.IsValueType): New public method.
18031
18032 2002-07-29  Martin Baulig  <martin@gnome.org>
18033
18034         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18035         is a flag which specifies that it's either ref or out.
18036         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18037         the out parameter to `out Parameter.Modifier mod', also set the
18038         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18039
18040         * support.cs (InternalParameters.ParameterModifier): Distinguish
18041         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18042         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18043
18044         * expression.cs (Argument.GetParameterModifier): Distinguish
18045         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18046         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18047
18048 2002-07-29  Martin Baulig  <martin@gnome.org>
18049
18050         * expression.cs (ParameterReference.ParameterReference): Added
18051         `Location loc' argument to the constructor.
18052
18053         * cs-parser.jay: Pass location to ParameterReference.
18054
18055 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18056
18057         * statement.cs (Try): Initialize the location.
18058
18059         * cs-parser.jay: pass location to Try.
18060
18061         * expression.cs (Unary.Reduce): Change the prototype to return
18062         whether a constant fold could be performed or not.  The result is
18063         returned in an out parameters.  In the case of Indirection and
18064         AddressOf, we want to perform the full tests.
18065
18066 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18067
18068         * statement.cs (Statement.Emit): Flag dead code.
18069
18070 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18071
18072         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18073
18074 2002-07-27  Martin Baulig  <martin@gnome.org>
18075
18076         * class.cs (MethodData.Define): Put back call to
18077         TypeManager.AddMethod(), accidentally commented this out.
18078
18079         * report.cs (Debug): New public method to print debugging information,
18080         this is `[Conditional ("DEBUG")]'.
18081
18082 2002-07-26  Martin Baulig  <martin@gnome.org>
18083
18084         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18085         (switch_statement): Push the current_block to the switch_stack and
18086         pop it again when we're done with the switch.
18087         (switch_section): The new block is a child of the current_block.
18088         Fixes bug #24007, added test-152.cs.
18089
18090 2002-07-27  Martin Baulig  <martin@gnome.org>
18091
18092         * expression.cs (Invocation.EmitArguments): When calling a varargs
18093         function with only its fixed arguments, we need to pass an empty
18094         array.
18095
18096 2002-07-27  Martin Baulig  <martin@gnome.org>
18097
18098         Mono 0.13 has been released.
18099
18100 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18101
18102         * driver.cs: Rename --resource to --linkres, because that is what
18103         we do currently, we dont support --resource yet.
18104
18105         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18106
18107 2002-07-25  Martin Baulig  <martin@gnome.org>
18108
18109         * class.cs (MethodData): New public class.  This is a `method builder'
18110         class for a method or one accessor of a Property/Indexer/Event.
18111         (MethodData.GetMethodFlags): Moved here from MemberBase.
18112         (MethodData.ApplyAttributes): Likewise.
18113         (MethodData.ApplyObsoleteAttribute): Likewise.
18114         (MethodData.ApplyConditionalAttribute): Likewise.
18115         (MethodData.ApplyDllImportAttribute): Likewise.
18116         (MethodData.CheckAbstractAndExternal): Likewise.
18117         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18118         (MethodData.Emit): Formerly known as Method.Emit().
18119         (MemberBase): Moved everything which was specific to a single
18120         accessor/method to MethodData.
18121         (Method): Create a new MethodData and call Define() and Emit() on it.
18122         (Property, Indexer, Event): Create a new MethodData objects for each
18123         accessor and call Define() and Emit() on them.
18124
18125 2002-07-25  Martin Baulig  <martin@gnome.org>
18126
18127         Made MethodCore derive from MemberBase to reuse the code from there.
18128         MemberBase now also checks for attributes.
18129
18130         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18131         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18132         as virtual.
18133         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18134         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18135         (MemberBase.ApplyAttributes): New virtual method; applies the
18136         attributes to a method or accessor.
18137         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18138         (MemberBase.ApplyConditionalAttribute): Likewise.
18139         (MemberBase.ApplyDllImportAttribute): Likewise.
18140         (MemberBase.CheckAbstractAndExternal): Likewise.
18141         (MethodCore.ParameterTypes): This is now a property instead of a
18142         method, it's initialized from DoDefineParameters().
18143         (MethodCore.ParameterInfo): Removed the set accessor.
18144         (MethodCore.DoDefineParameters): New protected virtual method to
18145         initialize ParameterTypes and ParameterInfo.
18146         (Method.GetReturnType): We can now simply return the MemberType.
18147         (Method.GetMethodFlags): Override the MemberBase version and add
18148         the conditional flags.
18149         (Method.CheckBase): Moved some code from Define() here, call
18150         DoDefineParameters() here.
18151         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18152         here to avoid some larger code duplication.
18153         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18154         ensure that abstract and external accessors don't declare a body.
18155
18156         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18157         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18158         lookup in the attribute's parent classes, so we need to abort as soon
18159         as we found the first match.
18160         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18161         the attribute has no arguments.
18162
18163         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18164         of a Method.
18165
18166 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18167
18168         * cs-parser.jay: reverted previous patch.
18169
18170 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18171
18172         * cs-parser.jay: fixed bug #22119.
18173
18174 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18175
18176         * attribute.cs: fixed compilation. The error was:
18177         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18178         be assigned to before control leaves the current method."
18179         [FIXME:  Filed as bug #28186: MCS must report this error.]
18180
18181 2002-07-25  Martin Baulig  <martin@gnome.org>
18182
18183         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18184         method to pull the condition name ouf of a Conditional attribute.
18185         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18186         the obsolete message and error flag out of an Obsolete attribute.
18187
18188         * class.cs (Method.GetMethodFlags): New public method to get the
18189         TypeManager.MethodFlags for this method.
18190         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18191         private methods.
18192         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18193         if we're overriding a virtual function, set the new private variable
18194         `parent_method'; call the new TypeManager.AddMethod().
18195
18196         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18197         the MethodBuilder and the Method in a PtrHashtable.
18198         (TypeManager.builder_to_method): Added for this purpose.
18199         (TypeManager.MethodFlags): Added IsObsoleteError.
18200         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18201         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18202         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18203         the message from the attribute.
18204
18205 2002-07-24  Martin Baulig  <martin@gnome.org>
18206
18207         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18208         preprocessor directives, ensure that the argument to #define/#undef is
18209         exactly one identifier and that it's actually an identifier.
18210
18211         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18212         did not work ....
18213
18214 2002-07-24  Martin Baulig  <martin@gnome.org>
18215
18216         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18217         initialize it to TypeManager.object_type in the constructor.
18218         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18219         of the `hm.get_current' method if we're using the collection pattern.
18220         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18221         for the explicit conversion to make it work when we're using the collection
18222         pattern and the `Current' property has a different return type than `object'.
18223         Fixes #27713.
18224
18225 2002-07-24  Martin Baulig  <martin@gnome.org>
18226
18227         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18228         does not match, but don't report any errors.  This method is called in
18229         order for all methods in a MethodGroupExpr until a matching method is
18230         found, so we don't want to bail out if the first method doesn't match.
18231         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18232         matches, report the 123.  Fixes #28070.
18233
18234 2002-07-24  Martin Baulig  <martin@gnome.org>
18235
18236         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18237         TypeManager.TypeToCoreType() to the top of the method so the
18238         following equality checks will work.  Fixes #28107.
18239
18240 2002-07-24  Martin Baulig  <martin@gnome.org>
18241
18242         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18243         operand is of type uint, and the other operand is of type sbyte,
18244         short or int, the operands are converted to type long." -
18245         Actually do what this comment already told us.  Fixes bug #28106,
18246         added test-150.cs.
18247
18248 2002-07-24  Martin Baulig  <martin@gnome.org>
18249
18250         * class.cs (MethodBase): New abstract class.  This is now a base
18251         class for Property, Indexer and Event to avoid some code duplication
18252         in their Define() and DefineMethods() methods.
18253         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18254         generic methods for Define() and DefineMethods().
18255         (FieldBase): Derive from MemberBase, not MemberCore.
18256         (Property): Derive from MemberBase, not MemberCore.
18257         (Property.DefineMethod): Moved all the code from this method to the
18258         new MethodBase.DefineAccessor(), just call it with appropriate
18259         argumetnts.
18260         (Property.Define): Call the new Property.DoDefine(), this does some
18261         sanity checks and we don't need to duplicate the code everywhere.
18262         (Event): Derive from MemberBase, not MemberCore.
18263         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18264         accessors, this will also make them work with interface events.
18265         (Indexer): Derive from MemberBase, not MemberCore.
18266         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18267         (Indexer.Define): Use the new MethodBase functions.
18268
18269         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18270         argument to the constructor.
18271         (Interface.FindMembers): Added support for interface events.
18272         (Interface.PopluateEvent): Implemented.
18273
18274         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18275
18276 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18277
18278         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18279         but this is required to check for a method name being the same as
18280         the containing class.  
18281
18282         Handle this now.
18283
18284 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18285
18286         * interface.cs: initialize variable.
18287
18288 2002-07-23  Martin Baulig  <martin@gnome.org>
18289
18290         Implemented the IndexerName attribute in interfaces.
18291
18292         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18293         name if this is an explicit interface implementation.
18294         (Indexer.InterfaceIndexerName): New public variable.  If we're
18295         implementing an interface indexer, this is the IndexerName in that
18296         interface.  Otherwise, it's the IndexerName.
18297         (Indexer.DefineMethod): If we're implementing interface indexer,
18298         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18299         and Pending.ImplementIndexer methods.
18300         (Indexer.Define): Also define the PropertyBuilder if we're
18301         implementing an interface indexer and this is neither an explicit
18302         interface implementation nor do the IndexerName match the one in
18303         the interface.
18304
18305         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18306         If a method is defined here, then we always need to create a proxy
18307         for it.  This is used when implementing interface indexers.
18308         (Pending.IsInterfaceIndexer): New public method.
18309         (Pending.ImplementIndexer): New public method.
18310         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18311         This is used when implementing interface indexers to define a proxy
18312         if necessary.
18313         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18314         define a proxy if necessary.
18315
18316         * interface.cs (Interface.IndexerName): New public variable.
18317         (Interface.PopulateIndexer): Set the IndexerName.
18318         (Interface.DefineIndexers): New private method.  Populate all the
18319         indexers and make sure their IndexerNames match.
18320
18321         * typemanager.cs (IndexerPropertyName): Added support for interface
18322         indexers.
18323
18324 2002-07-22  Martin Baulig  <martin@gnome.org>
18325
18326         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18327         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18328         ret if HasReturnLabel.
18329         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18330         variables.
18331
18332         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18333         and set the ec.LoopBeginTryCatchLevel.
18334         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18335         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18336         the current ec.TryCatchLevel, the branch goes out of an exception
18337         block.  In this case, we need to use Leave and not Br.
18338
18339 2002-07-22  Martin Baulig  <martin@gnome.org>
18340
18341         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18342         block unless the block does not always return or it is contained in
18343         another try { ... } catch { ... } block.  Fixes bug #26506.
18344         Added verify-1.cs to the test suite.
18345
18346 2002-07-22  Martin Baulig  <martin@gnome.org>
18347
18348         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18349         then we do not always return.  Fixes bug #24985.
18350
18351 2002-07-22  Martin Baulig  <martin@gnome.org>
18352
18353         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18354         lookup on a per-class level; ie. walk up the class hierarchy until we
18355         found at least one applicable method, then choose the best among them.
18356         Fixes bug #24463 and test-29.cs.
18357
18358 2002-07-22  Martin Baulig  <martin@gnome.org>
18359
18360         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18361         return types of the methods.  The return type is not part of the
18362         signature and we must not check it to make the `new' modifier work.
18363         Fixes bug #27999, also added test-147.cs.
18364         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18365
18366         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18367         on the method's return type.
18368
18369 2002-07-21  Martin Baulig  <martin@gnome.org>
18370
18371         * assign.cs: Make this work if the rightmost source is a constant and
18372         we need to do an implicit type conversion.  Also adding a few more tests
18373         to test-38.cs which should have caught this.
18374
18375         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18376         target in the makefile for this.  The makefile.gnu is primarily intended
18377         for end-users who don't want to debug the compiler.
18378
18379 2002-07-21  Martin Baulig  <martin@gnome.org>
18380
18381         * assign.cs: Improved the Assign class so it can now handle embedded
18382         assignments (X = Y = Z = something).  As a side-effect this'll now also
18383         consume less local variables.  test-38.cs now passes with MCS, added
18384         a few new test cases to that test.
18385
18386 2002-07-20  Martin Baulig  <martin@gnome.org>
18387
18388         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18389         instructions.  Fixes bug #27977, also added test-146.cs.
18390
18391 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18392
18393         * cs-tokenizer.cs: fixed getHex ().
18394
18395 2002-07-19  Martin Baulig  <martin@gnome.org>
18396
18397         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18398         not Type.GetType() to lookup the array type.  This is needed when
18399         we're constructing an array of a user-defined type.
18400         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18401         single-dimensional arrays, but also for single-dimensial arrays of
18402         type decimal.
18403
18404 2002-07-19  Martin Baulig  <martin@gnome.org>
18405
18406         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18407         this function is called, it's not allowed to share LocalBuilders
18408         among ILGenerators.
18409
18410 2002-07-19  Martin Baulig  <martin@gnome.org>
18411
18412         * expression.cs (Argument.Resolve): Report an error 118 when trying
18413         to pass a type as argument.
18414
18415 2002-07-18  Martin Baulig  <martin@gnome.org>
18416
18417         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18418         Conv_R_Un for the signed `long' type.
18419
18420 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18421
18422         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18423         `expr' for the temporary result, as that will fail if we do
18424         multiple resolves on the same expression.
18425
18426 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18427
18428         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18429         ec.TypeContainer for looking up aliases. 
18430
18431         * class.cs (TypeContainer): Remove LookupAlias from here.
18432
18433         * decl.cs (DeclSpace); Move here.
18434
18435 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18436
18437         * class.cs (FindMembers): Only call filter if the constructor
18438         bulider is not null.
18439
18440         Also handle delegates in `NestedTypes' now.  Now we will perform
18441         type lookups using the standard resolution process.  This also
18442         fixes a bug.
18443
18444         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18445         This uses Expressions (the limited kind that can be parsed by the
18446         tree) instead of strings.
18447
18448         * expression.cs (ComposedCast.ToString): Implement, used to flag
18449         errors since now we have to render expressions.
18450
18451         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18452         FormArrayType. 
18453
18454         * ecore.cs (SimpleName.ToString): ditto.
18455
18456         * cs-parser.jay: Instead of using strings to assemble types, use
18457         Expressions to assemble the type (using SimpleName, ComposedCast,
18458         MemberAccess).  This should fix the type lookups in declarations,
18459         because we were using a different code path for this.
18460
18461         * statement.cs (Block.Resolve): Continue processing statements
18462         even when there is an error.
18463
18464 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18465
18466         * class.cs (Event.Define): Also remove the `remove' method from
18467         the list of pending items.
18468
18469         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18470         generate more compact code. 
18471
18472 2002-07-17  Martin Baulig  <martin@gnome.org>
18473
18474         * const.cs (Const.LookupConstantValue): Add support for constant
18475         `unchecked' and `checked' expressions.
18476         Also adding test case test-140.cs for this.
18477
18478 2002-07-17  Martin Baulig  <martin@gnome.org>
18479
18480         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18481         check whether mi.ReturnType implements the IEnumerator interface; the
18482         `==' and the IsAssignableFrom() will fail in this situation.
18483
18484 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18485
18486         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18487         here too.
18488
18489 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18490
18491         * expression.cs: fixed bug #27811.
18492
18493 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18494
18495         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18496         Molaro: when we are a ref, the value already contains a pointer
18497         value, do not take the address of it.
18498
18499 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18500         * removed mb-parser.jay and mb-tokenizer.cs
18501
18502 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18503
18504         * expression.cs: check against the building corlib void type.
18505
18506 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18507
18508         * ecore.cs: fix for valuetype static readonly fields: when 
18509         initializing them, we need their address, not the address of a copy.
18510
18511 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18512
18513         * typemanager.cs: register also enum_type in corlib.
18514
18515 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18516
18517         * class.cs: allow calling this (but not base) initializers in structs.
18518
18519 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18520
18521         * ecore.cs: make sure we compare against the building base types
18522         in GetTypeSize ().
18523
18524 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18525
18526         * typemanager.cs: fix TypeToCoreType() to handle void and object
18527         (corlib gets no more typerefs after this change).
18528
18529 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18530
18531         * expression.cs (ArrayCreation.EmitArrayArguments): use
18532         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18533
18534         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18535         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18536         array indexes, the runtime actually forbids them.
18537
18538         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18539         for array arguments here.
18540
18541         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18542         instead of the default for ValueTypes.
18543
18544         (New.DoEmit): Use IsValueType instead of
18545         IsSubclassOf (value_type)
18546         (New.DoResolve): ditto.
18547         (Invocation.EmitCall): ditto.
18548
18549         * assign.cs (Assign): ditto.
18550
18551         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18552         Statements *are* currently doing part of their resolution during
18553         Emit.  
18554
18555         Expressions do always resolve during resolve, but statements are
18556         only required to propagate resolution to their children.
18557
18558 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18559
18560         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18561
18562         (LoadAssembly): Do not add the dll if it is already specified
18563
18564         (MainDriver): Add the System directory to the link path at the end,
18565         after all the other -L arguments. 
18566
18567         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18568         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18569         ldelem.u1) and using the opposite for sbytes.
18570
18571         This fixes Digger, and we can finally run it.
18572
18573         * driver.cs (UnixParseOption): Move the option parsing here.  
18574         (CSCParseOption): Implement CSC-like parsing of options.
18575
18576         We now support both modes of operation, the old Unix way, and the
18577         new CSC-like way.  This should help those who wanted to make cross
18578         platform makefiles.
18579
18580         The only thing broken is that /r:, /reference: and /lib: are not
18581         implemented, because I want to make those have the same semantics
18582         as the CSC compiler has, and kill once and for all the confussion
18583         around this.   Will be doing this tomorrow.
18584
18585         * statement.cs (Unsafe.Resolve): The state is checked during
18586         resolve, not emit, so we have to set the flags for IsUnsfe here.
18587
18588 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18589
18590         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18591         not catch the Error_ObjectRefRequired in SimpleName (as it is
18592         possible to have a class/instance variable name that later gets
18593         deambiguated), we have to check this here.      
18594
18595 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18596
18597         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18598         make static and put into Expression.
18599
18600         (Event.Define): Register the private field of the event with the 
18601         TypeManager so that GetFieldFromEvent can get at it.
18602
18603         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18604         keep track of the private field associated with an event which
18605         has no accessors.
18606
18607         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18608         private field.
18609
18610         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18611
18612 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18613
18614         * expression.cs (Binary.EmitBranchable): this routine emits the
18615         Binary expression in a branchable context.  This basically means:
18616         we need to branch somewhere, not just get the value on the stack.
18617
18618         This works together with Statement.EmitBoolExpression.
18619
18620         * statement.cs (Statement.EmitBoolExpression): Use
18621         EmitBranchable. 
18622
18623 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * statement.cs (For): Reduce the number of jumps in loops.
18626
18627         (For): Implement loop inversion for the For statement.
18628
18629         (Break): We can be breaking out of a Try/Catch controlled section
18630         (foreach might have an implicit try/catch clause), so we need to
18631         use Leave instead of Br.
18632
18633         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18634         now).  If the instace expression supports IMemoryLocation, we use
18635         the AddressOf method from the IMemoryLocation to extract the
18636         address instead of emitting the instance.
18637
18638         This showed up with `This', as we were emitting the instance
18639         always (Emit) instead of the Address of This.  Particularly
18640         interesting when This is a value type, as we dont want the Emit
18641         effect (which was to load the object).
18642
18643 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18646
18647         * statement.cs (Checked): Set the CheckedState during the resolve
18648         process too, as the ConvCast operations track the checked state on
18649         the resolve process, and not emit.
18650
18651         * cs-parser.jay (namespace_member_declaration): Flag that we have
18652         found a declaration when we do.  This is used to flag error 1529
18653
18654         * driver.cs: Report ok when we display the help only.
18655
18656 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18657
18658         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18659
18660 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18661
18662         * cs-tokenizer.cs (define): We also have to track locally the
18663         defines.  AllDefines is just used for the Conditional Attribute,
18664         but we also need the local defines for the current source code. 
18665
18666 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18667
18668         * statement.cs (While, For, Do): These loops can exit through a
18669         Break statement, use this information to tell whether the
18670         statement is the last piece of code.
18671
18672         (Break): Flag that we break.
18673
18674         * codegen.cs (EmitContexts): New `Breaks' state variable.
18675
18676 2002-07-03  Martin Baulig  <martin@gnome.org>
18677
18678         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18679         modifiers in method declarations in structs.  Otherwise, you won't
18680         be able to override things like Object.Equals().
18681
18682 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18683
18684         * class.cs (Method, Property, Indexer): Do not allow the public
18685         modifier to be used in explicit interface implementations.
18686
18687         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18688         override modifiers in method declarations in structs
18689
18690 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18691
18692         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18693         integer or real overflow, report an error
18694
18695 2002-07-02  Martin Baulig  <martin@gnome.org>
18696
18697         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18698         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18699         to tell the runtime about our newly created System.Object and
18700         System.ValueType types.
18701
18702 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18703
18704         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18705         struct instead of Ldarg/Starg.
18706
18707 2002-07-02  Martin Baulig  <martin@gnome.org>
18708
18709         * expression.cs (Indirection.Indirection): Call
18710         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18711
18712 2002-07-02  Martin Baulig  <martin@gnome.org>
18713
18714         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18715         ValueType, call TypeManager.TypeToCoreType() on it.
18716         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18717         the OpCodes.Newarr argument.
18718
18719 2002-07-02  Martin Baulig  <martin@gnome.org>
18720
18721         * expression.cs (Invocation.EmitCall): When compiling corlib,
18722         replace all calls to the system's System.Array type to calls to
18723         the newly created one.
18724
18725         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18726         System.Array methods.
18727         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18728         from the system's System.Array type which must be replaced.
18729
18730 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18731
18732         * typemanager.cs: load unverifiable_code_ctor so we can build
18733         corlib using the correct type. Avoid using GetTypeCode() with
18734         TypeBuilders.
18735         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18736         TypeManager.object_type to allow building corlib.
18737
18738 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18739
18740         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18741
18742 2002-07-01  Martin Baulig  <martin@gnome.org>
18743
18744         * class.cs: Make the last change actually work, we need to check
18745         whether `ifaces != null' to avoid a crash.
18746
18747 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18748
18749         * class.cs: when we build structs without fields that implement
18750         interfaces, we need to add the interfaces separately, since there is
18751         no API to both set the size and add the interfaces at type creation
18752         time.
18753
18754 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18755
18756         * expression.cs: the dimension arguments to the array constructors
18757         need to be converted if they are a long.
18758
18759 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18760
18761         * class.cs: don't emit ldarg.0 if there is no parent constructor
18762         (fixes showstopper for corlib).
18763
18764 2002-06-29  Martin Baulig  <martin@gnome.org>
18765
18766         MCS now compiles corlib on GNU/Linux :-)
18767
18768         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18769         ie. check for MethodImplOptions.InternalCall.
18770
18771         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18772         and TypeManager.attribute_type are null, so we must explicitly check
18773         whether parent is not null to find out whether it's an attribute type.
18774         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18775         and SetBuilder, not only if the property is neither abstract nor external.
18776         This is necessary to set the MethodImplOptions on the accessor methods.
18777         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18778         SetBuilder, see Property.Emit().
18779
18780         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18781         populate "System.Object", "System.ValueType" and "System.Attribute" since
18782         they've already been populated from BootCorlib_PopulateCoreTypes().
18783
18784 2002-06-29  Martin Baulig  <martin@gnome.org>
18785
18786         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18787         is the NullLiteral, we also need to make sure that target_type is not
18788         an enum type.   
18789
18790 2002-06-29  Martin Baulig  <martin@gnome.org>
18791
18792         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18793         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18794         before calling BootstrapCorlib_ResolveDelegate ().
18795
18796 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18797
18798         * statement.cs: fixed build-breaker. All tests passed ok.
18799
18800 2002-06-27  Martin Baulig  <martin@gnome.org>
18801
18802         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18803         for System.Decimal when compiling corlib.
18804
18805 2002-06-27  Martin Baulig  <martin@gnome.org>
18806
18807         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18808         switch blocks which contain nothing but a default clause.
18809
18810 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18811
18812        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18813
18814 2002-06-27  Martin Baulig  <martin@gnome.org>
18815
18816         * ecore.cs (PropertyExpr.PropertyExpr): Call
18817         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18818
18819         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18820         is already a TypeBuilder.
18821
18822 2002-06-27  Martin Baulig  <martin@gnome.org>
18823
18824         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18825         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18826         the "from an array-type to System.Array" case.  This makes it work
18827         when compiling corlib.
18828
18829 2002-06-27  Martin Baulig  <martin@gnome.org>
18830
18831         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18832         non-static PropertyExpr, set its InstanceExpression.  This makes
18833         the `ICollection.Count' property work in System/Array.cs.
18834
18835 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18836
18837         * driver.cs: Made error handling more consistent.  Errors now
18838         tracked by Report class, so many methods which used to return int
18839         now return void.  Main() now prints success/failure and 
18840         errors/warnings message.
18841
18842         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18843         the magic number return values (123 and 124).  Now, if the
18844         expected error occurs, the compiler exits with success (exit value
18845         0).  If the compilation completes without seeing that particular
18846         error, the compiler exits with failure (exit value 1).  The
18847         makefile in mcs/errors has been changed to handle the new behaviour.
18848
18849         * report.cs: Made 'expected error' number a property and renamed
18850         it from 'Probe' to 'ExpectedError'.
18851
18852         * genericparser.cs: Removed error handling support, since it is
18853         now all done by Report class.
18854
18855         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18856         class, so parse() no longer returns an int.
18857
18858         * namespace.cs: Use Report.Error instead of GenericParser.error
18859
18860 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18863         TypeContainer.AddOperator): At the front of the list put the
18864         explicit implementations, so they get resolved/defined first. 
18865
18866 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18869         interface type is implemented by this TypeContainer.  Used during
18870         explicit interface implementation.
18871
18872         (Property.Define, Indexer.Define, Method.Define): Validate that
18873         the given interface in the explicit implementation is one of the
18874         base classes for the containing type.
18875
18876         Also if we are explicitly implementing an interface, but there is
18877         no match in the pending implementation table, report an error.
18878
18879         (Property.Define): Only define the property if we are
18880         not explicitly implementing a property from an interface.  Use the
18881         correct name also for those properties (the same CSC uses,
18882         although that is really not needed).
18883
18884         (Property.Emit): Do not emit attributes for explicitly implemented
18885         properties, as there is no TypeBuilder.
18886
18887         (Indexer.Emit): ditto.
18888
18889         Hiding then means that we do not really *implement* a pending
18890         implementation, which makes code fail.
18891
18892 2002-06-22  Martin Baulig  <martin@gnome.org>
18893
18894         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18895         the return value of Object.GetType().  [FIXME: we need to do this whenever
18896         we get a type back from the reflection library].
18897
18898 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18899
18900         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18901
18902 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18903
18904         * attribute.cs: Return null if we can not look up the type.
18905
18906         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18907         the interface types found.
18908
18909         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18910         interface types found.
18911
18912         * typemanager.cs (GetInterfaces): Make this routine returns alll
18913         the interfaces and work around the lame differences between
18914         System.Type and System.Reflection.Emit.TypeBuilder in the results
18915         result for GetInterfaces.
18916
18917         (ExpandInterfaces): Given an array of interface types, expand and
18918         eliminate repeated ocurrences of an interface.  This expands in
18919         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18920         be IA, IB, IC.
18921
18922 2002-06-21  Martin Baulig  <martin@gnome.org>
18923
18924         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18925         on System.Enum.
18926
18927 2002-06-21  Martin Baulig  <martin@gnome.org>
18928
18929         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18930         and called with one of the core types, return the corresponding typebuilder for
18931         that type.
18932
18933         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18934         element type.
18935
18936 2002-06-21  Martin Baulig  <martin@gnome.org>
18937
18938         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18939         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18940         (Expression.ConvertReferenceExplicit): Likewise.
18941
18942         * expression.cs (ElementAccess.DoResolve): Likewise.
18943         (ElementAccess.DoResolveLValue): Likewise.
18944
18945 2002-06-10  Martin Baulig  <martin@gnome.org>
18946
18947         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18948         add the "value" parameter to the parameter list.
18949
18950         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18951         to our caller.
18952
18953 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18954
18955         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18956         the argument to an int, uint, long or ulong, per the spec.  Also
18957         catch negative constants in array creation.
18958
18959 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18960
18961         * class.cs: do not allow the same interface to appear twice in
18962         the definition list.
18963
18964 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18965
18966         * ecore.cs: don't use ldlen with System.Array.
18967
18968 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18969
18970         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18971
18972 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18973
18974         * modifiers.cs: produce correct field attributes for protected
18975         internal. Easy fix so miguel can work on ther harder stuff:-)
18976
18977 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * pending.cs: New file.  Move the code from class.cs here.
18980         Support clearning the pending flag for all methods (when not doing
18981         explicit interface implementation).
18982
18983 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18984
18985         * rootcontext.cs: added a couple more types needed to bootstrap.
18986
18987 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18990         constructor in the type, instead of any constructor in the type
18991         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18992         a bug in the Mono runtime when applying the params attribute). 
18993
18994 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18995         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18996
18997 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18998
18999         * expression.cs (Unary.ResolveOperator): Use TypeManager
19000         to resolve the type.
19001
19002 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19003
19004         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19005         attached.
19006
19007         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19008         with each member too.
19009
19010         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19011         field builders too - this takes care of the enum member case.
19012
19013 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19014
19015         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19016         address-of operator on both value types and pointers.
19017
19018 2002-06-10  Martin Baulig  <martin@gnome.org>
19019
19020         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19021         PropertyBuilder to the `property_builders' list.
19022
19023         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19024         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19025         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19026         find any indexers which are inherited from an interface.
19027
19028 2002-06-09  Martin Baulig  <martin@gnome.org>
19029
19030         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19031         the same type as the constant if necessary.  There's also a test-130.cs
19032         for this.
19033
19034         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19035
19036         * typemanager.cs (TypeManager.ChangeType): Previously known as
19037         Enum.ChangeEnumType().
19038
19039 2002-06-09  Martin Baulig  <martin@gnome.org>
19040
19041         * expression.cs (Cast.TryReduce): Added support for consts.
19042
19043 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19044
19045         * class.cs (Accessor): Hold attributes information so we can pass
19046         it along.
19047
19048         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19049         Modify to pass in attributes attached to the methods.
19050
19051         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19052
19053         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19054         to handle the Accessor kind :-)
19055
19056         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19057
19058 2002-06-08  Martin Baulig  <martin@gnome.org>
19059
19060         * expression.cs (Unary.TryReduceNegative): Added support for
19061         ULongConstants.
19062
19063 2002-06-08  Martin Baulig  <martin@gnome.org>
19064
19065         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19066         name can't be found in the `defined_names' - the caller will do a
19067         MemberLookup in this case and thus find methods in System.Enum
19068         such as Enum.IsDefined().
19069
19070 2002-06-08  Martin Baulig  <martin@gnome.org>
19071
19072         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19073         Convert.ChangeType() which works with TypeBuilder created types.
19074         (Enum.LookupEnumValue, Enum.Define): Use it here.
19075
19076         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19077         `TypeBuilder.BaseType != null' check.
19078         (TypeContainer.FindMembers): Only lookup parent members if we
19079         actually have a parent.
19080         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19081         (ConstructorInitializer.Resolve): Likewise.
19082
19083         * interface.cs (Interface.FindMembers): Added
19084         `TypeBuilder.BaseType != null' check.
19085
19086         * rootcontext.cs (RootContext.ResolveCore): Added
19087         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19088         classes_second_stage.
19089
19090         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19091         debug_type and trace_type when compiling with --nostdlib.       
19092
19093 2002-06-07  Martin Baulig  <martin@gnome.org>
19094
19095         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19096         (AddField): Set it to true when adding a non-static field.
19097         (DefineType): Use `have_nonstatic_fields' to find out whether we
19098         have non-static fields, not `Fields != null'.
19099
19100 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19103         dereferencing a null on the static-field code path)
19104
19105 2002-05-30  Martin Baulig  <martin@gnome.org>
19106
19107         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19108         to take command line arguments.  Use reflection to call the new
19109         custom `Initialize' function on the symbol writer and pass it the
19110         command line arguments.
19111
19112         * driver.cs (--debug-args): New command line argument to pass command
19113         line arguments to the symbol writer.
19114
19115 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19118         the target type for indexers and properties.  Thanks to Joe for
19119         catching this.
19120
19121 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19122
19123         * typemanager.cs (MethodFlags): returns the method flags
19124         (Obsolete/ShouldIgnore) that control warning emission and whether
19125         the invocation should be made, or ignored. 
19126
19127         * expression.cs (Invocation.Emit): Remove previous hack, we should
19128         not do this on matching a base type, we should do this based on an attribute
19129
19130         Only emit calls to System.Diagnostics.Debug and
19131         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19132         on the command line.
19133
19134         * rootcontext.cs: Global settings for tracing and debugging.
19135
19136         * cs-tokenizer.cs (define): New utility function to track
19137         defines.   Set the global settings for TRACE and DEBUG if found.
19138
19139 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19140
19141         * interface.cs (Populate*): Pass in the TypeContainer as well as
19142         the DeclSpace as parameters so that we can create EmitContexts and
19143         then use that to apply attributes etc.
19144
19145         (PopulateMethod, PopulateEvent, PopulateProperty)
19146         (PopulateIndexer): Apply attributes everywhere.
19147
19148         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19149         etc.
19150
19151         (ApplyAttributes): Update accordingly.
19152
19153         We now apply interface attributes for all members too.
19154
19155 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * class.cs (Indexer.Define); Correctly check if we are explicit
19158         implementation (instead of checking the Name for a ".", we
19159         directly look up if the InterfaceType was specified).
19160
19161         Delay the creation of the PropertyBuilder.
19162
19163         Only create the PropertyBuilder if we are not an explicit
19164         interface implementation.   This means that explicit interface
19165         implementation members do not participate in regular function
19166         lookups, and hence fixes another major ambiguity problem in
19167         overload resolution (that was the visible effect).
19168
19169         (DefineMethod): Return whether we are doing an interface
19170         implementation. 
19171
19172         * typemanager.cs: Temporary hack until we get attributes in
19173         interfaces (Ravi is working on that) and we get IndexerName
19174         support in interfaces.
19175
19176         * interface.cs: Register the indexers as properties.
19177
19178         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19179         warning, I have verified that this is a bug in the .NET runtime
19180         (JavaScript suffers of the same problem).
19181
19182         * typemanager.cs (MemberLookup): When looking up members for
19183         interfaces, the parent of an interface is the implicit
19184         System.Object (so we succeed in searches of Object methods in an
19185         interface method invocation.  Example:  IEnumerable x;  x.ToString
19186         ()) 
19187
19188 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * class.cs (Event): Events should also register if they do
19191         implement the methods that an interface requires.
19192
19193         * typemanager.cs (MemberLookup); use the new GetInterfaces
19194         method. 
19195
19196         (GetInterfaces): The code used to lookup interfaces for a type is
19197         used in more than one place, factor it here. 
19198
19199         * driver.cs: Track the errors at the bottom of the file, we kept
19200         on going.
19201
19202         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19203         instance if the method we are calling is static!
19204
19205 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * attribute.cs (ApplyAttributes): Make this function filter out
19208         the IndexerName attribute (as that attribute in reality is never
19209         applied) and return the string constant for the IndexerName
19210         attribute. 
19211
19212         * class.cs (TypeContainer.Emit): Validate that all the indexers
19213         have the same IndexerName attribute, and if so, set the
19214         DefaultName attribute on the class. 
19215
19216         * typemanager.cs: The return value might contain other stuff (not
19217         only methods).  For instance, consider a method with an "Item"
19218         property and an Item method.
19219
19220         * class.cs: If there is a problem with the parameter types,
19221         return. 
19222
19223 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19224
19225         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19226         looks at user defined conversion after making a call to 
19227         StandardConversionExists - we need this for overload resolution.
19228
19229         * expression.cs : Update accordingly the various method calls.
19230
19231         This fixes 2 bugs filed against implicit user defined conversions 
19232
19233 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19234
19235         * statement.cs: Track the result of the assignment.
19236
19237 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * expression.cs (MemberAccess): Improved error reporting for
19240         inaccessible members.
19241
19242 2002-05-22  Martin Baulig  <martin@gnome.org>
19243
19244         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19245         itself with debugging support.
19246
19247 2002-05-22  Martin Baulig  <martin@gnome.org>
19248
19249         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19250         Removed, this isn't needed anymore.
19251
19252 2002-05-20  Martin Baulig  <martin@gnome.org>
19253
19254         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19255         be underlying type for an enum.
19256
19257 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19258
19259         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19260         that splits out the loading of just the core types.
19261
19262         * rootcontext.cs (ResolveCore): Split the struct resolution in
19263         two, so we can load the enumeration underlying types before any
19264         enums are used.
19265
19266         * expression.cs (Is): Bandaid until we fix properly Switch (see
19267         bug #24985 for details).
19268
19269         * typemanager.cs (ImplementsInterface): The hashtable will contain
19270         a null if there are no interfaces implemented.
19271
19272 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19273
19274         * cs-parser.jay (indexer_declarator): It is fine to have array
19275         parameters
19276
19277 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * typemanager.cs: (RegisterBuilder): New function used to register
19280         TypeBuilders that implement interfaces.  Since
19281         TypeBuilder.GetInterfaces (as usual) does not work with lame
19282         Reflection.Emit. 
19283         (AddUserType): register interfaces.
19284
19285         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19286         dealing with TypeBuilder.  Also, arrays are showing up as
19287         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19288         methods can not be invoked on them!
19289
19290         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19291         (ImplicitReferenceConversionExists): Split out from
19292         StandardConversionExists. 
19293
19294         * expression.cs (As): We were only implementing one of the three
19295         cases for the as operator.  We now implement them all.
19296         (Is): Implement the various other cases for Is as well.
19297
19298         * typemanager.cs (CACHE): New define used to control if we want or
19299         not the FindMembers cache.  Seems to have a negative impact on
19300         performance currently
19301
19302         (MemberLookup): Nested types have full acess to
19303         enclosing type members
19304
19305         Remove code that coped with instance/static returns for events, we
19306         now catch this in RealFindMembers.
19307
19308         (RealFindMembers): only perform static lookup if the instance
19309         lookup did not return a type or an event.  
19310
19311 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19312
19313         * assign.cs (CompoundAssign): We pass more semantic information
19314         now to Compound Assignments than we did before: now we have all
19315         the information at hand, and now we resolve the target *before* we
19316         do the expression expansion, which allows the "CacheValue" method
19317         to have the effect we intended (before, a [x] += 1 would generate
19318         two differen ArrayAccess expressions from the ElementAccess,
19319         during the resolution process).
19320
19321         (CompoundAssign.DoResolve): Resolve target and original_source here.
19322
19323 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19324
19325         * expression.cs (ArrayAccess): dropped debugging information. 
19326
19327         * typemanager.cs: Small bug fix: I was always returning i_members,
19328         instead of one of i_members or s_members (depending on which had
19329         the content).
19330
19331         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19332         method is invoked before any code generation takes place, and it
19333         is a mechanism to inform that the expression will be invoked more
19334         than once, and that the method should use temporary values to
19335         avoid having side effects
19336
19337         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19338
19339         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19340         implementation.
19341
19342         * expression.cs (Indirection, ArrayAccess): Add support for
19343         CacheTemporaries in these two bad boys. 
19344
19345         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19346         ldobj or ldind_ref.  
19347         (StoreFromPtr): Handle stobj as well.
19348
19349         * expression.cs (UnaryMutator): Share more code.
19350
19351         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19352         down: I was not tracking the Filter function as well, which
19353         was affecting the results of the cache.
19354
19355 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19356
19357         * attribute.cs: Remove the hack to handle the CharSet property on
19358         StructLayouts. 
19359
19360 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * attribute.cs (DoResolve): More uglyness, we now only try to
19363         resolve the attribute partially, to extract the CharSet
19364         information (only if we are a StructLayout attribute).  Otherwise 
19365
19366         (GetExtraTypeInfo): Add some code to conditionally kill in the
19367         future this.   I am more and more convinced that the .NET
19368         framework has special code to handle the attribute setting on
19369         certain elements.
19370
19371         * expression.cs (IsParamsMethodApplicable): Revert my previous
19372         foreach change here, it was wrong.
19373
19374 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19375
19376         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19377         (pp_expr): do not abort on unknown input, just return.
19378         (eval): abort if there are pending chars.
19379
19380         * attribute.cs (Attribute.Resolve): Positional parameters are
19381         optional.  Deal with that case.
19382
19383         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19384         the Ansi/Unicode/Auto information for the type.
19385
19386         (TypeContainer.DefineType): instantiate the EmitContext here, as
19387         we will be using it during the type definition (to resolve
19388         attributes) and during the emit phase.
19389
19390         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19391         to pull type information out of the attributes
19392
19393         (Attribute.Resolve): track the constructor builder, and allow for
19394         multiple invocations (structs and classes will use this).
19395
19396         * ecore.cs (MemberLookupFinal): new version with all the
19397         parameters customizable.
19398
19399         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19400         constructors.  Return if the result value is null (as the error
19401         would have been flagged already by MemberLookupFinal)
19402
19403         Do not allow instances of abstract classes or interfaces to be
19404         created.
19405
19406         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19407         We have to compare the assembly property here when dealing with
19408         FamANDAssem and Assembly access modifiers, because we might be
19409         creating an assembly from *modules* (that means that we are not
19410         getting TypeBuilders for types defined in other modules that are
19411         part of this assembly).
19412
19413         (Method.Emit): If the method is marked abstract and has a body,
19414         emit an error. 
19415
19416         (TypeContainer.DefineMembers): If both the defined member and the
19417         parent name match are methods, then do not emit any warnings: let
19418         the Method.Define routine take care of flagging warnings.  But if
19419         there is a mismatch (method overrides something else, or method is
19420         overriwritten by something, then emit warning).
19421
19422         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19423         set to null, this means `do not check for the return type on the
19424         signature'. 
19425
19426         (Method.Define): set the return type for the method signature to
19427         null, so that we get methods with the same name and parameters and
19428         different return types.  This is used to flag warning 114 (you are
19429         hiding a method, and you probably want to use the new/override
19430         keywords instead).
19431
19432         * typemanager.cs (MemberLookup): Implemented proper access
19433         control, closing a long standing set of bug reports.  The problem
19434         was that the Framework only has two bits: Public and NonPublic,
19435         and NonPublic includes private and protected methods, but we need
19436         to enforce the FamANDAssem, FamOrAssem and Family. 
19437
19438 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * statement.cs (GotoCase): Return true: Ammounts to giving up
19441         knowledge on whether we return or not, and letting the other case
19442         be responsible for it.
19443
19444 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19445
19446         * driver.cs: Do not load directories for each file processed, only
19447         do it if there is a pattern.
19448
19449         * ecore.cs: Report readonly assigns here as well, as we might have
19450         been resolved only by MemberAccess.
19451
19452         (SimpleName.SimpleNameResolve): Also be useful for LValue
19453         resolution.   We need this to propagate assign to local readonly variables
19454
19455         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19456         do not want to reuse potential criteria memory.
19457
19458         * class.cs (MyEventBuilder): Set reflected_type;
19459
19460         * ecore.cs (Constantify): Added support for constifying bools.
19461
19462         (RootContext.LookupType): Added a cache for values looked up in
19463         the declaration space.
19464
19465         * typemanager.cs (FindMembers): Now is a front-end to
19466         RealFindMembers, and provides a two-level hashtable-based cache to
19467         the request.  
19468
19469         15% performance improvement: from 22.5 to 19.2 seconds.
19470
19471         * expression.cs (IsParamsMethodApplicable): use foreach.
19472         (Invocation.DoResolve): ditto.
19473         (New.DoResolve): ditto.
19474         (ArrayCreation.DoResolve): ditto.
19475
19476         * ecore.cs (FindMostEncompassingType): use foreach.
19477
19478         * delegate.cs (NewDelegate.DoResolve): Use foreach
19479
19480         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19481         (RemoveMethods): use foreach.
19482
19483         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19484         nested foreach statements instead of for, and also break out of
19485         the inner loop once a match is found.
19486
19487         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19488
19489 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19492         we actually unwrap the expression to allow for extra information
19493         to be extracted. 
19494
19495         * expression.cs: Use Shr_Un on unsigned operations. 
19496
19497 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19498
19499         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19500         applicable operators was not being considered correctly. This closes
19501         the bug Miguel reported.
19502
19503 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19504
19505         * attribute.cs: check that the type derives from System.Attribute
19506         and report the correct error in that case (moved the duplicate code to
19507         its own method, too).
19508
19509 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19510
19511         * attribute.cs: lookup attribute type name as the spec says: first the
19512         bare attribute name and then name + "Attribute" (nant compiles with
19513         mcs after this fix).
19514
19515 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19518         Because of the way we parse things, we should try to see if a
19519         UIntConstant can fit in an integer.
19520
19521 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19522
19523         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19524         when we are in an explicit context.
19525
19526         (ConvertReferenceExplicit): When converting from Iface type S to Class
19527         T make sure the rules are implemented as an OR.
19528
19529         * parameter.cs (ParameterType): Make it a property for now although the
19530         purpose really isn't anything immediate.
19531
19532         * expression.cs (Is*Applicable): Do better checking on the parameter type
19533         of a ref/out parameter. The ones from the system assemblies are already 
19534         marked with the correct type so we don't need to do any correction.
19535
19536         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19537         the object type is standard too so include that.
19538
19539 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19540
19541         * ecore.cs (StandardConversionExists): Augment with missing code:
19542         deal with IntConstant, LongConstants and Enumerations.
19543
19544         * assign.cs: Report the error, instead of failing silently
19545
19546         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19547         typecontainer that they are declared, because the
19548         typecontainer/namespace will have the list of using clauses that
19549         need to be applied.
19550
19551         Assembly Attributes were escaping the normal registration
19552         mechanism. 
19553
19554         (EmitCode): Apply attributes within an EmitContext that represents
19555         the container they were declared on.
19556
19557         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19558
19559 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19560
19561         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19562         Revamp completely - make much cleaner as we now operate only
19563         on a set of Types.
19564
19565         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19566         to implement the logic detailed in the spec more correctly.
19567
19568         (UserDefinedConversion): Update accordingly.
19569
19570 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * statement.cs: Return flow analysis information up.
19573
19574         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19575         and the default.
19576
19577         (token): Do not consume an extra character before calling
19578         decimal_digits.
19579
19580 2002-05-06  Piers Haken <piersh@friskit.com>
19581
19582         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19583
19584 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19585
19586         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19587         EmitContext during the instance constructor initializer
19588         resolution, to stop access to instance variables.
19589
19590         This is mandated by the spec, last paragraph of the `constructor
19591         initializers' section. 
19592
19593 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19594
19595         * cs-parser.jay, class.cs (Accessor): new class used to represent
19596         an accessor (get or set).  In the past we used `null' to represent
19597         a missing accessor.  But this is ambiguous because there was no
19598         way to tell in abstract indexers/properties if one of them was
19599         specified.
19600
19601         Now there is a way of addressing that.
19602
19603         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19604         instead of FindMembers.
19605
19606         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19607         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19608
19609         * attribute.cs: Treat indexers and properties as the same in terms
19610         of applying attributes
19611
19612         * ecore.cs (FindMostEncompassedType): Use statically initialized
19613         EmptyExpressions()s like we do elsewhere to avoid creating useless
19614         objects (and we take this out of the tight loop).
19615
19616         (GetConversionOperators): Move the code to extract the actual
19617         operators to a separate routine to clean things up.
19618
19619 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19620
19621         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19622         events are always registered FieldBuilders.
19623
19624         * class.cs (FieldBase): New class shared by Fields 
19625
19626         * delegate.cs: If we are a toplevel delegate, use our full name.
19627         If we are a nested delegate, then only use our tail name.
19628
19629 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19630
19631         * expression.cs (IsApplicable): Ensure that we add the "&" to
19632         ref/out types before comparing it with the type of the argument.
19633
19634         (IsParamsMethodApplicable): Ditto.
19635
19636         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19637         silly me ;-)
19638
19639         * delegate.cs : Handle the case when we have more than one applicable
19640         method. Flag an error only when we finish checking all.
19641
19642 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19643
19644         * expression.cs: Add support for boolean static initializers.
19645
19646 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19647
19648         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19649
19650         * parameter.cs (ComputeParameterTypes,
19651         ComputeAndDefineParameterTypes): Better error handling: now we
19652         clear the `types' cache if we fail during any of the type lookups.
19653         We also return the status code correctly to our caller
19654
19655         * delegate.cs: If we fail to define a delegate, abort the extra
19656         steps. 
19657
19658         * expression.cs (Binary.ResolveOperator): for
19659         operator==(object,object) and operator !=(object, object) we also
19660         have to verify that there is an implicit conversion from one to
19661         the other.
19662
19663         (ArrayAccess.DoResolve): Array Access can operate on
19664         non-variables. 
19665
19666 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19667
19668         * assign.cs (CompoundAssign): A new class used as a "flag" that
19669         the assignment actually is happening as part of a compound
19670         assignment operator.
19671
19672         During compound assignment, a few new rules exist to enable things
19673         like:
19674
19675         byte b |= 1 + 2
19676
19677         From the spec:
19678
19679         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19680         to the type of x) if y is implicitly convertible to the type of x,
19681         and the operator is a builtin operator and the return type of the
19682         operator is explicitly convertible to the type of x. 
19683
19684         * rootcontext.cs: Reset warning level to 2.  4 catches various
19685         "interesting" features in mcs, we must clean this up at some
19686         point, but currently am trying to kill other bugs ;-)
19687
19688         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19689         in container classes as well.  
19690
19691         * expression.cs (Binary.ResolveOperator): Handle string case
19692         before anything else (as operator overloading does emit an error
19693         before doing anything else).
19694
19695         This code could go away when we move to a table driven model, but
19696         i could not come up with a good plan last night.
19697
19698 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19699
19700         * typemanager.cs (CSharpName): reimplementation using regex.
19701         * class.cs: added null check for fields in Emit
19702         * rootcontext.cs: set warninglevel to 4
19703
19704 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * typemanager.cs (CSharpName): reimplemented with Lupus
19707         suggestion.
19708
19709 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * statement.cs (If): correclty implement Resolve, because we were
19712         not catching sem errors in there.  The same process is needed
19713         everywhere else. 
19714         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19715
19716
19717         (Statement.Warning_DeadCodeFound): Factorize code.
19718         (While): Report dead code here too.
19719
19720         (Statement): Added Resolve virtual method to allow
19721         for resolution split from the emit code.
19722
19723 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19724
19725         * statement.cs (EmitBoolExpression): No longer try to resolve the
19726         expression here.    
19727         (MakeBoolean): New utility function that resolve, implicitly
19728         converts to boolean and tags the expression. 
19729
19730
19731         (If, Do): Implement dead code elimination.
19732         (While): Implement loop inversion
19733
19734         (Do, While, For, If): Resolve the expression prior to calling our
19735         code generation.
19736
19737 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19738
19739         * class.cs:
19740           - added method Report28 (warning: program has more than one entry point)
19741           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19742           - modified method Method.Define, the part at the end of the method
19743
19744         * rootcontext.cs: added static public Location EntryPointLocation;
19745           
19746         * ../errors/cs0028.cs : Add test case for the above warning.              
19747
19748         * typemanager.cs:
19749           - modified method CSharpName to allow arrays of primitive type to
19750             be printed nicely (e.g. instead of System.Int32[][] it now prints
19751             int[][])
19752           - added method CSharpSignature: returns the signature of a method
19753             in string format to be used in reporting errors, warnings, etc.
19754
19755         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19756         with String.Empty.
19757
19758 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19759
19760         * delegate.cs (Define): Fix extremely silly bug where I was
19761         setting the type of the 'object' parameter of the BeginInvoke
19762         method to System.IAsyncResult instead of System.Object ;-)
19763
19764 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19767         here. 
19768
19769         (Constructor.Emit): return if we fail to initialize the
19770         constructor.  Another door closed!  
19771
19772         * expression.cs (New.DoResolve): Improve error message (from -6 to
19773         1501).  Use DeclaredOnly lookup to find the exact constructor.
19774
19775         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19776         loop.  This is useful.
19777
19778         * cs-parser.jay: Adjust the default parameters so that destructors
19779         have the proper signature.
19780
19781 2002-04-26  Martin Baulig  <martin@gnome.org>
19782
19783         * driver.cs (LoadAssembly): If `assembly' contains any characters
19784         which are only valid in path names and not in assembly names
19785         (currently slash, backslash and point), use Assembly.LoadFrom ()
19786         instead of Assembly.Load () on the `assembly' (before iteration
19787         over the link_paths).
19788
19789 2002-04-26  Martin Baulig  <martin@gnome.org>
19790
19791         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19792
19793 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * class.cs (Property): use the new typemanager.MemberLookup
19796
19797         (TypeContainer.MemberLookup): Implement using the
19798         TypeManager.MemberLookup now. 
19799
19800         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19801         and return MemberInfos, so that these can be used without an
19802         EmitContext (what we had before).
19803
19804 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19805
19806         * expression.cs: Fix the case where the argument to params if the
19807         type of the params.  I omitted handling this before.   Fixed
19808
19809 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19810
19811         * driver.cs: Call BootCorlib_PopulateCoreType
19812
19813         * class.cs (Property.CheckBase): Check for properties only, not
19814         for all members. 
19815
19816         * interface.cs: Temporary hack: try/catch around the
19817         CustomAttributeBuilder, because I am getting an exception that I
19818         do not understand.
19819
19820         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19821         types whose definitions are required to be there (attributes are
19822         defined before standard types).
19823
19824         Compute definitions as we boot the various types, as they are used
19825         immediately (value_type class will need object_type, but if we do
19826         not initialize object_type, we will pass a null, which will let
19827         the runtime pick the System.Object from the existing corlib, which
19828         is not what we want).
19829
19830 2002-04-22  Patrik Torstensson <totte@labs2.com>
19831
19832         * cs-tokenizer.cs: fixed a number of trim() issues.
19833
19834 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19835
19836         * expression.cs (Argument.Type): Ensure that we return the correct
19837         type when we have out or ref parameters [in which case we 
19838         append a "&"].
19839
19840 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19841
19842         * class.cs (Property, Indexer): Allow extern modifier in there. 
19843
19844         * typemanager.cs (InitBaseTypes): Initializes object_type and
19845         value_type, since those will be used early on during the bootstrap
19846         process to compile corlib.
19847
19848         (InitCoreTypes): Move code from here to InitBaseTypes.
19849
19850 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19853         single-dimension arrays as using the ldlen opcode.  
19854
19855         Daniel Lewis discovered this optimization.  
19856
19857         * typemanager.cs: Add signature for System.Array::get_Length
19858
19859 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19860
19861         * statement.cs: report the error when the foreach does not apply to an
19862         array nor a collection.
19863
19864 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19865
19866         * expression.cs: Add implicit conversions to the operator ~.
19867
19868         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19869
19870         * typemanager.cs: Locate the decimal constructor.
19871
19872 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19873
19874         * attribute.cs: use the new property of TypeOf.
19875         * expression.cs: added 'get' property around typearg.
19876
19877         These changes fix a build breaker reported by NickD. Is this the
19878         correct way to fix?  If not, please, revert my changes and make it
19879         work :-).
19880
19881 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * attribute.cs: Add support for typeof in attribute invocations.
19884         I am not sure that this is right though.
19885
19886 2002-04-14  Duncan Mak  <duncan@ximian.com>
19887
19888         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19889         Binary.Operator.Division case.
19890
19891 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19892
19893         * class.cs (DefineType): Ensure that we do a proper check on
19894         attribute types and also register it with the TypeManager.
19895
19896         (TypeContainer.Targets): The default for attribute types is
19897         AttributeTargets.All.
19898
19899         * attribute.cs (ApplyAttributes): Registering the attribute type
19900         is done elsewhere, not when we discover we have a Usage attribute.
19901
19902 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19903
19904         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19905         and get rid of is_delegate parameter.
19906
19907         * everywhere : update.
19908
19909 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19910
19911         * cs-parser.jay (compilation_unit): Revamp completely to use
19912         some new ideas that I got from Rhys' grammar to solve the problems
19913         with assembly level attributes.
19914
19915         (outer_declaration): New grammar production.
19916
19917         (attribute_sections): Add.
19918
19919         (opt_attributes): Base on attribute_sections
19920
19921         (namespace_declaration): Allow opt_attributes to tackle the case
19922         when we have assembly level attributes - we are clever in this
19923         regard now ;-)
19924
19925         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19926         attributes in the non-global context.
19927
19928         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19929         instead of SetGlobalAttributes.
19930
19931         * class.cs, rootcontext.cs : Ensure we define and generate 
19932         attribute types before anything else.
19933
19934         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19935         and flag the new error -20 for the case when the attribute type
19936         does not have valid targets specified. csc does not catch this.
19937
19938         * ../errors/errors.txt : update for error # -20
19939
19940 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19941
19942         * support.cs (InternalParameters.ParameterModifier): Do some null
19943         checking and return sane values.
19944
19945         * class.cs (Method.Define): If we are a PInvoke method, ensure
19946         that we are static and extern. Report error # 601
19947
19948         * ../errors/cs0601.cs : Add test case for the above error.
19949
19950 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19951
19952         * rootcontext.cs (attribute_types): We need to keep type of
19953         all attribute types separately and emit code for them first.
19954
19955         (RegisterAttribute) : Implement.
19956
19957         * class.cs (DefineType): Check if the current Type is a custom
19958         attribute type and register it accordingly.
19959
19960         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19961         adding the first attribute twice and rename to
19962
19963         (SetGlobalAttributes): this.
19964
19965         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19966         lookups.
19967
19968         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19969         if we are processing global arguments. Hmm, I am unsure of this.
19970
19971 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19972
19973         * expression.cs: added static array of strings to avoid calling
19974         Enum.ToString () for Operator in Binary. Significant recover of
19975         performance.
19976
19977 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19978
19979         * class.cs (FindMembers): Allow the Builders of the various
19980         members to be null.  If they are skip them.  This only happens
19981         during the PInvoke declaration.
19982
19983 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19986         failure, so we do not keep going afterwards.
19987
19988         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19989         wanted to pass `false' as the `is_delegate' argument.  If this is
19990         the case, why not use delegate_type == null to mean `is_delegate =
19991         false' and anything else as is_delegate = true.
19992
19993 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19994
19995         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19996         code for the section, not the beginning of the tests.
19997
19998 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20001
20002         * expression.cs (Binary): same.  Warn about errors where we have
20003         Enum/Enum in operator + as well.
20004
20005 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20006
20007         * statement.cs:
20008                 - added support for switch(bool)
20009                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20010                 - add TableSwitchEmit() to handle table-based switch statements
20011
20012 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20013
20014         * expression.cs (Invocation.OverloadResolve): Factor out code which
20015         does parameter compatibility checking with arguments so that we can 
20016         re-use the code even from Delegate.VerifyApplicability
20017
20018         (VerifyArgumentsCompat): Move above code here.
20019
20020         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20021         and instead make a call to the above method.
20022
20023 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20024
20025         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20026         We use it to keep track of classes which are attribute types.
20027
20028 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * delegate.cs (Delegate.Define): Correctly define the types in the
20031         presence of fixed and array parameters.
20032
20033         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20034         doing FindMembers.
20035
20036         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20037         include NonPublic after the first iteration.
20038
20039         * class.cs (Indexer.CheckBase): Only check if both parents are
20040         non-null. 
20041
20042         * cs-parser.jay (accessor_body): If empty, set to null.
20043
20044         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20045         same code path here to resolve constants names that we did have in
20046         MemberAccess.DoResolve.  There is too much code duplicated here.
20047
20048 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20049
20050         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20051
20052         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20053         to MakeUnionSet.
20054
20055         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20056         tokens, numbers and strings.
20057
20058         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20059         parenthesis.
20060
20061         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20062         asyncronous parameters and the regular parameters.  
20063
20064         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20065         specify the target directory.
20066
20067         * expression.cs: (This.DoResolve): Simplify
20068         (As.Emit): Optimize, do not generate IsInst if the expression is
20069         always of the given type.
20070
20071         (Is.DoResolve): Bug fix, we were reporting both always/never for
20072         the is expression.
20073
20074         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20075         creating too many unnecessary arrays.
20076
20077 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20078
20079         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20080         fields instead of rolling our own initializer.   Takes care of all
20081         implicit conversions, and drops unnecessary static checks/argument.
20082
20083 2002-03-31  Dick Porter  <dick@ximian.com>
20084
20085         * driver.cs: use the GetDirectories() return values properly, and
20086         use "/" as path separator.
20087
20088 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20089
20090         * expression.cs (Unary): Optimize - - expr into expr.
20091         (Binary): Optimize a + (-b) into a -b.
20092
20093         * codegen.cs (CodeGen): Made all methods static.
20094
20095 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20096
20097         * rootcontext.cs: 
20098
20099         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20100         TypeBuilder property.
20101
20102         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20103         instead. 
20104
20105         * tree.cs: Removed the various RecordXXXX, and replaced with a
20106         single RecordDecl.  Removed all the accessor methods, and just
20107         left a single access point Type 
20108
20109         * enum.cs: Rename DefineEnum to DefineType.
20110
20111         * decl.cs: New abstract method `DefineType' used to unify the
20112         Defines for Enumerations, Interfaces, TypeContainers and
20113         Delegates.
20114
20115         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20116         LookupBaseClasses method that used to live in class.cs and
20117         interface.cs here, and renamed to FindType.
20118
20119         * delegate.cs: Implement DefineType.  Take advantage of the
20120         refactored pattern for locating the parent builder without taking
20121         the parent_builder argument (which we know does not work if we are
20122         nested, and triggering a toplevel definition).
20123
20124 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20127         accessibility of a member has changed during override and report
20128         an error if so.
20129
20130         * class.cs (Method.Define, Property.Define): Only complain on
20131         overrides if the method is private, any other accessibility is
20132         fine (and since we just checked the permission is the same, we are
20133         good to go).
20134
20135         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20136         and elif are processed always.  The other pre-processing
20137         directives are only processed if we are "taking" the path
20138
20139 2002-03-29  Martin Baulig  <martin@gnome.org>
20140
20141         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20142         current location is not Null.
20143
20144         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20145         a separate method so we can profile it.
20146
20147         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20148         `span.Seconds' are just seconds, but no minutes or hours.
20149         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20150
20151 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20152
20153         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20154         Remove the gratuitous set of Final:
20155
20156                                 // If an interface implementation, then we can set Final.
20157                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20158                                     implementing.DeclaringType.IsInterface)
20159                                         flags |= MethodAttributes.Final;
20160
20161         I do not know what I was smoking when I used that.
20162
20163
20164         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20165         step into fixing the name resolution issues for delegates and
20166         unifying the toplevel name resolution.
20167
20168 2002-03-28  Martin Baulig  <martin@gnome.org>
20169
20170         * class.cs (Method.Emit): If we have a symbol writer, call its
20171         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20172         tell it about the current method.
20173
20174         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20175         writer that we're going to emit the first byte of IL code for a new
20176         statement (a new source line).
20177         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20178         EmitContext.Mark() before emitting any code.
20179
20180         * location.cs (SymbolDocument): Return null when we're Null.
20181
20182         * statement.cs (Statement): Moved the `Location loc' variable here.
20183         (Statement.EmitBoolExpression): If we have a symbol writer, call
20184         ec.Mark() before emitting any code to tell it that we're at the
20185         beginning of a new statement.
20186         (StatementExpression): Added `Location' argument to the constructor.
20187         (Block): Added public readonly variable `StartLocation' and public
20188         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20189         (Block): Added constructor which takes a start and end location.
20190         (Block.SetEndLocation): New method. This sets the end location.
20191         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20192         local variables we create.
20193         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20194         each statement and do also mark the begin and end of the block.
20195
20196         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20197         tell it the current lexer.Location, use Location.Null for the end of the
20198         block.
20199         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20200         current block, set its end location using SetEndLocation().
20201         (statement_expression): StatementExpression constructor now takes the
20202         lexer.Location as additional argument.
20203         (for_statement, declare_local_variables): Likewise.
20204         (declare_local_variables): When creating a new implicit block, use the
20205         new Block constructor and pass it the lexer.Location.
20206
20207 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20208
20209         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20210         members also on the parent interfaces recursively.
20211
20212 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20213
20214         * report.cs: Use new formats, since Gonzalo finished the missing
20215         bits. 
20216
20217         * expression.cs (Binary.ResolveOperator): added missing operator|
20218         operator& and operator^ for bool/bool.
20219
20220         * cs-parser.jay: CheckDef now takes a Location argument that is
20221         used to report errors more precisly (instead of reporting the end
20222         of a definition, we try to track something which is a lot closer
20223         to the source of the problem).
20224
20225         * cs-tokenizer.cs: Track global token use, so we can properly flag
20226         the use of #define/#undef after the first token has been seen.
20227
20228         Also, rename the reportXXXX to Error_DescriptiveName
20229
20230         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20231         TypeContainer, so that Enum and Interface can use this too.
20232
20233         * class.cs (TypeContainer.LookupInterfaceOrClass,
20234         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20235         `builder' argument.  Typically this was used to pass the parent
20236         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20237         the definition).  
20238
20239         The problem is that a nested class could trigger the definition of
20240         a toplevel class, and the builder would be obviously wrong in that
20241         case. 
20242
20243         So we drop this argument, and we compute dynamically the
20244         TypeBuilder/ModuleBuilder (the correct information was available
20245         to us anyways from DeclSpace.Parent)
20246
20247         * interface.cs (Interface.DefineInterface): Drop builder
20248         parameter cleanup like class.cs
20249
20250         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20251         like class.cs
20252
20253         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20254         values. 
20255
20256         (Try.Emit): Propagate the returns value from the statement.
20257
20258         (Return.Emit): Even if we are leavning 
20259
20260         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20261
20262         * modifiers.cs: Fix the computation of MethodAttributes flags.
20263
20264 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20265
20266         * driver.cs: allow compilation of files that start with '/'.
20267         Add a default case when checking the argument of --target.
20268
20269 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * interface.cs: Implement the same search algorithm for types in
20272         the interface code.
20273
20274         * delegate.cs: Do not allow multiple definition.
20275
20276         * Recovered ChangeLog that got accidentally amputated
20277
20278         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20279
20280         * rootcontext.cs: Load manually enum to allow core classes to
20281         contain enumerations.
20282
20283         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20284         Update to new static methods in TypeManager.
20285
20286         * typemanager.cs (GetMethod, GetConstructor): Use our
20287         implementation of FindMembers to find the members, since during
20288         corlib compilation, the types are TypeBuilders and GetMethod and
20289         GetConstructor do not work.
20290
20291         Make all methods in TypeManager static.
20292
20293         (InitCodeHelpers): Split the functionality from
20294         the InitCodeTypes function.
20295
20296         * driver.cs: Call InitCodeHelpers after we have populated the
20297         types. 
20298
20299         * cs-parser.jay (delegate_declaration): we did not used to compute
20300         the delegate name correctly for void delegates.
20301
20302 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * rootcontext.cs (RootContext): Init the interface_resolve_order
20305         and type_container_resolve_order always.
20306
20307         (ResolveCore, BootstrapCorlib_ResolveClass,
20308         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20309         compiler when compiling with --nostdlib
20310
20311         * class.cs (TypeContainer.DefineType): Check that our parent is
20312         not null.  This test is most important when we are bootstraping
20313         the core types.
20314
20315         * codegen.cs: Split out the symbol writing code.
20316
20317 2002-03-25  Martin Baulig  <martin@gnome.org>
20318
20319         * driver.cs (-g): Made -g an alias for --debug.
20320
20321 2002-03-24  Martin Baulig  <martin@gnome.org>
20322
20323         * codegen.cs (SymbolWriter): New public variable. Returns the
20324         current symbol writer.
20325         (CodeGen): Added `bool want_debugging_support' argument to the
20326          constructor. If true, tell the ModuleBuild that we want debugging
20327         support and ask it for the ISymbolWriter.
20328         (Save): If we have a symbol writer, call it's Close() method after
20329         saving the assembly.
20330
20331         * driver.c (--debug): New command line argument to create a
20332         debugger information file.
20333
20334         * location.cs (SymbolDocument): New public property. Returns an
20335         ISymbolDocumentWriter object for the current source file or null
20336         if we don't have a symbol writer.
20337
20338 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20339
20340         * driver.cs (LoadAssembly): Correctly return when all the paths
20341         have been tried and not before.
20342
20343         * statement.cs (Switch.Emit): return the actual coverage for this
20344         statement (returns/not-returns)
20345
20346         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20347         switch of the statement if we are the last switch section.  That
20348         kills two problems: try/catch problems (we used to emit an empty
20349         nop at the end) and switch statements where all branches would
20350         return. 
20351
20352 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20353
20354         * driver.cs: Add default assemblies (the equivalent to the
20355         Microsoft CSC.RSP file)
20356
20357         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20358         also update tokens_seen and set it to false.
20359
20360         * driver.cs: Implement --recurse for Mike.
20361
20362         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20363         correctly splitting out the paths.
20364
20365 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * interface.cs (Interface.PopulateProperty): Instead of using
20368         `parent' as the declaration space for the set parameters, use
20369         `this' 
20370
20371         * support.cs (InternalParameters): InternalParameters constructor
20372         takes a DeclSpace instead of a TypeContainer.
20373
20374         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20375         types are being initialized, load the address of it before calling
20376         the function.  
20377
20378         (New): Provide a mechanism to disable the generation of local
20379         value type temporaries when the caller will be providing us with
20380         an address to store it.
20381
20382         (ArrayCreation.EmitDynamicInitializers): Use it.
20383
20384 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20385
20386         * expression.cs (Invocation.EmitArguments): Only probe for array
20387         property if there is more than one argument.  Sorry about that.
20388
20389         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20390         empty param arrays.
20391
20392         * class.cs (Method.LabelParameters): Fix incorrect code path that
20393         prevented the `ParamArrayAttribute' from being applied to the
20394         params attribute.
20395
20396 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20397
20398         * support.cs (ReflectionParameters): Correctly compute whether the
20399         last argument is a params array.  Fixes the problem with
20400         string.Split ('a')
20401
20402         * typemanager.cs: Make the assemblies array always be non-null
20403         (empty, but non-null)
20404
20405         * tree.cs (RecordDecl): New function that abstracts the recording
20406         of names.  This reports error 101, and provides a pointer to the
20407         previous declaration.  Fixes a crash in the compiler.
20408
20409         * cs-parser.jay (constructor_declaration): Update to new grammar,
20410         and provide a constructor_body that can be empty.
20411
20412 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20413
20414         * driver.cs: Add support for --resources.
20415
20416         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20417         Make all types for the various array helper methods be integer.
20418
20419         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20420         CheckState to ConvCast.
20421
20422         (ConvCast): Now it takes a `checked' state argument, to avoid
20423         depending on the emit context for the conversion, and just using
20424         the resolve time setting.
20425
20426         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20427         instead of Invocation.EmitArguments.  We do not emit the original
20428         arguments, instead we emit those which have been converted to
20429         unsigned int expressions.
20430
20431         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20432
20433         * codegen.cs: ditto.
20434
20435         * expression.cs (LocalVariableReference): Drop the use of the
20436         Store function that depended on the variable index.
20437
20438         * statement.cs (VariableInfo): Drop the `Idx' property from this
20439         class, as this is not taking into account the indexes for
20440         temporaries tat we generate during the execution, getting the
20441         indexes wrong.
20442
20443         * class.cs: First emit class initializers, then call the parent
20444         constructor. 
20445
20446         * expression.cs (Binary): Fix opcode emision.
20447         (UnaryMutator.EmitCode): Support checked code generation
20448
20449         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20450         matches for events for both the Static and Instance scans,
20451         pointing to the same element.   Fix that.
20452
20453 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20454
20455         * rootcontext.cs (ResolveTree): Always set the
20456         interface_resolve_order, because nested interfaces will be calling
20457         into us.
20458
20459         * class.cs (GetInterfaceOrClass): Track the same resolution
20460         process used by TypeManager.LookupType.  This fixes the nested
20461         type lookups in class declarations (separate path from
20462         LookupType). 
20463
20464         (TypeContainer.DefineType): Also define nested interfaces.
20465         (TypeContainer.RegisterOrder): New public function used to
20466         register the order in which child interfaces need to be closed.
20467
20468         Nested interfaces need to be closed after their parents have been
20469         created. 
20470
20471         * interface.cs (InterfaceAttr): Put all the logic for computing
20472         the interface attribute here. 
20473
20474         (DefineInterface): Register our interface order with the
20475         RootContext or with the TypeContainer depending on the case.
20476
20477 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * cs-parser.jay: rework foreach statement to work with the new
20480         changes to the policy on SimpleNames.
20481
20482         * report.cs: support Stacktrace on warnings as well.
20483
20484         * makefile: drop --unsafe and /unsafe from the compile.
20485
20486 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20487
20488         * ecore.cs (StandardConversionExists): Modify to take an Expression
20489         as the first parameter. Ensure we do null -> reference type conversion
20490         checking.
20491
20492         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20493         temporary Expression objects.
20494
20495 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20496
20497         * interface.cs: workaround bug in method overloading resolution
20498         (there is already a bugzilla bug for it).
20499
20500 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20501
20502         We could also solve this problem by having a separate path for
20503         performing type lookups, instead of DoResolve, we could have a
20504         ResolveType entry point, and only participating pieces of the
20505         production (simplename, deref, array) would implement this. 
20506
20507         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20508         signal SimpleName to only resolve type names and not attempt to
20509         resolve anything else.
20510
20511         * expression.cs (Cast): Set the flag.
20512
20513         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20514
20515         * class.cs: Only report 108 if there is no `new' modifier.
20516
20517         * cs-parser.jay: rework foreach statement to work with the new
20518         changes to the policy on SimpleNames.
20519
20520         * report.cs: support Stacktrace on warnings as well.
20521
20522         * makefile: drop --unsafe and /unsafe from the compile.
20523
20524 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20525
20526         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20527         lookups here, instead of doing that at parse time.  This means
20528         that our grammar will not introduce `LocalVariableReferences' as
20529         expressions at this point.  That solves the problem of code like
20530         this:
20531
20532         class X {
20533            static void Main ()
20534            { int X = 1;
20535             { X x = null }}}
20536
20537         This is only half the fix.  The full fix requires parameters to
20538         also be handled in this way.
20539
20540         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20541         makes the use more obvious of the DeclSpace.  The
20542         ec.TypeContainer.TypeBuilder is now only used to pull the
20543         TypeBuilder for it.
20544
20545         My theory is that I can get rid of the TypeBuilder completely from
20546         the EmitContext, and have typecasts where it is used (from
20547         DeclSpace to where it matters).  
20548
20549         The only pending problem is that the code that implements Aliases
20550         is on TypeContainer, and probably should go in DeclSpace.
20551
20552         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20553         lookups here, instead of doing that at parse time.  This means
20554         that our grammar will not introduce `LocalVariableReferences' as
20555         expressions at this point.  That solves the problem of code like
20556         this:
20557
20558         class X {
20559            static void Main ()
20560            { int X = 1;
20561             { X x = null }}}
20562
20563         This is only half the fix.  The full fix requires parameters to
20564         also be handled in this way.
20565
20566         * class.cs (Property.DefineMethod): When implementing an interface
20567         method, set newslot, when implementing an abstract method, do not
20568         set the flag (before we tried never setting it, or always setting
20569         it, which is the difference).
20570         (Indexer.DefineMethod): same.
20571         (Method.DefineMethod): same.
20572
20573         * ecore.cs: Only set the status used flag if we get back a Field.
20574
20575         * attribute.cs: Temporary hack, so Paolo can keep working.
20576
20577 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20578
20579         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20580         the unmanaged type in the case we have a MarshalAs attribute.
20581
20582         (Resolve): Handle the case when we are parsing the special MarshalAs
20583         attribute [we need to store the unmanaged type to use later]
20584
20585         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20586         MarshalAs Attribute.
20587
20588         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20589         on parameters and accordingly set the marshalling info.
20590
20591 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * class.cs: Optimizing slightly by removing redundant code after
20594         we switched to the `NoTypes' return value.
20595         (Property.DefineMethod): use NoTypes here too.
20596
20597         This fixes the bug I introduced in my last batch of changes.
20598
20599 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20600
20601         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20602
20603         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20604         Enums since those are types too. 
20605
20606         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20607
20608         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20609         thanks to a call during the lookup process.
20610
20611 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20612
20613         * statement.cs (Foreach): Lots of work to accomodate a particular
20614         kind of foreach statement that I had not kept in mind.  It is
20615         possible to have foreachs on classes that provide a GetEnumerator
20616         method that return objects that implement the "pattern" for using
20617         a foreach, there is no need to support GetEnumerator
20618         specifically. 
20619
20620         This is needed to compile nant.
20621
20622         * decl.cs: Only report 114 if the member is not `Finalize' and if
20623         the warning level is at least 2.
20624
20625         * class.cs: Moved the compare function from Method to
20626         MethodSignature. 
20627
20628         (MethodSignature.InheritableMemberSignatureCompare): Add new
20629         filter function that is used to extract inheritable methods from a
20630         class. 
20631
20632         (Method.Define): Use the new `inheritable_method_signature_filter'
20633         delegate
20634
20635         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20636         command. 
20637
20638 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20639
20640         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20641
20642         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20643
20644         * expression.cs: Pass location information to
20645         ConvertImplicitStandard. 
20646
20647         * class.cs: Added debugging code to track return values from
20648         interfaces. 
20649
20650 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20651
20652         * expression.cs (Is.DoResolve): If either side of the `is' is an
20653         interface, do not flag the warning.
20654
20655         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20656         for interfaces
20657
20658         * report.cs: Allow for --fatal to be used with --probe.
20659
20660         * typemanager.cs (NoTypes): Move the definition for the empty Type
20661         array here. 
20662
20663         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20664         properties. 
20665         (TypeContainer.DefineProxy): New function used to proxy to parent
20666         implementations when implementing interfaces.
20667         (TypeContainer.ParentImplements): used to lookup if our parent
20668         implements a public function that is required by an interface.
20669         (TypeContainer.VerifyPendingMethods): Hook this up.
20670
20671         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20672         `modules' and `assemblies' arraylists into arrays.  We only grow
20673         these are the very early start up of the program, so this improves
20674         the speedof LookupType (nicely measured).
20675
20676         * expression.cs (MakeByteBlob): Replaced unsafe code with
20677         BitConverter, as suggested by Paolo.
20678
20679         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20680         folding of string concatenation, but if either side is a string,
20681         and the other is not, then return null, and let the runtime use
20682         the concatenation on the string plus the object (using
20683         `Object.ToString'). 
20684
20685 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20686
20687         Constant Folding has been implemented now.
20688
20689         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20690         the error instead on types that are not supported in one's
20691         complement. 
20692
20693         * constant.cs (Constant and all children): New set of functions to
20694         perform implict and explicit conversions.
20695
20696         * ecore.cs (EnumConstant): Implement the new functions to perform
20697         conversion by proxying to the child expression.
20698
20699         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20700         own separate setting that can not be turned off from the command
20701         line using --unchecked or --checked and is only controlled using
20702         the checked/unchecked statements and expressions.  This setting is
20703         used by the constant folder to flag errors.
20704
20705         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20706         ConstantCheckState as well.   
20707
20708         During Resolve, they also have to flag the state, because the
20709         constant folder runs completely in the Resolve phase.
20710
20711         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20712         well.
20713
20714 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20715
20716         * cfold.cs: New file, this file contains the constant folder.
20717
20718         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20719         argument to track whether we are using the resulting address to
20720         load or store a value and provide better error messages. 
20721
20722         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20723         new AddressOf arguments.
20724
20725         * statement.cs (Foreach.EmitCollectionForeach): Update
20726
20727         * expression.cs (Argument.Emit): Call AddressOf with proper
20728         arguments to track usage.
20729
20730         (New.DoEmit): Call AddressOf with new arguments.
20731
20732         (Unary.Emit): Adjust AddressOf call.
20733
20734 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20735
20736         * cs-parser.jay (member_access): Change the case for pre-defined types
20737         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20738         this suggestion.
20739
20740         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20741         a method body.
20742
20743         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20744         essentially like methods and apply attributes like MethodImplOptions to them too.
20745
20746         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20747         not being null.
20748
20749         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20750         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20751         is the DeclSpace.
20752
20753         * Update code everywhere accordingly.
20754
20755         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20756
20757         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20758
20759 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20760
20761         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20762         try performing lookups against those instead of jumping straight into using
20763         the 'using' clauses.
20764
20765         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20766
20767         (LookupType): Perform lookups in implicit parents too.
20768
20769         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20770         sequence as RootContext.LookupType. 
20771
20772         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20773         the various cases of namespace lookups into this method.
20774
20775 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20776
20777         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20778         in positional arguments)
20779
20780         * class.cs (Operator): Update the AllowedModifiers to contain
20781         extern. 
20782
20783         * cs-parser.jay: Update operator declaration to allow for the
20784         operator body to be empty.
20785
20786         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20787         values. 
20788
20789 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20790
20791         * class.cs (Method.Emit): Label parameters.
20792
20793         * driver.cs: Return 1 or 0 as the program exit code.
20794
20795 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20796
20797         * expression.cs: Special case the `null' object when trying to
20798         auto-compute the type, as anything can be explicitly converted to
20799         that. 
20800
20801         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20802         spotting this Paolo.
20803
20804         (Expression.ImplicitNumericConversion): Perform comparissions of
20805         the type using the underlying type in the case of an enumeration
20806         rather than using the enumeration type for the compare.
20807
20808         Cope with the underlying == type case, which is not possible to
20809         catch before. 
20810
20811         (Expression.ConvertNumericExplicit): Perform comparissions of
20812         the type using the underlying type in the case of an enumeration
20813         rather than using the enumeration type for the compare.
20814
20815         * driver.cs: If the user does not supply an extension, assume .exe
20816
20817         * cs-parser.jay (if_statement): Rewrote so that we can track the
20818         location for the if statement.
20819
20820         * expression.cs (Binary.ConstantFold): Only concat strings when
20821         the operation is "+", not everything ;-)
20822
20823         * statement.cs (Statement.EmitBoolExpression): Take a location
20824         argument. 
20825         (If, While, Do): Track location.
20826
20827         * expression.cs (Binary.ResolveOperator): In the object + string
20828         case, I was missing a call to ConvertImplicit
20829
20830 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20831
20832         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20833         Location arguments. Ensure we use RootContext.LookupType to do our work
20834         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20835
20836         * interface.cs (PopulateMethod): Handle the type of the parameter being
20837         null gracefully.
20838
20839         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20840         have a params method with no fixed arguments and a call is made with no
20841         arguments.
20842
20843 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20844
20845         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20846         the verbatim-string-literal
20847
20848         * support.cs (InternalParameters.ParameterModifier): handle null
20849         fixed parameters.
20850         (InternalParameters.ParameterType): ditto.
20851
20852         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20853         duplicating the name of the variable parameter.
20854         (GetParameterByName): Fix bug where we were not looking up array
20855         paramters if they were the only present (thanks Paolo!).
20856         (GetParameterInfo): We only have an empty set of types if both
20857         fixed and array are set to null.
20858         (GetParameterInfo-idx): Handle FixedParameter == null
20859
20860         * cs-parser.jay: Handle the case where there is no catch
20861         statements (missing null test).
20862
20863 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20864
20865         * driver.cs (MainDriver): Be conservative on our command line
20866         handling.
20867
20868         Catch DirectoryNotFoundException when calling GetFiles.
20869
20870         (SplitPathAndPattern): Used to split the input specification into
20871         a path and a pattern that we can feed to Directory.GetFiles.
20872
20873 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20874
20875         * statement.cs (Fixed): Implement the last case of the Fixed
20876         statement (string handling).
20877
20878         * expression.cs (StringPtr): New class used to return a char * to
20879         a string;  Used by the Fixed statement.
20880
20881         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20882
20883         * expression.cs (Binary.ResolveOperator): Remove redundant
20884         MemberLookup pn parent type.
20885         Optimize union call, we do not need a union if the types are the same.
20886         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20887         type.
20888
20889         Specialize the use of MemberLookup everywhere, instead of using
20890         the default settings. 
20891
20892         (StackAlloc): Implement stackalloc keyword.
20893
20894         * cs-parser.jay: Add rule to parse stackalloc.
20895
20896         * driver.cs: Handle /h, /help, /?
20897
20898         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20899         before we supported unsafe code.
20900
20901         * makefile: add --unsafe to the self compilation of mcs.
20902
20903 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * expression.cs (PointerArithmetic): New class that is used to
20906         perform pointer arithmetic.
20907         (Binary.Resolve): Handle pointer arithmetic
20908         Handle pointer comparission.
20909         (ArrayPtr): Utility expression class that is used to take the
20910         address of an array.
20911
20912         (ElementAccess): Implement array access for pointers
20913
20914         * statement.cs (Fixed): Implement fixed statement for arrays, we
20915         are missing one more case before we are done.
20916
20917         * expression.cs (Indirection): Implement EmitAssign and set the
20918         ExprClass to Variable.  This allows pointer dereferences to be
20919         treated as variables, and to have values assigned to them.
20920
20921         * ecore.cs (Expression.StoreFromPtr): New utility function to
20922         store values dereferencing.
20923
20924 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20925
20926         * expression.cs (Binary.ResolveOperator): Ensure that we are
20927         not trying to operate on a void type - this fixes the reported
20928         bug.
20929
20930         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20931         the parent implementation is sealed.
20932
20933         * ../errors/cs0239.cs : Add.
20934
20935         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20936
20937         * typemanager.cs (unverifiable_code_type): Corresponds to 
20938         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20939         which have unsafe code in them.
20940
20941         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20942         unsafe context.
20943
20944 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20945
20946         * cs-tokenizer.cs: Add support for @"litreal strings"
20947
20948         Make tokenizer accept pre-processor directives
20949         on any column (remove the old C-like limitation). 
20950
20951         * rootcontext.cs (EmitCode): Emit any global attributes.
20952         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20953
20954         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20955
20956         * cs-parser.jay: Add support for global attributes.  
20957
20958 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20959
20960         * expression.cs (Indirection): New helper class.  Unary will
20961         create Indirection classes to be able to implement the
20962         IMemoryLocation interface on it.
20963
20964 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20965
20966         * cs-parser.jay (fixed_statement): reference the right statement.
20967
20968         * statement.cs (Fixed.Emit): Finish implementing the fixed
20969         statement for the &x case.
20970
20971 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20972
20973         * class.cs (Property.Define, Method.Define): Remove newslot when
20974         `implementing'.  
20975
20976         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20977         wrong.  NewSlot should only be used if the `new' keyword is present.
20978
20979         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20980         locating our system dir.  Sorry about this.
20981
20982 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20983
20984         * driver.cs (GetSystemDir): Compute correctly the location of our
20985         system assemblies.  I was using the compiler directory instead of
20986         the library directory.
20987
20988 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20989
20990         * expression.cs (BetterFunction): Put back in what Miguel commented out
20991         since it is the correct fix. The problem is elsewhere ;-)
20992
20993         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20994         parameters of the parms method are themselves compatible or not !
20995
20996         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20997         to check that a class implements an interface before saying that an implicit
20998         conversion was allowed. Use ImplementsInterface to do the checking.
20999
21000 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21001
21002         * class.cs (Method.Define): Track whether we are an explicit
21003         implementation or not.  And only call DefineMethodOverride if we
21004         are an explicit implementation.
21005
21006         (Property.DefineMethod): Ditto.
21007
21008 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21009
21010         * expression.cs (BetterFunction): Catch hideous bug which was
21011          preventing us from detecting ambiguous calls due to implicit casts i.e
21012         cs0121.
21013
21014 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * support.cs (Pair): Remove un-needed method.  I figured why I was
21017         getting the error in cs-parser.jay, the variable in a foreach loop
21018         is readonly, and the compiler does not really treat this as a variable.
21019
21020         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21021         instead of EQUALS in grammar.  
21022
21023         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21024
21025         * expression.cs (Unary.DoResolve): Check whether the argument is
21026         managed or not.
21027
21028 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * support.cs: Api for Pair to set a value.  Despite the fact that
21031         the variables are public the MS C# compiler refuses to compile
21032         code that accesses the field if the variable is part of a foreach
21033         statement. 
21034
21035         * statement.cs (Fixed): Begin implementation of the fixed
21036         statement.
21037
21038         (Block.AddVariable): Return the VariableInfo on success and null
21039         on failure instead of true/false. 
21040
21041         * cs-parser.jay (foreach): Catch errors on variables already
21042         defined (we were ignoring this value before) and properly unwind
21043         the block hierarchy
21044
21045         (fixed_statement): grammar for the fixed statement.
21046
21047 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21050         pointer types to be incretemented.
21051
21052         (SizeOf): Implement.
21053
21054         * cs-parser.jay (pointer_member_access): Implement
21055         expr->IDENTIFIER production.
21056
21057         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21058         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21059         on safe contexts.
21060
21061         (Unary): Implement indirection.
21062
21063         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21064         use in non-unsafe context).
21065
21066         (SimpleName.DoResolve): Check for pointers in field access on safe
21067         contexts. 
21068
21069         (Expression.LoadFromPtr): Factor the load-indirect code in this
21070         function.  This was duplicated in UnboxCast and ParameterReference
21071
21072 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * expression.cs (ComposedCast): report an error if a pointer cast
21075         is used in a safe region.
21076
21077         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21078         pointer type casts in unsafe context.
21079
21080         * codegen.cs (EmitContext): Set up IsUnsafe.
21081
21082         * cs-parser.jay (non_expression_type): Add productions for pointer
21083         casts. 
21084
21085         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21086         code.  We should not use force into static mode if the method is
21087         not virtual.  Fixes bug in MIS
21088
21089         * statement.cs (Do.Emit, While.Emit, For.Emit,
21090         Statement.EmitBoolExpression): Add support to Do and While to
21091         propagate infinite loop as `I do return' semantics.
21092
21093         Improve the For case to also test for boolean constants.
21094
21095         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21096         to the list of attributes we can add.
21097
21098         Remove `EmitContext' argument.
21099
21100         * class.cs (Method.Define): Apply parameter attributes.
21101         (Constructor.Define): Apply parameter attributes.
21102         (MethodCore.LabelParameters): Move here the core of labeling
21103         parameters. 
21104
21105         * support.cs (ReflectionParameters.ParameterModifier,
21106         InternalParameters.ParameterModifier): Use IsByRef on the type and
21107         only return the OUT bit for these parameters instead of in/out/ref
21108         flags.
21109
21110         This is because I miss-understood things.  The ParameterInfo.IsIn
21111         and IsOut represent whether the parameter has the [In] and [Out]
21112         attributes set.  
21113
21114 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21115
21116         * ecore.cs (FieldExpr.Emit): Release temporaries.
21117
21118         * assign.cs (LocalTemporary.Release): new function.
21119
21120         * codegen.cs (EmitContext.GetTemporaryStorage,
21121         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21122         temporary storage.  Now we can "put back" localbuilders when we
21123         are done with them
21124
21125 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21126
21127         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21128         need to make a copy of the variable to generate verifiable code.
21129
21130 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21131
21132         * driver.cs: Compute dynamically the system directory.
21133
21134         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21135         Slower, but more generally useful.  Used by the abstract
21136         registering implementation. 
21137
21138         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21139         the rules for the special rule on Type/instances.  First check if
21140         we have the same name, and if so, try that special static path
21141         rather than the instance path.
21142
21143 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21144
21145         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21146         for, while and if.
21147
21148         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21149         Enum, ValueType, Delegate or Array for non-corlib compiles.
21150
21151         * cs-tokenizer.cs: Catch long identifiers (645)
21152
21153         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21154         piece of code.
21155
21156         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21157         fix, we were returning too early, so we were not registering
21158         pending methods from abstract classes.
21159
21160         Do not register pending methods if the class is abstract.
21161
21162         * expression.cs (Conditional.DoResolve): Report circular implicit
21163         conversions when we neecd to compute it for conditional
21164         expressions. 
21165
21166         (Is.DoResolve): If the expression is always of the provided type,
21167         flag warning 183.  If the expression can not ever be of the
21168         provided type flag warning 184.
21169
21170         * class.cs: Catch 169 as well.
21171
21172         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21173         read. 
21174
21175 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21176
21177         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21178
21179 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21180
21181         * interface.cs: (PopulateMethod): Check for pointers being defined
21182         only if the unsafe context is active.
21183         (PopulateProperty): ditto.
21184         (PopulateIndexer): ditto.
21185
21186         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21187         specified.  If pointers are present, make sure that they are
21188         present in an unsafe context.
21189         (Constructor, Constructor.Define): ditto.
21190         (Field, Field.Define): ditto.
21191         (Property, Property.Define): ditto.
21192         (Event, Event.Define): ditto.
21193
21194         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21195         hashtable if there are classes or structs defined.
21196
21197         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21198         code, as the constant resolution moved.
21199
21200         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21201         the metadata, so we can flag error 133. 
21202
21203         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21204         pointer is being declared in an unsafe context.
21205
21206 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21207
21208         * modifiers.cs (Modifiers.Check): Require a Location argument.
21209         Report error 227 for Unsafe use.
21210
21211         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21212
21213         * statement.cs (For.Emit): If the test is null, then report that
21214         we do `return', as we wont reach anything afterwards.
21215
21216         (Switch.SwitchGoverningType): Track the expression that matched
21217         the conversion.
21218
21219         * driver.cs: Allow negative numbers as an error code to flag.
21220
21221         * cs-parser.jay: Handle 1551.
21222
21223         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21224
21225 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21226
21227         * cs-parser.jay: Report 1518 (type declaration can only contain
21228         class, struct, interface, enum or delegate)
21229
21230         (switch_label): Report 1523 (keywords `case' or `default' must
21231         preced code)
21232
21233         (opt_switch_sections): Report 1522 (empty switch)
21234
21235         * driver.cs: Report 1515 (response file specified multiple times)
21236         Report 1516 (Source file specified multiple times).
21237
21238         * expression.cs (Argument.Resolve): Signal 1510
21239
21240         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21241         access not allowed in static code)
21242
21243 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21244
21245         * typemanager.cs (IsPointerType): Utility method which we are going
21246         to need a lot.
21247
21248         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21249         the object type, so we take care of that.
21250
21251         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21252
21253         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21254         added to non-params parameters :-)
21255
21256         * typemanager.cs (CSharpName): Include 'void' type too. 
21257
21258         (void_ptr_type): Include in the set of core types.
21259
21260         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21261         duplicating code.
21262
21263         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21264         an unsafe context.
21265
21266         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21267         completely forgotten about it.
21268
21269 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21270
21271         * cs-parser.jay (pointer_type): Add. This begins our implementation
21272         of parsing rules for unsafe code.
21273
21274         (unsafe_statement): Implement.
21275
21276         (embedded_statement): Modify to include the above.
21277
21278         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21279
21280         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21281         if the current context is an unsafe one.
21282
21283         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21284         are handled differently, we need separate rules for them.
21285
21286         (local_variable_declaration): Update to use local_variable_pointer_type
21287         to allow variable declarations of unmanaged pointer types.
21288
21289         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21290         in unsafe contexts.
21291
21292         * ../errors/cs0214.cs : Add.
21293
21294 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21295
21296         * makefile: remove 'response' file when cleaning.
21297
21298 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * cs-parser.jay: Report 1524.
21301
21302 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21303
21304         * typemanager.cs (RegisterMethod): drop checking if we have
21305         registered this from here
21306
21307 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * class.cs (Method.EmitDestructor): Implement calling our base
21310         destructor. 
21311
21312         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21313         value of InFinally.
21314
21315         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21316         this routine and will wrap the call in a try/catch block.  Deal
21317         with the case.
21318
21319 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21320
21321         * ecore.cs (Expression.MemberLookup): instead of taking a
21322         parameter `same_type' that was used to tell whether we could
21323         access private members we compute our containing type from the
21324         EmitContext.
21325
21326         (FieldExpr): Added partial support for volatile fields.  This does
21327         not work for volatile fields exposed from assemblies, as I can not
21328         figure out how to extract the modreq from it.
21329
21330         Updated all the source files to use this.
21331
21332         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21333         because it is referenced by MemberLookup very often. 
21334
21335 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21336
21337         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21338         TypeBuilder.GetCustomAttributes to retrieve what we need.
21339
21340         Get rid of redundant default_member_attr_type as this is the same as
21341         default_member_type which already exists.
21342
21343         * interface.cs, attribute.cs : Update accordingly.
21344
21345 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21346
21347         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21348         work for TYpeBuilders though.  Ravi, can you please fix this?
21349
21350         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21351
21352         * expression.cs (Argument.Emit): Handle the case of ref objects
21353         being passed to ref functions;  
21354
21355         (ParameterReference.EmitLoad): Loads the content of the pointer
21356         without dereferencing.
21357
21358 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21361
21362 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21363
21364         * class.cs (Indexer.DefineMethod): Incorporate the interface
21365         type in the name of the method if we are doing explicit interface
21366         implementation.
21367
21368         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21369
21370         (BetterConversion): Fix extremely trivial bug where we were referring to
21371         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21372         again !
21373
21374         * ../errors/bug16.cs : Add although we have fixed it.
21375
21376 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21377
21378         * expression.cs (BaseIndexer): Begin implementation.
21379
21380         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21381
21382         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21383         production directly to remove a shift/reduce, and implement
21384         explicit interface implementation.
21385
21386         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21387         after a floating point suffix.
21388
21389         * expression.cs (DoNumericPromotions): Improved the conversion for
21390         uint/uint.  If we have a constant, we avoid doing a typecast to a
21391         larger type.
21392
21393         * class.cs (Indexer): Implement explicit interface implementation
21394         for indexers.
21395
21396 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21397
21398         * class.cs: make the default instance constructor public and hidebysig.
21399
21400 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21401
21402         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21403         so we can call it from elsewhere.
21404
21405         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21406         we emit it internally if the class has a defined indexer; otherwise the user
21407         emits it by decorating the class definition with the DefaultMemberAttribute.
21408
21409         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21410         attribute is not used on a type which defines an indexer.
21411
21412         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21413         character when we skip whitespace.
21414
21415         * ../errors/cs0646.cs : Add.
21416
21417 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21418
21419         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21420         again. 
21421
21422         * makefile: Add practical target `mcs3.exe' which builds the third
21423         generation compiler. 
21424
21425         * expression.cs (New): Fix structures constructor calling.
21426
21427         * class.cs (Property, Method, Indexer): Emit Final flag on the
21428         method if we are an interface implementation and we are not
21429         abstract. 
21430
21431         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21432         whether this property is referencing a `base' method.
21433
21434         * expression.cs (Invocation.EmitCall): take an extra argument:
21435         is_base, this is used to determine whether the `call' or
21436         `callvirt' opcode should be used.
21437
21438
21439         * delegate.cs: update EmitCall.
21440
21441         * class.cs (Method.Define): Set NewSlot for the cases where we are
21442         not implementing an interface method.
21443
21444         (Property.Define): ditto.
21445
21446 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21447
21448         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21449         'r'.  Allows mcs to parse itself fully.
21450
21451 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21452
21453         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21454         of the number of initializers that require the InitializeArray method.
21455
21456         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21457         update the above field where necessary.
21458
21459         (MakeByteBlob): Update accordingly.
21460
21461         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21462         greater than 2.
21463
21464         (EmitDynamicInitializers): Update in accordance with the new optimization.
21465
21466         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21467         same OpCode applies.
21468
21469         * cs-parser.jay : Fix some glaring errors I introduced.
21470
21471 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21472
21473         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21474         so that we can check for name clashes there too.
21475
21476         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21477         for interface indexers.
21478
21479         * interfaces.cs (Define): Emit the default member attribute.
21480
21481         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21482         variable was being referred to while setting the value ;-)
21483
21484 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21485
21486         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21487         byte-by-byte information when we know the data is zero.
21488
21489         Make the block always a multiple of 4, because
21490         DefineInitializedData has a bug.
21491
21492         * assign.cs: Fix, we should assign from the temporary, not from
21493         the source. 
21494
21495         * expression.cs (MakeByteBlob): Fix my incorrect code.
21496
21497 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21498
21499         * typemanager.cs (EnumToUnderlying): This function is used to get
21500         the underlying type from an enumeration, because it does not
21501         always work. 
21502
21503         * constant.cs: Use the I4_S form for values between -128 and 127.
21504
21505         * statement.cs (Block.LookupLabel): Looks up a label.
21506         (Block): Drop support for labeled blocks.
21507
21508         (LabeledStatement): New kind of statement that represents a label
21509         only.
21510
21511         (Goto): Finally implement this bad boy.
21512
21513         * cs-parser.jay: Update to reflect new mechanism to implement
21514         labels.
21515
21516 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21517
21518         * codegen.cs (EmitContext.This): a codegen property that keeps the
21519         a single instance of this instead of creating many different this
21520         instances. 
21521
21522         * delegate.cs (Delegate.DoResolve): Update to use the property;
21523
21524         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21525
21526         * expression.cs (BaseAccess.DoResolve): Ditto.
21527
21528 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21529
21530         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21531         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21532
21533         (InitCoreTypes): Update accordingly.
21534
21535         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21536         so we can quickly store the state.
21537
21538         (ApplyAttributes): Set the correct implementation flags
21539         for InternalCall methods.
21540
21541 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21542
21543         * expression.cs (EmitCall): if a method is not virtual, then do
21544         not use callvirt on it.
21545
21546         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21547         user defined stuff) requires the use of stobj, which takes an
21548         address on the stack instead of an array and an index.  So emit
21549         the Ldelema operation for it.
21550
21551         (EmitStoreOpcode): Use stobj for valuetypes.
21552
21553         (UnaryMutator.EmitCode): Use the right 1 value depending on
21554         whether we are dealing with int64/uint64, float or doubles.
21555
21556         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21557         constructors that I implemented last night.
21558
21559         (Constructor.IsDefault): Fix to work properly for static
21560         constructors.
21561
21562         * cs-parser.jay (CheckDef): report method signature errors.
21563         Update error number 103 to be 132.
21564
21565         * decl.cs: New AdditionResult enumeration value: MethodExists.
21566         Although we do this check for methods later on in the semantic
21567         analysis, catching repeated default constructors is so easy that
21568         we catch these here. 
21569
21570         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21571         promotions code.
21572
21573         (ParameterReference.EmitAssign, Emit): handle
21574         bools as bytes.
21575
21576         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21577         (ArrayAccess.EmitStoreOpcode): ditto.
21578
21579         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21580
21581         * expression.cs (MakeByteBlob): Complete all the missing types
21582         (uint, short, ushort, byte, sbyte)
21583
21584         * class.cs: Only init instance field initializers on instance
21585         constructors. 
21586
21587         Rename `constructors' to instance_constructors. 
21588
21589         (TypeContainer.AddConstructor): Only add constructors to the list
21590         if it is not static.
21591
21592         Make sure that we handle default_static_constructor independently
21593         everywhere where we handle instance_constructors
21594
21595 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21596
21597         * class.cs: Do not lookup or create a base initializer for a
21598         static constructor.
21599
21600         (ConstructorInitializer.Resolve): use the proper type to lookup
21601         for constructors.
21602
21603         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21604
21605         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21606         in DeclSpace. 
21607
21608         * decl.cs: CloseType is now an virtual method, the default
21609         implementation just closes this type.
21610
21611 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21612
21613         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21614         to PreserveSig by default. Also emit HideBySig on such methods.
21615
21616         Basically, set the defaults to standard values.
21617
21618         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21619         argument, if candidate is better, it can't be worse than the best !
21620
21621         (Invocation): Re-write bits to differentiate between methods being
21622         applicable in their expanded form and their normal form - for params
21623         methods of course.
21624
21625         Get rid of use_standard everywhere as only standard conversions are allowed
21626         in overload resolution. 
21627
21628         More spec conformance.
21629
21630 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21631
21632         * driver.cs: Add --timestamp, to see where the compiler spends
21633         most of its time.
21634
21635         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21636         `this' in static code.
21637
21638         (SimpleName.DoResolve): Implement in terms of a helper function
21639         that allows static-references to be passed upstream to
21640         MemberAccess.
21641
21642         (Expression.ResolveWithSimpleName): Resolve specially simple
21643         names when called by MemberAccess to implement the special
21644         semantics. 
21645
21646         (Expression.ImplicitReferenceConversion): Handle conversions from
21647         Null to reference types before others, as Null's type is
21648         System.Object. 
21649
21650         * expression.cs (Invocation.EmitCall): Handle the special case of
21651         calling methods declared on a reference type from a ValueType
21652         (Base classes System.Object and System.Enum)
21653
21654         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21655         the left hand side is a TypeExpr, not on every enumeration. 
21656
21657         (Binary.Resolve): If types are reference types, then do a cast to
21658         object on operators != and == of both arguments.
21659
21660         * typemanager.cs (FindMembers): Extract instance and static
21661         members if requested.
21662
21663         * interface.cs (PopulateProperty): Use void_type instead of null
21664         as the return type for the setter method.
21665
21666         (PopulateIndexer): ditto.
21667
21668 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21669
21670         * support.cs (ReflectionParameters): Fix minor bug where we
21671         were examining the wrong parameter for the ParamArray attribute.
21672
21673         Cope with requests for the type of the parameter at position
21674         greater than the params parameter's. We now return the element
21675         type of the params array as that makes more sense.
21676
21677         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21678         accordingly as we no longer have to extract the element type
21679         ourselves.
21680
21681         (Invocation.OverloadResolve): Update.
21682
21683 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21684
21685         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21686         against IEnumerator, test whether the return value is a descendant
21687         of the IEnumerator interface.
21688
21689         * class.cs (Indexer.Define): Use an auxiliary method to implement
21690         the other bits of the method definition.  Begin support for
21691         explicit interface implementation.
21692
21693         (Property.DefineMethod): Use TypeManager.void_type instead of null
21694         for an empty return value.
21695
21696 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21699         dealing with a FieldExpr which is composed of a FieldBuilder, in
21700         the code path we did extract the constant, but we should have
21701         obtained the underlying value to be able to cast it (otherwise we
21702         end up in an infinite loop, this is what Ravi was running into).
21703
21704         (ArrayCreation.UpdateIndices): Arrays might be empty.
21705
21706         (MemberAccess.ResolveMemberAccess): Add support for section
21707         14.5.4.1 that deals with the special case of E.I when E is a type
21708         and something else, that I can be a reference to a static member.
21709
21710         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21711         handle a particular array type to create byte blobs, it is just
21712         something we dont generate byteblobs for.
21713
21714         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21715         arguments. 
21716
21717         * location.cs (Push): remove the key from the hashtable that we
21718         are about to add.   This happens for empty files.
21719
21720         * driver.cs: Dispose files after we have parsed them.
21721
21722         (tokenize): new function that only runs the tokenizer on its
21723         input, for speed testing.
21724
21725 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21726
21727         * class.cs (Event.Define): Define the private field only if there
21728         are no accessors defined.
21729
21730         * expression.cs (ResolveMemberAccess): If there is no associated
21731         field with the event, that means we have an event defined with its
21732         own accessors and we should flag error cs0070 since transforming
21733         ourselves into a field is not valid in that case.
21734
21735         * ecore.cs (SimpleName.DoResolve): Same as above.
21736
21737         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21738         and charset to sane values.
21739
21740 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21741
21742         * assign.cs (DoResolve): Perform check on events only if they 
21743         are being accessed outside the declaring type.
21744
21745         * cs-parser.jay (event_declarations): Update rules to correctly
21746         set the type of the implicit parameter etc.
21747
21748         (add_accessor, remove_accessor): Set current local parameters.
21749
21750         * expression.cs (Binary): For delegate addition and subtraction,
21751         cast the return value from the method into the appropriate delegate
21752         type.
21753
21754 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21755
21756         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21757         of these as the workaround is unnecessary.
21758
21759         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21760         delegate data - none of that is needed at all.
21761
21762         Re-write bits to extract the instance expression and the delegate method
21763         correctly.
21764
21765         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21766         on delegates too.
21767
21768         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21769         of attaching attributes instead of duplicating code everywhere.
21770
21771         * everywhere : Update code to do attribute emission using the above method.
21772
21773 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * expression.cs (IsParamsMethodApplicable): if there are not
21776         parameters, return immediately.
21777
21778         * ecore.cs: The 0 literal can be implicity converted to an enum
21779         type. 
21780
21781         (SimpleName.DoResolve): First lookup the type, then lookup the
21782         members. 
21783
21784         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21785         want to get its address.  If the InstanceExpression is not
21786         addressable, store the result in a temporary variable, then get
21787         the address of it.
21788
21789         * codegen.cs: Only display 219 errors on warning level or above. 
21790
21791         * expression.cs (ArrayAccess): Make it implement the
21792         IMemoryLocation interface.
21793
21794         (Binary.DoResolve): handle the operator == (object a, object b)
21795         and operator != (object a, object b) without incurring into a
21796         BoxedCast (because 5 != o should never be performed).
21797
21798         Handle binary enumerator operators.
21799
21800         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21801         value type, otherwise use Ldelem_ref.
21802
21803         Use precomputed names;
21804
21805         (AddressOf): Implement address of
21806
21807         * cs-parser.jay (labeled_statement): Fix recursive block
21808         addition by reworking the production.
21809
21810         * expression.cs (New.DoEmit): New has a special case:
21811                 
21812                  If we are dealing with a ValueType, we have a few
21813                  situations to deal with:
21814                 
21815                     * The target of New is a ValueType variable, that is
21816                       easy, we just pass this as the variable reference
21817                 
21818                     * The target of New is being passed as an argument,
21819                       to a boxing operation or a function that takes a
21820                       ValueType.
21821                 
21822                       In this case, we need to create a temporary variable
21823                       that is the argument of New.
21824
21825
21826 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21827
21828         * rootcontext.cs (LookupType): Check that current_type is not null before
21829         going about looking at nested types.
21830
21831         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21832         not implement the IAssignMethod interface any more.
21833
21834         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21835         where we tranform them into FieldExprs if they are being resolved from within
21836         the declaring type.
21837
21838         * ecore.cs (SimpleName.DoResolve): Do the same here.
21839
21840         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21841
21842         * ../errors/bug10.cs : Add.
21843
21844         * ../errors/cs0070.cs : Add.
21845
21846         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21847
21848         * assign.cs : Get rid of EventIsLocal everywhere.
21849
21850 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * ecore.cs (ConvertIntLiteral): finished the implementation.
21853
21854         * statement.cs (SwitchLabel): Convert the value we are using as a
21855         key before looking up the table.
21856
21857 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * codegen.cs (EmitTopBlock): Require a Location argument now.
21860
21861         * cs-parser.jay (constructor_declarator): We need to setup
21862         current_local_parameters before we parse the
21863         opt_constructor_initializer, to allow the variables to be bound
21864         to the constructor arguments.
21865
21866         * rootcontext.cs (LookupType): First lookup nested classes in our
21867         class and our parents before we go looking outside our class.
21868
21869         * expression.cs (ConstantFold): Extract/debox the values at the
21870         beginnning. 
21871
21872         * rootcontext.cs (EmitCode): Resolve the constants first before we
21873         resolve the types.  This is not really needed, but it helps debugging.
21874
21875         * statement.cs: report location.
21876
21877         * cs-parser.jay: pass location to throw statement.
21878
21879         * driver.cs: Small bug fix.
21880
21881         * report.cs: Updated format to be 4-zero filled digits.
21882
21883 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21884
21885         * expression.cs (CheckIndices): Fix minor bug where the wrong
21886         variable was being referred to ;-)
21887
21888         (DoEmit): Do not call EmitStaticInitializers when the 
21889         underlying type is System.Object.
21890
21891 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21892
21893         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21894         and do the usual workaround for SRE.
21895
21896         * class.cs (MyEventBuilder.EventType): New member to get at the type
21897         of the event, quickly.
21898
21899         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21900
21901         * assign.cs (Assign.DoResolve): Handle the case when the target
21902         is an EventExpr and perform the necessary checks.
21903
21904         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21905         interface.
21906
21907         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21908
21909         (EventExpr): Set the type in the constructor itself since we 
21910         are meant to be born fully resolved.
21911
21912         (EventExpr.Define): Revert code I wrote earlier.
21913                 
21914         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21915         instance expression is null. The instance expression is a This in that case
21916         or a null, depending on whether it is a static method or not.
21917
21918         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21919         refers to more than one method.
21920
21921         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21922         and accordingly flag errors.
21923
21924 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21927
21928 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21929
21930         * location.cs (ToString): Provide useful rutine.
21931
21932 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21933
21934         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21935         objects, return the actual integral boxed.
21936
21937         * statement.cs (SwitchLabel): define an ILLabel for each
21938         SwitchLabel. 
21939
21940         (Switch.CheckSwitch): If the value is a Literal, extract
21941         the underlying literal.
21942
21943         Also in the unused hashtable we had, add the SwitchLabel so we can
21944         quickly look this value up.
21945
21946         * constant.cs: Implement a bunch of new constants.  Rewrite
21947         Literal based on this.  Made changes everywhere to adapt to this.
21948
21949         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21950         dereferencing array only once, and also copes with enumrations.
21951
21952         bytes are two bytes wide, not one.
21953
21954         (Cast): Perform constant conversions.
21955
21956         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21957         wrappers to the literals here.
21958
21959         * expression.cs (DoNumericPromotions): long literals can converted
21960         to ulong implicity (this is taken care of elsewhere, but I was
21961         missing this spot).
21962
21963         * ecore.cs (Expression.Literalize): Make the return type Literal,
21964         to improve type checking.
21965
21966         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21967
21968 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21969
21970         * literal.cs: Revert code from ravi that checked the bounds.  The
21971         bounds are sane by the definition of the type itself. 
21972
21973         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21974         need to actually look up in our parent hierarchy for interfaces
21975         implemented. 
21976
21977         * const.cs: Use the underlying type for enumerations
21978
21979         * delegate.cs: Compute the basename for the delegate creation,
21980         that should fix the delegate test case, and restore the correct
21981         Type Lookup semantics in rootcontext
21982
21983         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21984         referencing a nested type with the Reflection API is using the "+"
21985         sign. 
21986
21987         * cs-parser.jay: Do not require EOF token at the end.
21988
21989 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21990
21991         * rootcontext.cs (LookupType): Concatenate type names with
21992         a '.' instead of a '+' The test suite passes again.
21993
21994         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21995         field of the enumeration.
21996
21997         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21998         the case when the member is an EventExpr.
21999
22000         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22001         static has an associated instance expression.
22002
22003         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22004
22005         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22006
22007         * class.cs (Event.Define): Register event and perform appropriate checks
22008         for error #111.
22009
22010         We define the Add and Remove methods even if the use provides none because
22011         in that case, we provide default implementations ourselves.
22012
22013         Define a private field of the type of the event. This is done by the CSC compiler
22014         and we should be doing it too ;-)
22015
22016         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22017         More methods we use in code we generate.
22018
22019         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22020         is important.
22021
22022         (InitCoreTypes): Update accordingly for the above.
22023
22024         * class.cs (Event.Emit): Generate code for default accessors that we provide
22025
22026         (EmitDefaultMethod): Do the job in the above.
22027
22028         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22029         appropriate place.
22030
22031 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22032
22033         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22034         builders even if we were missing one.
22035
22036         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22037         pass the Basename as our class name instead of the Name.  The
22038         basename will be correctly composed for us.
22039
22040         * parameter.cs (Paramters): Now takes a Location argument.
22041
22042         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22043         make all the code call directly LookupType in RootContext and take
22044         this chance to pass the Location information everywhere.
22045
22046         * Everywhere: pass Location information.
22047
22048 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22049
22050         * class.cs (Constructor.Define): Updated way of detecting the
22051         length of the parameters.
22052
22053         (TypeContainer.DefineType): Use basename as the type name for
22054         nested types.
22055
22056         (TypeContainer.Define): Do not recursively define types here, as
22057         definition is taken care in order by the RootContext.
22058
22059         * tree.cs: Keep track of namespaces in a per-file basis.
22060
22061         * parameter.cs (Parameter.ComputeSignature): Update to use
22062         DeclSpace. 
22063
22064         (Parameters.GetSignature): ditto.
22065
22066         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22067         instead of a TypeContainer.
22068
22069         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22070         resolve names.  Because we need to be resolve in our context, not
22071         our parents.
22072
22073         * driver.cs: Implement response files.
22074
22075         * class.cs (TypeContainer.DefineType): If we are defined, do not
22076         redefine ourselves.
22077
22078         (Event.Emit): Emit the code for add/remove handlers.
22079         (Event.Define): Save the MethodBuilders for add/remove.
22080
22081         * typemanager.cs: Use pair here too.
22082
22083         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22084         DictionaryEntry requires the first argument to be non-null.  
22085
22086         (enum_declaration): Compute full name for registering the
22087         enumeration.
22088
22089         (delegate_declaration): Instead of using
22090         formal_parameter_list, use opt_formal_parameter_list as the list
22091         can be empty.
22092
22093         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22094         (EventParsing): New property that controls whether `add' and
22095         `remove' are returned as tokens or identifiers (for events);
22096
22097 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22098
22099         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22100         use MyEventBuilder only and let it wrap the real builder for us.
22101
22102         (MyEventBuilder): Revamp constructor etc.
22103
22104         Implement all operations that we perform on EventBuilder in precisely the same
22105         way here too.
22106
22107         (FindMembers): Update to use the EventBuilder member.
22108
22109         (Event.Emit): Update accordingly.
22110
22111 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22112
22113         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22114         by calling the appropriate methods.
22115
22116         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22117         useful.
22118
22119         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22120
22121 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22122
22123         * delegate.cs (Delegate.Populate): Check that the return type
22124         and various parameters types are indeed accessible.
22125
22126         * class.cs (Constructor.Define): Same here.
22127
22128         (Field.Define): Ditto.
22129
22130         (Event.Define): Ditto.
22131
22132         (Operator.Define): Check that the underlying Method defined itself
22133         correctly - so it's MethodBuilder should not be null.
22134
22135         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22136         expression happens to be null.
22137
22138         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22139         members but as of now we don't seem to be able to do anything really useful with it.
22140
22141         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22142         not the EventBuilder.
22143
22144 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22145
22146         * cs-tokenizer.cs: Add support for defines.
22147         Add support for #if, #elif, #else, #endif
22148
22149         (eval_var): evaluates a variable.
22150         (eval): stubbed for evaluating functions.
22151
22152         * cs-parser.jay: Pass the defines information
22153
22154         * driver.cs: Add --define command line option.
22155
22156         * decl.cs: Move MemberCore here.
22157
22158         Make it the base class for DeclSpace.  This allows us to catch and
22159         report 108 and 109 for everything now.
22160
22161         * class.cs (TypeContainer.Define): Extract all the members
22162         before populating and emit the warning 108 (new keyword required
22163         to override) instead of having each member implement this.
22164
22165         (MemberCore.Define): New abstract method, we will be using this in
22166         the warning reporting engine in Populate.
22167
22168         (Operator.Define): Adjust to new MemberCore protocol. 
22169
22170         * const.cs (Const): This does not derive from Expression, it is a
22171         temporary object we use to create fields, it is a MemberCore. 
22172
22173         * class.cs (Method.Define): Allow the entry point to be in a
22174         specific class.
22175
22176         * driver.cs: Rewrite the argument handler to clean it up a bit.
22177
22178         * rootcontext.cs: Made it just an auxiliary namespace feature by
22179         making everything static.
22180
22181         * driver.cs: Adapt code to use RootContext type name instead of
22182         instance variable.
22183
22184         * delegate.cs: Remove RootContext argument.
22185
22186         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22187         argument. 
22188
22189         * class.cs (Event.Define): The lookup can fail.
22190
22191         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22192
22193         * expression.cs: Resolve the this instance before invoking the code.
22194
22195 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * cs-parser.jay: Add a production in element_access that allows
22198         the thing to become a "type" reference.  This way we can parse
22199         things like "(string [])" as a type.
22200
22201         Note that this still does not handle the more complex rules of
22202         casts. 
22203
22204
22205         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22206
22207         * ecore.cs: (CopyNewMethods): new utility function used to
22208         assemble the list of methods from running FindMembers.
22209
22210         (MemberLookup): Rework FindMembers so that 
22211
22212 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22213
22214         * class.cs (TypeContainer): Remove Delegates who fail to be
22215         defined.
22216
22217         * delegate.cs (Populate): Verify that we dont get null return
22218         values.   TODO: Check for AsAccessible.
22219
22220         * cs-parser.jay: Use basename to emit error 574 (destructor should
22221         have the same name as container class), not the full name.
22222
22223         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22224         possible representation.  
22225
22226         Also implements integer type suffixes U and L.
22227
22228 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22229
22230         * expression.cs (ArrayCreation.DoResolve): We need to do the
22231         argument resolution *always*.
22232
22233         * decl.cs: Make this hold the namespace.  Hold the root context as
22234         well.
22235         (LookupType): Move here.
22236
22237         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22238
22239         * location.cs (Row, Name): Fixed the code, it was always returning
22240         references to the first file.
22241
22242         * interface.cs: Register properties defined through interfaces.
22243
22244         * driver.cs: Add support for globbing on the command line
22245
22246         * class.cs (Field): Make it derive from MemberCore as well.
22247         (Event): ditto.
22248
22249 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22250
22251         * class.cs (Event::Define): Check that the type of the event is a delegate
22252         type else flag error #66.
22253
22254         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22255         same.
22256
22257         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22258         values of EntryPoint, CharSet etc etc.
22259
22260         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22261
22262         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22263         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22264         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22265         which needs this to do its work.
22266
22267         * ../errors/cs0066.cs : Add.
22268
22269 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22270
22271         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22272         helper functions.
22273
22274         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22275         clears out the parameters field.
22276         (MemberSignatureCompare): Cleanup
22277
22278         (MemberCore): New base class used to share code between MethodCore
22279         and Property.
22280
22281         (RegisterRequiredImplementations) BindingFlags.Public requires
22282         either BindingFlags.Instace or Static.  Use instance here.
22283
22284         (Property): Refactored code to cope better with the full spec.
22285
22286         * parameter.cs (GetParameterInfo): Return an empty array instead
22287         of null on error.
22288
22289         * class.cs (Property): Abstract or extern properties have no bodies.
22290
22291         * parameter.cs (GetParameterInfo): return a zero-sized array.
22292
22293         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22294         method modifier validation to the typecontainer so we can reuse
22295         this on properties.
22296
22297         (MethodCore.ParameterTypes): return an empty sized array of types.
22298
22299         (Property.Define): Test property modifier validity.
22300
22301         Add tests for sealed/override too.
22302
22303         (Method.Emit): abstract or extern methods have no bodies.
22304
22305 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22306
22307         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22308         thing.
22309
22310         (Method::Define, ::Emit): Modify accordingly.
22311
22312         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22313
22314         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22315
22316         * makefile: Pass in /unsafe.
22317
22318 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22319
22320         * class.cs (MakeKey): Kill routine.
22321
22322         * class.cs (TypeContainer.Define): Correctly define explicit
22323         method implementations (they require the full interface name plus
22324         the method name).
22325
22326         * typemanager.cs: Deply the PtrHashtable here and stop using the
22327         lame keys.  Things work so much better.
22328
22329         This of course broke everyone who depended on `RegisterMethod' to
22330         do the `test for existance' test.  This has to be done elsewhere.
22331
22332         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22333         the object stupid Equals method (because, that like fails all over
22334         the place).  We still do not use it.
22335
22336         * class.cs (TypeContainer.SetRequiredInterface,
22337         TypeContainer.RequireMethods): Killed these two routines and moved
22338         all the functionality to RegisterRequiredImplementations.
22339
22340         (TypeContainer.RegisterRequiredImplementations): This routine now
22341         registers all the implementations required in an array for the
22342         interfaces and abstract methods.  We use an array of structures
22343         which can be computed ahead of time to reduce memory usage and we
22344         also assume that lookups are cheap as most classes will not
22345         implement too many interfaces.
22346
22347         We also avoid creating too many MethodSignatures.
22348
22349         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22350         clear the "pending" bit if we find that there are problems with
22351         the declaration.
22352
22353         (TypeContainer.VerifyPendingMethods): Update to report errors of
22354         methods that look like implementations but are not.
22355
22356         (TypeContainer.Define): Add support for explicit interface method
22357         implementation. 
22358
22359 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * typemanager.cs: Keep track of the parameters here instead of
22362         being a feature of the TypeContainer.
22363
22364         * class.cs: Drop the registration of parameters here, as
22365         InterfaceMethods are also interface declarations.
22366
22367         * delegate.cs: Register methods with the TypeManager not only with
22368         the TypeContainer.  This code was buggy.
22369
22370         * interface.cs: Full registation here.
22371
22372 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22373
22374         * expression.cs: Remove reducer for binary expressions, it can not
22375         be done this way.
22376
22377         * const.cs: Put here the code that used to go into constant.cs
22378
22379         * constant.cs: Put here the code for constants, this is a new base
22380         class for Literals.
22381
22382         * literal.cs: Make Literal derive from Constant.
22383
22384 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22385
22386         * statement.cs (Return.Emit): Report error 157 if the user
22387         attempts to return from a finally block.
22388
22389         (Return.Emit): Instead of emitting a return, jump to the end of
22390         the function.
22391
22392         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22393         LocalBuilder to store the result of the function.  ReturnLabel is
22394         the target where we jump.
22395
22396
22397 2001-12-09  Radek Doulik  <rodo@ximian.com>
22398
22399         * cs-parser.jay: remember alias in current namespace
22400
22401         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22402         namespaces
22403
22404         * class.cs (LookupAlias): lookup alias in my_namespace
22405
22406         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22407         aliases hashtable
22408         (LookupAlias): lookup alias in this and if needed in parent
22409         namespaces
22410
22411 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22412
22413         * support.cs: 
22414
22415         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22416         making things static.  I need this to avoid passing the
22417         TypeContainer when calling ParameterType.
22418
22419         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22420         that did string manipulation to compute the type and then call
22421         GetType.  Use Parameter.ParameterType instead.
22422
22423         * cs-tokenizer.cs: Consume the suffix for floating values.
22424
22425         * expression.cs (ParameterReference): figure out whether this is a
22426         reference parameter or not.  Kill an extra variable by computing
22427         the arg_idx during emission.
22428
22429         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22430         function that returns whether a parameter is an out/ref value or not.
22431
22432         (Parameter.ParameterType): The type of the parameter (base,
22433         without ref/out applied).
22434
22435         (Parameter.Resolve): Perform resolution here.
22436         (Parameter.ExternalType): The full type (with ref/out applied).
22437
22438         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22439         support for expressions on the using statement.
22440
22441 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22442
22443         * statement.cs (Using.EmitLocalVariableDecls): Split the
22444         localvariable handling of the using statement.
22445
22446         (Block.EmitMeta): Keep track of variable count across blocks.  We
22447         were reusing slots on separate branches of blocks.
22448
22449         (Try.Emit): Emit the general code block, we were not emitting it. 
22450
22451         Check the type of the declaration to be an IDisposable or
22452         something that can be implicity converted to it. 
22453
22454         Emit conversions if required.
22455
22456         * ecore.cs (EmptyExpression): New utility class.
22457         (Expression.ImplicitConversionExists): New utility function.
22458
22459 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22460
22461         * statement.cs (Using): Implement.
22462
22463         * expression.cs (LocalVariableReference): Support read only variables.
22464
22465         * statement.cs: Remove the explicit emit for the Leave opcode.
22466         (VariableInfo): Add a readonly field.
22467
22468 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22469
22470         * ecore.cs (ConvCast): new class used to encapsulate the various
22471         explicit integer conversions that works in both checked and
22472         unchecked contexts.
22473
22474         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22475         properly generate the overflow opcodes.
22476
22477 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22478
22479         * statement.cs: The correct type for the EmptyExpression is the
22480         element_type, not the variable type.  Ravi pointed this out.
22481
22482 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22483
22484         * class.cs (Method::Define): Handle PInvoke methods specially
22485         by using DefinePInvokeMethod instead of the usual one.
22486
22487         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22488         above to do the task of extracting information and defining the method.
22489
22490 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22491
22492         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22493         of the condition for string type.
22494
22495         (Emit): Move that here. 
22496
22497         (ArrayCreation::CheckIndices): Keep string literals in their expression
22498         form.
22499
22500         (EmitDynamicInitializers): Handle strings appropriately.
22501
22502 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22503
22504         * codegen.cs (EmitContext): Replace multiple variables with a
22505         single pointer to the current Switch statement.
22506
22507         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22508         EmitContext.
22509
22510 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22511
22512         * statement.cs 
22513
22514         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22515         default'.
22516
22517         (Foreach.Emit): Foreach on arrays was not setting
22518         up the loop variables (for break/continue).
22519
22520         (GotoCase): Semi-implented.
22521
22522 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22523
22524         * attribute.cs (CheckAttribute): Handle system attributes by using
22525         Attribute.GetAttributes to examine information we need.
22526
22527         (GetValidPlaces): Same here.
22528
22529         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22530
22531         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22532
22533         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22534
22535         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22536
22537         (Method::Emit): Handle the case when we are a PInvoke method.
22538
22539 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * expression.cs: Use ResolveWithSimpleName on compound names.
22542
22543 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22544
22545         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22546         before trying to reduce it.
22547
22548         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22549
22550         * constant.cs (LookupConstantValue): Implement.
22551
22552         (EmitConstant): Use the above in emitting the constant.
22553
22554         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22555         that are user-defined by doing a LookupConstantValue on them.
22556
22557         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22558         too, like above.
22559
22560 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22561
22562         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22563
22564         (BaseAccess.DoResolve): Implement.
22565
22566         (MemberAccess.DoResolve): Split this routine into a
22567         ResolveMemberAccess routine that can be used independently
22568
22569 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22570
22571         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22572         As that share bits of the implementation.  Is returns a boolean,
22573         while As returns the Type that is being probed.
22574
22575 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22576
22577         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22578         instead of a Literal - much easier.
22579
22580         (EnumInTransit): Remove - utterly useless :-)
22581
22582         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22583
22584         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22585
22586         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22587         chain when we have no associated expression.
22588
22589 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22590
22591         * constant.cs (Define): Use Location while reporting the errror.
22592
22593         Also emit a warning when 'new' is used and there is no inherited
22594         member to hide.
22595
22596         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22597         populated.
22598
22599         (LookupEnumValue): Implement to lookup an enum member's value and define it
22600         if necessary.
22601
22602         (Populate): Re-write accordingly to use the above routine.
22603
22604 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22605
22606         * expression.cs (This): Fix prototype for DoResolveLValue to
22607         override the base class DoResolveLValue.
22608
22609         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22610         declarations) 
22611
22612         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22613         (we need to load the address of the field here).  This fixes
22614         test-22. 
22615
22616         (FieldExpr.DoResolveLValue): Call the DoResolve
22617         function to initialize the Instance expression.
22618
22619         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22620         correctly the GetEnumerator operation on a value type.
22621
22622         * cs-parser.jay: Add more simple parsing error catches.
22623
22624         * statement.cs (Switch): Add support for string switches.
22625         Handle null specially.
22626
22627         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22628
22629 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22630
22631         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22632
22633         (declare_local_constant): New helper function.
22634
22635         * statement.cs (AddConstant): Keep a separate record of constants
22636
22637         (IsConstant): Implement to determine if a variable is a constant.
22638
22639         (GetConstantExpression): Implement.
22640
22641         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22642
22643         * statement.cs (IsVariableDefined): Re-write.
22644
22645 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22646
22647         * class.cs (TypeContainer::FindMembers): Look for constants
22648         in the case when we are looking for MemberTypes.Field
22649
22650         * expression.cs (MemberAccess::DoResolve): Check that in the
22651         case we are a FieldExpr and a Literal, we are not being accessed
22652         by an instance reference.
22653
22654         * cs-parser.jay (local_constant_declaration): Implement.
22655
22656         (declaration_statement): Implement for constant declarations.
22657
22658 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22659
22660         * statement.cs (Switch): Catch double defaults.
22661
22662         (Switch): More work on the switch() statement
22663         implementation.  It works for integral values now, need to finish
22664         string support.
22665
22666
22667 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22668
22669         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22670         integer literals into other integer literals.  To be used by
22671         switch. 
22672
22673 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22674
22675         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22676         some memory.
22677
22678         (EmitDynamicInitializers): Cope with the above since we extract data
22679         directly from ArrayData now.
22680
22681         (ExpectInitializers): Keep track of whether initializers are mandatory
22682         or not.
22683
22684         (Bounds): Make it a hashtable to prevent the same dimension being 
22685         recorded for every element in that dimension.
22686
22687         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22688         from being found.
22689
22690         Also fix bug which was causing the indices to be emitted in the reverse
22691         order.
22692
22693 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22694
22695         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22696         unfinished.  They do not work, because the underlying code is
22697         sloppy.
22698
22699 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22700
22701         * cs-parser.jay: Remove bogus fixme.
22702
22703         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22704         on Switch statement.
22705
22706 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22707
22708         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22709         the same. 
22710
22711         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22712         parameter. Apparently, any expression is allowed. 
22713
22714         (ValidateInitializers): Update accordingly.
22715
22716         (CheckIndices): Fix some tricky bugs thanks to recursion.
22717
22718         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22719         I was being completely brain-dead.
22720
22721         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22722         and re-write acordingly.
22723
22724         (DelegateInvocation): Re-write accordingly.
22725
22726         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22727
22728         (MakeByteBlob): Handle types more correctly.
22729
22730         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22731         initialization from expressions but it is incomplete because I am a complete
22732         Dodo :-|
22733
22734 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22735
22736         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22737         on If.  Basically, we have to return `true' (ie, we do return to
22738         our caller) only if both branches of the if return.
22739
22740         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22741         short-circuit operators, handle them as short circuit operators. 
22742
22743         (Cast.DoResolve): Resolve type.
22744         (Cast.Cast): Take an expression as the target type.
22745
22746         * cs-parser.jay (cast_expression): Remove old hack that only
22747         allowed a limited set of types to be handled.  Now we take a
22748         unary_expression and we resolve to a type during semantic
22749         analysis.
22750
22751         Use the grammar productions from Rhys to handle casts (this is
22752         not complete like Rhys syntax yet, we fail to handle that corner
22753         case that C# has regarding (-x), but we will get there.
22754
22755 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22756
22757         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22758         field which is an array type.
22759
22760         * cs-parser.jay (declare_local_variables): Support array initialization too.
22761
22762         * typemanager.cs (MakeKey): Implement.
22763
22764         (everywhere): Use the above appropriately.
22765
22766         * cs-parser.jay (for_statement): Update for array initialization while
22767         declaring variables.
22768
22769         * ecore.cs : The error message was correct, it's the variable's names that
22770         were misleading ;-) Make the code more readable.
22771
22772         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22773         the correct type etc.
22774
22775         (ConvertExplicit): Handle Enum types by examining the underlying type.
22776
22777 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22778
22779         * parameter.cs (GetCallingConvention): Always return
22780         CallingConventions.Standard for now.
22781
22782 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22783
22784         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22785         and `r' after calling DoNumericPromotions.
22786
22787         * ecore.cs: Fix error message (the types were in the wrong order).
22788
22789         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22790         BindingFlags.Instance as well 
22791
22792         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22793         implicit int literal conversion in an empty cast so that we
22794         propagate the right type upstream.
22795
22796         (UnboxCast): new class used to unbox value types.
22797         (Expression.ConvertExplicit): Add explicit type conversions done
22798         by unboxing.
22799
22800         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22801         the target type before applying the implicit LongLiterals to ULong
22802         literal cast.
22803
22804 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22805
22806         * cs-parser.jay (for_statement): Reworked the way For works: now
22807         we declare manually any variables that are introduced in
22808         for_initializer to solve the problem of having out-of-band code
22809         emition (that is what got for broken).
22810
22811         (declaration_statement): Perform the actual variable declaration
22812         that used to be done in local_variable_declaration here.
22813
22814         (local_variable_declaration): Do not declare anything, just pass
22815         the information on a DictionaryEntry
22816
22817 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22818
22819         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22820         re-write of the logic to now make it recursive.
22821
22822         (UpdateIndices): Re-write accordingly.
22823
22824         Store element data in a separate ArrayData list in the above methods.
22825
22826         (MakeByteBlob): Implement to dump the array data into a byte array.
22827
22828 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22829
22830         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22831         into CheckIndices.
22832
22833         * constant.cs (Define): Implement.
22834
22835         (EmitConstant): Re-write fully.
22836
22837         Pass in location info.
22838
22839         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22840         respectively.
22841
22842         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22843         DictionaryEntry since we need location info too.
22844
22845         (constant_declaration): Update accordingly.
22846
22847         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22848         code into another method : UpdateIndices.
22849
22850 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22851
22852         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22853         some type checking etc.
22854
22855 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22856
22857         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22858         bits to provide dimension info if the user skips doing that.
22859
22860         Update second constructor to store the rank correctly.
22861
22862 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22863
22864         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22865         and try to implement.
22866
22867         * ../errors/cs0150.cs : Add.
22868
22869         * ../errors/cs0178.cs : Add.
22870
22871 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22872
22873         * statement.cs: Implement foreach on multi-dimensional arrays. 
22874
22875         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22876         name of the params argument.
22877
22878         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22879         initializing the array.
22880
22881         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22882         we can use this elsewhere.
22883
22884         * statement.cs: Finish implementation of foreach for single
22885         dimension arrays.
22886
22887         * cs-parser.jay: Use an out-of-band stack to pass information
22888         around, I wonder why I need this.
22889
22890         foreach_block: Make the new foreach_block the current_block.
22891
22892         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22893         function used to return a static Parameters structure.  Used for
22894         empty parameters, as those are created very frequently.
22895
22896         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22897
22898 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22899
22900         * interface.cs : Default modifier is private, not public. The
22901         make verify test passes again.
22902
22903 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22904
22905         * support.cs (ReflectionParameters): Fix logic to determine
22906         whether the last parameter is a params one. Test 9 passes again.
22907
22908         * delegate.cs (Populate): Register the builders we define with
22909         RegisterParameterForBuilder. Test 19 passes again.
22910
22911         * cs-parser.jay (property_declaration): Reference $6 instead
22912         of $$ to get at the location.
22913
22914         (indexer_declaration): Similar stuff.
22915
22916         (attribute): Ditto.
22917
22918         * class.cs (Property): Register parameters for the Get and Set methods
22919         if they exist. Test 23 passes again.
22920
22921         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22922         call to EmitArguments as we are sure there aren't any params arguments. 
22923         Test 32 passes again.
22924
22925         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22926         IndexOutOfRangeException. 
22927
22928         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22929         Test 33 now passes again.
22930
22931 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22932
22933         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22934         broke a bunch of things.  Will have to come up with a better way
22935         of tracking locations.
22936
22937         * statement.cs: Implemented foreach for single dimension arrays.
22938
22939 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22940
22941         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22942         an error.  This removes the lookup from the critical path.
22943
22944         * cs-parser.jay: Removed use of temporary_loc, which is completely
22945         broken. 
22946
22947 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22948
22949         * support.cs (ReflectionParameters.ParameterModifier): Report
22950         whether the argument is a PARAMS argument or not.
22951
22952         * class.cs: Set the attribute `ParamArrayAttribute' on the
22953         parameter argument.
22954
22955         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22956         and cons_param_array_attribute (ConstructorInfo for
22957         ParamArrayAttribute)., 
22958
22959         * codegen.cs: Emit the return using the `Return' statement, that
22960         way we can report the error correctly for missing return values. 
22961
22962         * class.cs (Method.Emit): Clean up.
22963
22964         * expression.cs (Argument.Resolve): Take another argument: the
22965         location where this argument is used.  Notice that this is not
22966         part of the "Argument" class as to reduce the size of the
22967         structure (we know the approximate location anyways).
22968
22969         Test if the argument is a variable-reference, if not, then
22970         complain with a 206.
22971
22972         (Argument.Emit): Emit addresses of variables.
22973
22974         (Argument.FullDesc): Simplify.
22975
22976         (Invocation.DoResolve): Update for Argument.Resolve.
22977
22978         (ElementAccess.DoResolve): ditto.
22979
22980         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22981         method should be virtual, as this method is always virtual.
22982
22983         (NewDelegate.DoResolve): Update for Argument.Resolve.
22984
22985         * class.cs (ConstructorInitializer.DoResolve): ditto.
22986
22987         * attribute.cs (Attribute.Resolve): ditto.
22988
22989 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22990
22991         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22992
22993         * expression.cs (ParameterReference): Drop IStackStorage and implement
22994         IAssignMethod instead. 
22995
22996         (LocalVariableReference): ditto.
22997
22998         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22999         IAssignMethod instead. 
23000
23001 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23002
23003         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23004         enumerations that are used in heavily used structures derive from
23005         byte in a laughable and pathetic attempt to reduce memory usage.
23006         This is the kind of pre-optimzations that you should not do at
23007         home without adult supervision.
23008
23009         * expression.cs (UnaryMutator): New class, used to handle ++ and
23010         -- separatedly from the other unary operators.  Cleans up the
23011         code, and kills the ExpressionStatement dependency in Unary.
23012
23013         (Unary): Removed `method' and `Arguments' from this class, making
23014         it smaller, and moving it all to SimpleCall, so I can reuse this
23015         code in other locations and avoid creating a lot of transient data
23016         strucutres when not required.
23017
23018         * cs-parser.jay: Adjust for new changes.
23019
23020 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * enum.cs (Enum.Populate): If there is a failure during
23023         definition, return
23024
23025         * cs-parser.jay (opt_enum_base): we used to catch type errors
23026         here, but this is really incorrect.  The type error should be
23027         catched during semantic analysis.
23028
23029 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23030
23031         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23032         current_local_parameters as expected since I, in my stupidity, had forgotten
23033         to do this :-)
23034
23035         * attribute.cs (GetValidPlaces): Fix stupid bug.
23036
23037         * class.cs (Method::Emit): Perform check on applicability of attributes.
23038
23039         (Constructor::Emit): Ditto.
23040
23041         (Field::Emit): Ditto.
23042
23043         (Field.Location): Store location information.
23044
23045         (Property, Event, Indexer, Operator): Ditto.
23046
23047         * cs-parser.jay (field_declaration): Pass in location for each field.
23048
23049         * ../errors/cs0592.cs : Add.
23050
23051 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23052
23053         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23054
23055         (InitCoreTypes): Update accordingly.
23056
23057         (RegisterAttrType, LookupAttr): Implement.
23058
23059         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23060         info about the same.
23061
23062         (Resolve): Update to populate the above as necessary.
23063
23064         (Error592): Helper.
23065
23066         (GetValidPlaces): Helper to the above.
23067
23068         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23069
23070         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23071
23072 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23073
23074         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23075
23076         * ../errors/cs0617.cs : Add.
23077
23078 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23079
23080         * enum.cs (Emit): Rename to Populate to be more consistent with what
23081         we expect it to do and when exactly it is called.
23082
23083         * class.cs, rootcontext.cs : Update accordingly.
23084
23085         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23086         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23087
23088         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23089
23090         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23091         of a fieldinfo using the above, when dealing with a FieldBuilder.
23092
23093 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23094
23095         * ../errors/cs0031.cs : Add.
23096
23097         * ../errors/cs1008.cs : Add.
23098
23099         * ../errrors/cs0543.cs : Add.
23100
23101         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23102         enum type.
23103
23104         (FindMembers): Implement.
23105
23106         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23107         enums and delegates too.
23108
23109         (enum_types): Rename to builder_to_enum.
23110
23111         (delegate_types): Rename to builder_to_delegate.
23112
23113         * delegate.cs (FindMembers): Implement.
23114
23115 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23116
23117         * typemanager.cs (IsEnumType): Implement.
23118
23119         * enum.cs (Emit): Re-write parts to account for the underlying type
23120         better and perform checking etc.
23121
23122         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23123         of the underlying type.
23124
23125         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23126         value
23127
23128         * enum.cs (error31): Helper to report error #31.
23129
23130         * cs-parser.jay (enum_declaration): Store location of each member too.
23131
23132         * enum.cs (member_to_location): New hashtable. 
23133
23134         (AddEnumMember): Update location hashtable.
23135
23136         (Emit): Use the location of each member while reporting errors.
23137
23138 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23139
23140         * cs-parser.jay: A for_initializer if is a
23141         local_variable_declaration really ammount to have an implicit
23142         block with the variable declaration and no initializer for for.
23143
23144         * statement.cs (For.Emit): Cope with null initializers.
23145
23146         This fixes the infinite loop on for initializers.
23147
23148 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * enum.cs: More cleanup.
23151
23152         * ecore.cs: Remove dead code.
23153
23154         * class.cs (Property.Emit): More simplification.
23155         (Event.Emit): ditto.
23156
23157         Reworked to have less levels of indentation.
23158
23159 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23160
23161         * class.cs (Property): Emit attributes.
23162
23163         (Field): Ditto.
23164
23165         (Event): Ditto.
23166
23167         (Indexer): Ditto.
23168
23169         (Operator): Ditto.
23170
23171         * enum.cs (Emit): Ditto.
23172
23173         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23174         Enums too.
23175
23176         * class.cs (Field, Event, etc.): Move attribute generation into the
23177         Emit method everywhere.
23178
23179         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23180         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23181         as we had no way of defining nested enums !
23182
23183         * rootcontext.cs : Adjust code accordingly.
23184
23185         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23186
23187 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23188
23189         * expression.cs (EvalConstantExpression): Move into ecore.cs
23190
23191         * enum.cs (Enum): Rename some members and make them public and readonly
23192         according to our convention.
23193
23194         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23195         nothing else.
23196
23197         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23198
23199         (Enum::Emit): Write a simple version for now which doesn't try to compute
23200         expressions. I shall modify this to be more robust in just a while.
23201
23202         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23203
23204         (TypeContainer::CloseType): Create the Enum types too.
23205
23206         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23207
23208         * expression.cs (EvalConstantExpression): Get rid of completely.
23209
23210         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23211         user-defined values and other cases.
23212
23213         (IsValidEnumLiteral): Helper function.
23214
23215         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23216         out there in the case we had a literal FieldExpr.
23217
23218         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23219
23220         (Literalize): Revamp a bit to take two arguments.
23221
23222         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23223
23224 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23225
23226         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23227
23228         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23229
23230         (Resolve): Use the above to ensure we have proper initializers.
23231
23232 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23233
23234         * expression.cs (Expression::EvalConstantExpression): New method to 
23235         evaluate constant expressions.
23236
23237         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23238
23239 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23240
23241         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23242         in an array.
23243
23244         (Binary.ResolveOperator): Handle operator != (object a, object b)
23245         and operator == (object a, object b);
23246
23247         (Binary.DoNumericPromotions): Indicate whether the numeric
23248         promotion was possible.
23249
23250         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23251         Implement.  
23252
23253         Made the ArrayAccess implement interface IAssignMethod instead of
23254         IStackStore as the order in which arguments are passed reflects
23255         this.
23256
23257         * assign.cs: Instead of using expr.ExprClass to select the way of
23258         assinging, probe for the IStackStore/IAssignMethod interfaces.
23259
23260         * typemanager.cs: Load InitializeArray definition.
23261
23262         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23263         static data that can be used to initialize arrays. 
23264
23265 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23266
23267         * expression.cs: Handle operator== and operator!= for booleans.
23268
23269         (Conditioal.Reduce): Implement reducer for the ?: operator.
23270
23271         (Conditional.Resolve): Implement dead code elimination.
23272
23273         (Binary.Resolve): Catch string literals and return a new
23274         concatenated string.
23275
23276         (Unary.Reduce): Implement reduction of unary expressions.
23277
23278         * ecore.cs: Split out the expression core handling here.
23279
23280         (Expression.Reduce): New method used to perform constant folding
23281         and CSE.  This is needed to support constant-expressions. 
23282
23283         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23284         targets, and optimize for !x.
23285
23286 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23287
23288         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23289         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23290         set custom atttributes.
23291
23292         * literal.cs (Literal::GetValue): New abstract method to return the actual
23293         value of the literal, cast as an object.
23294
23295         (*Literal): Implement GetValue method.
23296
23297         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23298         expressions to the arraylist but objects of type Argument.
23299
23300         * class.cs (TypeContainer::Emit): Emit our attributes too.
23301
23302         (Method::Emit, Constructor::Emit): Ditto.
23303
23304         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23305         to be ignoring earlier.
23306
23307 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23308
23309         * attribute.cs (AttributeSection::Define): Implement to do the business
23310         of constructing a CustomAttributeBuilder.
23311
23312         (Attribute): New trivial class. Increases readability of code.  
23313
23314         * cs-parser.jay : Update accordingly.
23315
23316         (positional_argument_list, named_argument_list, named_argument): New rules
23317
23318         (attribute_arguments): Use the above so that we are more correct.
23319
23320 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23321
23322         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23323         to perform all checks for a method with a params parameter.
23324
23325         (Invocation::OverloadResolve): Update to use the above method and therefore
23326         cope correctly with params method invocations.
23327
23328         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23329         params too.
23330
23331         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23332         constructors in our parent too because we can't afford to miss out on 
23333         protected ones ;-)
23334
23335         * attribute.cs (AttributeSection): New name for the class Attribute
23336
23337         Other trivial changes to improve readability.
23338
23339         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23340         use the new class names.
23341
23342 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23343
23344         * class.cs (Method::Define): Complete definition for params types too
23345
23346         (Indexer::Define): Ditto.
23347
23348         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23349         Cope everywhere with a request for info about the array parameter.
23350
23351 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23352
23353         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23354
23355         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23356         local_variable_type to extract the string corresponding to the type.
23357
23358         (local_variable_type): Fixup the action to use the new helper method.
23359
23360         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23361         go.
23362
23363         * expression.cs : Clean out code which uses the above.
23364
23365 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23366
23367         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23368         and bale out if necessary by returning a false.
23369
23370         (RegisterProperty): Ditto.
23371
23372         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23373         and print out appropriate error messages.
23374
23375         * interface.cs (everywhere): Ditto.
23376
23377         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23378         location to constructor.
23379
23380         * class.cs (Property, Event, Indexer): Update accordingly.
23381
23382         * ../errors/cs111.cs : Added.
23383
23384         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23385         of a method, as laid down by the spec.
23386
23387         (Invocation::OverloadResolve): Use the above method.
23388
23389 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23390
23391         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23392         now take a TypeContainer and a Parameters object.
23393
23394         (ParameterData): Modify return type of ParameterModifier method to be 
23395         Parameter.Modifier and not a string.
23396
23397         (ReflectionParameters, InternalParameters): Update accordingly.
23398
23399         * expression.cs (Argument::GetParameterModifier): Same here.
23400
23401         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23402         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23403         symbol in it at all so maybe this is only for now.
23404
23405 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23406
23407         * support.cs (InternalParameters): Constructor now takes an extra argument 
23408         which is the actual Parameters class.
23409
23410         (ParameterDesc): Update to provide info on ref/out modifiers.
23411
23412         * class.cs (everywhere): Update call to InternalParameters to pass in
23413         the second argument too.
23414
23415         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23416         to return the modifier info [ref/out etc]
23417
23418         (InternalParameters, ReflectionParameters): Implement the above.
23419
23420         * expression.cs (Argument::ParameterModifier): Similar function to return
23421         info about the argument's modifiers.
23422
23423         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23424         too.
23425
23426         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23427         a new SetFormalParameters object which we pass to InternalParameters.
23428
23429 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23430
23431         * expression.cs (NewArray): Merge into the ArrayCreation class.
23432
23433 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23434
23435         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23436         NewUserdefinedArray into one as there wasn't much of a use in having
23437         two separate ones.
23438
23439         * expression.cs (Argument): Change field's name to ArgType from Type.
23440
23441         (Type): New readonly property which returns the proper type, taking into 
23442         account ref/out modifiers.
23443
23444         (everywhere): Adjust code accordingly for the above.
23445
23446         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23447         whether we are emitting for a ref or out parameter.
23448
23449         * expression.cs (Argument::Emit): Use the above field to set the state.
23450
23451         (LocalVariableReference::Emit): Update to honour the flag and emit the
23452         right stuff.
23453
23454         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23455
23456         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23457
23458         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23459
23460         (ReflectionParameters, InternalParameters): Implement the above method.
23461
23462         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23463         reporting errors.
23464
23465         (Invocation::FullMethodDesc): Ditto. 
23466
23467 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23468
23469         * cs-parser.jay: Add extra production for the second form of array
23470         creation. 
23471
23472         * expression.cs (ArrayCreation): Update to reflect the above
23473         change. 
23474
23475         * Small changes to prepare for Array initialization.
23476
23477 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23478
23479         * typemanager.cs (ImplementsInterface): interface might be null;
23480         Deal with this problem;
23481
23482         Also, we do store negative hits on the cache (null values), so use
23483         this instead of calling t.GetInterfaces on the type everytime.
23484
23485 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23486
23487         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23488
23489         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23490         split functionality out into different classes.
23491
23492         (New::FormArrayType): Move into NewBuiltinArray.
23493
23494         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23495         quite useless.
23496
23497         (NewBuiltinArray): New class to handle creation of built-in arrays.
23498
23499         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23500         account creation of one-dimensional arrays.
23501
23502         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23503
23504         (NewUserdefinedArray::DoResolve): Implement.
23505
23506         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23507
23508         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23509         we maintain inside the TypeManager. This is necessary to perform lookups on the
23510         module builder.
23511
23512         (LookupType): Update to perform GetType on the module builders too.     
23513
23514         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23515
23516         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23517
23518 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23519
23520         * expression.cs (New::DoResolve): Implement guts of array creation.
23521
23522         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23523
23524 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23525
23526         * expression.cs: Fix bug I introduced lsat night that broke
23527         Delegates. 
23528
23529         (Expression.Resolve): Report a 246 error (can not resolve name)
23530         if we find a SimpleName in the stream.
23531
23532         (Expression.ResolveLValue): Ditto.
23533
23534         (Expression.ResolveWithSimpleName): This function is a variant of
23535         ResolveName, this one allows SimpleNames to be returned without a
23536         warning.  The only consumer of SimpleNames is MemberAccess
23537
23538 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23539
23540         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23541         might arrive here.  I have my doubts that this is correct.
23542
23543         * statement.cs (Lock): Implement lock statement.
23544
23545         * cs-parser.jay: Small fixes to support `lock' and `using'
23546
23547         * cs-tokenizer.cs: Remove extra space
23548
23549         * driver.cs: New flag --checked, allows to turn on integer math
23550         checking. 
23551
23552         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23553         Threading.Monitor.Exit 
23554
23555 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23556
23557         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23558         Expression Class to be IndexerAccess.
23559
23560         Notice that Indexer::DoResolve sets the eclass to Value.
23561
23562 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23563
23564         * class.cs (TypeContainer::Emit): Emit code for indexers.
23565
23566         * assign.cs (IAssignMethod): New interface implemented by Indexers
23567         and Properties for handling assignment.
23568
23569         (Assign::Emit): Simplify and reuse code. 
23570
23571         * expression.cs (IndexerAccess, PropertyExpr): Implement
23572         IAssignMethod, clean up old code. 
23573
23574 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23575
23576         * typemanager.cs (ImplementsInterface): New method to determine if a type
23577         implements a given interface. Provides a nice cache too.
23578
23579         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23580         method.
23581
23582         (ConvertReferenceExplicit): Ditto.
23583
23584         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23585         various methods, with correct names etc.
23586
23587         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23588         Operator.UnaryNegation.
23589
23590         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23591         we have a unary plus or minus operator.
23592
23593         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23594         UnaryMinus.
23595
23596         * everywhere : update accordingly.
23597
23598         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23599         respectively.
23600
23601         * class.cs (Method::Define): For the case where we are implementing a method
23602         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23603         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23604
23605 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23606
23607         * interface.cs (FindMembers): Implement to work around S.R.E
23608         lameness.
23609
23610         * typemanager.cs (IsInterfaceType): Implement.
23611
23612         (FindMembers): Update to handle interface types too.
23613
23614         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23615         use IsAssignableFrom as that is not correct - it doesn't work.
23616
23617         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23618         and accordingly override EmitStatement.
23619
23620         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23621         using the correct logic :-)
23622
23623 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23624
23625         * ../errors/cs-11.cs : Add to demonstrate error -11 
23626
23627 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23628
23629         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23630         then pass this as a hint to ResolveLValue.
23631
23632         * expression.cs (FieldExpr): Add Location information
23633
23634         (FieldExpr::LValueResolve): Report assignment to readonly
23635         variable. 
23636
23637         (Expression::ExprClassFromMemberInfo): Pass location information.
23638
23639         (Expression::ResolveLValue): Add new method that resolves an
23640         LValue. 
23641
23642         (Expression::DoResolveLValue): Default invocation calls
23643         DoResolve. 
23644
23645         (Indexers): New class used to keep track of indexers in a given
23646         Type. 
23647
23648         (IStackStore): Renamed from LValue, as it did not really describe
23649         what this did.  Also ResolveLValue is gone from this interface and
23650         now is part of Expression.
23651
23652         (ElementAccess): Depending on the element access type
23653
23654         * typemanager.cs: Add `indexer_name_type' as a Core type
23655         (System.Runtime.CompilerServices.IndexerNameAttribute)
23656
23657         * statement.cs (Goto): Take a location.
23658
23659 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23660
23661         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23662         if two delegates are compatible.
23663
23664         (NewDelegate::DoResolve): Update to take care of the case when
23665         we instantiate a delegate from another delegate.
23666
23667         * typemanager.cs (FindMembers): Don't even try to look up members
23668         of Delegate types for now.
23669
23670 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23671
23672         * delegate.cs (NewDelegate): New class to take care of delegate
23673         instantiation.
23674
23675         * expression.cs (New): Split the delegate related code out into 
23676         the NewDelegate class.
23677
23678         * delegate.cs (DelegateInvocation): New class to handle delegate 
23679         invocation.
23680
23681         * expression.cs (Invocation): Split out delegate related code into
23682         the DelegateInvocation class.
23683
23684 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23685
23686         * expression.cs (New::DoResolve): Implement delegate creation fully
23687         and according to the spec.
23688
23689         (New::DoEmit): Update to handle delegates differently.
23690
23691         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23692         because of which we were printing out arguments in reverse order !
23693
23694         * delegate.cs (VerifyMethod): Implement to check if the given method
23695         matches the delegate.
23696
23697         (FullDelegateDesc): Implement.
23698
23699         (VerifyApplicability): Implement.
23700
23701         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23702         delegate invocations too.
23703
23704         (Invocation::Emit): Ditto.
23705
23706         * ../errors/cs1593.cs : Added.
23707
23708         * ../errors/cs1594.cs : Added.
23709
23710         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23711
23712 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23713
23714         * typemanager.cs (intptr_type): Core type for System.IntPtr
23715
23716         (InitCoreTypes): Update for the same.
23717
23718         (iasyncresult_type, asynccallback_type): Ditto.
23719
23720         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23721         correct.
23722
23723         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23724         too.
23725
23726         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23727         the builders for the 4 members of a delegate type :-)
23728
23729         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23730         type.
23731
23732         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23733
23734         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23735
23736 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23737
23738         * statement.cs (Break::Emit): Implement.   
23739         (Continue::Emit): Implement.
23740
23741         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23742         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23743         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23744         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23745         end loop
23746
23747         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23748         properties that track the label for the current loop (begin of the
23749         loop and end of the loop).
23750
23751 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23752
23753         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23754         use of emitting anything at all.
23755
23756         * class.cs, rootcontext.cs : Get rid of calls to the same.
23757
23758         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23759
23760         (Populate): Define the constructor correctly and set the implementation
23761         attributes.
23762
23763         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23764         have been defined.
23765
23766         (AddDelegateType): Implement.
23767
23768         (IsDelegateType): Implement helper method.
23769
23770         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23771
23772         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23773         and accordingly handle it.
23774
23775         * delegate.cs (Populate): Take TypeContainer argument.
23776         Implement bits to define the Invoke method. However, I still haven't figured out
23777         how to take care of the native int bit :-(
23778
23779         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23780         Qualify the name of the delegate, not its return type !
23781
23782         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23783         conversion.
23784
23785         (StandardConversionExists): Checking for array types turns out to be recursive.
23786
23787         (ConvertReferenceExplicit): Implement array conversion.
23788
23789         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23790
23791 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23792
23793         * cs-parser.jay (delegate_declaration): Store the fully qualified
23794         name as it is a type declaration.
23795
23796         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23797         readonly.
23798
23799         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23800         as TypeContainer::DefineType.
23801
23802         (Populate): Method in which all the definition of the various methods (Invoke)
23803         etc is done.
23804
23805         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23806         see.
23807
23808         (CloseDelegate): Finally creates the delegate.
23809
23810         * class.cs (TypeContainer::DefineType): Update to define delegates.
23811         (Populate, Emit and CloseType): Do the same thing here too.
23812
23813         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23814         delegates in all these operations.
23815
23816 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23817
23818         * expression.cs: LocalTemporary: a new expression used to
23819         reference a temporary that has been created.
23820
23821         * assign.cs: Handle PropertyAccess back here, so that we can
23822         provide the proper semantic access to properties.
23823
23824         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23825         a few more explicit conversions. 
23826
23827         * modifiers.cs: `NEW' modifier maps to HideBySig.
23828
23829         * expression.cs (PropertyExpr): Make this into an
23830         ExpressionStatement, and support the EmitStatement code path. 
23831
23832         Perform get/set error checking, clean up the interface.
23833
23834         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23835         them into toplevel access objects.
23836
23837 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23838
23839         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23840         SRE.
23841
23842         * typemanager.cs: Keep track here of our PropertyBuilders again to
23843         work around lameness in SRE.
23844
23845 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23846
23847         * expression.cs (LValue::LValueResolve): New method in the
23848         interface, used to perform a second resolution pass for LValues. 
23849
23850         (This::DoResolve): Catch the use of this in static methods.
23851
23852         (This::LValueResolve): Implement.
23853
23854         (This::Store): Remove warning, assigning to `this' in structures
23855         is 
23856
23857         (Invocation::Emit): Deal with invocation of
23858         methods on value types.  We need to pass the address to structure
23859         methods rather than the object itself.  (The equivalent code to
23860         emit "this" for structures leaves the entire structure on the
23861         stack instead of a pointer to it). 
23862
23863         (ParameterReference::DoResolve): Compute the real index for the
23864         argument based on whether the method takes or not a `this' pointer
23865         (ie, the method is static).
23866
23867         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23868         value types returned from functions when we need to invoke a
23869         method on the sturcture.
23870
23871
23872 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23873
23874         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23875         defining the type in the Modulebuilder or Typebuilder. This is to take
23876         care of nested types which need to be defined on the TypeBuilder using
23877         DefineNestedMethod.
23878
23879         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23880         methods in RootContext, only ported to be part of TypeContainer.
23881
23882         (TypeContainer::GetInterfaceOrClass): Ditto.
23883
23884         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23885
23886         * interface.cs (Interface::DefineInterface): New method. Does exactly
23887         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23888         too.
23889
23890         (Interface::GetInterfaces): Move from RootContext here and port.
23891
23892         (Interface::GetInterfaceByName): Same here.
23893
23894         * rootcontext.cs (ResolveTree): Re-write.
23895
23896         (PopulateTypes): Re-write.
23897
23898         * class.cs (TypeContainer::Populate): Populate nested types too.
23899         (TypeContainer::Emit): Emit nested members too.
23900
23901         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23902         instead just use the name argument passed in as it is already fully
23903         qualified.
23904
23905         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23906         to TypeContainer mapping to see if a type is user-defined.
23907
23908         * class.cs (TypeContainer::CloseType): Implement. 
23909
23910         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23911         the default constructor.
23912
23913         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23914         twice.
23915
23916         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23917
23918         * interface.cs (CloseType): Create the type here.
23919
23920         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23921         the hierarchy.
23922
23923         Remove all the methods which are now in TypeContainer.
23924
23925 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23926
23927         * delegate.cs (Define): Re-write bits to define the delegate
23928         correctly.
23929
23930 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23931
23932         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23933
23934         * expression.cs (ImplicitReferenceConversion): handle null as well
23935         as a source to convert to any reference type.
23936
23937         * statement.cs (Return): Perform any implicit conversions to
23938         expected return type.  
23939
23940         Validate use of return statement.  
23941
23942         * codegen.cs (EmitContext): Pass the expected return type here.
23943
23944         * class.cs (Method, Constructor, Property): Pass expected return
23945         type to EmitContext.
23946
23947 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23948
23949         * expression.cs: Make DoResolve take an EmitContext instead of a
23950         TypeContainer.
23951
23952         Replaced `l' and `location' for `loc', for consistency.
23953
23954         (Error, Warning): Remove unneeded Tc argument.
23955
23956         * assign.cs, literal.cs, constant.cs: Update to new calling
23957         convention. 
23958
23959         * codegen.cs: EmitContext now contains a flag indicating whether
23960         code is being generated in a static method or not.
23961
23962         * cs-parser.jay: DecomposeQI, new function that replaces the old
23963         QualifiedIdentifier.  Now we always decompose the assembled
23964         strings from qualified_identifier productions into a group of
23965         memberaccesses.
23966
23967 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23968
23969         * rootcontext.cs: Deal with field-less struct types correctly now
23970         by passing the size option to Define Type.
23971
23972         * class.cs: Removed hack that created one static field. 
23973
23974 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23975
23976         * statement.cs: Moved most of the code generation here. 
23977
23978 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23979
23980         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23981         seem very right.
23982
23983         (ElementAccess): Remove useless bits for now - keep checks as the spec
23984         says.
23985
23986 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23987
23988         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23989         and start performing checks according to the spec.
23990
23991 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23992
23993         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23994         rank_specifiers instead.
23995
23996         (rank_specifiers): Change the order in which the rank specifiers are stored
23997
23998         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23999
24000         * expression.cs (ElementAccess): Implement the LValue interface too.
24001
24002 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24003
24004         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24005         except that user defined conversions are not included.
24006
24007         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24008         perform the conversion of the return type, if necessary.
24009
24010         (New::DoResolve): Check whether we are creating an array or an object
24011         and accordingly do the needful.
24012
24013         (New::Emit): Same here.
24014
24015         (New::DoResolve): Implement guts of array creation.
24016
24017         (New::FormLookupType): Helper function.
24018
24019 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24020
24021         * codegen.cs: Removed most of the code generation here, and move the
24022         corresponding code generation bits to the statement classes. 
24023
24024         Added support for try/catch/finalize and throw.
24025
24026         * cs-parser.jay: Added support for try/catch/finalize.
24027
24028         * class.cs: Catch static methods having the flags override,
24029         virtual or abstract.
24030
24031         * expression.cs (UserCast): This user cast was not really doing
24032         what it was supposed to do.  Which is to be born in fully resolved
24033         state.  Parts of the resolution were being performed at Emit time! 
24034
24035         Fixed this code.
24036
24037 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24038
24039         * expression.cs: Implicity convert the result from UserCast.
24040
24041 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24042
24043         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24044         prevented it from working correctly. 
24045
24046         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24047         merely ConvertImplicit.
24048
24049 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24050
24051         * typemanager.cs: Make the LookupTypeContainer function static,
24052         and not per-instance.  
24053
24054         * class.cs: Make static FindMembers (the one that takes a Type
24055         argument). 
24056
24057         * codegen.cs: Add EmitForeach here.
24058
24059         * cs-parser.jay: Make foreach a toplevel object instead of the
24060         inline expansion, as we need to perform semantic analysis on it. 
24061
24062 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24063
24064         * expression.cs (Expression::ImplicitUserConversion): Rename to
24065         UserDefinedConversion.
24066
24067         (Expression::UserDefinedConversion): Take an extra argument specifying 
24068         whether we look for explicit user conversions too.
24069
24070         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24071
24072         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24073
24074         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24075         with the appropriate arguments.
24076
24077         * cs-parser.jay (cast_expression): Record location too.
24078
24079         * expression.cs (Cast): Record location info.
24080
24081         (Expression::ConvertExplicit): Take location argument.
24082
24083         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24084         to determine if we are doing explicit conversions.
24085
24086         (UserCast::Emit): Update accordingly.
24087
24088         (Expression::ConvertExplicit): Report an error if everything fails.
24089
24090         * ../errors/cs0030.cs : Add.
24091
24092 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24093
24094         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24095         virtual and newslot bits. 
24096
24097         * class.cs (TypeContainer::RegisterRequiredImplementations):
24098         Record methods we need.
24099
24100         (TypeContainer::MakeKey): Helper function to make keys for
24101         MethodBases, since the Methodbase key is useless.
24102
24103         (TypeContainer::Populate): Call RegisterRequiredImplementations
24104         before defining the methods.   
24105
24106         Create a mapping for method_builders_to_methods ahead of time
24107         instead of inside a tight loop.
24108
24109         (::RequireMethods):  Accept an object as the data to set into the
24110         hashtable so we can report interface vs abstract method mismatch.
24111
24112 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24113
24114         * report.cs: Make all of it static.
24115
24116         * rootcontext.cs: Drop object_type and value_type computations, as
24117         we have those in the TypeManager anyways.
24118
24119         Drop report instance variable too, now it is a global.
24120
24121         * driver.cs: Use try/catch on command line handling.
24122
24123         Add --probe option to debug the error reporting system with a test
24124         suite. 
24125
24126         * report.cs: Add support for exiting program when a probe
24127         condition is reached.
24128
24129 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24130
24131         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24132         we do a forcible conversion regardless of type, to check if 
24133         ForceConversion returns a null.
24134
24135         (Binary::error19): Use location to report error.
24136
24137         (Unary::error23): Use location here too.
24138
24139         * ../errors/cs0019.cs : Check in.
24140
24141         * ../errors/cs0023.cs : Check in.
24142
24143         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24144         case of a non-null MethodInfo object with a length of 0 !
24145
24146         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24147         an applicable member - according to the spec :-)
24148         Also fix logic to find members in base types.
24149
24150         (Unary::ResolveOperator): Same here.
24151
24152         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24153         as I was getting thoroughly confused between this and error19 :-)
24154
24155         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24156         (::FindMostEncompassedType): Implement.
24157         (::FindMostEncompassingType): Implement.
24158         (::StandardConversionExists): Implement.
24159
24160         (UserImplicitCast): Re-vamp. We now need info about most specific
24161         source and target types so that we can do the necessary conversions.
24162
24163         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24164         mathematical union with no duplicates.
24165
24166 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24167
24168         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24169         in order from base classes to child classes, so that we can in
24170         child classes look up in our parent for method names and
24171         attributes (required for handling abstract, virtual, new, override
24172         constructs: we need to instrospect our base class, and if we dont
24173         populate the classes in order, the introspection might be
24174         incorrect.  For example, a method could query its parent before
24175         the parent has any methods and would determine that the parent has
24176         no abstract methods (while it could have had them)).
24177
24178         (RootContext::CreateType): Record the order in which we define the
24179         classes.
24180
24181 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24182
24183         * class.cs (TypeContainer::Populate): Also method definitions can
24184         fail now, keep track of this.
24185
24186         (TypeContainer::FindMembers): Implement support for
24187         DeclaredOnly/noDeclaredOnly flag.
24188
24189         (Constructor::Emit) Return the ConstructorBuilder.
24190
24191         (Method::Emit) Return the MethodBuilder. 
24192         Check for abstract or virtual methods to be public.
24193
24194         * rootcontext.cs (RootContext::CreateType): Register all the
24195         abstract methods required for the class to be complete and the
24196         interface methods that must be implemented. 
24197
24198         * cs-parser.jay: Report error 501 (method requires body if it is
24199         not marked abstract or extern).
24200
24201         * expression.cs (TypeOf::Emit): Implement.
24202
24203         * typemanager.cs: runtime_handle_type, new global type.
24204
24205         * class.cs (Property::Emit): Generate code for properties.
24206
24207 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24208
24209         * expression.cs (Unary::ResolveOperator): Find operators on base type
24210         too - we now conform exactly to the spec.
24211
24212         (Binary::ResolveOperator): Same here.
24213
24214         * class.cs (Operator::Define): Fix minor quirk in the tests.
24215
24216         * ../errors/cs0215.cs : Added.
24217
24218         * ../errors/cs0556.cs : Added.
24219
24220         * ../errors/cs0555.cs : Added.
24221
24222 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24223
24224         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24225         single integer which is really efficient
24226
24227 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24228
24229         *  expression.cs (Expression::ImplicitUserConversion): Use location
24230         even in the case when we are examining True operators.
24231  
24232         * class.cs (Operator::Define): Perform extensive checks to conform
24233         with the rules for operator overloading in the spec.
24234
24235         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24236         some of the other conversions mentioned in the spec.
24237
24238         * typemanager.cs (array_type): New static member for the System.Array built-in
24239         type.
24240
24241         (cloneable_interface): For System.ICloneable interface.
24242
24243         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24244         we start resolving the tree and populating types.
24245
24246         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24247  
24248 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24249
24250         * expression.cs (Expression::ExprClassFromMemberInfo,
24251         Expression::Literalize): Create literal expressions from
24252         FieldInfos which are literals.
24253
24254         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24255         type casts, because they were wrong.  The test suite in tests
24256         caught these ones.
24257
24258         (ImplicitNumericConversion): ushort to ulong requires a widening
24259         cast. 
24260
24261         Int32 constant to long requires widening cast as well.
24262
24263         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24264         for integers because the type on the stack is not i4.
24265
24266 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24267
24268         * expression.cs (report118): require location argument. 
24269
24270         * parameter.cs: Do not dereference potential null value.
24271
24272         * class.cs: Catch methods that lack the `new' keyword when
24273         overriding a name.  Report warnings when `new' is used without
24274         anything being there to override.
24275
24276         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24277
24278         * class.cs: Only add constructor to hashtable if it is non-null
24279         (as now constructors can fail on define).
24280
24281         (TypeManager, Class, Struct): Take location arguments.
24282
24283         Catch field instance initialization in structs as errors.
24284
24285         accepting_filter: a new filter for FindMembers that is static so
24286         that we dont create an instance per invocation.
24287
24288         (Constructor::Define): Catch errors where a struct constructor is
24289         parameterless 
24290
24291         * cs-parser.jay: Pass location information for various new
24292         constructs. 
24293
24294         * delegate.cs (Delegate): take a location argument.
24295
24296         * driver.cs: Do not call EmitCode if there were problesm in the
24297         Definition of the types, as many Builders wont be there. 
24298
24299         * decl.cs (Decl::Decl): Require a location argument.
24300
24301         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24302         into integers, and find the most appropiate integer for it.
24303
24304         * literal.cs: Implement ULongLiteral.
24305
24306         * rootcontext.cs: Provide better information about the location of
24307         failure when CreateType fails.
24308
24309 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24310
24311         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24312         as well.
24313
24314         * expression.cs (Binary::CheckShiftArguments): Add missing type
24315         computation.
24316         (Binary::ResolveOperator): Add type to the logical and and logical
24317         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24318         before.
24319
24320         (Binary::DoNumericPromotions): In the case where either argument
24321         is ulong (and most signed types combined with ulong cause an
24322         error) perform implicit integer constant conversions as well.
24323
24324 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24325
24326         * expression.cs (UserImplicitCast): Method should always be
24327         non-null. 
24328         (Invocation::BetterConversion): Simplified test for IntLiteral.
24329
24330         (Expression::ImplicitNumericConversion): Split this routine out.
24331         Put the code that performs implicit constant integer conversions
24332         here. 
24333
24334         (Expression::Resolve): Become a wrapper around DoResolve so we can
24335         check eclass and type being set after resolve.
24336
24337         (Invocation::Badness): Remove this dead function
24338
24339         (Binary::ResolveOperator): Do not compute the expensive argumnets
24340         unless we have a union for it.
24341
24342         (Probe::Emit): Is needs to do an isinst and then
24343         compare against null.
24344
24345         (::CanConvert): Added Location argument.  If the Location argument
24346         is null (Location.Null), then we do not report errors.  This is
24347         used by the `probe' mechanism of the Explicit conversion.  We do
24348         not want to generate an error for something that the user
24349         explicitly requested to be casted.  But the pipeline for an
24350         explicit cast first tests for potential implicit casts.
24351
24352         So for now, if the Location is null, it means `Probe only' to
24353         avoid adding another argument.   Might have to revise this
24354         strategy later.
24355
24356         (ClassCast): New class used to type cast objects into arbitrary
24357         classes (used in Explicit Reference Conversions).
24358
24359         Implement `as' as well.
24360
24361         Reverted all the patches from Ravi below: they were broken:
24362
24363                 * The use of `level' as a mechanism to stop recursive
24364                   invocations is wrong.  That was there just to catch the
24365                   bug with a strack trace but not as a way of addressing
24366                   the problem.
24367
24368                   To fix the problem we have to *understand* what is going
24369                   on and the interactions and come up with a plan, not
24370                   just get things going.
24371
24372                 * The use of the type conversion cache that I proposed
24373                   last night had an open topic: How does this work across
24374                   protection domains.  A user defined conversion might not
24375                   be public in the location where we are applying the
24376                   conversion, a different conversion might be selected
24377                   (ie, private A->B (better) but public B->A (worse),
24378                   inside A, A->B applies, but outside it, B->A will
24379                   apply).
24380
24381                 * On top of that (ie, even if the above is solved),
24382                   conversions in a cache need to be abstract.  Ie, `To
24383                   convert from an Int to a Short use an OpcodeCast', not
24384                   `To convert from an Int to a Short use the OpcodeCast on
24385                   the variable 5' (which is what this patch was doing).
24386
24387 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24388
24389         * expression.cs (Invocation::ConversionExists): Re-write to use
24390         the conversion cache
24391
24392         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24393         cache all conversions done, not just user-defined ones.
24394
24395         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24396         to determine if a conversion exists instead of acutually trying to 
24397         perform the conversion. It's faster too.
24398
24399         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24400         and only then attempt the implicit conversion.
24401
24402 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24403
24404         * expression.cs (ConvertImplicit): Use a cache for conversions
24405         already found. Check level of recursion and bail out if necessary.
24406
24407 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24410         Export standard methods that we expect for string operations.
24411
24412         * statement.cs (Block::UsageWarning): Track usage of variables and
24413         report the errors for not used variables.
24414
24415         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24416         operator. 
24417
24418 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24419
24420         * codegen.cs: remove unnneded code 
24421
24422         * expression.cs: Removed BuiltinTypeAccess class
24423
24424         Fix the order in which implicit conversions are
24425         done.  
24426
24427         The previous fixed dropped support for boxed conversions (adding a
24428         test to the test suite now)
24429
24430         (UserImplicitCast::CanConvert): Remove test for source being null,
24431         that code is broken.  We should not feed a null to begin with, if
24432         we do, then we should track the bug where the problem originates
24433         and not try to cover it up here.
24434
24435         Return a resolved expression of type UserImplicitCast on success
24436         rather than true/false.  Ravi: this is what I was talking about,
24437         the pattern is to use a static method as a "constructor" for
24438         objects. 
24439
24440         Also, do not create arguments until the very last minute,
24441         otherwise we always create the arguments even for lookups that
24442         will never be performed. 
24443
24444         (UserImplicitCast::Resolve): Eliminate, objects of type
24445         UserImplicitCast are born in a fully resolved state. 
24446
24447         * typemanager.cs (InitCoreTypes): Init also value_type
24448         (System.ValueType). 
24449
24450         * expression.cs (Cast::Resolve): First resolve the child expression.
24451
24452         (LValue): Add new method AddressOf to be used by
24453         the `&' operator.  
24454
24455         Change the argument of Store to take an EmitContext instead of an
24456         ILGenerator, because things like FieldExpr need to be able to call
24457         their children expression to generate the instance code. 
24458
24459         (Expression::Error, Expression::Warning): Sugar functions for
24460         reporting errors.
24461
24462         (Expression::MemberLookup): Accept a TypeContainer instead of a
24463         Report as the first argument.
24464
24465         (Expression::ResolvePrimary): Killed.  I still want to improve
24466         this as currently the code is just not right.
24467
24468         (Expression::ResolveMemberAccess): Simplify, but it is still
24469         wrong. 
24470
24471         (Unary::Resolve): Catch errors in AddressOf operators.
24472
24473         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24474         index to a byte for the short-version, or the compiler will choose
24475         the wrong Emit call, which generates the wrong data.
24476
24477         (ParameterReference::Emit, ::Store): same.
24478
24479         (FieldExpr::AddressOf): Implement.
24480
24481         * typemanager.cs: TypeManager: made public variable instead of
24482         property.
24483
24484         * driver.cs: document --fatal.
24485
24486         * report.cs (ErrorMessage, WarningMessage): new names for the old
24487         Error and Warning classes.
24488
24489         * cs-parser.jay (member_access): Turn built-in access to types
24490         into a normal simplename
24491
24492 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24493
24494         * expression.cs (Invocation::BetterConversion): Fix to cope
24495         with q being null, since this was introducing a bug.
24496
24497         * expression.cs (ConvertImplicit): Do built-in conversions first.
24498
24499 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24500
24501         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24502
24503 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24504
24505         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24506         I had introduced long ago (what's new ?).
24507
24508         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24509         the work of all the checking. 
24510         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24511         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24512
24513         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24514         that is the right way. 
24515
24516         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24517         overloading resolution. Use everywhere instead of cutting and pasting code.
24518
24519         (Binary::ResolveOperator): Use MakeUnionSet.
24520
24521         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24522         we have to convert to bool types. Not complete yet.
24523
24524 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24525
24526         * typemanager.cs (TypeManager::CSharpName): support ushort.
24527
24528         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24529         to provide an expression that performsn an implicit constant int
24530         conversion (section 6.1.6).
24531         (Expression::ConvertImplicitRequired): Reworked to include
24532         implicit constant expression conversions.
24533
24534         (Expression::ConvertNumericExplicit): Finished.
24535
24536         (Invocation::Emit): If InstanceExpression is null, then it means
24537         that we perform a call on this.
24538
24539 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24540
24541         * expression.cs (Unary::Emit): Remove some dead code.
24542         (Probe): Implement Resolve and Emit for `is'.
24543         (Expression::ConvertImplicitRequired): Attempt to do constant
24544         expression conversions here.  Maybe should be moved to
24545         ConvertImplicit, but I am not sure.
24546         (Expression::ImplicitLongConstantConversionPossible,
24547         Expression::ImplicitIntConstantConversionPossible): New functions
24548         that tell whether is it possible to apply an implicit constant
24549         expression conversion.
24550
24551         (ConvertNumericExplicit): Started work on explicit numeric
24552         conversions.
24553
24554         * cs-parser.jay: Update operator constants.
24555
24556         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24557         (Parameters::GetSignature): Hook up VerifyArgs here.
24558         (Parameters::VerifyArgs): Verifies that no two arguments have the
24559         same name. 
24560
24561         * class.cs (Operator): Update the operator names to reflect the
24562         ones that the spec expects (as we are just stringizing the
24563         operator names).
24564
24565         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24566         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24567         previous usage did only work for our methods.
24568         (Expression::ConvertImplicit): Handle decimal implicit numeric
24569         conversions as well.
24570         (Expression::InternalTypeConstructor): Used to invoke constructors
24571         on internal types for default promotions.
24572
24573         (Unary::Emit): Implement special handling for the pre/post
24574         increment/decrement for overloaded operators, as they need to have
24575         the same semantics as the other operators.
24576
24577         (Binary::ResolveOperator): ditto.
24578         (Invocation::ConversionExists): ditto.
24579         (UserImplicitCast::Resolve): ditto.
24580
24581 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24582
24583         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24584         operator, return after emitting body. Regression tests pass again !
24585
24586         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24587         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24588         (Invocation::OverloadResolve): Ditto.
24589         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24590
24591         * everywhere : update calls to the above methods accordingly.
24592
24593 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24596
24597         * expression.cs (ExpressionStatement): New base class used for
24598         expressions that can appear in statements, so that we can provide
24599         an alternate path to generate expression that do not leave a value
24600         on the stack.
24601
24602         (Expression::Emit, and all the derivatives): We no longer return
24603         whether a value is left on the stack or not.  Every expression
24604         after being emitted leaves a single value on the stack.
24605
24606         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24607         facilties of ExpressionStatement if possible.
24608
24609         * cs-parser.jay: Update statement_expression.
24610
24611 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24612
24613         * driver.cs: Change the wording of message
24614
24615 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24616
24617         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24618         the type of the expression to the return type of the method if
24619         we have an overloaded operator match ! The regression tests pass again !
24620         (Unary::ResolveOperator): Ditto.
24621
24622         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24623         to find "op_Implicit", not "implicit" ;-)
24624         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24625         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24626
24627         * everywhere : Correct calls to the above accordingly.
24628
24629         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24630         (ConvertImplicit): Do user-defined conversion if it exists.
24631
24632 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24633
24634         * assign.cs: track location.
24635         (Resolve): Use implicit conversions on assignment.
24636
24637         * literal.cs: Oops.  Not good, Emit of short access values should
24638         pass (Bytes) or the wrong argument will be selected.
24639
24640         * expression.cs (Unary::Emit): Emit code for -expr.
24641
24642         (Unary::ResolveOperator): Handle `Substract' for non-constants
24643         (substract from zero from the non-constants).
24644         Deal with Doubles as well. 
24645
24646         (Expression::ConvertImplicitRequired): New routine that reports an
24647         error if no implicit conversion exists. 
24648
24649         (Invocation::OverloadResolve): Store the converted implicit
24650         expressions if we make them
24651
24652 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24653
24654         * class.cs (ConstructorInitializer): Take a Location argument.
24655         (ConstructorBaseInitializer): Same here.
24656         (ConstructorThisInitializer): Same here.
24657
24658         * cs-parser.jay : Update all calls accordingly.
24659
24660         * expression.cs (Unary, Binary, New): Take location argument.
24661         Update accordingly everywhere.
24662
24663         * cs-parser.jay : Update all calls to the above to take a location
24664         argument.
24665
24666         * class.cs : Ditto.
24667
24668 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24669
24670         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24671         (Invocation::BetterConversion): Same here
24672         (Invocation::ConversionExists): Ditto.
24673
24674         (Invocation::ConversionExists): Implement.
24675
24676 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24677
24678         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24679         Also take an additional TypeContainer argument.
24680
24681         * All over : Pass in TypeContainer as argument to OverloadResolve.
24682
24683         * typemanager.cs (CSharpName): Update to check for the string type and return
24684         that too.
24685
24686         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24687         a given method.
24688
24689 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24690
24691         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24692         (Invocation::BetterFunction): Implement.
24693         (Invocation::BetterConversion): Implement.
24694         (Invocation::ConversionExists): Skeleton, no implementation yet.
24695
24696         Okay, things work fine !
24697
24698 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24699
24700         * typemanager.cs: declare and load enum_type, delegate_type and
24701         void_type. 
24702
24703         * expression.cs (Expression::Emit): Now emit returns a value that
24704         tells whether a value is left on the stack or not.  This strategy
24705         might be reveted tomorrow with a mechanism that would address
24706         multiple assignments.
24707         (Expression::report118): Utility routine to report mismatches on
24708         the ExprClass.
24709
24710         (Unary::Report23): Report impossible type/operator combination
24711         utility function.
24712
24713         (Unary::IsIncrementableNumber): Whether the type can be
24714         incremented or decremented with add.
24715         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24716         complemented. 
24717         (Unary::ResolveOperator): Implement ++, !, ~,
24718
24719         (Invocation::Emit): Deal with new Emit convetion.
24720
24721         * All Expression derivatives: Updated their Emit method to return
24722         whether they leave values on the stack or not.
24723
24724         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24725         stack for expressions that are statements. 
24726
24727 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24728
24729         * expression.cs (LValue): New interface.  Must be implemented by
24730         LValue objects.
24731         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24732         LValue interface.
24733
24734         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24735         interface for generating code, simplifies the code.
24736
24737 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24738
24739         * expression.cs (everywhere): Comment out return statements in ::Resolve
24740         methods to avoid the warnings.
24741
24742 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24743
24744         * driver.cs (parse): Report error 2001 if we can not open the
24745         source file.
24746
24747         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24748         not resolve it.
24749
24750         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24751         object. 
24752
24753         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24754         otherwise nested blocks end up with the same index.
24755
24756         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24757
24758         * expression.cs:  Instead of having FIXMEs in the Resolve
24759         functions, throw exceptions so it is obvious that we are facing a
24760         bug. 
24761
24762         * cs-parser.jay (invocation_expression): Pass Location information.
24763
24764         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24765         Use a basename for those routines because .NET does not like paths
24766         on them. 
24767
24768         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24769         already defined.
24770
24771 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24772
24773         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24774         are loading the correct data types (throws an exception if not).
24775         (TypeManager::InitCoreTypes): Use CoreLookupType
24776
24777         * expression.cs (Unary::ResolveOperator): return the child
24778         expression for expressions which are just +expr.
24779         (Unary::ResolveOperator): Return negative literals for -LITERAL
24780         expressions (otherwise they are Unary {Literal}).
24781         (Invocation::Badness): Take into account `Implicit constant
24782         expression conversions'.
24783
24784         * literal.cs (LongLiteral): Implement long literal class.
24785         (IntLiteral): export the `Value' of the intliteral. 
24786
24787 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24788
24789         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24790
24791         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24792         instead of 'Operator'
24793
24794         * expression.cs (Binary::ResolveOperator): Update accordingly.
24795         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24796         and 'Minus'
24797
24798         * cs-parser.jay (unary_expression): Update to use the new names.
24799
24800         * gen-treedump.cs (GetUnary): Same here.
24801
24802         * expression.cs (Unary::Resolve): Implement.
24803         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24804         operators are found instead of making noise ;-)
24805         (Unary::ResolveOperator): New method to do precisely the same thing which
24806         Binary::ResolveOperator does for Binary expressions.
24807         (Unary.method, .Arguments): Add.
24808         (Unary::OperName): Implement.   
24809         (Unary::ForceConversion): Copy and Paste !
24810
24811         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24812         a unary operator.
24813
24814         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24815         for the inbuilt operators. Only overloading works for now ;-)
24816
24817 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24818
24819         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24820         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24821
24822         * expression.cs (This::Emit): Implement. 
24823         (This::Resolve): Implement.
24824         (TypeOf:Resolve): Implement.
24825         (Expression::ResolveSimpleName): Add an implicit this to instance
24826         field references. 
24827         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24828         Bind instance variable to Field expressions.
24829         (FieldExpr::Instance): New field used to track the expression that
24830         represents the object instance.
24831         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24832         binding 
24833         (FieldExpr::Emit): Implement.
24834
24835         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24836         the last instruction contains a return opcode to avoid generating
24837         the last `ret' instruction (this generates correct code, and it is
24838         nice to pass the peverify output).
24839
24840         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24841         initializer for static and instance variables.
24842         (Constructor::Emit): Allow initializer to be null in the case of
24843         static constructors.  Only emit initializer for instance
24844         constructors. 
24845
24846         (TypeContainer::FindMembers): Return a null array if there are no
24847         matches.
24848
24849         Also fix the code for the MemberTypes.Method branch, as it was not
24850         scanning that for operators (or tried to access null variables before).
24851
24852         * assign.cs (Assign::Emit): Handle instance and static fields. 
24853
24854         * TODO: Updated.
24855
24856         * driver.cs: Stop compilation if there are parse errors.
24857
24858         * cs-parser.jay (constructor_declaration): Provide default base
24859         initializer for non-static constructors.
24860         (constructor_declarator): Do not provide a default base
24861         initializers if none was specified.
24862         Catch the fact that constructors should not have parameters.
24863
24864         * class.cs: Do not emit parent class initializers for static
24865         constructors, that should be flagged as an error.
24866
24867 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24868
24869         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24870         Move back code into TypeContainer::Populate.
24871
24872 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24873
24874         * class.cs (TypeContainer::AddConstructor): Fix the check to
24875         compare against Name, not Basename. 
24876         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24877
24878         * cs-parser.jay : Update accordingly.
24879
24880         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24881         for methods, don't forget to look into the operators too.
24882         (RegisterMethodBuilder): Helper method to take care of this for
24883         methods, constructors and operators.
24884         (Operator::Define): Completely revamp.
24885         (Operator.OperatorMethod, MethodName): New fields.
24886         (TypeContainer::Populate): Move the registering of builders into
24887         RegisterMethodBuilder.
24888         (Operator::Emit): Re-write.
24889
24890         * expression.cs (Binary::Emit): Comment out code path to emit method
24891         invocation stuff for the case when we have a user defined operator. I am
24892         just not able to get it right !
24893
24894 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24895
24896         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24897         argument. 
24898
24899         (Expression::MemberLookup): Provide a version that allows to
24900         specify the MemberTypes and BindingFlags. 
24901
24902         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24903         so it was not fetching variable information from outer blocks.
24904
24905         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24906         Beforefieldinit as it was buggy.
24907
24908         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24909         that Ravi put here.  
24910
24911         * class.cs (Constructor::Emit): Only emit if block is not null.
24912         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24913         deal with this by semantically definining it as if the user had
24914         done it.
24915
24916         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24917         constructors as we now "emit" them at a higher level.
24918
24919         (TypeContainer::DefineDefaultConstructor): Used to define the
24920         default constructors if none was provided.
24921
24922         (ConstructorInitializer): Add methods Resolve and Emit. 
24923
24924         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24925
24926 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24927
24928         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24929         the default constructor builder with our hashtable for methodbuilders
24930         to methodcores.
24931
24932         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24933         and argument_count is 0 in which case we have a match.
24934         (Binary::ResolveOperator): More null checking and miscellaneous coding
24935         style cleanup.
24936
24937 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24938
24939         * rootcontext.cs (IsNameSpace): Compare against null.
24940
24941         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24942
24943         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24944         and Unary::Operator.
24945
24946         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24947         accordingly.
24948
24949         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24950         we have overloaded operators.
24951         (Binary::ResolveOperator): Implement the part which does the operator overload
24952         resolution.
24953
24954         * class.cs (Operator::Emit): Implement.
24955         (TypeContainer::Emit): Emit the operators we have too.
24956
24957         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24958         the case when we have a user-defined operator.
24959
24960 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24961
24962         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24963
24964 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24965
24966         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24967         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24968         (Constructor::Emit): Implement.
24969         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24970         if we have no work to do. 
24971         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24972         Emit method.
24973
24974         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24975         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24976
24977         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24978         of parent.parent.
24979
24980 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24981
24982         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24983         in the source.
24984         (Tree::RecordNamespace): Method to do what the name says ;-)
24985         (Tree::Namespaces): Property to get at the namespaces hashtable.
24986
24987         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24988         keep track.
24989
24990         * rootcontext.cs (IsNamespace): Fixed it :-)
24991
24992 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24993
24994         * class.cs (TypeContainer::FindMembers): Add support for
24995         constructors. 
24996         (MethodCore): New class that encapsulates both the shared aspects
24997         of a Constructor and a Method.  
24998         (Method, Constructor): Factored pieces into MethodCore.
24999
25000         * driver.cs: Added --fatal which makes errors throw exceptions.
25001         Load System assembly as well as part of the standard library.
25002
25003         * report.cs: Allow throwing exceptions on errors for debugging.
25004
25005         * modifiers.cs: Do not use `parent', instead use the real type
25006         container to evaluate permission settings.
25007
25008         * class.cs: Put Ravi's patch back in.  He is right, and we will
25009         have to cope with the
25010
25011 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25012
25013         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25014         FamORAssem, not FamANDAssem.
25015
25016 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * driver.cs: Added --parse option that only parses its input files
25019         and terminates.
25020
25021         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25022         incorrect.  IsTopLevel is not used to tell whether an object is
25023         root_types or not (that can be achieved by testing this ==
25024         root_types).  But to see if this is a top-level *class* (not
25025         necessarly our "toplevel" container). 
25026
25027 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25028
25029         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25030         parent instead of a direct call to GetType.
25031
25032 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25033
25034         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25035         Modifiers.TypeAttr. This should just be a call to that method.
25036
25037         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25038         object so that we can determine if we are top-level or not.
25039
25040         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25041         TypeContainer too.
25042
25043         * enum.cs (Enum::Define): Ditto.
25044
25045         * modifiers.cs (FieldAttr): Re-write.
25046
25047         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25048         (TypeContainer::HaveStaticConstructor): New property to provide access
25049         to precisely that info.
25050
25051         * modifiers.cs (MethodAttr): Re-write.
25052         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25053
25054         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25055         of top-level types as claimed.
25056
25057 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25058
25059         * expression.cs (MemberLookup): Fruitless attempt to lookup
25060         constructors.  Maybe I need to emit default constructors?  That
25061         might be it (currently .NET emits this for me automatically).
25062         (Invocation::OverloadResolve): Cope with Arguments == null.
25063         (Invocation::EmitArguments): new function, shared by the new
25064         constructor and us.
25065         (Invocation::Emit): Handle static and instance methods.  Emit
25066         proper call instruction for virtual or non-virtual invocations.
25067         (New::Emit): Implement.
25068         (New::Resolve): Implement.
25069         (MemberAccess:Resolve): Implement.
25070         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25071         to track instances.
25072         (FieldExpr::Resolve): Set type.
25073
25074         * support.cs: Handle empty arguments.
25075                 
25076         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25077         SimpleLookup): Auxiliary routines to help parse a qualifier
25078         identifier.  
25079
25080         Update qualifier_identifier rule.
25081
25082         * codegen.cs: Removed debugging messages.
25083
25084         * class.cs: Make this a global thing, this acts just as a "key" to
25085         objects that we might have around.
25086
25087         (Populate): Only initialize method_builders_to_methods once.
25088
25089         * expression.cs (PropertyExpr): Initialize type from the
25090         PropertyType. 
25091
25092         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25093         Resolve pattern.  Attempt to implicitly convert value to boolean.
25094         Emit code.
25095
25096         * expression.cs: Set the type for the int32/int32 argument case.
25097         (Binary::ResolveOperator): Set the return type to boolean for
25098         comparission operators
25099
25100         * typemanager.cs: Remove debugging print code.
25101
25102         (Invocation::Resolve): resolve type.
25103
25104         * class.cs: Allocate a MemberInfo of the correct size, as the code
25105         elsewhere depends on the test to reflect the correct contents.
25106
25107         (Method::) Keep track of parameters, due to System.Reflection holes
25108
25109         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25110         mapping here.
25111
25112         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25113         of the exact size and return that.
25114
25115         (Class::LookupMethodByBuilder): New function that maps
25116         MethodBuilders to its methods.  Required to locate the information
25117         on methods because System.Reflection bit us again.
25118
25119         * support.cs: New file, contains an interface ParameterData and
25120         two implementations: ReflectionParameters and InternalParameters
25121         used to access Parameter information.  We will need to grow this
25122         as required.
25123
25124         * expression.cs (Invocation::GetParameterData): implement a cache
25125         and a wrapper around the ParameterData creation for methods. 
25126         (Invocation::OverloadResolve): Use new code.
25127
25128 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25129
25130         * class.cs (TypeContainer::EmitField): Remove and move into 
25131         (Field::Define): here and modify accordingly.
25132         (Field.FieldBuilder): New member.
25133         (TypeContainer::Populate): Update accordingly.
25134         (TypeContainer::FindMembers): Implement.
25135
25136 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25137
25138         * statement.cs: (VariableInfo::VariableType): New field to be
25139         initialized with the full type once it is resolved. 
25140
25141 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25142
25143         * parameter.cs (GetParameterInfo): Use a type cache to compute
25144         things only once, and to reuse this information
25145
25146         * expression.cs (LocalVariableReference::Emit): Implement.
25147         (OpcodeCast::Emit): fix.
25148
25149         (ParameterReference::Resolve): Implement.
25150         (ParameterReference::Emit): Implement.
25151
25152         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25153         that are expressions need to stay as Expressions.
25154
25155         * typemanager.cs (CSharpName): Returns the C# name of a type if
25156         possible. 
25157
25158         * expression.cs (Expression::ConvertImplicit): New function that
25159         implements implicit type conversions.
25160
25161         (Expression::ImplicitReferenceConversion): Implements implicit
25162         reference conversions.
25163
25164         (EmptyCast): New type for transparent casts.
25165
25166         (OpcodeCast): New type for casts of types that are performed with
25167         a sequence of bytecodes.
25168
25169         (BoxedCast): New type used for casting value types into reference
25170         types.  Emits a box opcode.
25171
25172         (Binary::DoNumericPromotions): Implements numeric promotions of
25173         and computation of the Binary::Type.
25174
25175         (Binary::EmitBranchable): Optimization.
25176
25177         (Binary::Emit): Implement code emission for expressions.
25178
25179         * typemanager.cs (TypeManager): Added two new core types: sbyte
25180         and byte.
25181
25182 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25183
25184         * class.cs (TypeContainer::FindMembers): Method which does exactly
25185         what Type.FindMembers does, only we don't have to use reflection. No
25186         implementation yet.
25187
25188         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25189         typecontainer objects as we need to get at them.
25190         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25191
25192         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25193         typecontainer object.
25194
25195         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25196         of just a Report object.
25197
25198 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25199
25200         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25201         "remove_"
25202         (TypeContainer::Populate): Now define the delegates of the type too.
25203         (TypeContainer.Delegates): Property to access the list of delegates defined
25204         in the type.
25205
25206         * delegates.cs (Delegate::Define): Implement partially.
25207
25208         * modifiers.cs (TypeAttr): Handle more flags.
25209
25210 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25211
25212         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25213         and not <=
25214         (Operator::Define): Re-write logic to get types by using the LookupType method
25215         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25216         (Indexer::Define): Ditto.
25217         (Event::Define): Ditto.
25218         (Property::Define): Ditto.
25219
25220 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25221
25222         * class.cs (TypeContainer::Populate): Now define operators too. 
25223         (TypeContainer.Operators): New property to access the list of operators
25224         in a type.
25225         (Operator.OperatorMethodBuilder): New member to hold the method builder
25226         for the operator we are defining.
25227         (Operator::Define): Implement.
25228
25229 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25230
25231         * class.cs (Event::Define): Make the prefixes of the accessor methods
25232         addOn_ and removeOn_ 
25233
25234         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25235         of the location being passed in too. Ideally, this should go later since all
25236         error reporting should be done through the Report object.
25237
25238         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25239         (Populate): Iterate thru the indexers we have and define them too.
25240         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25241         for the get and set accessors.
25242         (Indexer::Define): Implement.
25243
25244 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25245
25246         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25247         my previous implementation, did not work.
25248
25249         * typemanager.cs: Add a couple of missing types (the longs).
25250
25251         * literal.cs: Use TypeManager.bool_type instead of getting it.
25252
25253         * expression.cs (EventExpr): New kind of expressions.
25254         (Expressio::ExprClassFromMemberInfo): finish
25255
25256 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25257
25258         * assign.cs: Emit stores to static fields differently.
25259
25260 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25261
25262         * Merge in changes and adjust code to tackle conflicts. Backed out my
25263         code in Assign::Resolve ;-) 
25264
25265 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25266
25267         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25268         instead Report.Error and also pass in the location.
25269         (CSharpParser::Lexer): New readonly property to return the reference
25270         to the Tokenizer object.
25271         (declare_local_variables): Use Report.Error with location instead of plain 
25272         old error.
25273         (CheckDef): Ditto.
25274
25275         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25276         (Operator.CheckBinaryOperator): Ditto.
25277
25278         * cs-parser.jay (operator_declarator): Update accordingly.
25279
25280         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25281         (CheckBinaryOperator): Same here.
25282
25283         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25284         on the name without any prefixes of namespace names etc. This is because we
25285         already might have something already fully qualified like 
25286         'System.Console.WriteLine'
25287
25288         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25289
25290 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25291
25292         * cs-tokenizer.cs (location): Return a string which also contains
25293         the file name.
25294
25295         * expression.cs (ElementAccess): New class for expressions of the
25296         type 'element access.'
25297         (BaseAccess): New class for expressions of the type 'base access.'
25298         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25299         respectively.
25300
25301         * cs-parser.jay (element_access): Implement action.
25302         (base_access): Implement actions.
25303         (checked_expression, unchecked_expression): Implement.
25304
25305         * cs-parser.jay (local_variable_type): Correct and implement.
25306         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25307
25308         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25309
25310         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25311         name and the specifiers.
25312
25313         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25314
25315         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25316         making them all public ;-)
25317
25318         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25319         class anyways.
25320
25321 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25322
25323         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25324         PropertyExprs.
25325         (FieldExpr, PropertyExprs): New resolved expressions.
25326         (SimpleName::MemberStaticCheck): Perform static checks for access
25327         to non-static fields on static methods. Maybe this should be
25328         generalized for MemberAccesses. 
25329         (SimpleName::ResolveSimpleName): More work on simple name
25330         resolution. 
25331
25332         * cs-parser.jay (primary_expression/qualified_identifier): track
25333         the parameter index.
25334
25335         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25336         (EmitContext::EmitBoolExpression): Chain to expression generation
25337         instead of temporary hack.
25338         (::EmitStatementExpression): Put generic expression code generation.
25339
25340         * assign.cs (Assign::Emit): Implement variable assignments to
25341         local variables, parameters and fields.
25342
25343 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25344
25345         * statement.cs (Block::GetVariableInfo): New method, returns the
25346         VariableInfo for a variable name in a block.
25347         (Block::GetVariableType): Implement in terms of GetVariableInfo
25348
25349         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25350         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25351
25352 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25353
25354         * cs-parser.jay (operator_declaration): Continue on my quest : update
25355         to take attributes argument.
25356         (event_declaration): Ditto.
25357         (enum_declaration): Ditto.
25358         (indexer_declaration): Ditto.
25359
25360         * class.cs (Operator::Operator): Update constructor accordingly.
25361         (Event::Event): Ditto.
25362
25363         * delegate.cs (Delegate::Delegate): Same here.
25364
25365         * enum.cs (Enum::Enum): Same here.
25366
25367 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25368
25369         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25370
25371         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25372
25373         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25374         being passed around as an arraylist.
25375         (Attributes::AddAttribute): Method to add attribute sections.
25376
25377         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25378         (struct_declaration): Update accordingly.
25379         (constant_declaration): Update.
25380         (field_declaration): Update.
25381         (method_header): Update.
25382         (fixed_parameter): Update.
25383         (parameter_array): Ditto.
25384         (property_declaration): Ditto.
25385         (destructor_declaration): Ditto.
25386
25387         * class.cs (Struct::Struct): Update constructors accordingly.
25388         (Class::Class): Ditto.
25389         (Field::Field): Ditto.
25390         (Method::Method): Ditto.
25391         (Property::Property): Ditto.
25392         (TypeContainer::OptAttribute): update property's return type.
25393
25394         * interface.cs (Interface.opt_attributes): New member.
25395         (Interface::Interface): Update to take the extra Attributes argument.
25396
25397         * parameter.cs (Parameter::Parameter): Ditto.
25398
25399         * constant.cs (Constant::Constant): Ditto.
25400
25401         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25402         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25403         the attributes as a parameter.
25404         (InterfaceProperty): Update constructor call.
25405         (InterfaceEvent): Ditto.
25406         (InterfaceMethod): Ditto.
25407         (InterfaceIndexer): Ditto.
25408
25409         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25410         pass the attributes too.
25411         (interface_event_declaration): Ditto.
25412         (interface_property_declaration): Ditto.
25413         (interface_method_declaration): Ditto.
25414         (interface_declaration): Ditto.
25415
25416 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25417
25418         * class.cs (Method::Define): Track the "static Main" definition to
25419         create an entry point. 
25420
25421         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25422         EntryPoint if we find it. 
25423
25424         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25425         (EmitContext::ig): Make this variable public.
25426
25427         * driver.cs: Make the default output file be the first file name
25428         with the .exe extension.  
25429
25430         Detect empty compilations
25431
25432         Handle various kinds of output targets.  Handle --target and
25433         rename -t to --dumper.
25434
25435         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25436         methods inherited from Expression return now an Expression.  This
25437         will is used during the tree rewriting as we resolve them during
25438         semantic analysis.
25439
25440         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25441         the spec.  Missing entirely is the information about
25442         accessability of elements of it.
25443
25444         (Expression::ExprClassFromMemberInfo): New constructor for
25445         Expressions that creates a fully initialized Expression based on
25446         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25447         a Type.
25448
25449         (Invocation::Resolve): Begin implementing resolution of invocations.
25450
25451         * literal.cs (StringLiteral):  Implement Emit.
25452
25453 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25454
25455         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25456         member.
25457
25458 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25459
25460         * cs-parser.jay (attribute_arguments): Implement actions.
25461         (attribute): Fix bug in production. Implement action.
25462         (attribute_list): Implement.
25463         (attribute_target): Implement.
25464         (attribute_target_specifier, opt_target_specifier): Implement
25465         (CheckAttributeTarget): New method to check if the attribute target
25466         is valid.
25467         (attribute_section): Implement.
25468         (opt_attributes): Implement.
25469
25470         * attribute.cs : New file to handle attributes.
25471         (Attribute): Class to hold attribute info.
25472
25473         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25474         (attribute_section): Modify production to use 2 different rules to 
25475         achieve the same thing. 1 s/r conflict down !
25476         Clean out commented, useless, non-reducing dimension_separator rules.
25477
25478         * class.cs (TypeContainer.attributes): New member to hold list
25479         of attributes for a type.
25480         (Struct::Struct): Modify to take one more argument, the attribute list.
25481         (Class::Class): Ditto.
25482         (Field::Field): Ditto.
25483         (Method::Method): Ditto.
25484         (Property::Property): Ditto.
25485
25486         * cs-parser.jay (struct_declaration): Update constructor call to
25487         pass in the attributes too.
25488         (class_declaration): Ditto.
25489         (constant_declaration): Ditto.
25490         (field_declaration): Ditto.
25491         (method_header): Ditto.
25492         (fixed_parameter): Ditto.
25493         (parameter_array): Ditto.
25494         (property_declaration): Ditto.
25495
25496         * constant.cs (Constant::Constant): Update constructor similarly.
25497         Use System.Collections.
25498
25499         * parameter.cs (Parameter::Parameter): Update as above.
25500
25501 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25502
25503         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25504         (TypeContainer.delegates): New member to hold list of delegates.
25505
25506         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25507         this time as I seem to be on crack ;-)
25508
25509 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25510
25511         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25512         tell whether an identifier represents a namespace.
25513
25514         * expression.cs (NamespaceExpr): A namespace expression, used only
25515         temporarly during expression resolution.
25516         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25517         utility functions to resolve names on expressions.
25518
25519 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25520
25521         * codegen.cs: Add hook for StatementExpressions. 
25522
25523         * class.cs: Fix inverted test for static flag in methods.
25524
25525 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25526
25527         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25528         to make it coincide with MS' number.
25529         (Operator::CheckBinaryOperator): Ditto.
25530
25531         * ../errors/errors.txt : Remove error numbers added earlier.
25532
25533         * ../errors/cs1019.cs : Test case for error # 1019
25534
25535         * ../errros/cs1020.cs : Test case for error # 1020
25536
25537         * cs-parser.jay : Clean out commented cruft.
25538         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25539         used anywhere - non-reducing rule.
25540         (namespace_declarations): Non-reducing rule - comment out.
25541
25542         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25543         with TypeContainer::AddEnum.
25544
25545         * delegate.cs : New file for delegate handling classes.
25546         (Delegate): Class for declaring delegates.
25547
25548         * makefile : Update.
25549
25550         * cs-parser.jay (delegate_declaration): Implement.
25551
25552 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25553
25554         * class.cs (Event::Define): Implement.
25555         (Event.EventBuilder): New member.
25556
25557         * class.cs (TypeContainer::Populate): Update to define all enums and events
25558         we have.
25559         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25560         readonly fields for all these cases ?
25561
25562 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25563
25564         * class.cs (Property): Revamp to use the convention of making fields readonly.
25565         Accordingly modify code elsewhere.
25566
25567         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25568         the Define method of the Property class.
25569
25570         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25571         trivial bug.
25572         (TypeContainer::Populate): Update to define all the properties we have. Also
25573         define all enumerations.
25574
25575         * enum.cs (Define): Implement.
25576
25577 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25578
25579         * cs-parser.jay (overloadable_operator): The semantic value is an
25580         enum of the Operator class.
25581         (operator_declarator): Implement actions.
25582         (operator_declaration): Implement.
25583
25584         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25585         validity of definitions.
25586         (Operator::CheckBinaryOperator): Static method to check for binary operators
25587         (TypeContainer::AddOperator): New method to add an operator to a type.
25588
25589         * cs-parser.jay (indexer_declaration): Added line to actually call the
25590         AddIndexer method so it gets added ;-)
25591
25592         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25593         already taken care of by the MS compiler ?  
25594
25595 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25596
25597         * class.cs (Operator): New class for operator declarations.
25598         (Operator::OpType): Enum for the various operators.
25599
25600 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25601
25602         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25603         ostensibly handle this in semantic analysis.
25604
25605         * cs-parser.jay (general_catch_clause): Comment out
25606         (specific_catch_clauses, specific_catch_clause): Ditto.
25607         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25608         (catch_args, opt_catch_args): New productions.
25609         (catch_clause): Rewrite to use the new productions above
25610         (catch_clauses): Modify accordingly.
25611         (opt_catch_clauses): New production to use in try_statement
25612         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25613         and re-write the code in the actions to extract the specific and
25614         general catch clauses by being a little smart ;-)
25615
25616         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25617         Hooray, try and catch statements parse fine !
25618
25619 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25620
25621         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25622         string from the hashtable of variables.
25623
25624         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25625         I end up making that mistake ;-)
25626         (catch_clauses): Fixed gross error which made Key and Value of the 
25627         DictionaryEntry the same : $1 !!
25628
25629 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25630
25631         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25632
25633         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25634         when the add and remove accessors are specified. 
25635
25636 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25637
25638         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25639         information about indexer_declarator.
25640         (indexer_declarator): Implement actions.
25641         (parsing_indexer): New local boolean used to keep track of whether
25642         we are parsing indexers or properties. This is necessary because 
25643         implicit_parameters come into picture even for the get accessor in the 
25644         case of an indexer.
25645         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25646
25647         * class.cs (Indexer): New class for indexer declarations.
25648         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25649         (TypeContainer::indexers): New member to hold list of indexers for the
25650         type.
25651
25652 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25653
25654         * cs-parser.jay (add_accessor_declaration): Implement action.
25655         (remove_accessor_declaration): Implement action.
25656         (event_accessors_declaration): Implement
25657         (variable_declarators): swap statements for first rule - trivial.
25658
25659         * class.cs (Event): New class to hold information about event
25660         declarations.
25661         (TypeContainer::AddEvent): New method to add an event to a type
25662         (TypeContainer::events): New member to hold list of events.
25663
25664         * cs-parser.jay (event_declaration): Implement actions.
25665
25666 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25667
25668         * cs-parser.jay (dim_separators): Implement. Make it a string
25669         concatenating all the commas together, just as they appear.
25670         (opt_dim_separators): Modify accordingly
25671         (rank_specifiers): Update accordingly. Basically do the same
25672         thing - instead, collect the brackets here.
25673         (opt_rank_sepcifiers): Modify accordingly.
25674         (array_type): Modify to actually return the complete type string
25675         instead of ignoring the rank_specifiers.
25676         (expression_list): Implement to collect the expressions
25677         (variable_initializer): Implement. We make it a list of expressions
25678         essentially so that we can handle the array_initializer case neatly too.
25679         (variable_initializer_list): Implement.
25680         (array_initializer): Make it a list of variable_initializers
25681         (opt_array_initializer): Modify accordingly.
25682
25683         * expression.cs (New::NType): Add enumeration to help us
25684         keep track of whether we have an object/delegate creation
25685         or an array creation.
25686         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25687         members to hold data about array creation.
25688         (New:New): Modify to update NewType
25689         (New:New): New Overloaded contructor for the array creation
25690         case.
25691
25692         * cs-parser.jay (array_creation_expression): Implement to call
25693         the overloaded New constructor.
25694
25695 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25696
25697         * class.cs (TypeContainer::Constructors): Return member
25698         constructors instead of returning null.
25699
25700 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25701
25702         * typemanager.cs (InitCoreTypes): Initialize the various core
25703         types after we have populated the type manager with the user
25704         defined types (this distinction will be important later while
25705         compiling corlib.dll)
25706
25707         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25708         on Expression Classification.  Now all expressions have a method
25709         `Resolve' and a method `Emit'.
25710
25711         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25712         generation from working.     Also add some temporary debugging
25713         code. 
25714
25715 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25716
25717         * codegen.cs: Lots of code generation pieces.  This is only the
25718         beginning, will continue tomorrow with more touches of polish.  We
25719         handle the fundamentals of if, while, do, for, return.  Others are
25720         trickier and I need to start working on invocations soon.
25721
25722         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25723         s.InitStatement. 
25724
25725         * codegen.cs (EmitContext): New struct, used during code
25726         emission to keep a context.   Most of the code generation will be
25727         here. 
25728
25729         * cs-parser.jay: Add embedded blocks to the list of statements of
25730         this block.  So code generation proceeds in a top down fashion.
25731
25732 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25733
25734         * statement.cs: Add support for multiple child blocks.
25735
25736 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25737
25738         * codegen.cs (EmitCode): New function, will emit the code for a
25739         Block of code given a TypeContainer and its ILGenerator. 
25740
25741         * statement.cs (Block): Standard public readonly optimization.
25742         (Block::Block constructors): Link children. 
25743         (Block::Child): Child Linker.
25744         (Block::EmitVariables): Emits IL variable declarations.
25745
25746         * class.cs: Drop support for MethodGroups here, delay until
25747         Semantic Analysis.
25748         (Method::): Applied the same simplification that I did before, and
25749         move from Properties to public readonly fields.
25750         (Method::ParameterTypes): Returns the parameter types for the
25751         function, and implements a cache that will be useful later when I
25752         do error checking and the semantic analysis on the methods is
25753         performed.
25754         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25755         and made a method, optional argument tells whether this is a class
25756         or a structure to apply the `has-this' bit.
25757         (Method::GetCallingConvention): Implement, returns the calling
25758         convention. 
25759         (Method::Define): Defines the type, a second pass is performed
25760         later to populate the methods.
25761
25762         (Constructor::ParameterTypes): implement a cache similar to the
25763         one on Method::ParameterTypes, useful later when we do semantic
25764         analysis. 
25765
25766         (TypeContainer::EmitMethod):  New method.  Emits methods.
25767
25768         * expression.cs: Removed MethodGroup class from here.
25769
25770         * parameter.cs (Parameters::GetCallingConvention): new method.
25771
25772 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25773
25774         * class.cs (TypeContainer::Populate): Drop RootContext from the
25775         argument. 
25776
25777         (Constructor::CallingConvention): Returns the calling convention.
25778         (Constructor::ParameterTypes): Returns the constructor parameter
25779         types. 
25780
25781         (TypeContainer::AddConstructor): Keep track of default constructor
25782         and the default static constructor.
25783
25784         (Constructor::) Another class that starts using `public readonly'
25785         instead of properties. 
25786
25787         (Constructor::IsDefault): Whether this is a default constructor. 
25788
25789         (Field::) use readonly public fields instead of properties also.
25790
25791         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25792         track of static constructors;  If none is used, turn on
25793         BeforeFieldInit in the TypeAttributes. 
25794
25795         * cs-parser.jay (opt_argument_list): now the return can be null
25796         for the cases where there are no arguments. 
25797
25798         (constructor_declarator): If there is no implicit `base' or
25799         `this', then invoke the default parent constructor. 
25800
25801         * modifiers.cs (MethodAttr): New static function maps a set of
25802         modifiers flags into a MethodAttributes enum
25803         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25804         MethodAttr, TypeAttr to represent the various mappings where the
25805         modifiers are used.
25806         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25807
25808 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25809
25810         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25811         method arguments.
25812
25813         * interface.cs (PopulateIndexer): Implemented the code generator
25814         for interface indexers.
25815
25816 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25817
25818         * interface.cs (InterfaceMemberBase): Now we track the new status
25819         here.  
25820
25821         (PopulateProperty): Implement property population.  Woohoo!  Got
25822         Methods and Properties going today. 
25823
25824         Removed all the properties for interfaces, and replaced them with
25825         `public readonly' fields. 
25826
25827 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25828
25829         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25830         initialize their hashtables/arraylists only when they are needed
25831         instead of doing this always.
25832
25833         * parameter.cs: Handle refs and out parameters.
25834
25835         * cs-parser.jay: Use an ArrayList to construct the arguments
25836         instead of the ParameterCollection, and then cast that to a
25837         Parameter[] array.
25838
25839         * parameter.cs: Drop the use of ParameterCollection and use
25840         instead arrays of Parameters.
25841
25842         (GetParameterInfo): Use the Type, not the Name when resolving
25843         types. 
25844
25845 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25846
25847         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25848         and instead use public readonly fields.
25849
25850         * class.cs: Put back walking code for type containers.
25851
25852 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25853
25854         * class.cs (MakeConstant): Code to define constants.
25855
25856         * rootcontext.cs (LookupType): New function.  Used to locate types 
25857
25858
25859 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25860
25861         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25862         this System.Reflection code is.  Kudos to Microsoft
25863
25864         * typemanager.cs: Implement a type cache and avoid loading all
25865         types at boot time.  Wrap in LookupType the internals.  This made
25866         the compiler so much faster.  Wow.  I rule!
25867
25868         * driver.cs: Make sure we always load mscorlib first (for
25869         debugging purposes, nothing really important).
25870
25871         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25872         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25873
25874         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25875         on namespaces that have been imported using the `using' keyword.
25876
25877         * class.cs (TypeContainer::TypeAttr): Virtualize.
25878         (Class::TypeAttr): Return attributes suitable for this bad boy.
25879         (Struct::TypeAttr): ditto.
25880         Handle nested classes.
25881         (TypeContainer::) Remove all the type visiting code, it is now
25882         replaced with the rootcontext.cs code
25883
25884         * rootcontext.cs (GetClassBases): Added support for structs. 
25885
25886 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25887
25888         * interface.cs, statement.cs, class.cs, parameter.cs,
25889         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25890         Drop use of TypeRefs, and use strings instead.
25891
25892 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25893
25894         * rootcontext.cs: 
25895
25896         * class.cs (Struct::Struct): set the SEALED flags after
25897         checking the modifiers.
25898         (TypeContainer::TypeAttr): new property, returns the
25899         TypeAttributes for a class.  
25900
25901         * cs-parser.jay (type_list): Oops, list production was creating a
25902         new list of base types.
25903
25904         * rootcontext.cs (StdLib): New property.
25905         (GetInterfaceTypeByName): returns an interface by type name, and
25906         encapsulates error handling here.
25907         (GetInterfaces): simplified.
25908         (ResolveTree): Encapsulated all the tree resolution here.
25909         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25910         types. 
25911
25912         * driver.cs: Add support for --nostdlib, to avoid loading the
25913         default assemblies.
25914         (Main): Do not put tree resolution here. 
25915
25916         * rootcontext.cs: Beginning of the class resolution.
25917
25918 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25919
25920         * rootcontext.cs: Provide better error reporting. 
25921
25922         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25923
25924         * rootcontext.cs (CreateInterface): Handle the case where there
25925         are no parent interfaces.
25926
25927         (CloseTypes): Routine to flush types at the end.
25928         (CreateInterface): Track types.
25929         (GetInterfaces): Returns an array of Types from the list of
25930         defined interfaces.
25931
25932         * typemanager.c (AddUserType): Mechanism to track user types (puts
25933         the type on the global type hash, and allows us to close it at the
25934         end). 
25935
25936 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25937
25938         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25939         RecordInterface instead.
25940
25941         * cs-parser.jay: Updated to reflect changes above.
25942
25943         * decl.cs (Definition): Keep track of the TypeBuilder type that
25944         represents this type here.  Not sure we will use it in the long
25945         run, but wont hurt for now.
25946
25947         * driver.cs: Smaller changes to accomodate the new code.
25948
25949         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25950         when done. 
25951
25952         * rootcontext.cs (CreateInterface):  New method, used to create
25953         the System.TypeBuilder type for interfaces.
25954         (ResolveInterfaces): new entry point to resolve the interface
25955         hierarchy. 
25956         (CodeGen): Property, used to keep track of the code generator.
25957
25958 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25959
25960         * cs-parser.jay: Add a second production for delegate_declaration
25961         with `VOID'.
25962
25963         (enum_body): Put an opt_comma here instead of putting it on
25964         enum_body or enum_member_declarations so we can handle trailing
25965         commas on enumeration members.  Gets rid of a shift/reduce.
25966
25967         (type_list): Need a COMMA in the middle.
25968
25969         (indexer_declaration): Tell tokenizer to recognize get/set
25970
25971         * Remove old targets.
25972
25973         * Re-add the parser target.
25974
25975 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25976
25977         * cs-parser.jay: Add precendence rules for a number of operators
25978         ot reduce the number of shift/reduce conflicts in the grammar.
25979
25980 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25981
25982         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25983         and put it here.
25984
25985         Get rid of old crufty code.
25986
25987         * rootcontext.cs: Use this to keep track of the parsed
25988         representation and the defined types available to the program. 
25989
25990         * gen-treedump.cs: adjust for new convention.
25991
25992         * type.cs: Split out the type manager, and the assembly builder
25993         from here. 
25994
25995         * typemanager.cs: the type manager will live here now.
25996
25997         * cil-codegen.cs: And the code generator here. 
25998
25999 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26000
26001         * makefile: Fixed up for easy making.
26002
26003 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26004
26005         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26006         the 
26007
26008         (unary_expression): Expand pre_increment_expression and
26009         post_decrement_expression to reduce a shift/reduce.
26010
26011 2001-07-11  Simon Cozens
26012
26013         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26014
26015         Improve allow_keyword_as_indent name.
26016
26017 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26018
26019         * Adjustments for Beta2. 
26020
26021 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26022
26023         * decl.cs: Added `Define' abstract method.
26024         (InTransit): new property, used to catch recursive definitions. 
26025
26026         * interface.cs: Implement `Define'. 
26027
26028         * modifiers.cs: Map Modifiers.constants to
26029         System.Reflection.TypeAttribute flags.
26030
26031         * class.cs: Keep track of types and user-defined types.
26032         (BuilderInit): New method for creating an assembly
26033         (ResolveType): New function to launch the resolution process, only
26034         used by interfaces for now.
26035
26036         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26037         that are inserted into the name space. 
26038
26039 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26040
26041         * ARGH.  I have screwed up my tree so many times due to the use of
26042         rsync rather than using CVS.  Going to fix this at once. 
26043
26044         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26045         load types.
26046
26047 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26048
26049         * Experiment successful: Use System.Type rather that our own
26050         version of Type.  
26051
26052 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26053
26054         * cs-parser.jay: Removed nsAliases from here.
26055
26056         Use new namespaces, handle `using XXX;' 
26057
26058         * namespace.cs: Reimplemented namespace handling, use a recursive
26059         definition of the class.  Now we can keep track of using clauses
26060         and catch invalid using clauses.
26061
26062 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26063
26064         * gen-treedump.cs: Adapted for all the renaming.
26065
26066         * expression.cs (Expression): this class now has a Type property
26067         which returns an expression Type.
26068
26069         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26070         `Type', as this has a different meaning now in the base
26071
26072 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26073
26074         * interface.cs, class.cs: Removed from all the sources the
26075         references to signature computation, as we can not do method
26076         signature computation during the parsing time, as we are not
26077         trying to solve at that point distinguishing:
26078
26079         class X {
26080                 void a (Blah x) {}
26081                 void a (NS.Blah x) {}
26082         }
26083
26084         Which depending on the context might be valid or not, as we do not
26085         know if Blah is the same thing as NS.Blah at that point.
26086
26087         * Redid everything so the code uses TypeRefs now instead of
26088         Types.  TypeRefs are just temporary type placeholders, that need
26089         to be resolved.  They initially have a pointer to a string and the
26090         current scope in which they are used.  This is used later by the
26091         compiler to resolve the reference to an actual Type. 
26092
26093         * DeclSpace is no longer a CIR.Type, and neither are
26094         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26095         are all DeclSpaces, but no Types. 
26096
26097         * type.cs (TypeRefManager): This implements the TypeRef manager,
26098         which keeps track of all the types that need to be resolved after
26099         the parsing has finished. 
26100
26101 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26102
26103         * ARGH.  We are going to have to store `foreach' as a class rather
26104         than resolving it, as we need to verify error 1579 after name
26105         resolution.   *OR* we could keep a flag that says `This request to
26106         IEnumerator comes from a foreach statement' which we can then use
26107         to generate the error.
26108
26109 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26110
26111         * class.cs (TypeContainer.AddMethod): we now add methods to the
26112         MethodGroup instead of the method hashtable.  
26113
26114         * expression.cs: Add MethodGroup abstraction, which gets us one
26115         step closer to the specification in the way we handle method
26116         declarations.  
26117
26118         * cs-parser.jay (primary_expression): qualified_identifier now
26119         tried to match up an identifier to a local variable reference or
26120         to a parameter reference.
26121
26122         current_local_parameters is now a parser global variable that
26123         points to the current parameters for the block, used during name
26124         lookup.
26125
26126         (property_declaration): Now creates an implicit `value' argument to
26127         the set accessor.
26128
26129 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26130
26131         * parameter.cs: Do not use `param' arguments as part of the
26132         signature, per the spec.
26133
26134 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26135
26136         * decl.cs: Base class for classes, structs and interfaces.  This
26137         is the "Declaration Space" 
26138
26139         * cs-parser.jay: Use CheckDef for checking declaration errors
26140         instead of having one on each function.
26141
26142         * class.cs: Factor out some code for handling error handling in
26143         accordance to the "Declarations" section in the "Basic Concepts"
26144         chapter in the ECMA C# spec.
26145
26146         * interface.cs: Make all interface member classes derive from
26147         InterfaceMemberBase.
26148
26149 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26150
26151         * Many things: all interfaces are parsed and generated in
26152         gen-treedump.  Support for member variables, constructors,
26153         destructors, properties, constants is there.
26154
26155         Beginning of the IL backend, but very little done, just there for
26156         testing purposes. 
26157
26158 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26159
26160         * cs-parser.jay: Fix labeled statement.
26161
26162         * cs-tokenizer.cs (escape): Escape " and ' always.
26163         ref_line, ref_name: keep track of the line/filename as instructed
26164         by #line by the compiler.
26165         Parse #line.
26166
26167 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26168
26169         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26170         to match the values in System.CodeDOM.
26171
26172         Divid renamed to Divide.
26173
26174         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26175         statements. 
26176         (Statements.set): remove.
26177
26178         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26179         statements. 
26180
26181         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26182         falseStatements always have valid values. 
26183
26184         * cs-parser.jay: Use System.CodeDOM now.
26185